@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 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(require("tinycolor2"));const a={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 n=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"]),l=e=>n.has(e),i=(e,t,r)=>r.indexOf(e)===t;const s=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(l).filter(i):e?e.filter(l).filter(i):a.appearance.walletList,p={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"}}},c={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},h={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"}}},u={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},d={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"}}},m={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},g={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},f={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},y={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"}}},b={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"}}},C={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},w={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"}}},E={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},v={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},k={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"}}},x=[p,c,v,y,b,C,w,E,g,{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"}}},d,m,{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"}}},f,{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},h,u,k,{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"}}}],S=new Set(x.map((e=>e.id)));let O="#FFFFFF";function A(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function _({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=O;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#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"}(a.getLuminance()),c=A(a,"light"===p?-.04:.11),h=A(a,"light"===p?-.88:.87),u=A(a,"light"===p?-.7:.75),d=A(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=A(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=A(n,.15),f=A(n,-.06),y=A(s,.3),b=A(i,.3),C=o.default(n.getLuminance()>.5?"#040217":O),w=A(l,-.16),E=A(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:w.toHslString(),successLight:E.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function T(e,t,r){let o,n,l,i,p,c,h,u,d,m,g,f,b,C,w,E,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),p=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),u=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),w=t.loginMethods.includes("telegram")):(o=e.emailAuth,n=e.smsAuth,i=e.walletAuth,p=e.googleOAuth,c=e.twitterOAuth,h=e.discordOAuth,f=e.githubOAuth,d=e.spotifyOAuth,m=e.instagramOAuth,u=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,C=e.farcasterAuth,w=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let k=[o,n].filter(Boolean),S=[p,c,h,f,d,m,u,g,b,C,w].filter(Boolean),O=[i].filter(Boolean);if(k.length+S.length+O.length===0)throw Error("You must enable at least one login method");let A=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;A&&0===O.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),A=!1):A||S.length+k.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),A=!0);let T=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=s({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r 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(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),M=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:F}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;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&&o&&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`."),a=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=x.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}(e,r):e}))}else a=x.concat(e??[]);let n=t?a[0]:y,l=r??n;if(!a.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),P=!!t?.defaultChain,I=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,W=!(e.enforceWalletUis??1);if(E=e.legacyWalletUiConfig??1?I?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??W:W,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==E)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:R,...K}=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??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:_({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:A?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:n,passkey:l,google:p,twitter:c,discord:h,github:f,spotify:d,instagram:m,tiktok:u,linkedin:g,apple:b,farcaster:C,telegram:w},loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:H,defaultChain:F,intl:{defaultCountry:M},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:T},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof R?{requireUserOwnedRecoveryOnCreate:R}:{},...I?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...K,noPromptOnSignature:E},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:I?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let U={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 L=T(U,void 0,!1);let M=t.createContext({appConfig:L,isServerConfigLoaded:!1});const H=t.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=L,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=x,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PrivyAppConfigProvider=({children:r,legacyCreateEmbeddedWalletFlag:o,client:a,clientConfig:n})=>{let[l,i]=t.useState(null),s=t.useMemo((()=>T(l??U,n,!!l)),[l,n]);return t.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:l,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,o),t=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${l.id}:${t}`;localStorage.getItem(r)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[n,o,l]),t.useEffect((()=>{l||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(M.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:r})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=H,exports.VERSION="1.88.2",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!S.has(e.id)));return x.concat(t)},exports.arbitrum=p,exports.arbitrumSepolia=c,exports.avalanche=h,exports.avalancheFuji=u,exports.base=d,exports.baseSepolia=m,exports.celo=g,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=f,exports.mainnet=y,exports.optimism=b,exports.optimismSepolia=C,exports.polygon=w,exports.polygonAmoy=E,exports.sepolia=v,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(M);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(M);return e},exports.useWallets=function(){let e=t.useContext(H);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=k;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(require("tinycolor2"));const a={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 n=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"]),l=e=>n.has(e),i=(e,t,r)=>r.indexOf(e)===t;const s=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(l).filter(i):e?e.filter(l).filter(i):a.appearance.walletList,p={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"}}},c={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},h={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"}}},u={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},d={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"}}},m={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},g={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},f={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},y={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"}}},b={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"}}},C={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},w={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"}}},E={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},v={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},k={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"}}},x=[p,c,v,y,b,C,w,E,g,{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"}}},d,m,{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"}}},f,{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},h,u,k,{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"}}}],S=new Set(x.map((e=>e.id)));let O="#FFFFFF";function A(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function _({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=O;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#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"}(a.getLuminance()),c=A(a,"light"===p?-.04:.11),h=A(a,"light"===p?-.88:.87),u=A(a,"light"===p?-.7:.75),d=A(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=A(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=A(n,.15),f=A(n,-.06),y=A(s,.3),b=A(i,.3),C=o.default(n.getLuminance()>.5?"#040217":O),w=A(l,-.16),E=A(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:w.toHslString(),successLight:E.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function T(e,t,r){let o,n,l,i,p,c,h,u,d,m,g,f,b,C,w,E,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),p=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),u=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),w=t.loginMethods.includes("telegram")):(o=e.emailAuth,n=e.smsAuth,i=e.walletAuth,p=e.googleOAuth,c=e.twitterOAuth,h=e.discordOAuth,f=e.githubOAuth,d=e.spotifyOAuth,m=e.instagramOAuth,u=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,C=e.farcasterAuth,w=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let k=[o,n].filter(Boolean),S=[p,c,h,f,d,m,u,g,b,C,w].filter(Boolean),O=[i].filter(Boolean);if(k.length+S.length+O.length===0)throw Error("You must enable at least one login method");let A=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;A&&0===O.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),A=!1):A||S.length+k.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),A=!0);let T=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=s({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r 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(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),M=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:F}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;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&&o&&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`."),a=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=x.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}(e,r):e}))}else a=x.concat(e??[]);let n=t?a[0]:y,l=r??n;if(!a.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),P=!!t?.defaultChain,I=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,W=!(e.enforceWalletUis??1);if(E=e.legacyWalletUiConfig??1?I?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??W:W,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==E)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:R,...K}=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??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:_({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:A?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:n,passkey:l,google:p,twitter:c,discord:h,github:f,spotify:d,instagram:m,tiktok:u,linkedin:g,apple:b,farcaster:C,telegram:w},loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:H,defaultChain:F,intl:{defaultCountry:M},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:T},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof R?{requireUserOwnedRecoveryOnCreate:R}:{},...I?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...K,noPromptOnSignature:E},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:I?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let U={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 L=T(U,void 0,!1);let M=t.createContext({appConfig:L,isServerConfigLoaded:!1});const H=t.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=L,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=x,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PrivyAppConfigProvider=({children:r,legacyCreateEmbeddedWalletFlag:o,client:a,clientConfig:n})=>{let[l,i]=t.useState(null),s=t.useMemo((()=>T(l??U,n,!!l)),[l,n]);return t.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:l,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,o),t=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${l.id}:${t}`;localStorage.getItem(r)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[n,o,l]),t.useEffect((()=>{l||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(M.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:r})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=H,exports.VERSION="1.88.3",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!S.has(e.id)));return x.concat(t)},exports.arbitrum=p,exports.arbitrumSepolia=c,exports.avalanche=h,exports.avalancheFuji=u,exports.base=d,exports.baseSepolia=m,exports.celo=g,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=f,exports.mainnet=y,exports.optimism=b,exports.optimismSepolia=C,exports.polygon=w,exports.polygonAmoy=E,exports.sepolia=v,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(M);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(M);return e},exports.useWallets=function(){let e=t.useContext(H);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=k;
@@ -245,8 +245,10 @@ declare class ProviderRpcError extends PrivyError {
245
245
  constructor(message: string, code: number, data?: unknown);
246
246
  }
247
247
 
248
- type WalletCreateRequestDataType = {
248
+ type BaseWalletCreateRequestDataType = {
249
249
  accessToken: string;
250
+ };
251
+ type BaseWalletCreateWithUserControlledRecoveryDataType = {
250
252
  recoveryPassword?: string;
251
253
  recoveryMethod?: UserRecoveryMethod;
252
254
  recoveryAccessToken?: string;
@@ -256,13 +258,18 @@ type WalletCreateRequestDataType = {
256
258
  */
257
259
  recoveryPin?: string;
258
260
  };
259
- type WalletCreateAdditionalRequestDataType = {
260
- accessToken: string;
261
- primaryWalletAddress: string;
262
- hdWalletIndex: number;
261
+ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & BaseWalletCreateWithUserControlledRecoveryDataType & {
262
+ /**
263
+ * If a user has an existing Solana embedded wallet when creating the Ethereum wallet, that address
264
+ * MUST be passed in this field. Our iframe will use this address to derive the Ethereum embedded wallet from the
265
+ * same entropy as the Solana wallet.
266
+ *
267
+ * If no address is passed here, our iframe assumes that the user has no existing Solana wallet and will create
268
+ * a new set of entropy for Ethereum.
269
+ */
270
+ solanaAddress?: string;
263
271
  };
264
- type SolanaWalletCreateRequestDataType = {
265
- accessToken: string;
272
+ type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
266
273
  /**
267
274
  * If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
268
275
  * MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
@@ -273,6 +280,11 @@ type SolanaWalletCreateRequestDataType = {
273
280
  */
274
281
  ethereumAddress?: string;
275
282
  };
283
+ type WalletCreateAdditionalRequestDataType = {
284
+ accessToken: string;
285
+ primaryWalletAddress: string;
286
+ hdWalletIndex: number;
287
+ };
276
288
  type WalletImportRequestDataType = {
277
289
  accessToken: string;
278
290
  privateKey: string;
@@ -458,7 +470,7 @@ type FarcasterSignResponseDataType = {
458
470
  declare const PrivyIframeErrorTypes: readonly ["error", "invalid_request_arguments", "wallet_not_on_device", "invalid_recovery_pin", "insufficient_funds", "missing_or_invalid_mfa", "mfa_verification_max_attempts_reached", "mfa_timeout", "twilio_verification_failed"];
459
471
  type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
460
472
  interface EmbeddedWalletProxy {
461
- create: (data: WalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
473
+ create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
462
474
  createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
463
475
  import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
464
476
  connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
@@ -245,8 +245,10 @@ declare class ProviderRpcError extends PrivyError {
245
245
  constructor(message: string, code: number, data?: unknown);
246
246
  }
247
247
 
248
- type WalletCreateRequestDataType = {
248
+ type BaseWalletCreateRequestDataType = {
249
249
  accessToken: string;
250
+ };
251
+ type BaseWalletCreateWithUserControlledRecoveryDataType = {
250
252
  recoveryPassword?: string;
251
253
  recoveryMethod?: UserRecoveryMethod;
252
254
  recoveryAccessToken?: string;
@@ -256,13 +258,18 @@ type WalletCreateRequestDataType = {
256
258
  */
257
259
  recoveryPin?: string;
258
260
  };
259
- type WalletCreateAdditionalRequestDataType = {
260
- accessToken: string;
261
- primaryWalletAddress: string;
262
- hdWalletIndex: number;
261
+ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & BaseWalletCreateWithUserControlledRecoveryDataType & {
262
+ /**
263
+ * If a user has an existing Solana embedded wallet when creating the Ethereum wallet, that address
264
+ * MUST be passed in this field. Our iframe will use this address to derive the Ethereum embedded wallet from the
265
+ * same entropy as the Solana wallet.
266
+ *
267
+ * If no address is passed here, our iframe assumes that the user has no existing Solana wallet and will create
268
+ * a new set of entropy for Ethereum.
269
+ */
270
+ solanaAddress?: string;
263
271
  };
264
- type SolanaWalletCreateRequestDataType = {
265
- accessToken: string;
272
+ type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
266
273
  /**
267
274
  * If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
268
275
  * MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
@@ -273,6 +280,11 @@ type SolanaWalletCreateRequestDataType = {
273
280
  */
274
281
  ethereumAddress?: string;
275
282
  };
283
+ type WalletCreateAdditionalRequestDataType = {
284
+ accessToken: string;
285
+ primaryWalletAddress: string;
286
+ hdWalletIndex: number;
287
+ };
276
288
  type WalletImportRequestDataType = {
277
289
  accessToken: string;
278
290
  privateKey: string;
@@ -458,7 +470,7 @@ type FarcasterSignResponseDataType = {
458
470
  declare const PrivyIframeErrorTypes: readonly ["error", "invalid_request_arguments", "wallet_not_on_device", "invalid_recovery_pin", "insufficient_funds", "missing_or_invalid_mfa", "mfa_verification_max_attempts_reached", "mfa_timeout", "twilio_verification_failed"];
459
471
  type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
460
472
  interface EmbeddedWalletProxy {
461
- create: (data: WalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
473
+ create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
462
474
  createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
463
475
  import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
464
476
  connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
package/dist/dts/ui.d.mts CHANGED
@@ -23,7 +23,10 @@ type UserPillProps = {
23
23
  expanded?: boolean;
24
24
  label?: string;
25
25
  size?: number;
26
+ ui?: {
27
+ minimal?: boolean;
28
+ };
26
29
  };
27
- declare const UserPill: ({ expanded, action, label, size, }: UserPillProps) => react_jsx_runtime.JSX.Element;
30
+ declare const UserPill: ({ expanded, action, label, size, ui: { minimal }, }: UserPillProps) => react_jsx_runtime.JSX.Element;
28
31
 
29
32
  export { UserPill };
package/dist/dts/ui.d.ts CHANGED
@@ -23,7 +23,10 @@ type UserPillProps = {
23
23
  expanded?: boolean;
24
24
  label?: string;
25
25
  size?: number;
26
+ ui?: {
27
+ minimal?: boolean;
28
+ };
26
29
  };
27
- declare const UserPill: ({ expanded, action, label, size, }: UserPillProps) => react_jsx_runtime.JSX.Element;
30
+ declare const UserPill: ({ expanded, action, label, size, ui: { minimal }, }: UserPillProps) => react_jsx_runtime.JSX.Element;
28
31
 
29
32
  export { UserPill };