@privy-io/react-auth 1.86.0 → 1.87.0-beta-20240920184838

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 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkZ4PCJGI3js = require('./chunk-Z4PCJGI3.js');function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!_chunkZ4PCJGI3js.la.has(n.id));return _chunkZ4PCJGI3js.ka.concat(t)}function R(e){return _nullishCoalesce(e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported), () => (null))}var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function p({src:e,...t}){return _jsxruntime.jsx.call(void 0, "img",{src:e,...t,style:{display:"none"}})}var f=_react.createContext.call(void 0, {ready:!1,app:_chunkZ4PCJGI3js.ma,currentScreen:null,lastScreen:null,navigate:_chunkZ4PCJGI3js.W,navigateBack:_chunkZ4PCJGI3js.W,resetNavigation:_chunkZ4PCJGI3js.W,setModalData:_chunkZ4PCJGI3js.W,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W= exports.a =e=>{let t=_chunkZ4PCJGI3js.oa.call(void 0, ),n=e.authenticated,[i,l]=_react.useState.call(void 0, e.initialScreen);_react.useEffect.call(void 0, ()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{e.open||(o.current=null)},[e.open]),_react.useEffect.call(void 0, ()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return _jsxruntime.jsxs.call(void 0, f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||_optionalChain([t, 'access', _ => _.appearance, 'access', _2 => _2.logo, 'optionalAccess', _3 => _3.type])==="img")&&_jsxruntime.jsx.call(void 0, p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k= exports.b =()=>_react.useContext.call(void 0, f);function G(e){let n=_optionalChain([new RegExp(/^eip155:(?<chainId>\d+)$/gm), 'access', _4 => _4.exec, 'call', _5 => _5(e), 'optionalAccess', _6 => _6.groups, 'optionalAccess', _7 => _7.chainId]);if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}exports.a = W; exports.b = k; exports.c = E; exports.d = N; exports.e = G; exports.f = R;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkVGM5FGSZjs = require('./chunk-VGM5FGSZ.js');function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!_chunkVGM5FGSZjs.la.has(n.id));return _chunkVGM5FGSZjs.ka.concat(t)}function R(e){return _nullishCoalesce(e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported), () => (null))}var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function p({src:e,...t}){return _jsxruntime.jsx.call(void 0, "img",{src:e,...t,style:{display:"none"}})}var f=_react.createContext.call(void 0, {ready:!1,app:_chunkVGM5FGSZjs.ma,currentScreen:null,lastScreen:null,navigate:_chunkVGM5FGSZjs.W,navigateBack:_chunkVGM5FGSZjs.W,resetNavigation:_chunkVGM5FGSZjs.W,setModalData:_chunkVGM5FGSZjs.W,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W= exports.a =e=>{let t=_chunkVGM5FGSZjs.oa.call(void 0, ),n=e.authenticated,[i,l]=_react.useState.call(void 0, e.initialScreen);_react.useEffect.call(void 0, ()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{e.open||(o.current=null)},[e.open]),_react.useEffect.call(void 0, ()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return _jsxruntime.jsxs.call(void 0, f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||_optionalChain([t, 'access', _ => _.appearance, 'access', _2 => _2.logo, 'optionalAccess', _3 => _3.type])==="img")&&_jsxruntime.jsx.call(void 0, p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k= exports.b =()=>_react.useContext.call(void 0, f);function G(e){let n=_optionalChain([new RegExp(/^eip155:(?<chainId>\d+)$/gm), 'access', _4 => _4.exec, 'call', _5 => _5(e), 'optionalAccess', _6 => _6.groups, 'optionalAccess', _7 => _7.chainId]);if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}exports.a = W; exports.b = k; exports.c = E; exports.d = N; exports.e = G; exports.f = R;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkZ4PCJGI3js = require('./chunk-Z4PCJGI3.js');var _react = require('react');var tt={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:[]}},me= exports.F =_react.createContext.call(void 0, void 0),N=()=>_react.useContext.call(void 0, me);function y(t,r){if(!r)return;let n=N().current[t];return _react.useEffect.call(void 0, ()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),_optionalChain([n, 'access', _2 => _2[i], 'optionalAccess', _3 => _3.push, 'call', _4 => _4(o)]);return()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]=_optionalChain([n, 'access', _5 => _5[i], 'optionalAccess', _6 => _6.filter, 'call', _7 => _7(s=>s!==o)])}},[r])}function ye(t,r,e,...n){for(let i of t.current[r][e])i(...n)}function rt(){let t=N();return(r,e,...n)=>ye(t,r,e,...n)}function st(t){let{logout:r}=_react.useContext.call(void 0, _chunkZ4PCJGI3js.sa);return y("logout",t),{logout:r}}function pt(t){let{login:r}=_react.useContext.call(void 0, _chunkZ4PCJGI3js.sa);return y("login",t),{login:r}}function vt(t){let{connectWallet:r}=_react.useContext.call(void 0, _chunkZ4PCJGI3js.sa);return y("connectWallet",t),{connectWallet:r}}var At=t=>{y("fundWallet",t);let{fundWallet:r}=_chunkZ4PCJGI3js.ta.call(void 0, );return{fundWallet:r}};var S=class{constructor(){this._cache={}}get(r){return this._cache[r]}put(r,e){e!==void 0?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}},P=class{get(r){let e=localStorage.getItem(r);return e===null?void 0:JSON.parse(e)}put(r,e){e!==void 0?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map(([r])=>r)}};function wt(){try{let t="privy:__session_storage__test",r="blobby",e=new P;return e.put(t,r),e.del(t),!0}catch (e2){return!1}}function _e(){return typeof window<"u"&&window.localStorage?new P:new S}var A=_e();function B(){let t=window,r=t.ethereum;if(!r)return[];let e=[];if(_optionalChain([r, 'access', _8 => _8.providers, 'optionalAccess', _9 => _9.length]))for(let n of r.providers)n&&e.push(n);return e.push(t.ethereum),e}var T=t=>{if(t.isApexWallet)return"Apex Wallet";if(t.isAvalanche)return"Core Wallet";if(t.isBackpack)return"Backpack";if(t.isBifrost)return"Bifrost Wallet";if(t.isBitKeep)return"BitKeep";if(t.isBitski)return"Bitski";if(t.isBlockWallet)return"BlockWallet";if(t.isBraveWallet)return"Brave Wallet";if(t.isClover)return"Clover";if(t.isCoin98)return"Coin98 Wallet";if(t.isCoinbaseWallet)return"Coinbase Wallet";if(t.isDawn)return"Dawn Wallet";if(t.isDefiant)return"Defiant";if(t.isDesig)return"Desig Wallet";if(t.isEnkrypt)return"Enkrypt";if(t.isExodus)return"Exodus";if(t.isFordefi)return"Fordefi";if(t.isFrame)return"Frame";if(t.isFrontier)return"Frontier Wallet";if(t.isGamestop)return"GameStop Wallet";if(t.isHaqqWallet)return"HAQQ Wallet";if(t.isHyperPay)return"HyperPay Wallet";if(t.isImToken)return"ImToken";if(t.isHaloWallet)return"Halo Wallet";if(t.isKuCoinWallet)return"KuCoin Wallet";if(t.isMathWallet)return"MathWallet";if(t.isNovaWallet)return"Nova Wallet";if(t.isOkxWallet||t.isOKExWallet)return"OKX Wallet";if(t.isOneInchIOSWallet||t.isOneInchAndroidWallet)return"1inch Wallet";if(t.isOneKey)return"OneKey Wallet";if(t.isOpera)return"Opera";if(t.isPhantom)return"Phantom";if(t.isPortal)return"Ripio Portal";if(t.isRabby)return"Rabby Wallet";if(t.isRainbow)return"Rainbow";if(t.isSafePal)return"SafePal Wallet";if(t.isStatus)return"Status";if(t.isSubWallet)return"SubWallet";if(t.isTalisman)return"Talisman";if(t.isTally||t.isTaho)return"Taho";if(t.isTokenPocket)return"TokenPocket";if(t.isTokenary)return"Tokenary";if(t.isTrust||t.isTrustWallet)return"Trust Wallet";if(t.isTTWallet)return"TTWallet";if(t.isXDEFI)return"XDEFI Wallet";if(t.isZeal)return"Zeal";if(t.isZerion)return"Zerion";if(t.isMetaMask)return"MetaMask"};var R=(t,r)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!r)return!0;if(t.isBraveWallet&&!t._events&&!t._state||T(t)!=="MetaMask")return!1;if(t.providers){for(let e of t.providers)if(!R(e))return!1}return!0},Tt= exports.c =()=>!!("phantom"in window&&_optionalChain([window, 'optionalAccess', _10 => _10.phantom, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.isPhantom])),Ct= exports.d =()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let r of t.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0}return!1};var _providers = require('@ethersproject/providers');var It=(t,r)=>{let e=[],n=[];for(let[i,o]of t.entries())i<r?e.push(o):n.push(o);return[e,n]},Ut= exports.f =t=>!!String(t).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,}))$/),Lt= exports.g =(t,r)=>{let e=t.slice(0),n=[];for(;e.length;)n.push(e.splice(0,r));return n},O= exports.h =(t,r=3,e=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0,o=3;if(r+e+i+o>=t.length)return t;let s=t.slice(0,i+r),c=t.slice(t.length-e,t.length);return`${s}...${c}`},be= exports.i =t=>new Promise(r=>setTimeout(r,t));function jt(t,{interval:r=100,timeout:e=5e3}={}){return new Promise((n,i)=>{let o=0,s,c=()=>{if(o>=e){i("Max attempts reached without result");return}if(s=t(),o+=r,s!=null){n(s);return}setTimeout(c,r)};c()})}var $t=(t,r={})=>{let e=r.delayMs||150,n=r.maxAttempts||270;return new Promise(async(i,o)=>{let s=!1,c=0;for(;!s&&c<n;){if(_optionalChain([r, 'access', _13 => _13.abortSignal, 'optionalAccess', _14 => _14.aborted]))return;t().then(l=>{s=!0,i(l)},(...l)=>{s=!0,o(...l)}),c+=1,await be(e)}s||o(new Error("Exceeded max attempts before resolving function"))})},Ft= exports.l =(t,r,e={},n={})=>{let i=new URL(r,t);for(let[s,c]of Object.entries(e))c!==void 0&&i.searchParams.set(s,c);let o=Object.entries(n);if(o.length>0){let s=new URLSearchParams;for(let[c,l]of o)s.append(c,l);i.hash=s.toString()}return i.href};var Dt=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Vt= exports.n =t=>typeof t=="string"?t:"0x"+t.toString(16);async function Nt(t,r,e,n=3e3){let i=!1,o=window;return new Promise(s=>{o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},n));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)r.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of B()){let h=T(d);if(!l.some(p=>p.info.name===h)){if(R(d,!0)&&!u.find(p=>p.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(p=>p.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(p=>p.type==="coinbase_wallet"&&_optionalChain([e, 'optionalAccess', _15 => _15.coinbaseWallet, 'optionalAccess', _16 => _16.connectionOptions])!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(p=>p.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}s(u)}})}function Bt(t){return`eip155:${String(Number(t))}`}var Gt=(t,r,e,n)=>{let i=Number(t),o=r.find(s=>s.id===i);if(!o)throw new (0, _chunkZ4PCJGI3js.i)(`Unsupported chainId ${t}`,4901);return Ae(o,e,n)},Ae= exports.r =(t,r,e)=>{let n=t.id,i=Number(t.id),o;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])o=t.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])o=r.rpcUrls[i];else if(_optionalChain([t, 'access', _17 => _17.rpcUrls, 'access', _18 => _18.privy, 'optionalAccess', _19 => _19.http, 'access', _20 => _20[0]])){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",e),o=s.toString()}else _optionalChain([t, 'access', _21 => _21.rpcUrls, 'access', _22 => _22.public, 'optionalAccess', _23 => _23.http, 'access', _24 => _24[0]])?o=t.rpcUrls.public.http[0]:o=_optionalChain([t, 'access', _25 => _25.rpcUrls, 'access', _26 => _26.default, 'optionalAccess', _27 => _27.http, 'access', _28 => _28[0]]);if(!o)throw new (0, _chunkZ4PCJGI3js.i)(`No RPC url found for ${n}`);return o},G=(t,r)=>{let e=Number(t),n=r.find(i=>i.id===e);if(!n)throw new (0, _chunkZ4PCJGI3js.i)(`Unsupported chainId ${t}`,4901);return _optionalChain([n, 'access', _29 => _29.blockExplorers, 'optionalAccess', _30 => _30.default, 'access', _31 => _31.url])},Ht= exports.s =(t,r,e,n)=>{let i=Number(t),o=r.find(c=>c.id===i);if(!o)throw new (0, _chunkZ4PCJGI3js.i)(`Unsupported chainId ${t}`,4901);let s;if(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?s=new (0, _providers.StaticJsonRpcProvider)(o.rpcUrls.privyWalletOverride.http[0]):e.rpcUrls&&e.rpcUrls[i]?s=new (0, _providers.StaticJsonRpcProvider)(e.rpcUrls[i]):_optionalChain([o, 'access', _32 => _32.rpcUrls, 'access', _33 => _33.privy, 'optionalAccess', _34 => _34.http, 'access', _35 => _35[0]])?s=new (0, _providers.StaticJsonRpcProvider)({url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}):_optionalChain([o, 'access', _36 => _36.rpcUrls, 'access', _37 => _37.public, 'optionalAccess', _38 => _38.http, 'access', _39 => _39[0]])?s=new (0, _providers.StaticJsonRpcProvider)(o.rpcUrls.public.http[0]):s=new (0, _providers.StaticJsonRpcProvider)(_optionalChain([o, 'access', _40 => _40.rpcUrls, 'access', _41 => _41.default, 'optionalAccess', _42 => _42.http, 'access', _43 => _43[0]])),!s)throw new (0, _chunkZ4PCJGI3js.i)(`No RPC url found for ${t}`);return s},Kt= exports.t =t=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},e=_nullishCoalesce(t.types.EIP712Domain, () => (Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in r)return{name:n,type:r[n]}}).filter(n=>n!==void 0)));return{...t,types:{...t.types,EIP712Domain:e}}};function zt(t,{min:r,max:e}){return Math.min(Math.max(t,r),e)}var _address = require('@ethersproject/address');function a(t){return t?new Date(t*1e3):null}function We(t){let r=[];for(let e of t){let n=e.type;switch(e.type){case"wallet":let i={address:e.address,type:e.type,imported:e.imported,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),chainType:e.chain_type,chainId:e.chain_id,walletClient:e.wallet_client_type==="privy"?"privy":"unknown",walletClientType:e.wallet_client_type,connectorType:e.connector_type,recoveryMethod:e.recovery_method,walletIndex:e.wallet_index};r.push(i);break;case"smart_wallet":let o={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),smartWalletType:e.smart_wallet_type};r.push(o);break;case"cross_app":let s={type:e.type,subject:e.subject,embeddedWallets:e.embedded_wallets,smartWallets:e.smart_wallets,providerApp:{id:e.provider_app_id},verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(s);break;case"email":let c={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(c);break;case"phone":let l={number:e.phoneNumber,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(l);break;case"google_oauth":let u={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(u);break;case"spotify_oauth":let d={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(d);break;case"instagram_oauth":let h={subject:e.subject,username:e.username,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(h);break;case"twitter_oauth":let p={subject:e.subject,username:e.username,name:e.name,type:e.type,profilePictureUrl:e.profile_picture_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(p);break;case"discord_oauth":let g={subject:e.subject,username:e.username,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(g);break;case"github_oauth":let w={subject:e.subject,username:e.username,name:e.name,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(w);break;case"tiktok_oauth":let m={subject:e.subject,username:e.username,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(m);break;case"linkedin_oauth":let v={subject:e.subject,name:e.name,email:e.email,vanityName:e.vanity_name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(v);break;case"apple_oauth":let E={subject:e.subject,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(E);break;case"custom_auth":r.push({type:e.type,customUserId:e.custom_user_id,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)});break;case"farcaster":let $={type:e.type,fid:e.fid,ownerAddress:e.owner_address,displayName:e.display_name,username:e.username,bio:e.bio,pfp:e.profile_picture_url,url:e.homepage_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),signerPublicKey:e.signer_public_key};r.push($);break;case"passkey":let k={type:e.type,enrolledInMfa:e.enrolled_in_mfa,credentialId:e.credential_id,authenticatorName:e.authenticator_name,createdWithDevice:e.created_with_device,createdWithOs:e.created_with_os,createdWithBrowser:e.created_with_browser,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(k);break;case"telegram":let M={type:e.type,telegramUserId:e.telegram_user_id,firstName:e.first_name,lastName:e.last_name,username:e.username,photoUrl:e.photo_url,verifiedAt:a(e.first_verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(M);break;default:console.warn(`Unrecognized account type: ${n}. Please consider upgrading the Privy SDK.`)}}return r}function f(t,r){return t.slice().sort((e,n)=>(_nullishCoalesce(n.firstVerifiedAt, () => (n.verifiedAt))).getTime()-(_nullishCoalesce(e.firstVerifiedAt, () => (e.verifiedAt))).getTime()).find(e=>e.type===r)}var K=t=>_optionalChain([t, 'optionalAccess', _44 => _44.linkedAccounts, 'access', _45 => _45.find, 'call', _46 => _46(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"&&r.walletIndex===0)])||null,Qt= exports.w =t=>_optionalChain([t, 'optionalAccess', _47 => _47.linkedAccounts, 'access', _48 => _48.filter, 'call', _49 => _49(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum")]),we=t=>_optionalChain([t, 'optionalAccess', _50 => _50.linkedAccounts, 'access', _51 => _51.filter, 'call', _52 => _52(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType==="ethereum")]),ke= exports.x =t=>_optionalChain([t, 'optionalAccess', _53 => _53.linkedAccounts, 'access', _54 => _54.find, 'call', _55 => _55(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="solana")])||null,Xt= exports.y =t=>_optionalChain([t, 'optionalAccess', _56 => _56.linkedAccounts, 'access', _57 => _57.find, 'call', _58 => _58(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.imported&&r.chainType==="ethereum")])||null,qt= exports.z =(t,r)=>{let e=we(t).find(i=>_address.getAddress.call(void 0, i.address)===_address.getAddress.call(void 0, r)),n=e?e.imported?e:K(t):void 0;return{signingWallet:e,rootWallet:n}},xe=t=>t.linkedAccounts.filter(r=>r.type==="wallet"),Yt= exports.A =(t,r)=>K(t)||ke(t)?!1:r==="all-users"||r==="users-without-wallets"&&!_optionalChain([xe, 'call', _59 => _59(t), 'optionalAccess', _60 => _60.length]);function er(t){if(!t)return null;let r=We(t.linked_accounts),e=f(r,"wallet"),n=f(r,"smart_wallet"),i=f(r,"email"),o=f(r,"phone"),s=f(r,"google_oauth"),c=f(r,"twitter_oauth"),l=f(r,"discord_oauth"),u=f(r,"github_oauth"),d=f(r,"spotify_oauth"),h=f(r,"instagram_oauth"),p=f(r,"tiktok_oauth"),g=f(r,"linkedin_oauth"),w=f(r,"apple_oauth"),m=f(r,"farcaster"),v=f(r,"telegram"),E=t.mfa_methods.map(({type:k,verified_at:M})=>({type:k,verifiedAt:a(M)}));return{id:t.id,createdAt:a(t.created_at),linkedAccounts:r,email:i&&{address:_optionalChain([i, 'optionalAccess', _61 => _61.address])},phone:o&&{number:_optionalChain([o, 'optionalAccess', _62 => _62.number])},wallet:e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,recoveryMethod:e.recoveryMethod,imported:e.imported,walletIndex:e.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:h&&{subject:h.subject,username:h.username},tiktok:p&&{subject:p.subject,username:p.username,name:p.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:_nullishCoalesce(t.has_accepted_terms, () => (!1)),isGuest:t.is_guest,customMetadata:t.custom_metadata}}var nr=t=>{let[r,e]=_react.useState.call(void 0, "auto");return _react.useEffect.call(void 0, ()=>{let n=new ResizeObserver(i=>{e(_nullishCoalesce(_optionalChain([i, 'access', _63 => _63[0], 'optionalAccess', _64 => _64.contentRect, 'access', _65 => _65.height]), () => ("auto")))});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),r};var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);var _jsxruntime = require('react/jsx-runtime');var Z=({...t})=>_jsxruntime.jsx.call(void 0, "svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});var I=_styledcomponents2.default.div`
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkVGM5FGSZjs = require('./chunk-VGM5FGSZ.js');var _react = require('react');var tt={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:[]}},me= exports.F =_react.createContext.call(void 0, void 0),N=()=>_react.useContext.call(void 0, me);function y(t,r){if(!r)return;let n=N().current[t];return _react.useEffect.call(void 0, ()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),_optionalChain([n, 'access', _2 => _2[i], 'optionalAccess', _3 => _3.push, 'call', _4 => _4(o)]);return()=>{for(let[i,o]of Object.entries(r))n.hasOwnProperty(i)||console.warn(`Invalid event type "${i}" for action "${t}"`),n[i]=_optionalChain([n, 'access', _5 => _5[i], 'optionalAccess', _6 => _6.filter, 'call', _7 => _7(s=>s!==o)])}},[r])}function ye(t,r,e,...n){for(let i of t.current[r][e])i(...n)}function rt(){let t=N();return(r,e,...n)=>ye(t,r,e,...n)}function st(t){let{logout:r}=_react.useContext.call(void 0, _chunkVGM5FGSZjs.sa);return y("logout",t),{logout:r}}function pt(t){let{login:r}=_react.useContext.call(void 0, _chunkVGM5FGSZjs.sa);return y("login",t),{login:r}}function vt(t){let{connectWallet:r}=_react.useContext.call(void 0, _chunkVGM5FGSZjs.sa);return y("connectWallet",t),{connectWallet:r}}var At=t=>{y("fundWallet",t);let{fundWallet:r}=_chunkVGM5FGSZjs.ta.call(void 0, );return{fundWallet:r}};var S=class{constructor(){this._cache={}}get(r){return this._cache[r]}put(r,e){e!==void 0?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}},P=class{get(r){let e=localStorage.getItem(r);return e===null?void 0:JSON.parse(e)}put(r,e){e!==void 0?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map(([r])=>r)}};function wt(){try{let t="privy:__session_storage__test",r="blobby",e=new P;return e.put(t,r),e.del(t),!0}catch (e2){return!1}}function _e(){return typeof window<"u"&&window.localStorage?new P:new S}var A=_e();function B(){let t=window,r=t.ethereum;if(!r)return[];let e=[];if(_optionalChain([r, 'access', _8 => _8.providers, 'optionalAccess', _9 => _9.length]))for(let n of r.providers)n&&e.push(n);return e.push(t.ethereum),e}var T=t=>{if(t.isApexWallet)return"Apex Wallet";if(t.isAvalanche)return"Core Wallet";if(t.isBackpack)return"Backpack";if(t.isBifrost)return"Bifrost Wallet";if(t.isBitKeep)return"BitKeep";if(t.isBitski)return"Bitski";if(t.isBlockWallet)return"BlockWallet";if(t.isBraveWallet)return"Brave Wallet";if(t.isClover)return"Clover";if(t.isCoin98)return"Coin98 Wallet";if(t.isCoinbaseWallet)return"Coinbase Wallet";if(t.isDawn)return"Dawn Wallet";if(t.isDefiant)return"Defiant";if(t.isDesig)return"Desig Wallet";if(t.isEnkrypt)return"Enkrypt";if(t.isExodus)return"Exodus";if(t.isFordefi)return"Fordefi";if(t.isFrame)return"Frame";if(t.isFrontier)return"Frontier Wallet";if(t.isGamestop)return"GameStop Wallet";if(t.isHaqqWallet)return"HAQQ Wallet";if(t.isHyperPay)return"HyperPay Wallet";if(t.isImToken)return"ImToken";if(t.isHaloWallet)return"Halo Wallet";if(t.isKuCoinWallet)return"KuCoin Wallet";if(t.isMathWallet)return"MathWallet";if(t.isNovaWallet)return"Nova Wallet";if(t.isOkxWallet||t.isOKExWallet)return"OKX Wallet";if(t.isOneInchIOSWallet||t.isOneInchAndroidWallet)return"1inch Wallet";if(t.isOneKey)return"OneKey Wallet";if(t.isOpera)return"Opera";if(t.isPhantom)return"Phantom";if(t.isPortal)return"Ripio Portal";if(t.isRabby)return"Rabby Wallet";if(t.isRainbow)return"Rainbow";if(t.isSafePal)return"SafePal Wallet";if(t.isStatus)return"Status";if(t.isSubWallet)return"SubWallet";if(t.isTalisman)return"Talisman";if(t.isTally||t.isTaho)return"Taho";if(t.isTokenPocket)return"TokenPocket";if(t.isTokenary)return"Tokenary";if(t.isTrust||t.isTrustWallet)return"Trust Wallet";if(t.isTTWallet)return"TTWallet";if(t.isXDEFI)return"XDEFI Wallet";if(t.isZeal)return"Zeal";if(t.isZerion)return"Zerion";if(t.isMetaMask)return"MetaMask"};var R=(t,r)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!r)return!0;if(t.isBraveWallet&&!t._events&&!t._state||T(t)!=="MetaMask")return!1;if(t.providers){for(let e of t.providers)if(!R(e))return!1}return!0},Tt= exports.c =()=>!!("phantom"in window&&_optionalChain([window, 'optionalAccess', _10 => _10.phantom, 'optionalAccess', _11 => _11.ethereum, 'optionalAccess', _12 => _12.isPhantom])),Ct= exports.d =()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let r of t.ethereum.providers)if(r&&r.isCoinbaseWallet)return!0}return!1};var _providers = require('@ethersproject/providers');var It=(t,r)=>{let e=[],n=[];for(let[i,o]of t.entries())i<r?e.push(o):n.push(o);return[e,n]},Ut= exports.f =t=>!!String(t).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,}))$/),Lt= exports.g =(t,r)=>{let e=t.slice(0),n=[];for(;e.length;)n.push(e.splice(0,r));return n},O= exports.h =(t,r=3,e=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0,o=3;if(r+e+i+o>=t.length)return t;let s=t.slice(0,i+r),c=t.slice(t.length-e,t.length);return`${s}...${c}`},be= exports.i =t=>new Promise(r=>setTimeout(r,t));function jt(t,{interval:r=100,timeout:e=5e3}={}){return new Promise((n,i)=>{let o=0,s,c=()=>{if(o>=e){i("Max attempts reached without result");return}if(s=t(),o+=r,s!=null){n(s);return}setTimeout(c,r)};c()})}var $t=(t,r={})=>{let e=r.delayMs||150,n=r.maxAttempts||270;return new Promise(async(i,o)=>{let s=!1,c=0;for(;!s&&c<n;){if(_optionalChain([r, 'access', _13 => _13.abortSignal, 'optionalAccess', _14 => _14.aborted]))return;t().then(l=>{s=!0,i(l)},(...l)=>{s=!0,o(...l)}),c+=1,await be(e)}s||o(new Error("Exceeded max attempts before resolving function"))})},Ft= exports.l =(t,r,e={},n={})=>{let i=new URL(r,t);for(let[s,c]of Object.entries(e))c!==void 0&&i.searchParams.set(s,c);let o=Object.entries(n);if(o.length>0){let s=new URLSearchParams;for(let[c,l]of o)s.append(c,l);i.hash=s.toString()}return i.href};var Dt=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Vt= exports.n =t=>typeof t=="string"?t:"0x"+t.toString(16);async function Nt(t,r,e,n=3e3){let i=!1,o=window;return new Promise(s=>{o.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout(()=>{c()},n));function c(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map(d=>d.info));let u=[];for(let d of l)r.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});for(let d of B()){let h=T(d);if(!l.some(p=>p.info.name===h)){if(R(d,!0)&&!u.find(p=>p.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(h==="Phantom"&&!u.find(p=>p.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(h==="Coinbase Wallet"&&!u.find(p=>p.type==="coinbase_wallet"&&_optionalChain([e, 'optionalAccess', _15 => _15.coinbaseWallet, 'optionalAccess', _16 => _16.connectionOptions])!=="smartWalletOnly")){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find(p=>p.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}s(u)}})}function Bt(t){return`eip155:${String(Number(t))}`}var Gt=(t,r,e,n)=>{let i=Number(t),o=r.find(s=>s.id===i);if(!o)throw new (0, _chunkVGM5FGSZjs.i)(`Unsupported chainId ${t}`,4901);return Ae(o,e,n)},Ae= exports.r =(t,r,e)=>{let n=t.id,i=Number(t.id),o;if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])o=t.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])o=r.rpcUrls[i];else if(_optionalChain([t, 'access', _17 => _17.rpcUrls, 'access', _18 => _18.privy, 'optionalAccess', _19 => _19.http, 'access', _20 => _20[0]])){let s=new URL(t.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",e),o=s.toString()}else _optionalChain([t, 'access', _21 => _21.rpcUrls, 'access', _22 => _22.public, 'optionalAccess', _23 => _23.http, 'access', _24 => _24[0]])?o=t.rpcUrls.public.http[0]:o=_optionalChain([t, 'access', _25 => _25.rpcUrls, 'access', _26 => _26.default, 'optionalAccess', _27 => _27.http, 'access', _28 => _28[0]]);if(!o)throw new (0, _chunkVGM5FGSZjs.i)(`No RPC url found for ${n}`);return o},G=(t,r)=>{let e=Number(t),n=r.find(i=>i.id===e);if(!n)throw new (0, _chunkVGM5FGSZjs.i)(`Unsupported chainId ${t}`,4901);return _optionalChain([n, 'access', _29 => _29.blockExplorers, 'optionalAccess', _30 => _30.default, 'access', _31 => _31.url])},Ht= exports.s =(t,r,e,n)=>{let i=Number(t),o=r.find(c=>c.id===i);if(!o)throw new (0, _chunkVGM5FGSZjs.i)(`Unsupported chainId ${t}`,4901);let s;if(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?s=new (0, _providers.StaticJsonRpcProvider)(o.rpcUrls.privyWalletOverride.http[0]):e.rpcUrls&&e.rpcUrls[i]?s=new (0, _providers.StaticJsonRpcProvider)(e.rpcUrls[i]):_optionalChain([o, 'access', _32 => _32.rpcUrls, 'access', _33 => _33.privy, 'optionalAccess', _34 => _34.http, 'access', _35 => _35[0]])?s=new (0, _providers.StaticJsonRpcProvider)({url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}):_optionalChain([o, 'access', _36 => _36.rpcUrls, 'access', _37 => _37.public, 'optionalAccess', _38 => _38.http, 'access', _39 => _39[0]])?s=new (0, _providers.StaticJsonRpcProvider)(o.rpcUrls.public.http[0]):s=new (0, _providers.StaticJsonRpcProvider)(_optionalChain([o, 'access', _40 => _40.rpcUrls, 'access', _41 => _41.default, 'optionalAccess', _42 => _42.http, 'access', _43 => _43[0]])),!s)throw new (0, _chunkVGM5FGSZjs.i)(`No RPC url found for ${t}`);return s},Kt= exports.t =t=>{let r={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},e=_nullishCoalesce(t.types.EIP712Domain, () => (Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in r)return{name:n,type:r[n]}}).filter(n=>n!==void 0)));return{...t,types:{...t.types,EIP712Domain:e}}};function zt(t,{min:r,max:e}){return Math.min(Math.max(t,r),e)}var _address = require('@ethersproject/address');function a(t){return t?new Date(t*1e3):null}function We(t){let r=[];for(let e of t){let n=e.type;switch(e.type){case"wallet":let i={address:e.address,type:e.type,imported:e.imported,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),chainType:e.chain_type,chainId:e.chain_id,walletClient:e.wallet_client_type==="privy"?"privy":"unknown",walletClientType:e.wallet_client_type,connectorType:e.connector_type,recoveryMethod:e.recovery_method,walletIndex:e.wallet_index};r.push(i);break;case"smart_wallet":let o={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),smartWalletType:e.smart_wallet_type};r.push(o);break;case"cross_app":let s={type:e.type,subject:e.subject,embeddedWallets:e.embedded_wallets,smartWallets:e.smart_wallets,providerApp:{id:e.provider_app_id},verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(s);break;case"email":let c={address:e.address,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(c);break;case"phone":let l={number:e.phoneNumber,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(l);break;case"google_oauth":let u={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(u);break;case"spotify_oauth":let d={subject:e.subject,email:e.email,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(d);break;case"instagram_oauth":let h={subject:e.subject,username:e.username,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(h);break;case"twitter_oauth":let p={subject:e.subject,username:e.username,name:e.name,type:e.type,profilePictureUrl:e.profile_picture_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(p);break;case"discord_oauth":let g={subject:e.subject,username:e.username,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(g);break;case"github_oauth":let w={subject:e.subject,username:e.username,name:e.name,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(w);break;case"tiktok_oauth":let m={subject:e.subject,username:e.username,name:e.name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(m);break;case"linkedin_oauth":let v={subject:e.subject,name:e.name,email:e.email,vanityName:e.vanity_name,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(v);break;case"apple_oauth":let E={subject:e.subject,email:e.email,type:e.type,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(E);break;case"custom_auth":r.push({type:e.type,customUserId:e.custom_user_id,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)});break;case"farcaster":let $={type:e.type,fid:e.fid,ownerAddress:e.owner_address,displayName:e.display_name,username:e.username,bio:e.bio,pfp:e.profile_picture_url,url:e.homepage_url,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at),signerPublicKey:e.signer_public_key};r.push($);break;case"passkey":let k={type:e.type,enrolledInMfa:e.enrolled_in_mfa,credentialId:e.credential_id,authenticatorName:e.authenticator_name,createdWithDevice:e.created_with_device,createdWithOs:e.created_with_os,createdWithBrowser:e.created_with_browser,verifiedAt:a(e.verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(k);break;case"telegram":let M={type:e.type,telegramUserId:e.telegram_user_id,firstName:e.first_name,lastName:e.last_name,username:e.username,photoUrl:e.photo_url,verifiedAt:a(e.first_verified_at),firstVerifiedAt:a(e.first_verified_at),latestVerifiedAt:a(e.latest_verified_at)};r.push(M);break;default:console.warn(`Unrecognized account type: ${n}. Please consider upgrading the Privy SDK.`)}}return r}function f(t,r){return t.slice().sort((e,n)=>(_nullishCoalesce(n.firstVerifiedAt, () => (n.verifiedAt))).getTime()-(_nullishCoalesce(e.firstVerifiedAt, () => (e.verifiedAt))).getTime()).find(e=>e.type===r)}var K=t=>_optionalChain([t, 'optionalAccess', _44 => _44.linkedAccounts, 'access', _45 => _45.find, 'call', _46 => _46(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum"&&r.walletIndex===0)])||null,Qt= exports.w =t=>_optionalChain([t, 'optionalAccess', _47 => _47.linkedAccounts, 'access', _48 => _48.filter, 'call', _49 => _49(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="ethereum")]),we=t=>_optionalChain([t, 'optionalAccess', _50 => _50.linkedAccounts, 'access', _51 => _51.filter, 'call', _52 => _52(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType==="ethereum")]),ke= exports.x =t=>_optionalChain([t, 'optionalAccess', _53 => _53.linkedAccounts, 'access', _54 => _54.find, 'call', _55 => _55(r=>r.type==="wallet"&&r.walletClientType==="privy"&&!r.imported&&r.chainType==="solana")])||null,Xt= exports.y =t=>_optionalChain([t, 'optionalAccess', _56 => _56.linkedAccounts, 'access', _57 => _57.find, 'call', _58 => _58(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.imported&&r.chainType==="ethereum")])||null,qt= exports.z =(t,r)=>{let e=we(t).find(i=>_address.getAddress.call(void 0, i.address)===_address.getAddress.call(void 0, r)),n=e?e.imported?e:K(t):void 0;return{signingWallet:e,rootWallet:n}},xe=t=>t.linkedAccounts.filter(r=>r.type==="wallet"),Yt= exports.A =(t,r)=>K(t)||ke(t)?!1:r==="all-users"||r==="users-without-wallets"&&!_optionalChain([xe, 'call', _59 => _59(t), 'optionalAccess', _60 => _60.length]);function er(t){if(!t)return null;let r=We(t.linked_accounts),e=f(r,"wallet"),n=f(r,"smart_wallet"),i=f(r,"email"),o=f(r,"phone"),s=f(r,"google_oauth"),c=f(r,"twitter_oauth"),l=f(r,"discord_oauth"),u=f(r,"github_oauth"),d=f(r,"spotify_oauth"),h=f(r,"instagram_oauth"),p=f(r,"tiktok_oauth"),g=f(r,"linkedin_oauth"),w=f(r,"apple_oauth"),m=f(r,"farcaster"),v=f(r,"telegram"),E=t.mfa_methods.map(({type:k,verified_at:M})=>({type:k,verifiedAt:a(M)}));return{id:t.id,createdAt:a(t.created_at),linkedAccounts:r,email:i&&{address:_optionalChain([i, 'optionalAccess', _61 => _61.address])},phone:o&&{number:_optionalChain([o, 'optionalAccess', _62 => _62.number])},wallet:e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,recoveryMethod:e.recoveryMethod,imported:e.imported,walletIndex:e.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:c&&{subject:c.subject,username:c.username,name:c.name,profilePictureUrl:c.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:u&&{subject:u.subject,username:u.username,name:u.name,email:u.email},spotify:d&&{subject:d.subject,email:d.email,name:d.name},instagram:h&&{subject:h.subject,username:h.username},tiktok:p&&{subject:p.subject,username:p.username,name:p.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:w&&{subject:w.subject,email:w.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:_nullishCoalesce(t.has_accepted_terms, () => (!1)),isGuest:t.is_guest,customMetadata:t.custom_metadata}}var nr=t=>{let[r,e]=_react.useState.call(void 0, "auto");return _react.useEffect.call(void 0, ()=>{let n=new ResizeObserver(i=>{e(_nullishCoalesce(_optionalChain([i, 'access', _63 => _63[0], 'optionalAccess', _64 => _64.contentRect, 'access', _65 => _65.height]), () => ("auto")))});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),r};var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);var _jsxruntime = require('react/jsx-runtime');var Z=({...t})=>_jsxruntime.jsx.call(void 0, "svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});var I=_styledcomponents2.default.div`
2
2
  margin-top: 16px;
3
3
  font-size: 13px;
4
4
  text-align: center;
@@ -34,7 +34,7 @@
34
34
  @media all and (display-mode: standalone) {
35
35
  padding-bottom: 30px;
36
36
  }
37
- `;var q=_react.createContext.call(void 0, {}),_r= exports.P =({children:t})=>{let r=_chunkZ4PCJGI3js.oa.call(void 0, ),[e,n]=_react.useState.call(void 0, {});return y("login",{onComplete:(i,o,s,c,l)=>{!l||l.type==="passkey"||l.type==="cross_app"||l.type==="wallet"&&l.walletClientType==="privy"||(A.put(X(r.id),l.type),l.type==="wallet"?(A.put(U(r.id),l.walletClientType),n({accountType:l.type,connectorType:l.connectorType,walletClientType:l.walletClientType})):(A.del(U(r.id)),n({accountType:l.type})))}}),_react.useEffect.call(void 0, ()=>{if(!r.id)return;let i=A.get(X(r.id)),o=A.get(U(r.id));i&&n(i==="wallet"?{accountType:i,walletClientType:o}:{accountType:i})},[r.id]),_jsxruntime.jsx.call(void 0, q.Provider,{value:e,children:t})},X=t=>`privy:${t}:recent-login-method`,U=t=>`privy:${t}:recent-login-wallet-client`,br= exports.Q =()=>_react.useContext.call(void 0, q);var _Square2StackIcon = require('@heroicons/react/24/outline/Square2StackIcon'); var _Square2StackIcon2 = _interopRequireDefault(_Square2StackIcon);var ee=({address:t,showCopyIcon:r,url:e,className:n})=>e?_jsxruntime.jsx.call(void 0, "a",{title:t,className:n,href:`${e}/address/${t}`,target:"_blank",children:O(t)}):_jsxruntime.jsxs.call(void 0, "button",{title:t,className:n,onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[O(t),r&&_jsxruntime.jsx.call(void 0, Le,{})]}),Le=_styledcomponents2.default.call(void 0, _Square2StackIcon2.default)`
37
+ `;var q=_react.createContext.call(void 0, {}),_r= exports.P =({children:t})=>{let r=_chunkVGM5FGSZjs.oa.call(void 0, ),[e,n]=_react.useState.call(void 0, {});return y("login",{onComplete:(i,o,s,c,l)=>{!l||l.type==="passkey"||l.type==="cross_app"||l.type==="wallet"&&l.walletClientType==="privy"||(A.put(X(r.id),l.type),l.type==="wallet"?(A.put(U(r.id),l.walletClientType),n({accountType:l.type,connectorType:l.connectorType,walletClientType:l.walletClientType})):(A.del(U(r.id)),n({accountType:l.type})))}}),_react.useEffect.call(void 0, ()=>{if(!r.id)return;let i=A.get(X(r.id)),o=A.get(U(r.id));i&&n(i==="wallet"?{accountType:i,walletClientType:o}:{accountType:i})},[r.id]),_jsxruntime.jsx.call(void 0, q.Provider,{value:e,children:t})},X=t=>`privy:${t}:recent-login-method`,U=t=>`privy:${t}:recent-login-wallet-client`,br= exports.Q =()=>_react.useContext.call(void 0, q);var _Square2StackIcon = require('@heroicons/react/24/outline/Square2StackIcon'); var _Square2StackIcon2 = _interopRequireDefault(_Square2StackIcon);var ee=({address:t,showCopyIcon:r,url:e,className:n})=>e?_jsxruntime.jsx.call(void 0, "a",{title:t,className:n,href:`${e}/address/${t}`,target:"_blank",children:O(t)}):_jsxruntime.jsxs.call(void 0, "button",{title:t,className:n,onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[O(t),r&&_jsxruntime.jsx.call(void 0, Le,{})]}),Le=_styledcomponents2.default.call(void 0, _Square2StackIcon2.default)`
38
38
  && {
39
39
  display: inline;
40
40
  }
@@ -115,4 +115,4 @@
115
115
  ${t=>t.$state==="error"?"border-color: var(--privy-color-error);":""}
116
116
  `,le= exports.U =_styledcomponents2.default.div`
117
117
  ${Je}
118
- `;var Zr=({errMsg:t,balance:r,address:e,isLoading:n,className:i,title:o,isPulsing:s,showIcon:c,statusColor:l="green"})=>{let u;return l?u=l:t?u="red":u="green",_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, le,{className:i,$state:t?"error":void 0,children:[_jsxruntime.jsxs.call(void 0, ae,{children:[_jsxruntime.jsx.call(void 0, se,{children:o||"Pay with"}),_jsxruntime.jsx.call(void 0, ee,{address:e,showCopyIcon:c||!!t})]}),r!==void 0&&_jsxruntime.jsx.call(void 0, ie,{isLoading:n,isPulsing:s,color:u,children:r})]}),t&&_jsxruntime.jsx.call(void 0, oe,{style:{marginTop:"0.25rem"},children:t})]})};var _bignumber = require('@ethersproject/bignumber');var _units = require('@ethersproject/units');var _jssdkcore = require('@privy-io/js-sdk-core');var Ye=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),ue=t=>Ye.format(t),rn= exports.X =(t,r)=>{let e=ue(r*parseFloat(t));return e!=="$0.00"?e:"<$0.01"},nn= exports.Y =(t,r)=>{let e=ue(r*parseFloat(_units.formatEther.call(void 0, t)));return e==="$0.00"?"<$0.01":e},an= exports.Z =(t,r,e=6,n=!1)=>{let o=parseFloat(_units.formatEther.call(void 0, t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?`${o} ${r}`:`${o==="0"?"<0.001":o} ${r}`},on= exports._ =t=>t.map(_jssdkcore.QuantityToBigNumber).reduce((r,e)=>r.add(e),_bignumber.BigNumber.from(0)).toHexString(),sn= exports.$ =(t,r)=>{let{chains:e}=_chunkZ4PCJGI3js.ra.call(void 0, ),n=`https://etherscan.io/address/${r}`,i=`${G(t,e)}/address/${r}`;if(!i)return n;try{new URL(i)}catch (e3){return n}return i};var cn=({color:t,...r})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "path",{fill:t||"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"})})});exports.a = wt; exports.b = A; exports.c = Tt; exports.d = Ct; exports.e = It; exports.f = Ut; exports.g = Lt; exports.h = O; exports.i = be; exports.j = jt; exports.k = $t; exports.l = Ft; exports.m = Dt; exports.n = Vt; exports.o = Nt; exports.p = Bt; exports.q = Gt; exports.r = Ae; exports.s = Ht; exports.t = Kt; exports.u = zt; exports.v = K; exports.w = Qt; exports.x = ke; exports.y = Xt; exports.z = qt; exports.A = Yt; exports.B = er; exports.C = Z; exports.D = nr; exports.E = tt; exports.F = me; exports.G = y; exports.H = ye; exports.I = rt; exports.J = cr; exports.K = ur; exports.L = Ce; exports.M = ee; exports.N = re; exports.O = ie; exports.P = _r; exports.Q = br; exports.R = st; exports.S = oe; exports.T = Je; exports.U = le; exports.V = Zr; exports.W = cn; exports.X = rn; exports.Y = nn; exports.Z = an; exports._ = on; exports.$ = sn; exports.aa = pt; exports.ba = vt; exports.ca = At;
118
+ `;var Zr=({errMsg:t,balance:r,address:e,isLoading:n,className:i,title:o,isPulsing:s,showIcon:c,statusColor:l="green"})=>{let u;return l?u=l:t?u="red":u="green",_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, le,{className:i,$state:t?"error":void 0,children:[_jsxruntime.jsxs.call(void 0, ae,{children:[_jsxruntime.jsx.call(void 0, se,{children:o||"Pay with"}),_jsxruntime.jsx.call(void 0, ee,{address:e,showCopyIcon:c||!!t})]}),r!==void 0&&_jsxruntime.jsx.call(void 0, ie,{isLoading:n,isPulsing:s,color:u,children:r})]}),t&&_jsxruntime.jsx.call(void 0, oe,{style:{marginTop:"0.25rem"},children:t})]})};var _bignumber = require('@ethersproject/bignumber');var _units = require('@ethersproject/units');var _jssdkcore = require('@privy-io/js-sdk-core');var Ye=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),ue=t=>Ye.format(t),rn= exports.X =(t,r)=>{let e=ue(r*parseFloat(t));return e!=="$0.00"?e:"<$0.01"},nn= exports.Y =(t,r)=>{let e=ue(r*parseFloat(_units.formatEther.call(void 0, t)));return e==="$0.00"?"<$0.01":e},an= exports.Z =(t,r,e=6,n=!1)=>{let o=parseFloat(_units.formatEther.call(void 0, t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"");return n?`${o} ${r}`:`${o==="0"?"<0.001":o} ${r}`},on= exports._ =t=>t.map(_jssdkcore.QuantityToBigNumber).reduce((r,e)=>r.add(e),_bignumber.BigNumber.from(0)).toHexString(),sn= exports.$ =(t,r)=>{let{chains:e}=_chunkVGM5FGSZjs.ra.call(void 0, ),n=`https://etherscan.io/address/${r}`,i=`${G(t,e)}/address/${r}`;if(!i)return n;try{new URL(i)}catch (e3){return n}return i};var cn=({color:t,...r})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "path",{fill:t||"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"})})});exports.a = wt; exports.b = A; exports.c = Tt; exports.d = Ct; exports.e = It; exports.f = Ut; exports.g = Lt; exports.h = O; exports.i = be; exports.j = jt; exports.k = $t; exports.l = Ft; exports.m = Dt; exports.n = Vt; exports.o = Nt; exports.p = Bt; exports.q = Gt; exports.r = Ae; exports.s = Ht; exports.t = Kt; exports.u = zt; exports.v = K; exports.w = Qt; exports.x = ke; exports.y = Xt; exports.z = qt; exports.A = Yt; exports.B = er; exports.C = Z; exports.D = nr; exports.E = tt; exports.F = me; exports.G = y; exports.H = ye; exports.I = rt; exports.J = cr; exports.K = ur; exports.L = Ce; exports.M = ee; exports.N = re; exports.O = ie; exports.P = _r; exports.Q = br; exports.R = st; exports.S = oe; exports.T = Je; exports.U = le; exports.V = Zr; exports.W = cn; exports.X = rn; exports.Y = nn; exports.Z = an; exports._ = on; exports.$ = sn; exports.aa = pt; exports.ba = vt; exports.ca = At;