@privy-io/react-auth 1.88.2 → 1.88.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{useState as e,useEffect as r,createContext as t,useContext as o}from"react";import{jsx as i,jsxs as n,Fragment as l}from"react/jsx-runtime";import{styled as a,keyframes as s,css as c}from"styled-components";import{u as C}from"./useWallets.mjs";import{b as p,l as u,u as d,h as f}from"./privy-context.mjs";import h from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as v}from"@ethersproject/bignumber";import{formatEther as y}from"@ethersproject/units";import{StaticJsonRpcProvider as m}from"@ethersproject/providers";let g=e=>v.from(e);function L(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)}function w(e){let r={};return void 0!==e.to&&(r.to=e.to),void 0!==e.data&&(r.data=e.data),void 0!==e.chainId&&(r.chainId=e.chainId),void 0!==e.type&&(r.type=e.type),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.nonce&&(r.nonce=g(e.nonce).toNumber()),void 0!==e.gasLimit&&(r.gasLimit=g(e.gasLimit)),void 0!==e.gasPrice&&(r.gasPrice=g(e.gasPrice)),void 0!==e.value&&(r.value=g(e.value)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=g(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=g(e.maxPriorityFeePerGas)),r}class b{get(e){let r=localStorage.getItem(e);return null===r?void 0:JSON.parse(r)}put(e,r){void 0!==r?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}function k(){try{let e="privy:__session_storage__test",r=new b;return r.put(e,"blobby"),r.del(e),!0}catch(e){return!1}}var M="undefined"!=typeof window&&window.localStorage?new b:new class{get(e){return this._cache[e]}put(e,r){void 0!==r?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const W=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,x=(e,r)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!r)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==W(e))return!1;if(e.providers)for(let r of e.providers)if(!x(r))return!1;return!0},P=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom)return!0}return!1},$=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let r of e.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0;return!1},O=(e,r)=>{let t=[],o=[];for(let[i,n]of e.entries())i<r?t.push(n):o.push(n);return[t,o]},T=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),S=(e,r)=>{let t=e.slice(0),o=[];for(;t.length;)o.push(t.splice(0,r));return o},I=(e,r=3,t=4,o="ethereum")=>{if(!e)return"";let i="ethereum"===o?2:0;return r+t+i+3>=e.length?e:`${e.slice(0,i+r)}...${e.slice(e.length-t,e.length)}`},U=e=>new Promise((r=>setTimeout(r,e)));function F(e,{interval:r=100,timeout:t=5e3}={}){return new Promise(((o,i)=>{let n,l=0,a=()=>{l>=t?i("Max attempts reached without result"):(n=e(),l+=r,null==n?setTimeout(a,r):o(n))};a()}))}const R=(e,r={})=>{let t=r.delayMs||150,o=r.maxAttempts||270;return new Promise((async(i,n)=>{let l=!1,a=0;for(;!l&&a<o;){if(r.abortSignal?.aborted)return;e().then((e=>{l=!0,i(e)}),((...e)=>{l=!0,n(...e)})),a+=1,await U(t)}l||n(Error("Exceeded max attempts before resolving function"))}))},z=(e,r,t={},o={})=>{let i=new URL(r,e);for(let[e,r]of Object.entries(t))void 0!==r&&i.searchParams.set(e,r);let n=Object.entries(o);if(n.length>0){let e=new URLSearchParams;for(let[r,t]of n)e.append(r,t);i.hash=e.toString()}return i.href},Z=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),E=e=>"string"==typeof e?e:"0x"+e.toString(16);async function D(e,r,t,o=3e3){let i=!1,n=window;return new Promise((l=>{function a(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",a);let o=e.getProviders();console.debug("Detected injected providers:",o.map((e=>e.info)));let n=[];for(let e of o)r.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||n.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});for(let e of function(){let e=window,r=e.ethereum;if(!r)return[];let t=[];if(r.providers?.length)for(let e of r.providers)e&&t.push(e);return t.push(e.ethereum),t}()){let r=W(e);if(!o.some((e=>e.info.name===r))){if(x(e,!0)&&!n.find((e=>"metamask"===e.type))){n.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===r&&!n.find((e=>"phantom"===e.type))){n.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===r&&!n.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==t?.coinbaseWallet?.connectionOptions))){n.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}n.find((e=>"unknown_browser_extension"===e.type))||n.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}l(n)}n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout((()=>{a()}),o))}))}function _(e){return`eip155:${String(Number(e))}`}const j=(e,r,t,o)=>{let i=Number(e),n=r.find((e=>e.id===i));if(!n)throw new p(`Unsupported chainId ${e}`,4901);return A(n,t,o)},A=(e,r,t)=>{let o,i=e.id,n=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])o=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])o=r.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let r=new URL(e.rpcUrls.privy.http[0]);r.searchParams.append("privyAppId",t),o=r.toString()}else o=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!o)throw new p(`No RPC url found for ${i}`);return o},N=(e,r,t,o)=>{let i=Number(e),n=r.find((e=>e.id===i));if(!n)throw new p(`Unsupported chainId ${e}`,4901);return new m(n.rpcUrls.privyWalletOverride&&n.rpcUrls.privyWalletOverride.http[0]?n.rpcUrls.privyWalletOverride.http[0]:t.rpcUrls&&t.rpcUrls[i]?t.rpcUrls[i]:n.rpcUrls.privy?.http[0]?{url:n.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:n.rpcUrls.public?.http[0]?n.rpcUrls.public.http[0]:n.rpcUrls.default?.http[0])},B=e=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},t=e.types.EIP712Domain??Object.entries(e.domain).map((([e,t])=>{if(null!=t&&"string"==typeof e&&e in r)return{name:e,type:r[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:t}}};function H(e,{min:r,max:t}){return Math.min(Math.max(e,r),t)}const G=t=>{let[o,i]=e("auto");return r((()=>{let e=new ResizeObserver((e=>{i(e[0]?.contentRect.height??"auto")}));return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[t.current]),o},K={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},V=t(void 0);let q=()=>o(V);function X(e,t){if(!t)return;let o=q().current[e];return r((()=>{for(let[r,i]of Object.entries(t))o.hasOwnProperty(r)||console.warn(`Invalid event type "${r}" for action "${e}"`),o[r]?.push(i);return()=>{for(let[r,i]of Object.entries(t))o.hasOwnProperty(r)||console.warn(`Invalid event type "${r}" for action "${e}"`),o[r]=o[r]?.filter((e=>e!==i))}}),[t])}function J(e,r,t,...o){for(let i of e.current[r][t])i(...o)}function Q(){let e=q();return(r,t,...o)=>J(e,r,t,...o)}function Y(e){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",version:"1.1",...e,children:n("g",{id:"surface1",children:[i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 0 15.390625 L 0 30.78125 L 4.644531 30.78125 L 4.644531 19.964844 L 8.21875 19.957031 C 10.6875 19.953125 11.851562 19.945312 11.992188 19.9375 C 12.992188 19.855469 13.480469 19.789062 14.167969 19.640625 C 15.96875 19.253906 17.503906 18.460938 18.769531 17.265625 C 20.429688 15.699219 21.414062 13.402344 21.582031 10.710938 C 21.601562 10.410156 21.601562 9.523438 21.582031 9.222656 C 21.472656 7.453125 21.015625 5.867188 20.222656 4.5 C 19.152344 2.652344 17.328125 1.238281 15.144531 0.566406 C 14.207031 0.277344 13.394531 0.136719 12.050781 0.0273438 C 11.902344 0.015625 10.1875 0.0078125 5.925781 0.00390625 L 0 0 Z M 10.851562 3.996094 C 12.695312 4.054688 13.957031 4.453125 15.011719 5.296875 C 15.230469 5.472656 15.546875 5.785156 15.699219 5.976562 C 16.351562 6.792969 16.746094 7.84375 16.886719 9.113281 C 16.925781 9.460938 16.925781 10.472656 16.886719 10.820312 C 16.8125 11.496094 16.660156 12.128906 16.445312 12.671875 C 16.167969 13.359375 15.839844 13.867188 15.363281 14.347656 C 14.5 15.214844 13.398438 15.730469 11.992188 15.921875 C 11.386719 16.003906 11.585938 16 7.976562 16.007812 L 4.644531 16.011719 L 4.644531 3.980469 L 7.539062 3.980469 C 9.132812 3.980469 10.621094 3.988281 10.851562 3.996094 Z M 10.851562 3.996094 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 187.648438 5.714844 L 187.648438 11.433594 L 187.378906 11.433594 L 187.292969 11.285156 C 187.019531 10.816406 186.402344 9.941406 186.078125 9.5625 C 185.648438 9.066406 185.082031 8.609375 184.378906 8.203125 C 183.839844 7.894531 183.328125 7.703125 182.652344 7.566406 C 182.125 7.460938 181.628906 7.410156 180.957031 7.398438 C 179.804688 7.375 178.789062 7.519531 177.777344 7.851562 C 175.886719 8.472656 174.289062 9.707031 173.148438 11.425781 C 171.96875 13.203125 171.3125 15.28125 171.125 17.820312 C 171.054688 18.800781 171.0625 19.96875 171.140625 20.945312 C 171.34375 23.417969 172.007812 25.476562 173.160156 27.203125 C 173.554688 27.792969 173.917969 28.234375 174.433594 28.738281 C 175.859375 30.140625 177.671875 30.980469 179.703125 31.179688 C 181.007812 31.3125 182.382812 31.1875 183.375 30.847656 C 183.753906 30.71875 183.96875 30.621094 184.347656 30.40625 C 185.09375 29.984375 185.726562 29.46875 186.179688 28.914062 C 186.589844 28.410156 187.015625 27.8125 187.277344 27.367188 L 187.378906 27.195312 L 187.75 27.195312 L 187.75 30.78125 L 192.132812 30.78125 L 192.132812 0 L 187.648438 0 Z M 182.40625 11.25 C 183.707031 11.386719 184.703125 11.851562 185.578125 12.730469 C 186.472656 13.621094 187.078125 14.816406 187.425781 16.367188 C 187.789062 17.976562 187.816406 20.089844 187.492188 21.804688 C 187.222656 23.25 186.695312 24.480469 185.945312 25.417969 C 185.664062 25.769531 185.214844 26.203125 184.867188 26.449219 C 184.042969 27.035156 183.148438 27.328125 182.011719 27.382812 C 181.199219 27.421875 180.375 27.3125 179.703125 27.070312 C 178.242188 26.539062 177.050781 25.289062 176.371094 23.566406 C 175.980469 22.578125 175.75 21.519531 175.648438 20.253906 C 175.621094 19.933594 175.613281 18.902344 175.632812 18.523438 C 175.714844 16.960938 176.03125 15.609375 176.589844 14.46875 C 176.894531 13.839844 177.230469 13.34375 177.652344 12.890625 C 178.617188 11.851562 179.746094 11.332031 181.253906 11.226562 C 181.503906 11.210938 182.148438 11.222656 182.40625 11.25 Z M 182.40625 11.25 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 210.074219 15.386719 L 210.082031 30.773438 L 214.464844 30.773438 L 214.472656 27.195312 L 214.84375 27.195312 L 214.929688 27.351562 C 215.171875 27.785156 215.765625 28.613281 216.140625 29.046875 C 216.753906 29.757812 217.800781 30.476562 218.707031 30.804688 C 219.84375 31.21875 221.445312 31.339844 222.929688 31.128906 C 223.839844 31 224.777344 30.710938 225.570312 30.3125 C 227.277344 29.457031 228.632812 28.09375 229.621094 26.238281 C 230.335938 24.894531 230.796875 23.351562 231.003906 21.609375 C 231.210938 19.878906 231.175781 17.914062 230.910156 16.289062 C 230.730469 15.191406 230.453125 14.199219 230.054688 13.261719 C 229.914062 12.929688 229.601562 12.300781 229.417969 11.984375 C 228.464844 10.355469 227.207031 9.140625 225.65625 8.355469 C 224.316406 7.679688 222.867188 7.363281 221.234375 7.398438 C 220.097656 7.417969 219.195312 7.582031 218.425781 7.90625 C 217.917969 8.117188 217.28125 8.511719 216.777344 8.929688 C 216.550781 9.121094 216.1875 9.484375 216.011719 9.703125 C 215.605469 10.21875 215.1875 10.816406 214.917969 11.285156 L 214.839844 11.425781 L 214.574219 11.433594 L 214.574219 0 L 210.074219 0 Z M 221.195312 11.25 C 222.273438 11.359375 223.140625 11.691406 223.90625 12.289062 C 224.5625 12.800781 225.105469 13.464844 225.535156 14.273438 C 225.972656 15.105469 226.324219 16.265625 226.476562 17.382812 C 226.632812 18.535156 226.640625 19.777344 226.5 20.921875 C 226.304688 22.488281 225.824219 23.886719 225.113281 24.945312 C 224.40625 26 223.480469 26.738281 222.421875 27.097656 C 221.515625 27.402344 220.382812 27.476562 219.363281 27.296875 C 217.949219 27.046875 216.765625 26.234375 215.910156 24.925781 C 215.734375 24.660156 215.625 24.464844 215.460938 24.125 C 214.960938 23.097656 214.660156 21.925781 214.539062 20.550781 C 214.496094 20.0625 214.480469 19.660156 214.488281 19.023438 C 214.5 18.257812 214.535156 17.785156 214.625 17.167969 C 215 14.636719 216.09375 12.789062 217.769531 11.859375 C 218.414062 11.5 219.195312 11.285156 220.0625 11.226562 C 220.308594 11.210938 220.941406 11.222656 221.195312 11.25 Z M 221.195312 11.25 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 69.050781 2.167969 C 69.042969 2.171875 69.039062 3.417969 69.039062 4.9375 L 69.039062 7.699219 L 65.675781 7.699219 L 65.675781 11.300781 L 69.039062 11.300781 L 69.039062 18.105469 C 69.039062 22.296875 69.042969 25.042969 69.054688 25.253906 C 69.113281 26.640625 69.453125 27.691406 70.144531 28.617188 C 70.890625 29.609375 71.839844 30.273438 73.117188 30.691406 C 74.03125 30.992188 74.949219 31.109375 76.023438 31.074219 C 76.652344 31.050781 77.117188 31.003906 77.519531 30.917969 C 78.042969 30.808594 78.679688 30.625 78.679688 30.585938 C 78.679688 30.558594 77.878906 26.898438 77.871094 26.890625 C 77.867188 26.886719 77.703125 26.914062 77.503906 26.953125 C 76.960938 27.054688 76.828125 27.066406 76.347656 27.070312 C 75.796875 27.070312 75.488281 27.027344 75.066406 26.886719 C 74.738281 26.78125 74.511719 26.640625 74.273438 26.402344 C 73.867188 25.988281 73.667969 25.515625 73.570312 24.730469 C 73.550781 24.53125 73.546875 24.109375 73.542969 17.910156 L 73.539062 11.300781 L 78.269531 11.300781 L 78.269531 7.699219 L 73.539062 7.699219 L 73.539062 2.15625 L 71.300781 2.15625 C 70.066406 2.15625 69.054688 2.164062 69.050781 2.167969 Z M 69.050781 2.167969 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 133.339844 2.167969 C 133.335938 2.171875 133.332031 3.417969 133.332031 4.9375 L 133.332031 7.699219 L 129.953125 7.699219 L 129.953125 11.300781 L 133.332031 11.300781 L 133.332031 18.199219 C 133.332031 22.738281 133.335938 25.195312 133.34375 25.371094 C 133.421875 26.769531 133.800781 27.832031 134.5625 28.785156 C 134.851562 29.148438 135.308594 29.574219 135.695312 29.855469 C 136.550781 30.464844 137.730469 30.890625 138.964844 31.03125 C 139.808594 31.125 140.992188 31.082031 141.769531 30.925781 C 142.066406 30.867188 142.523438 30.75 142.769531 30.667969 L 142.972656 30.605469 L 142.964844 30.558594 C 142.9375 30.410156 142.164062 26.894531 142.160156 26.890625 C 142.160156 26.886719 141.992188 26.914062 141.789062 26.953125 C 141.238281 27.054688 141.121094 27.066406 140.625 27.070312 C 140.257812 27.070312 140.167969 27.066406 139.992188 27.035156 C 139.140625 26.90625 138.671875 26.636719 138.289062 26.070312 C 138.101562 25.792969 137.976562 25.453125 137.902344 25.027344 C 137.835938 24.628906 137.839844 25.039062 137.835938 17.9375 L 137.832031 11.300781 L 142.546875 11.300781 L 142.546875 7.699219 L 137.832031 7.699219 L 137.828125 4.929688 L 137.824219 2.164062 L 135.585938 2.160156 C 134.359375 2.160156 133.34375 2.164062 133.339844 2.167969 Z M 133.339844 2.167969 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 293.414062 2.363281 C 290.832031 2.503906 288.324219 3.332031 286.167969 4.761719 C 283.429688 6.574219 281.375 9.265625 280.359375 12.371094 C 279.976562 13.539062 279.765625 14.632812 279.664062 15.953125 C 279.652344 16.105469 279.644531 16.46875 279.644531 16.929688 C 279.644531 17.679688 279.652344 17.863281 279.710938 18.429688 C 279.949219 20.777344 280.746094 23.003906 282.046875 24.972656 C 284.277344 28.34375 287.800781 30.640625 291.773438 31.3125 C 293.144531 31.542969 294.632812 31.574219 296.019531 31.398438 C 297.984375 31.152344 299.871094 30.511719 301.574219 29.507812 C 303.199219 28.550781 304.679688 27.230469 305.816406 25.722656 C 307.4375 23.570312 308.425781 21.054688 308.6875 18.417969 C 308.746094 17.8125 308.753906 17.675781 308.753906 16.929688 C 308.753906 16.183594 308.746094 16.042969 308.6875 15.441406 C 308.464844 13.214844 307.707031 11.019531 306.503906 9.121094 C 305.691406 7.847656 304.671875 6.683594 303.507812 5.710938 C 303.105469 5.375 302.582031 4.988281 302.148438 4.707031 C 299.992188 3.296875 297.53125 2.5 294.941406 2.363281 C 294.613281 2.347656 293.746094 2.347656 293.414062 2.363281 Z M 293.414062 2.363281 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 350.792969 2.363281 C 347.769531 2.574219 345.125 4.042969 343.238281 6.5625 C 343.082031 6.765625 342.792969 7.191406 342.664062 7.394531 L 342.605469 7.496094 L 342.136719 7.496094 L 342.128906 3.128906 L 334.769531 3.121094 L 334.769531 39.53125 L 342.589844 39.53125 L 342.589844 27.265625 L 342.832031 27.265625 L 343.078125 27.269531 L 343.125 27.339844 C 343.261719 27.542969 343.738281 28.0625 344.082031 28.378906 C 345.996094 30.167969 348.269531 31.25 350.613281 31.488281 C 350.921875 31.519531 351.710938 31.535156 352.074219 31.511719 C 354.226562 31.386719 356.121094 30.726562 357.796875 29.507812 C 358.5625 28.953125 359.359375 28.183594 359.992188 27.382812 C 361.660156 25.28125 362.726562 22.492188 363.074219 19.328125 C 363.171875 18.464844 363.199219 17.933594 363.199219 16.957031 C 363.203125 16.152344 363.191406 15.855469 363.132812 15.195312 C 362.847656 11.777344 361.722656 8.75 359.898438 6.480469 C 359.382812 5.84375 358.679688 5.140625 358.054688 4.644531 C 356.613281 3.496094 354.914062 2.75 353.117188 2.472656 C 352.53125 2.382812 352.246094 2.359375 351.566406 2.355469 C 351.246094 2.351562 350.898438 2.355469 350.792969 2.363281 Z M 349.855469 8.40625 C 351.128906 8.5625 352.1875 9.0625 353.0625 9.914062 C 354.039062 10.867188 354.726562 12.222656 355.089844 13.914062 C 355.425781 15.484375 355.472656 17.589844 355.214844 19.296875 C 355.023438 20.539062 354.667969 21.65625 354.167969 22.550781 C 354.03125 22.796875 353.734375 23.238281 353.574219 23.4375 C 352.796875 24.410156 351.800781 25.050781 350.628906 25.339844 C 350.160156 25.457031 349.808594 25.5 349.257812 25.511719 C 348.816406 25.523438 348.566406 25.507812 348.207031 25.460938 C 346.855469 25.269531 345.703125 24.632812 344.84375 23.605469 C 344.324219 22.980469 343.886719 22.175781 343.585938 21.289062 C 343.128906 19.941406 342.917969 18.277344 342.96875 16.457031 C 343.023438 14.480469 343.351562 12.925781 343.992188 11.613281 C 344.59375 10.386719 345.429688 9.5 346.492188 8.960938 C 347.148438 8.625 347.789062 8.453125 348.632812 8.378906 C 348.808594 8.363281 349.667969 8.382812 349.855469 8.40625 Z M 349.855469 8.40625 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 363.625 3.109375 C 363.617188 3.117188 363.617188 4.550781 363.617188 6.292969 L 363.625 9.457031 L 365.050781 9.464844 C 366.308594 9.472656 366.492188 9.476562 366.585938 9.496094 C 367.007812 9.589844 367.253906 9.78125 367.378906 10.121094 C 367.464844 10.351562 367.460938 10.199219 367.460938 13.078125 C 367.460938 14.828125 367.464844 15.71875 367.476562 15.71875 C 367.484375 15.71875 367.488281 18.242188 367.488281 23.257812 L 367.488281 30.796875 L 375.308594 30.796875 L 375.308594 23.40625 C 375.308594 18.929688 375.316406 15.839844 375.324219 15.566406 C 375.351562 14.628906 375.433594 13.941406 375.59375 13.289062 C 376.050781 11.398438 377.128906 10.359375 378.9375 10.0625 C 379.457031 9.976562 379.136719 9.984375 383.941406 9.976562 L 388.34375 9.972656 L 388.34375 3.089844 L 385.246094 3.089844 C 381.761719 3.089844 381.328125 3.101562 380.574219 3.1875 C 378.742188 3.398438 377.527344 3.976562 376.609375 5.074219 C 376.109375 5.671875 375.707031 6.394531 375.351562 7.332031 L 375.289062 7.496094 L 374.828125 7.496094 L 374.828125 3.089844 L 369.230469 3.089844 C 364.765625 3.089844 363.628906 3.09375 363.625 3.109375 Z M 363.625 3.109375 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 390.804688 16.945312 L 390.804688 30.796875 L 394.667969 30.792969 L 398.527344 30.789062 L 398.527344 3.097656 L 394.667969 3.09375 L 390.804688 3.089844 Z M 390.804688 16.945312 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 400.601562 3.101562 C 400.59375 3.105469 400.589844 3.285156 400.589844 3.496094 L 400.589844 3.878906 L 405.253906 17.289062 C 407.824219 24.667969 409.929688 30.722656 409.9375 30.746094 L 409.957031 30.796875 L 420.265625 30.796875 L 420.285156 30.75 C 420.292969 30.722656 422.402344 24.671875 424.964844 17.304688 L 429.625 3.90625 L 429.625 3.089844 L 422.195312 3.097656 L 415.507812 22.347656 L 415.253906 22.351562 L 415 22.351562 L 411.722656 12.84375 C 409.921875 7.613281 408.429688 3.277344 408.40625 3.210938 L 408.359375 3.089844 L 404.484375 3.089844 C 402.351562 3.089844 400.605469 3.09375 400.601562 3.101562 Z M 400.601562 3.101562 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 430.976562 3.101562 C 430.96875 3.105469 430.964844 3.285156 430.964844 3.5 L 430.964844 3.886719 L 436.039062 18.476562 C 438.832031 26.5 441.117188 33.074219 441.125 33.089844 C 441.132812 33.113281 440.898438 33.113281 436.320312 33.113281 L 431.503906 33.113281 L 431.503906 39.53125 L 436.453125 39.53125 C 441.539062 39.53125 441.675781 39.527344 442.316406 39.46875 C 445.46875 39.1875 447.609375 37.84375 448.945312 35.316406 C 449.234375 34.773438 449.394531 34.375 449.816406 33.164062 C 450.339844 31.667969 454.875 18.636719 458.996094 6.78125 L 460.003906 3.890625 L 460.003906 3.089844 L 456.285156 3.09375 L 452.570312 3.097656 L 445.882812 22.347656 L 445.628906 22.351562 L 445.375 22.351562 L 442.113281 12.886719 C 440.320312 7.679688 438.828125 3.34375 438.796875 3.253906 L 438.738281 3.089844 L 434.863281 3.089844 C 432.730469 3.089844 430.980469 3.09375 430.976562 3.101562 Z M 430.976562 3.101562 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 36.566406 7.363281 C 35.210938 7.460938 33.960938 7.960938 32.945312 8.808594 C 32.199219 9.433594 31.601562 10.300781 31.277344 11.226562 L 31.230469 11.359375 L 31.003906 11.359375 L 31.003906 7.699219 L 26.648438 7.699219 L 26.648438 30.78125 L 31.148438 30.78125 L 31.152344 23.480469 C 31.15625 15.488281 31.148438 16.136719 31.234375 15.660156 C 31.414062 14.671875 31.886719 13.777344 32.617188 13.050781 C 32.855469 12.8125 33.03125 12.664062 33.285156 12.484375 C 34.121094 11.902344 35.03125 11.589844 36.15625 11.503906 C 36.445312 11.480469 37.214844 11.496094 37.542969 11.527344 C 37.96875 11.566406 38.753906 11.691406 38.964844 11.746094 L 38.996094 11.753906 L 38.996094 9.601562 C 38.996094 8.417969 38.996094 7.449219 38.992188 7.449219 C 38.988281 7.449219 38.898438 7.441406 38.789062 7.429688 C 38.175781 7.363281 37.050781 7.332031 36.566406 7.363281 Z M 36.566406 7.363281 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 51.078125 7.410156 C 48.75 7.53125 46.777344 8.25 45.125 9.566406 C 44.34375 10.191406 43.679688 10.914062 43.101562 11.765625 C 42.003906 13.386719 41.332031 15.335938 41.101562 17.550781 C 40.980469 18.710938 40.984375 20.035156 41.109375 21.195312 C 41.359375 23.535156 42.121094 25.582031 43.363281 27.246094 C 44.617188 28.933594 46.367188 30.167969 48.355469 30.769531 C 50.472656 31.40625 53.050781 31.40625 55.164062 30.769531 C 57.09375 30.183594 58.800781 29.003906 60.042969 27.402344 C 61.421875 25.621094 62.230469 23.402344 62.449219 20.824219 C 62.574219 19.355469 62.503906 17.757812 62.257812 16.402344 C 61.769531 13.691406 60.515625 11.382812 58.679688 9.796875 C 57.101562 8.441406 55.152344 7.640625 52.933594 7.445312 C 52.371094 7.394531 51.617188 7.378906 51.078125 7.410156 Z M 52.496094 11.191406 C 53.375 11.285156 54.117188 11.53125 54.78125 11.941406 C 55.535156 12.410156 56.265625 13.199219 56.765625 14.085938 C 57.417969 15.234375 57.828125 16.746094 57.941406 18.429688 C 57.953125 18.546875 57.960938 18.84375 57.964844 19.09375 C 57.992188 20.316406 57.847656 21.53125 57.554688 22.601562 C 57.167969 24.011719 56.589844 25.070312 55.738281 25.917969 C 55.128906 26.523438 54.539062 26.902344 53.789062 27.15625 C 53.1875 27.363281 52.554688 27.460938 51.78125 27.460938 C 50.714844 27.460938 49.851562 27.273438 49.066406 26.867188 C 48.59375 26.625 48.199219 26.332031 47.785156 25.921875 C 46.960938 25.097656 46.390625 24.078125 46.003906 22.734375 C 45.429688 20.742188 45.398438 18.273438 45.921875 16.238281 C 46.328125 14.644531 46.972656 13.484375 47.953125 12.5625 C 48.867188 11.703125 49.921875 11.265625 51.304688 11.167969 C 51.558594 11.152344 52.246094 11.164062 52.496094 11.191406 Z M 52.496094 11.191406 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 92.054688 7.402344 C 91.085938 7.460938 90.488281 7.546875 89.757812 7.730469 C 87.601562 8.269531 85.734375 9.519531 84.367188 11.335938 C 84.148438 11.621094 83.851562 12.070312 83.664062 12.386719 C 83.511719 12.652344 83.199219 13.257812 83.078125 13.539062 C 82.507812 14.828125 82.148438 16.253906 82.007812 17.796875 C 81.957031 18.359375 81.949219 18.566406 81.949219 19.394531 C 81.949219 20.21875 81.957031 20.429688 82.007812 20.988281 C 82.167969 22.761719 82.59375 24.308594 83.296875 25.699219 C 84.023438 27.144531 84.96875 28.289062 86.199219 29.210938 C 87.382812 30.097656 88.726562 30.6875 90.277344 31 C 92.117188 31.367188 94.355469 31.320312 96.128906 30.875 C 98.230469 30.347656 99.964844 29.269531 101.148438 27.761719 C 101.625 27.152344 102.019531 26.445312 102.289062 25.710938 C 102.394531 25.429688 102.519531 25.019531 102.507812 25.007812 C 102.5 25 101.550781 24.828125 100.398438 24.621094 C 99.246094 24.414062 98.292969 24.242188 98.285156 24.238281 C 98.277344 24.234375 98.246094 24.292969 98.214844 24.367188 C 97.738281 25.535156 96.953125 26.378906 95.855469 26.917969 C 95.207031 27.234375 94.523438 27.414062 93.628906 27.503906 C 93.34375 27.53125 92.496094 27.527344 92.191406 27.496094 C 90.996094 27.371094 90.039062 27.046875 89.171875 26.460938 C 88.320312 25.886719 87.609375 25.03125 87.148438 24.03125 C 86.722656 23.109375 86.472656 22 86.429688 20.847656 L 86.421875 20.589844 L 102.808594 20.589844 L 102.808594 19.777344 C 102.808594 17.945312 102.746094 17.019531 102.5625 15.914062 C 102.355469 14.691406 102.027344 13.671875 101.511719 12.628906 C 100.847656 11.285156 100.007812 10.257812 98.847656 9.371094 C 97.398438 8.269531 95.589844 7.605469 93.507812 7.429688 C 93.265625 7.40625 92.265625 7.386719 92.054688 7.402344 Z M 93.355469 11.148438 C 94.554688 11.28125 95.539062 11.699219 96.402344 12.449219 C 97.253906 13.183594 97.894531 14.246094 98.183594 15.40625 C 98.3125 15.921875 98.394531 16.578125 98.394531 17.070312 L 98.394531 17.222656 L 86.425781 17.222656 L 86.433594 17.101562 C 86.511719 16.132812 86.730469 15.324219 87.148438 14.488281 C 87.648438 13.488281 88.359375 12.6875 89.289062 12.066406 C 89.941406 11.628906 90.570312 11.375 91.371094 11.222656 C 91.546875 11.1875 91.988281 11.132812 92.183594 11.121094 C 92.390625 11.105469 93.15625 11.125 93.355469 11.148438 Z M 93.355469 11.148438 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 116.789062 7.410156 C 114.78125 7.515625 113.0625 8.0625 111.566406 9.0625 C 109.53125 10.429688 108.070312 12.515625 107.316406 15.121094 C 106.816406 16.855469 106.644531 18.890625 106.828125 20.917969 C 107.027344 23.09375 107.664062 25.050781 108.703125 26.679688 C 109.28125 27.585938 110.015625 28.40625 110.847656 29.074219 C 111.921875 29.9375 113.109375 30.53125 114.449219 30.875 C 115.144531 31.054688 115.816406 31.160156 116.648438 31.222656 C 116.96875 31.246094 118.046875 31.246094 118.367188 31.222656 C 119.882812 31.113281 121.082031 30.8125 122.214844 30.265625 C 124.242188 29.28125 125.714844 27.679688 126.476562 25.632812 C 126.71875 24.980469 126.863281 24.375 126.972656 23.523438 L 126.980469 23.476562 L 122.605469 23.476562 L 122.5625 23.640625 C 122.035156 25.722656 120.457031 27.117188 118.324219 27.390625 C 117.730469 27.464844 117 27.445312 116.394531 27.339844 C 114.988281 27.089844 113.773438 26.308594 112.882812 25.074219 C 112.332031 24.320312 111.890625 23.335938 111.632812 22.28125 C 111.25 20.71875 111.1875 18.707031 111.472656 17.035156 C 111.773438 15.273438 112.515625 13.757812 113.574219 12.734375 C 114.191406 12.140625 114.945312 11.6875 115.71875 11.449219 C 116.941406 11.070312 118.484375 11.105469 119.605469 11.53125 C 120.195312 11.753906 120.644531 12.042969 121.113281 12.503906 C 121.652344 13.035156 122.039062 13.589844 122.316406 14.238281 C 122.398438 14.4375 122.527344 14.816406 122.570312 15.007812 L 122.605469 15.148438 L 126.980469 15.148438 L 126.972656 15.085938 C 126.785156 13.492188 126.273438 12.144531 125.402344 10.988281 C 124.714844 10.074219 123.894531 9.34375 122.882812 8.75 C 122.601562 8.585938 121.972656 8.277344 121.667969 8.152344 C 120.566406 7.714844 119.445312 7.480469 118.113281 7.40625 C 117.792969 7.390625 117.105469 7.390625 116.789062 7.410156 Z M 116.789062 7.410156 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 156.207031 7.410156 C 153.863281 7.535156 151.875 8.292969 150.199219 9.699219 C 148.609375 11.039062 147.421875 12.925781 146.789062 15.132812 C 146.273438 16.910156 146.105469 19.027344 146.308594 21.097656 C 146.480469 22.894531 146.9375 24.484375 147.683594 25.898438 C 148.949219 28.300781 151.023438 30.003906 153.59375 30.757812 C 155.238281 31.242188 157.222656 31.375 159.121094 31.121094 C 162.84375 30.632812 165.671875 28.5 166.675781 25.429688 C 166.800781 25.042969 166.8125 25.007812 166.78125 25 C 166.757812 24.996094 162.652344 24.253906 162.589844 24.246094 C 162.558594 24.242188 162.546875 24.257812 162.484375 24.410156 C 162.3125 24.828125 162.035156 25.300781 161.769531 25.632812 C 161.609375 25.835938 161.28125 26.164062 161.078125 26.324219 C 160.402344 26.867188 159.578125 27.230469 158.640625 27.40625 C 158.15625 27.492188 157.8125 27.523438 157.226562 27.519531 C 156.589844 27.519531 156.160156 27.480469 155.632812 27.367188 C 153.910156 27.003906 152.554688 26.03125 151.703125 24.542969 C 151.089844 23.476562 150.792969 22.339844 150.710938 20.753906 L 150.703125 20.589844 L 167.085938 20.589844 L 167.085938 19.476562 C 167.085938 18.867188 167.078125 18.222656 167.070312 18.050781 C 166.964844 15.800781 166.542969 14.054688 165.71875 12.460938 C 165.253906 11.5625 164.75 10.867188 164.085938 10.207031 C 162.828125 8.949219 161.382812 8.15625 159.535156 7.707031 C 158.5 7.453125 157.332031 7.347656 156.207031 7.410156 Z M 157.648438 11.148438 C 158.792969 11.273438 159.726562 11.65625 160.578125 12.351562 C 160.777344 12.515625 161.152344 12.886719 161.3125 13.085938 C 162.050781 13.992188 162.496094 15.074219 162.636719 16.308594 C 162.660156 16.535156 162.6875 16.929688 162.6875 17.101562 L 162.6875 17.222656 L 150.71875 17.222656 L 150.71875 17.164062 C 150.71875 17.136719 150.726562 17.019531 150.738281 16.90625 C 150.914062 15.191406 151.675781 13.660156 152.886719 12.59375 C 153.902344 11.703125 155.023438 11.230469 156.390625 11.128906 C 156.644531 11.105469 157.398438 11.121094 157.648438 11.148438 Z M 157.648438 11.148438 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 233.578125 7.820312 C 233.714844 8.1875 241.941406 31 241.953125 31.035156 C 241.964844 31.074219 241.929688 31.179688 241.667969 31.90625 C 241.503906 32.359375 241.328125 32.824219 241.28125 32.941406 C 240.933594 33.753906 240.570312 34.328125 240.140625 34.742188 C 239.726562 35.136719 239.324219 35.324219 238.660156 35.429688 C 238.394531 35.46875 237.628906 35.464844 237.3125 35.421875 C 237.019531 35.378906 236.765625 35.332031 236.457031 35.253906 C 236.320312 35.222656 236.207031 35.199219 236.207031 35.203125 C 236.199219 35.210938 235.132812 38.84375 235.132812 38.867188 C 235.132812 38.894531 235.453125 39.007812 235.785156 39.089844 C 236.621094 39.300781 237.355469 39.378906 238.351562 39.367188 C 238.910156 39.355469 239.144531 39.339844 239.589844 39.273438 C 242.300781 38.878906 244.25 37.183594 245.449219 34.1875 C 245.589844 33.824219 255.101562 7.753906 255.09375 7.746094 C 255.082031 7.734375 250.265625 7.691406 250.257812 7.703125 C 250.25 7.707031 248.933594 11.738281 247.332031 16.65625 L 244.417969 25.597656 L 244.296875 25.601562 L 244.179688 25.605469 L 243.964844 24.953125 C 243.847656 24.59375 242.535156 20.566406 241.046875 16.003906 L 238.34375 7.707031 L 235.941406 7.703125 L 233.535156 7.699219 Z M 233.578125 7.820312 "}),i("path",{stroke:"none",fillRule:"nonzero",fillOpacity:"1",fill:e.color||"var(--privy-color-foreground)",d:"M 293.054688 35.804688 C 291.867188 35.84375 291.125 35.886719 290.253906 35.964844 C 287.730469 36.195312 285.71875 36.648438 284.816406 37.1875 C 284.128906 37.601562 284.058594 38.046875 284.621094 38.46875 C 285.503906 39.125 287.910156 39.660156 290.980469 39.878906 C 291.824219 39.941406 292.347656 39.960938 293.378906 39.984375 C 294.4375 40.003906 295.617188 39.984375 296.730469 39.925781 C 300.195312 39.734375 302.972656 39.144531 303.839844 38.417969 C 304.058594 38.234375 304.148438 38.078125 304.148438 37.886719 C 304.148438 37.796875 304.144531 37.765625 304.097656 37.671875 C 303.753906 36.980469 301.78125 36.363281 298.851562 36.039062 C 297.953125 35.9375 297.148438 35.878906 295.976562 35.824219 C 295.65625 35.8125 293.375 35.796875 293.054688 35.804688 Z M 293.054688 35.804688 "})]})})}let ee=a.div`
1
+ import{useState as e,useEffect as r,createContext as t,useContext as a}from"react";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import{styled as l,keyframes as s,css as c}from"styled-components";import{u as p}from"./useWallets.mjs";import{c as u,l as d,u as h,h as v}from"./privy-context.mjs";import m from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as f}from"@ethersproject/bignumber";import{formatEther as g}from"@ethersproject/units";import{StaticJsonRpcProvider as y}from"@ethersproject/providers";let w=e=>f.from(e);function b(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)}function W(e){let r={};return void 0!==e.to&&(r.to=e.to),void 0!==e.data&&(r.data=e.data),void 0!==e.chainId&&(r.chainId=e.chainId),void 0!==e.type&&(r.type=e.type),void 0!==e.accessList&&(r.accessList=e.accessList),void 0!==e.nonce&&(r.nonce=w(e.nonce).toNumber()),void 0!==e.gasLimit&&(r.gasLimit=w(e.gasLimit)),void 0!==e.gasPrice&&(r.gasPrice=w(e.gasPrice)),void 0!==e.value&&(r.value=w(e.value)),void 0!==e.maxFeePerGas&&(r.maxFeePerGas=w(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=w(e.maxPriorityFeePerGas)),r}class x{get(e){let r=localStorage.getItem(e);return null===r?void 0:JSON.parse(r)}put(e,r){void 0!==r?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}function P(){try{let e="privy:__session_storage__test",r=new x;return r.put(e,"blobby"),r.del(e),!0}catch(e){return!1}}var k="undefined"!=typeof window&&window.localStorage?new x:new class{get(e){return this._cache[e]}put(e,r){void 0!==r?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const $=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,T=(e,r)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!r)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==$(e))return!1;if(e.providers)for(let r of e.providers)if(!T(r))return!1;return!0},M=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom)return!0}return!1},S=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let r of e.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0;return!1},C=(e,r)=>{let t=[],a=[];for(let[i,o]of e.entries())i<r?t.push(o):a.push(o);return[t,a]},I=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),U=(e,r)=>{let t=e.slice(0),a=[];for(;t.length;)a.push(t.splice(0,r));return a},F=(e,r=3,t=4,a="ethereum")=>{if(!e)return"";let i="ethereum"===a?2:0;return r+t+i+3>=e.length?e:`${e.slice(0,i+r)}...${e.slice(e.length-t,e.length)}`},O=e=>new Promise((r=>setTimeout(r,e)));function Z(e,{interval:r=100,timeout:t=5e3}={}){return new Promise(((a,i)=>{let o,n=0,l=()=>{n>=t?i("Max attempts reached without result"):(o=e(),n+=r,null==o?setTimeout(l,r):a(o))};l()}))}const E=(e,r={})=>{let t=r.delayMs||150,a=r.maxAttempts||270;return new Promise((async(i,o)=>{let n=!1,l=0;for(;!n&&l<a;){if(r.abortSignal?.aborted)return;e().then((e=>{n=!0,i(e)}),((...e)=>{n=!0,o(...e)})),l+=1,await O(t)}n||o(Error("Exceeded max attempts before resolving function"))}))},A=(e,r,t={},a={})=>{let i=new URL(r,e);for(let[e,r]of Object.entries(t))void 0!==r&&i.searchParams.set(e,r);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[r,t]of o)e.append(r,t);i.hash=e.toString()}return i.href},D=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),L=e=>"string"==typeof e?e:"0x"+e.toString(16);async function V(e,r,t,a=3e3){let i=!1,o=window;return new Promise((n=>{function l(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",l);let a=e.getProviders();console.debug("Detected injected providers:",a.map((e=>e.info)));let o=[];for(let e of a)r.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||o.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});for(let e of function(){let e=window,r=e.ethereum;if(!r)return[];let t=[];if(r.providers?.length)for(let e of r.providers)e&&t.push(e);return t.push(e.ethereum),t}()){let r=$(e);if(!a.some((e=>e.info.name===r))){if(T(e,!0)&&!o.find((e=>"metamask"===e.type))){o.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===r&&!o.find((e=>"phantom"===e.type))){o.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===r&&!o.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==t?.coinbaseWallet?.connectionOptions))){o.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}o.find((e=>"unknown_browser_extension"===e.type))||o.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}n(o)}o.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout((()=>{l()}),a))}))}function _(e){return`eip155:${String(Number(e))}`}const j=(e,r,t,a)=>{let i=Number(e),o=r.find((e=>e.id===i));if(!o)throw new u(`Unsupported chainId ${e}`,4901);return N(o,t,a)},N=(e,r,t)=>{let a,i=e.id,o=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[o])a=r.rpcUrls[o];else if(e.rpcUrls.privy?.http[0]){let r=new URL(e.rpcUrls.privy.http[0]);r.searchParams.append("privyAppId",t),a=r.toString()}else a=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!a)throw new u(`No RPC url found for ${i}`);return a},H=(e,r,t,a)=>{let i=Number(e),o=r.find((e=>e.id===i));if(!o)throw new u(`Unsupported chainId ${e}`,4901);return new y(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?o.rpcUrls.privyWalletOverride.http[0]:t.rpcUrls&&t.rpcUrls[i]?t.rpcUrls[i]:o.rpcUrls.privy?.http[0]?{url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":a.appId}}:o.rpcUrls.public?.http[0]?o.rpcUrls.public.http[0]:o.rpcUrls.default?.http[0])},B=e=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},t=e.types.EIP712Domain??Object.entries(e.domain).map((([e,t])=>{if(null!=t&&"string"==typeof e&&e in r)return{name:e,type:r[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:t}}};function R(e,{min:r,max:t}){return Math.min(Math.max(e,r),t)}const z=t=>{let[a,i]=e("auto");return r((()=>{let e=new ResizeObserver((e=>{i(e[0]?.contentRect.height??"auto")}));return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[t.current]),a},G={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},K=t(void 0);let q=()=>a(K);function X(e,t){if(!t)return;let a=q().current[e];return r((()=>{for(let[r,i]of Object.entries(t))a.hasOwnProperty(r)||console.warn(`Invalid event type "${r}" for action "${e}"`),a[r]?.push(i);return()=>{for(let[r,i]of Object.entries(t))a.hasOwnProperty(r)||console.warn(`Invalid event type "${r}" for action "${e}"`),a[r]=a[r]?.filter((e=>e!==i))}}),[t])}function J(e,r,t,...a){for(let i of e.current[r][t])i(...a)}function Q(){let e=q();return(r,t,...a)=>J(e,r,t,...a)}function Y(e){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...e,children:i("g",{fill:e.color||"var(--privy-color-foreground)",children:i("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let ee=l.div`
2
2
  margin-top: 16px;
3
3
  font-size: 13px;
4
4
  text-align: center;
@@ -7,7 +7,7 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
7
7
  && > a {
8
8
  color: var(--privy-color-accent);
9
9
  }
10
- `;function re(e){let{legal:{privacyPolicyUrl:r,termsAndConditionsUrl:t,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent||!t&&!r)return i(ee,{});let l=!(!r||!t);return n(ee,{children:["By logging in I agree to the"," ",t&&i("a",{href:t,target:"_blank",children:l?"Terms":"Terms of Service"}),l&&" & ",r&&i("a",{href:r,target:"_blank",children:"Privacy Policy"})]})}const te=()=>i(oe,{children:i("a",{href:"https://www.privy.io/",target:"_blank",children:i(Y,{height:13,width:150})})}),oe=a.div`
10
+ `;function re(e){let{legal:{privacyPolicyUrl:r,termsAndConditionsUrl:t,requireUsersAcceptTerms:a}}=e.app;if(a&&!e.alwaysShowImplicitConsent||!t&&!r)return i(ee,{});let n=!(!r||!t);return o(ee,{children:["By logging in I agree to the"," ",t&&i("a",{href:t,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",r&&i("a",{href:r,target:"_blank",children:"Privacy Policy"})]})}const te=()=>i(ae,{children:i("a",{href:"https://www.privy.io/",target:"_blank",children:i(Y,{height:13,width:150})})}),ae=l.div`
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: center;
@@ -28,7 +28,7 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
28
28
  @media all and (display-mode: standalone) {
29
29
  padding-bottom: 30px;
30
30
  }
31
- `,ie=({address:e,showCopyIcon:r,url:t,className:o})=>t?i("a",{title:e,className:o,href:`${t}/address/${e}`,target:"_blank",children:I(e)}):n("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[I(e),r&&i(ne,{})]});let ne=a(h)`
31
+ `,ie=({address:e,showCopyIcon:r,url:t,className:a})=>t?i("a",{title:e,className:a,href:`${t}/address/${e}`,target:"_blank",children:F(e)}):o("button",{title:e,className:a,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[F(e),r&&i(oe,{})]});let oe=l(m)`
32
32
  && {
33
33
  display: inline;
34
34
  }
@@ -37,7 +37,7 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
37
37
  width: 0.875rem;
38
38
  margin-left: 0.125rem;
39
39
  color: var(--privy-color-foreground-3);
40
- `,le=s`
40
+ `,ne=s`
41
41
  from, to {
42
42
  background: var(--privy-color-foreground-4);
43
43
  color: var(--privy-color-foreground-4);
@@ -47,20 +47,20 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
47
47
  background: var(--privy-color-foreground-accent);
48
48
  color: var(--privy-color-foreground-accent);
49
49
  }
50
- `;const ae=c`
50
+ `;const le=c`
51
51
  ${e=>e.$isLoading?c`
52
52
  width: 35%;
53
- animation: ${le} 2s linear infinite;
53
+ animation: ${ne} 2s linear infinite;
54
54
  border-radius: var(--privy-border-radius-sm);
55
55
  `:""}
56
- `,se=({children:e,color:r,isLoading:t,isPulsing:o,className:n})=>i(ce,{$color:r,$isLoading:t,$isPulsing:o,className:n,children:e});let ce=a.span`
56
+ `,se=({children:e,color:r,isLoading:t,isPulsing:a,className:o})=>i(ce,{$color:r,$isLoading:t,$isPulsing:a,className:o,children:e});let ce=l.span`
57
57
  padding: 0.125rem 0.5rem;
58
58
  font-size: 0.75rem;
59
59
  font-weight: 500;
60
60
  line-height: 1.125rem; /* 150% */
61
61
  border-radius: var(--privy-border-radius-sm);
62
62
 
63
- ${e=>{let r,t;"green"===e.$color&&(r="var(--privy-color-success-dark)",t="var(--privy-color-success-light)"),"red"===e.$color&&(r="var(--privy-color-error)",t="var(--privy-color-error-light)"),"gray"===e.$color&&(r="var(--privy-color-foreground-2)",t="var(--privy-color-background-2)");let o=s`
63
+ ${e=>{let r,t;"green"===e.$color&&(r="var(--privy-color-success-dark)",t="var(--privy-color-success-light)"),"red"===e.$color&&(r="var(--privy-color-error)",t="var(--privy-color-error-light)"),"gray"===e.$color&&(r="var(--privy-color-foreground-2)",t="var(--privy-color-background-2)");let a=s`
64
64
  from, to {
65
65
  background-color: ${t};
66
66
  }
@@ -72,27 +72,27 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
72
72
  color: ${r};
73
73
  background-color: ${t};
74
74
  ${e.$isPulsing&&c`
75
- animation: ${o} 3s linear infinite;
75
+ animation: ${a} 3s linear infinite;
76
76
  `};
77
77
  `}}
78
78
 
79
- ${ae}
80
- `,Ce=t({});const pe=({children:t})=>{let o=C(),[n,l]=e({});return X("login",{onComplete:(e,r,t,i,n)=>{n&&"passkey"!==n.type&&"cross_app"!==n.type&&("wallet"!==n.type||"privy"!==n.walletClientType)&&(M.put(ue(o.id),n.type),"wallet"===n.type?(M.put(de(o.id),n.walletClientType),M.put(fe(o.id),n.chainType),l({accountType:n.type,walletClientType:n.walletClientType,chainType:n.chainType})):(M.del(de(o.id)),M.del(fe(o.id)),l({accountType:n.type})))}}),r((()=>{if(!o.id)return;let e=M.get(ue(o.id)),r=M.get(de(o.id)),t=M.get(fe(o.id));e&&l("wallet"===e?{accountType:e,walletClientType:r,chainType:t}:{accountType:e})}),[o.id]),i(Ce.Provider,{value:n,children:t})};let ue=e=>`privy:${e}:recent-login-method`,de=e=>`privy:${e}:recent-login-wallet-client`,fe=e=>`privy:${e}:recent-login-chain-type`;const he=()=>o(Ce);function ve(e){let{logout:r}=o(u);return X("logout",e),{logout:r}}const ye=a.div`
79
+ ${le}
80
+ `,pe=t({});const ue=({children:t})=>{let a=p(),[o,n]=e({});return X("login",{onComplete:(e,r,t,i,o)=>{o&&"passkey"!==o.type&&"cross_app"!==o.type&&("wallet"!==o.type||"privy"!==o.walletClientType)&&(k.put(de(a.id),o.type),"wallet"===o.type?(k.put(he(a.id),o.walletClientType),k.put(ve(a.id),o.chainType),n({accountType:o.type,walletClientType:o.walletClientType,chainType:o.chainType})):(k.del(he(a.id)),k.del(ve(a.id)),n({accountType:o.type})))}}),r((()=>{if(!a.id)return;let e=k.get(de(a.id)),r=k.get(he(a.id)),t=k.get(ve(a.id));e&&n("wallet"===e?{accountType:e,walletClientType:r,chainType:t}:{accountType:e})}),[a.id]),i(pe.Provider,{value:o,children:t})};let de=e=>`privy:${e}:recent-login-method`,he=e=>`privy:${e}:recent-login-wallet-client`,ve=e=>`privy:${e}:recent-login-chain-type`;const me=()=>a(pe);function fe(e){let{logout:r}=a(d);return X("logout",e),{logout:r}}const ge=l.div`
81
81
  display: flex;
82
82
  flex-direction: column;
83
- `,me=a.span`
83
+ `,ye=l.span`
84
84
  text-align: left;
85
85
  font-size: 0.75rem;
86
86
  font-weight: 500;
87
87
  line-height: 1.125rem; /* 150% */
88
88
 
89
89
  color: var(--privy-color-error);
90
- `,ge=a.span`
90
+ `,we=l.span`
91
91
  color: var(--privy-color-foreground-3);
92
92
  font-size: 0.75rem;
93
93
  font-weight: 500;
94
94
  line-height: 1.125rem; /* 150% */
95
- `,Le=c`
95
+ `,be=c`
96
96
  && {
97
97
  border-width: 1px;
98
98
  padding: 0.5rem 1rem;
@@ -107,6 +107,6 @@ import{useState as e,useEffect as r,createContext as t,useContext as o}from"reac
107
107
  align-items: center;
108
108
 
109
109
  ${e=>"error"===e.$state?"border-color: var(--privy-color-error);":""}
110
- `,we=a.div`
111
- ${Le}
112
- `,be=({errMsg:e,balance:r,address:t,isLoading:o,className:a,title:s,isPulsing:c,showIcon:C,statusColor:p="green"})=>{let u;return u=p||(e?"red":"green"),n(l,{children:[n(we,{className:a,$state:e?"error":void 0,children:[n(ye,{children:[i(ge,{children:s||"Pay with"}),i(ie,{address:t,showCopyIcon:C||!!e})]}),void 0!==r&&i(se,{isLoading:o,isPulsing:c,color:u,children:r})]}),e&&i(me,{style:{marginTop:"0.25rem"},children:e})]})},ke=({color:e,...r})=>i("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...r,children:i("g",{children:i("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let Me=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),We=e=>Me.format(e);const xe=(e,r)=>{let t=We(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},Pe=(e,r)=>{let t=We(r*parseFloat(y(e)));return"$0.00"===t?"<$0.01":t},$e=(e,r,t=6,o=!1)=>{let i=parseFloat(y(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${r}`:`${"0"===i?"<0.001":i} ${r}`},Oe=e=>e.map(g).reduce(((e,r)=>e.add(r)),v.from(0)).toHexString(),Te=(e,r)=>{let{chains:t}=d(),o=`https://etherscan.io/address/${r}`,i=`${((e,r)=>{let t=Number(e),o=r.find((e=>e.id===t));if(!o)throw new p(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url})(e,t)}/address/${r}`;if(!i)return o;try{new URL(i)}catch{return o}return i};function Se(e){let{login:r}=o(u);return X("login",e),{login:r}}function Ie(e){let{connectWallet:r}=o(u);return X("connectWallet",e),{connectWallet:r}}const Ue=e=>{X("fundWallet",e);let{fundWallet:r}=f();return{fundWallet:r}};export{ie as A,te as B,se as C,we as D,Le as E,$e as F,me as G,xe as H,Oe as I,Pe as J,T as K,ae as L,oe as M,O as N,Te as O,Q as P,G as Q,K as R,J as S,re as T,V as U,pe as V,be as W,Se as X,Ie as Y,Ue as Z,M as a,B as b,E as c,R as d,k as e,_ as f,N as g,j as h,g as i,D as j,P as k,he as l,$ as m,I as n,U as o,F as p,ve as q,w as r,Z as s,L as t,X as u,z as v,ke as w,S as x,H as y,A as z};
110
+ `,We=l.div`
111
+ ${be}
112
+ `,xe=({errMsg:e,balance:r,address:t,isLoading:a,className:l,title:s,isPulsing:c,showIcon:p,statusColor:u="green"})=>{let d;return d=u||(e?"red":"green"),o(n,{children:[o(We,{className:l,$state:e?"error":void 0,children:[o(ge,{children:[i(we,{children:s||"Pay with"}),i(ie,{address:t,showCopyIcon:p||!!e})]}),void 0!==r&&i(se,{isLoading:a,isPulsing:c,color:d,children:r})]}),e&&i(ye,{style:{marginTop:"0.25rem"},children:e})]})},Pe=({color:e,...r})=>i("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...r,children:i("g",{children:i("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let ke=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),$e=e=>ke.format(e);const Te=(e,r)=>{let t=$e(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},Me=(e,r)=>{let t=$e(r*parseFloat(g(e)));return"$0.00"===t?"<$0.01":t},Se=(e,r,t=6,a=!1)=>{let i=parseFloat(g(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return a?`${i} ${r}`:`${"0"===i?"<0.001":i} ${r}`},Ce=e=>e.map(w).reduce(((e,r)=>e.add(r)),f.from(0)).toHexString(),Ie=(e,r)=>{let{chains:t}=h(),a=`https://etherscan.io/address/${r}`,i=`${((e,r)=>{let t=Number(e),a=r.find((e=>e.id===t));if(!a)throw new u(`Unsupported chainId ${e}`,4901);return a.blockExplorers?.default.url})(e,t)}/address/${r}`;if(!i)return a;try{new URL(i)}catch{return a}return i};function Ue(e){let{login:r}=a(d);return X("login",e),{login:r}}function Fe(e){let{connectWallet:r}=a(d);return X("connectWallet",e),{connectWallet:r}}const Oe=e=>{X("fundWallet",e);let{fundWallet:r}=v();return{fundWallet:r}};export{ie as A,te as B,se as C,We as D,be as E,Se as F,ye as G,Te as H,Ce as I,Me as J,I as K,le as L,ae as M,C as N,Ie as O,Q as P,z as Q,G as R,J as S,re as T,K as U,ue as V,xe as W,Ue as X,Fe as Y,Oe as Z,k as a,B as b,L as c,E as d,P as e,_ as f,H as g,j as h,w as i,V as j,M as k,me as l,S as m,F as n,O as o,Z as p,fe as q,W as r,D as s,b as t,X as u,A as v,Pe as w,U as x,R as y,N as z};
@@ -1 +1 @@
1
- import{b as e,g as t,n as a,u as s,h as n,P as r}from"./privy-context.mjs";import{ErrorCode as i}from"@ethersproject/logger";import o from"eventemitter3";import{b as l}from"./user.mjs";var d,c;(c=d||(d={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",c.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",c.INVALID_DATA="invalid_data",c.LINKED_TO_ANOTHER_USER="linked_to_another_user",c.ALLOWLIST_REJECTED="allowlist_rejected",c.OAUTH_USER_DENIED="oauth_user_denied",c.UNKNOWN_AUTH_ERROR="unknown_auth_error",c.USER_EXITED_AUTH_FLOW="exited_auth_flow",c.MUST_BE_AUTHENTICATED="must_be_authenticated",c.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",c.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",c.CLIENT_REQUEST_TIMEOUT="client_request_timeout",c.INVALID_CREDENTIALS="invalid_credentials";class _ extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class E extends _{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let u={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class h extends E{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}class p extends e{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class m extends e{constructor(){super("User rejected connection"),this.type="wallet_error"}}const y=t=>{if(t instanceof e)return t;if(t?.code&&t?.reason){let e=new R(t);return t.code===i.ACTION_REJECTED&&(e.details=u.E4001_USER_REJECTED_REQUEST),e}return t?.code?new R(t):new e("Unknown connector error",t)};class T extends t{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class R extends T{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}const g={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...u};class C extends o{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const w=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","privy","unknown","phantom","solflare","glow"];function N(e){return"solana"===e.chainType}function A(e){return"solana"===e.type}class D extends C{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(e,t){let s,n,r;if("Installed"!==e.readyState||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(s=async(...t)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(t[0])}),"sendTransaction"in e&&(n=async(...t)=>await e.sendTransaction(t[0],t[1],t[2])),"signTransaction"in e&&(r=async t=>await e.signTransaction(t)),{type:"solana",address:e.publicKey.toBase58(),meta:t,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:a,signMessage:s,sendTransaction:n,signTransaction:r}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return w.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw y(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}}const b=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:a,solanaWallets:i,initDelegateAction:o}=s(),{user:d}=n();return{createWallet:a,exportWallet:t,delegateWalletAction:async()=>{let e=l(d);if(!e)throw new r("User must have a solana wallet in order to delegate actions");return await o({address:e.address})},wallets:i.concat(e?[e]:[])}};export{g as C,u as E,R as P,D as S,m as U,p as W,C as a,T as b,A as c,y as f,N as i,h as l,b as u};
1
+ import{c as e,b as t,n as a,u as s,h as n,P as r}from"./privy-context.mjs";import{ErrorCode as i}from"@ethersproject/logger";import o from"eventemitter3";import{a as l}from"./user.mjs";var d,c;(c=d||(d={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",c.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",c.INVALID_DATA="invalid_data",c.LINKED_TO_ANOTHER_USER="linked_to_another_user",c.ALLOWLIST_REJECTED="allowlist_rejected",c.OAUTH_USER_DENIED="oauth_user_denied",c.UNKNOWN_AUTH_ERROR="unknown_auth_error",c.USER_EXITED_AUTH_FLOW="exited_auth_flow",c.MUST_BE_AUTHENTICATED="must_be_authenticated",c.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",c.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",c.CLIENT_REQUEST_TIMEOUT="client_request_timeout",c.INVALID_CREDENTIALS="invalid_credentials";class _ extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class E extends _{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let u={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class h extends E{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}class p extends e{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class m extends e{constructor(){super("User rejected connection"),this.type="wallet_error"}}const y=t=>{if(t instanceof e)return t;if(t?.code&&t?.reason){let e=new R(t);return t.code===i.ACTION_REJECTED&&(e.details=u.E4001_USER_REJECTED_REQUEST),e}return t?.code?new R(t):new e("Unknown connector error",t)};class T extends t{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class R extends T{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}const g={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...u};class C extends o{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const w=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","privy","unknown","phantom","solflare","glow"];function N(e){return"solana"===e.chainType}function A(e){return"solana"===e.type}class D extends C{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(e,t){let s,n,r;if("Installed"!==e.readyState||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(s=async(...t)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(t[0])}),"sendTransaction"in e&&(n=async(...t)=>await e.sendTransaction(t[0],t[1],t[2])),"signTransaction"in e&&(r=async t=>await e.signTransaction(t)),{type:"solana",address:e.publicKey.toBase58(),meta:t,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:a,signMessage:s,sendTransaction:n,signTransaction:r}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return w.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw y(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}}const b=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:a,solanaWallets:i,initDelegateAction:o}=s(),{user:d}=n();return{createWallet:a,exportWallet:t,delegateWalletAction:async()=>{let e=l(d);if(!e)throw new r("User must have a solana wallet in order to delegate actions");return await o({address:e.address})},wallets:i.concat(e?[e]:[])}};export{g as C,u as E,R as P,D as S,m as U,p as W,C as a,T as b,A as c,y as f,N as i,h as l,b as u};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,useContext as r,createContext as o}from"react";import l from"tinycolor2";const i="https://auth.privy.io",s=2e4,p=1400,c=2500,h=4e3,u="1.88.2",d="privy:token",m="privy-token",g="privy:refresh_token",f="privy-refresh-token",y="privy:id_token",b="privy-id-token",w="privy-session",v="privy:session_transfer_token",C="privy:caid",k=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,S="privy:state_code",x="privy:code_verifier",O="privy:headless_oauth",A="privy:oauth_disable_signup",U=e=>`privy:wallet:${e}`,M="privy:connectors",H="privy:connections",L=12e4,W=1,T="0x1",F=3e4,P="https://api.moonpay.com/v1",_="https://api.moonpay.com/v1",z="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",B="deprecated",R={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let I=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),D=e=>I.has(e),q=(e,t,a)=>a.indexOf(e)===t;const K=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(D).filter(q):e?e.filter(D).filter(q):R.appearance.walletList,Y={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},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"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},Z={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},$={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},G={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},X={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},J={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},N={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},V={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},Q={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},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"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},ee={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},te={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},ae={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},ne={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},re={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},oe={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},le=[Y,Z,re,Q,ee,te,ae,ne,N,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},X,J,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},V,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},$,G,oe,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],ie=new Set(le.map((e=>e.id)));function se(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function pe(e){let t=e.filter((e=>!ie.has(e.id)));return le.concat(t)}let ce="#FFFFFF";function he(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return l({...e.toHsl(),l:a})}function ue({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=ce;break;case"dark":a="#1E1E1D";break;default:a=e}let n=l(a),r=l(t),o=l("#51BA81"),i=l("#FFB74D"),s=l("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(n.getLuminance()),c=he(n,"light"===p?-.04:.11),h=he(n,"light"===p?-.88:.87),u=he(n,"light"===p?-.7:.75),d=he(n,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=he(n,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=he(r,.15),f=he(r,-.06),y=he(s,.3),b=he(i,.3),w=l(r.getLuminance()>.5?"#040217":ce),v=he(o,-.16),C=he(o,.4);return{colorScheme:p,background:n.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:r.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:w.toHslString(),success:o.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function de(e,t,a){let n,r,o,l,i,s,p,c,h,u,d,m,g,f,y,b,w=a?console.warn:()=>{};t?.loginMethods?(n=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),g=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(n=e.emailAuth,r=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,h=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,g=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[n,r].filter(Boolean),C=[i,s,p,m,h,u,c,d,g,f,y].filter(Boolean),k=[l].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let x=K({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),O=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),A=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:n}){let r;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),r=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=le.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}(e,a):e}))}else r=le.concat(e??[]);let o=t?r[0]:Q,l=a??o;if(!r.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),H=!!t?.defaultChain,L=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,W=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?L?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??W:W,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:T,...F}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??R.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:ue({backgroundTheme:t?.appearance?.theme??R.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??R.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:x,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:n,sms:r,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:h,instagram:u,tiktok:c,linkedin:d,apple:g,farcaster:f,telegram:y},loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??R.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??R.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??R.rpcConfig.rpcTimeouts},chains:U,defaultChain:M,intl:{defaultCountry:A},shouldEnforceDefaultChainOnConnect:H,captchaEnabled:e.captchaEnabled??R.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??R.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof T?{requireUserOwnedRecoveryOnCreate:T}:{},...L?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...F,noPromptOnSignature:b},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:L?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??R._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??R.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??R.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??R.fundingMethodConfig.moonpay.useSandbox}}}}let me={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const ge=de(me,void 0,!1);let fe=o({appConfig:ge,isServerConfigLoaded:!1});const ye=({children:r,legacyCreateEmbeddedWalletFlag:o,client:l,clientConfig:i})=>{let[s,p]=t(null),c=a((()=>de(s??me,i,!!s)),[s,i]);return n((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:n,supportedChains:r,defaultChain:o,externalWallets:l,...i}=e;return{...i,...n?{additionalChains:n.map((e=>e.id))}:void 0,...r?{supportedChains:r.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(i,o),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${s.id}:${t}`;localStorage.getItem(a)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,o,s]),n((()=>{s||(async()=>{try{let e=await l.getServerConfig();e.customApiUrl&&l.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e(fe.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:r})},be=()=>{let{appConfig:e}=r(fe);return e},we=()=>{let{isServerConfigLoaded:e}=r(fe);return e},ve=o(null);function Ce(){let e=r(ve);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{ve as $,ae as A,oe as B,x as C,L as D,Ce as E,v as F,h as G,O as H,y as I,P as J,j as K,z as L,_ as M,re as N,A as O,te as P,ne as Q,g as R,S,d as T,J as U,u as V,F as W,G as X,Z as Y,ye as Z,we as _,U as a,le as a0,se as a1,ge as a2,T as b,M as c,H as d,E as e,w as f,k as g,B as h,m as i,f as j,b as k,i as l,s as m,C as n,p as o,c as p,W as q,pe as r,Y as s,$ as t,be as u,X as v,N as w,V as x,Q as y,ee as z};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,useContext as r,createContext as o}from"react";import l from"tinycolor2";const i="https://auth.privy.io",s=2e4,p=1400,c=2500,h=4e3,u="1.88.3",d="privy:token",m="privy-token",g="privy:refresh_token",f="privy-refresh-token",y="privy:id_token",b="privy-id-token",w="privy-session",v="privy:session_transfer_token",C="privy:caid",k=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,S="privy:state_code",x="privy:code_verifier",O="privy:headless_oauth",A="privy:oauth_disable_signup",U=e=>`privy:wallet:${e}`,M="privy:connectors",H="privy:connections",L=12e4,W=1,T="0x1",F=3e4,P="https://api.moonpay.com/v1",_="https://api.moonpay.com/v1",z="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",B="deprecated",R={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let I=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),D=e=>I.has(e),q=(e,t,a)=>a.indexOf(e)===t;const K=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(D).filter(q):e?e.filter(D).filter(q):R.appearance.walletList,Y={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},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"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},Z={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},$={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},G={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},X={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},J={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},N={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},V={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},Q={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},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"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},ee={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},te={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},ae={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},ne={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},re={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},oe={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},le=[Y,Z,re,Q,ee,te,ae,ne,N,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},X,J,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},V,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},$,G,oe,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],ie=new Set(le.map((e=>e.id)));function se(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function pe(e){let t=e.filter((e=>!ie.has(e.id)));return le.concat(t)}let ce="#FFFFFF";function he(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return l({...e.toHsl(),l:a})}function ue({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=ce;break;case"dark":a="#1E1E1D";break;default:a=e}let n=l(a),r=l(t),o=l("#51BA81"),i=l("#FFB74D"),s=l("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(n.getLuminance()),c=he(n,"light"===p?-.04:.11),h=he(n,"light"===p?-.88:.87),u=he(n,"light"===p?-.7:.75),d=he(n,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=he(n,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=he(r,.15),f=he(r,-.06),y=he(s,.3),b=he(i,.3),w=l(r.getLuminance()>.5?"#040217":ce),v=he(o,-.16),C=he(o,.4);return{colorScheme:p,background:n.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:r.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:w.toHslString(),success:o.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function de(e,t,a){let n,r,o,l,i,s,p,c,h,u,d,m,g,f,y,b,w=a?console.warn:()=>{};t?.loginMethods?(n=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),g=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(n=e.emailAuth,r=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,h=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,g=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[n,r].filter(Boolean),C=[i,s,p,m,h,u,c,d,g,f,y].filter(Boolean),k=[l].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let x=K({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),O=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),A=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:n}){let r;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),r=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=le.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}(e,a):e}))}else r=le.concat(e??[]);let o=t?r[0]:Q,l=a??o;if(!r.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),H=!!t?.defaultChain,L=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,W=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?L?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??W:W,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:T,...F}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??R.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:ue({backgroundTheme:t?.appearance?.theme??R.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??R.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:x,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:n,sms:r,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:h,instagram:u,tiktok:c,linkedin:d,apple:g,farcaster:f,telegram:y},loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??R.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??R.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??R.rpcConfig.rpcTimeouts},chains:U,defaultChain:M,intl:{defaultCountry:A},shouldEnforceDefaultChainOnConnect:H,captchaEnabled:e.captchaEnabled??R.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??R.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof T?{requireUserOwnedRecoveryOnCreate:T}:{},...L?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...F,noPromptOnSignature:b},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:L?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??R._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??R.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??R.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??R.fundingMethodConfig.moonpay.useSandbox}}}}let me={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const ge=de(me,void 0,!1);let fe=o({appConfig:ge,isServerConfigLoaded:!1});const ye=({children:r,legacyCreateEmbeddedWalletFlag:o,client:l,clientConfig:i})=>{let[s,p]=t(null),c=a((()=>de(s??me,i,!!s)),[s,i]);return n((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:n,supportedChains:r,defaultChain:o,externalWallets:l,...i}=e;return{...i,...n?{additionalChains:n.map((e=>e.id))}:void 0,...r?{supportedChains:r.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(i,o),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${s.id}:${t}`;localStorage.getItem(a)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,o,s]),n((()=>{s||(async()=>{try{let e=await l.getServerConfig();e.customApiUrl&&l.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e(fe.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:r})},be=()=>{let{appConfig:e}=r(fe);return e},we=()=>{let{isServerConfigLoaded:e}=r(fe);return e},ve=o(null);function Ce(){let e=r(ve);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{ve as $,ae as A,oe as B,x as C,L as D,Ce as E,v as F,h as G,O as H,y as I,P as J,j as K,z as L,_ as M,re as N,A as O,te as P,ne as Q,g as R,S,d as T,J as U,u as V,F as W,G as X,Z as Y,ye as Z,we as _,U as a,le as a0,se as a1,ge as a2,T as b,M as c,H as d,E as e,w as f,k as g,B as h,m as i,f as j,b as k,i as l,s as m,C as n,p as o,c as p,W as q,pe as r,Y as s,$ as t,be as u,X as v,N as w,V as x,Q as y,ee as z};
package/dist/esm/user.mjs CHANGED
@@ -1 +1 @@
1
- import{getAddress as e}from"@ethersproject/address";function t(e){return e?new Date(1e3*e):null}function i(e,t){return e.slice().sort(((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime())).find((e=>e.type===t))}const a=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,r=e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),s=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType))||null,l=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,d=(t,i)=>{let r=(s=t,s?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType))).find((t=>e(t.address)===e(i)));var s;return{signingWallet:r,rootWallet:r?r.imported?r:a(t):void 0}};const f=(e,t)=>!(a(e)||s(e)||"all-users"!==t&&("users-without-wallets"!==t||(e=>e.linkedAccounts.filter((e=>"wallet"===e.type)))(e)?.length));function n(e){if(!e)return null;let a=function(e){let i=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let r={address:a.address,type:a.type,imported:a.imported,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),chainType:a.chain_type,chainId:a.chain_id,walletClient:"privy"===a.wallet_client_type?"privy":"unknown",walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};i.push(r);break;case"smart_wallet":let s={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),smartWalletType:a.smart_wallet_type};i.push(s);break;case"cross_app":let l={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(l);break;case"email":let d={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(d);break;case"phone":let f={number:a.phoneNumber,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(f);break;case"google_oauth":let n={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(n);break;case"spotify_oauth":let u={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(u);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(p);break;case"twitter_oauth":let _={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(_);break;case"discord_oauth":let m={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(m);break;case"github_oauth":let c={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(c);break;case"tiktok_oauth":let o={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(o);break;case"linkedin_oauth":let y={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(y);break;case"apple_oauth":let v={subject:a.subject,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(v);break;case"custom_auth":i.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)});break;case"farcaster":let h={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),signerPublicKey:a.signer_public_key};i.push(h);break;case"passkey":let b={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(b);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:t(a.first_verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(A);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return i}(e.linked_accounts),r=i(a,"wallet"),s=i(a,"smart_wallet"),l=i(a,"email"),d=i(a,"phone"),f=i(a,"google_oauth"),n=i(a,"twitter_oauth"),u=i(a,"discord_oauth"),p=i(a,"github_oauth"),_=i(a,"spotify_oauth"),m=i(a,"instagram_oauth"),c=i(a,"tiktok_oauth"),o=i(a,"linkedin_oauth"),y=i(a,"apple_oauth"),v=i(a,"farcaster"),h=i(a,"telegram"),b=e.mfa_methods.map((({type:e,verified_at:i})=>({type:e,verifiedAt:t(i)})));return{id:e.id,createdAt:t(e.created_at),linkedAccounts:a,email:l&&{address:l?.address},phone:d&&{number:d?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},smartWallet:s&&{address:s.address,smartWalletType:s.smartWalletType},google:f&&{subject:f.subject,email:f.email,name:f.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:p&&{subject:p.subject,username:p.username,name:p.name,email:p.email},spotify:_&&{subject:_.subject,email:_.email,name:_.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},linkedin:o&&{subject:o.subject,name:o.name,email:o.email,vanityName:o.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:h&&{telegramUserId:h.telegramUserId,firstName:h.firstName,lastName:h.lastName,username:h.username,photoUrl:h.photoUrl},mfaMethods:b.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}export{l as a,s as b,n as c,r as d,d as e,a as g,f as s};
1
+ import{getAddress as e}from"@ethersproject/address";function t(e){return e?new Date(1e3*e):null}function i(e,t){return e.slice().sort(((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime())).find((e=>e.type===t))}const a=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,r=e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),s=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType))||null,l=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,d=(t,i)=>{let r=(s=t,s?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType))).find((t=>e(t.address)===e(i)));var s;return{signingWallet:r,rootWallet:r?r.imported?r:a(t):void 0}};const f=(e,t)=>!(a(e)||s(e)||"all-users"!==t&&("users-without-wallets"!==t||(e=>e.linkedAccounts.filter((e=>"wallet"===e.type)))(e)?.length));function n(e){if(!e)return null;let a=function(e){let i=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let r={address:a.address,type:a.type,imported:a.imported,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),chainType:a.chain_type,chainId:a.chain_id,walletClient:"privy"===a.wallet_client_type?"privy":"unknown",walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};i.push(r);break;case"smart_wallet":let s={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),smartWalletType:a.smart_wallet_type};i.push(s);break;case"cross_app":let l={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(l);break;case"email":let d={address:a.address,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(d);break;case"phone":let f={number:a.phoneNumber,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(f);break;case"google_oauth":let n={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(n);break;case"spotify_oauth":let u={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(u);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(p);break;case"twitter_oauth":let _={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(_);break;case"discord_oauth":let m={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(m);break;case"github_oauth":let c={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(c);break;case"tiktok_oauth":let o={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(o);break;case"linkedin_oauth":let y={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(y);break;case"apple_oauth":let v={subject:a.subject,email:a.email,type:a.type,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(v);break;case"custom_auth":i.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)});break;case"farcaster":let h={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at),signerPublicKey:a.signer_public_key};i.push(h);break;case"passkey":let b={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:t(a.verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(b);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:t(a.first_verified_at),firstVerifiedAt:t(a.first_verified_at),latestVerifiedAt:t(a.latest_verified_at)};i.push(A);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return i}(e.linked_accounts),r=i(a,"wallet"),s=i(a,"smart_wallet"),l=i(a,"email"),d=i(a,"phone"),f=i(a,"google_oauth"),n=i(a,"twitter_oauth"),u=i(a,"discord_oauth"),p=i(a,"github_oauth"),_=i(a,"spotify_oauth"),m=i(a,"instagram_oauth"),c=i(a,"tiktok_oauth"),o=i(a,"linkedin_oauth"),y=i(a,"apple_oauth"),v=i(a,"farcaster"),h=i(a,"telegram"),b=e.mfa_methods.map((({type:e,verified_at:i})=>({type:e,verifiedAt:t(i)})));return{id:e.id,createdAt:t(e.created_at),linkedAccounts:a,email:l&&{address:l?.address},phone:d&&{number:d?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,walletIndex:r.walletIndex},smartWallet:s&&{address:s.address,smartWalletType:s.smartWalletType},google:f&&{subject:f.subject,email:f.email,name:f.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:p&&{subject:p.subject,username:p.username,name:p.name,email:p.email},spotify:_&&{subject:_.subject,email:_.email,name:_.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},linkedin:o&&{subject:o.subject,name:o.name,email:o.email,vanityName:o.vanityName},apple:y&&{subject:y.subject,email:y.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:h&&{telegramUserId:h.telegramUserId,firstName:h.firstName,lastName:h.lastName,username:h.username,photoUrl:h.photoUrl},mfaMethods:b.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}export{s as a,l as b,n as c,r as d,d as e,a as g,f as s};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.88.2",
3
+ "version": "1.88.3",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",
@@ -107,7 +107,7 @@
107
107
  "@heroicons/react": "^2.1.1",
108
108
  "@marsidev/react-turnstile": "^0.4.1",
109
109
  "@metamask/eth-sig-util": "^6.0.0",
110
- "@privy-io/js-sdk-core": "0.28.5",
110
+ "@privy-io/js-sdk-core": "0.28.6",
111
111
  "@simplewebauthn/browser": "^9.0.1",
112
112
  "@solana/wallet-adapter-base": "^0.9.23",
113
113
  "@solana/wallet-standard-wallet-adapter-base": "^1.1.2",