@privy-io/react-auth 1.89.0 → 1.89.1-beta-20241010170842

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"),a=require("./useWallets.js"),r=require("./privy-context.js"),n=require("./getEmbeddedConnectedWallet.js"),i=require("permissionless"),s=require("permissionless/accounts"),l=require("permissionless/clients/pimlico"),o=require("viem"),c=require("viem/account-abstraction");require("tinycolor2"),require("ofetch");let d=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:r,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:n,maxFeePerGas:r,maxPriorityFeePerGas:a})));let u={address:c.entryPoint06Address,version:"0.6"},m={address:c.entryPoint07Address,version:"0.7"},y=async({owner:e,smartWalletType:t,chain:a,bundlerUrl:r,paymasterUrl:n,paymasterContext:c})=>{let d=o.createPublicClient({chain:a,transport:o.http()}),y=await(({owner:e,smartWalletType:t,chain:a})=>{let r=o.createPublicClient({chain:a,transport:o.http()});switch(t){case"safe":return s.toSafeSmartAccount({client:r,entryPoint:m,owners:[e],version:"1.4.1"});case"kernel":return s.toEcdsaKernelSmartAccount({client:r,version:"0.3.1",entryPoint:m,owners:[e]});case"biconomy":return s.toBiconomySmartAccount({client:r,owners:[e],entryPoint:u});case"light_account":return s.toLightSmartAccount({client:r,entryPoint:u,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}})({owner:e,smartWalletType:t,chain:a}),p=n?l.createPimlicoClient({transport:o.http(n),entryPoint:y.entryPoint}):void 0;return i.createSmartAccountClient({account:y,chain:a,paymaster:p,paymasterContext:c,bundlerTransport:o.http(r),userOperation:{estimateFeesPerGas:async()=>{let e=await d.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}})};let p=t.createContext({client:void 0});let g=t.createContext({config:void 0}),P=()=>{let{config:e}=t.useContext(g);return{config:e}},E=({children:a})=>{let[n,i]=t.useState(void 0),{client:s}=r.usePrivyInternal();return t.useEffect((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e.jsx(g.Provider,{value:{config:n},children:a})},h=({config:i,children:s})=>{let{config:l}=P(),{defaultChain:o}=a.useAppConfig(),[c]=t.useState(o),{wallets:d}=a.useWallets(),{user:u}=r.usePrivy(),[m,p]=t.useState(),g=n.getEmbeddedConnectedWallet(d);return t.useEffect((()=>{(async()=>{if(!l?.enabled||!u||!g)return void p(void 0);if(m&&m.chain.id===c.id)return;let e=l.configuredNetworks.find((e=>e.chainId===`eip155:${c.id}`));if(!e)throw new r.PrivyClientError(`The chain ${c.name} (eip155:${c.id}) must be configured in the smart wallet configuration in your dashboard`);let t=u.smartWallet?.smartWalletType??l.smartWalletType;try{let a=await(async(e,t,a,r,n)=>{let i=await e.getEthereumProvider();return await y({owner:i,smartWalletType:a,chain:t,paymasterContext:n,...r})})(g,c,t,e,i?.paymasterContext);p(a)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!l?.enabled,!!u?.smartWallet,!!g]),e.jsx(v.Provider,{value:{client:m},children:s})},v=t.createContext({client:void 0}),W=({children:i})=>{let{client:s}=(()=>{let{client:e}=t.useContext(v);return{client:e}})(),{config:l}=P(),{wrapSmartAccountClient:o}=(()=>{let{noPromptOnSignature:e,openPrivyModal:t}=r.usePrivyInternal(),i=a.useAppConfig(),{setModalData:s}=n.usePrivyModal();return{wrapSmartAccountClient:a=>{let{sendTransaction:r,signMessage:l,signTypedData:o,...c}=a;return{...c,sendTransaction:async a=>{if(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)return e.current=!0,await r(a).finally((()=>e.current=!1));let l=[];"calls"in a&&void 0!==a.calls?l=[...a.calls]:"to"in a&&(l=[{to:a.to,value:a.value||BigInt(0),data:a.data||"0x"}]);let o=async()=>{if(!c.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await c.prepareUserOperation({calls:l,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(i,u)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:d({calls:l,chain:c.chain,maxPriorityFeePerGas:a.maxPriorityFeePerGas,maxFeePerGas:a.maxFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0}),rootWallet:{address:c.account.address},transactingWallet:{address:c.account.address,walletIndex:null},getIsSponsored:o,onConfirm:()=>r(a),onSuccess:e=>i(e.hash),onFailure:u,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:a})=>(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)?(e.current=!0,await l({message:a}).finally((()=>e.current=!1))):new Promise((async(r,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:a,confirmAndSign:()=>l({message:a}),onSuccess:e=>r(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})),signTypedData:async a=>(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)?(e.current=!0,await o(a).finally((()=>e.current=!1))):new Promise((async(r,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:a,confirmAndSign:()=>o(a),onSuccess:e=>r(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}})(),{user:c}=r.usePrivy(),{generateSiweMessageForSmartWallet:u,linkSmartWallet:m,noPromptOnSignature:y}=r.usePrivyInternal();return t.useEffect((()=>{(async()=>{if(s&&!c?.smartWallet&&l?.enabled)try{let e=await u({address:s.account.address,chainId:`eip155:${s.chain.id}`});y.current=!0;let t=await s.signMessage({message:e});await m({signature:t,message:e,smartWalletType:l.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{y.current=!1}})()}),[!!s,!!c?.smartWallet,!!l?.enabled]),e.jsx(p.Provider,{value:{client:c?.smartWallet&&s?o(s):void 0},children:i})};exports.SmartWalletsProvider=({config:t,children:a})=>e.jsx(E,{children:e.jsx(h,{config:t,children:e.jsx(W,{children:a})})}),exports.useSmartWallets=()=>{let{client:e}=t.useContext(p);return{client:e}};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./useWallets.js"),a=require("./privy-context.js"),n=require("./getEmbeddedConnectedWallet.js"),i=require("permissionless"),s=require("permissionless/accounts"),l=require("permissionless/clients/pimlico"),o=require("viem"),c=require("viem/account-abstraction");require("tinycolor2"),require("ofetch");let d=({calls:e,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:a,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:n,maxFeePerGas:a,maxPriorityFeePerGas:r})));let u={address:c.entryPoint06Address,version:"0.6"},m={address:c.entryPoint07Address,version:"0.7"},y=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"],p=async({owner:e,smartWalletType:t,chain:r,bundlerUrl:a,paymasterUrl:n,paymasterContext:c})=>{let d=o.createPublicClient({chain:r,transport:o.http()}),p=await(({owner:e,smartWalletType:t,chain:r})=>{let a=o.createPublicClient({chain:r,transport:o.http()});switch(t){case"safe":return s.toSafeSmartAccount({client:a,entryPoint:m,owners:[e],version:"1.4.1"});case"kernel":return s.toEcdsaKernelSmartAccount({client:a,version:"0.3.1",entryPoint:m,owners:[e]});case"biconomy":return s.toBiconomySmartAccount({client:a,owners:[e],entryPoint:u});case"light_account":return s.toLightSmartAccount({client:a,entryPoint:u,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}})({owner:e,smartWalletType:t,chain:r}),g=l.createPimlicoClient({transport:o.http(a),entryPoint:p.entryPoint}),P=n?l.createPimlicoClient({transport:o.http(n),entryPoint:p.entryPoint}):void 0;return i.createSmartAccountClient({account:p,chain:r,paymaster:P,paymasterContext:c,bundlerTransport:o.http(a),userOperation:{estimateFeesPerGas:async()=>{if(y.some((e=>a.includes(e))))return await g.getUserOperationGasPrice().then((e=>e.fast));{let e=await d.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}}})};let g=t.createContext({client:void 0});let P=t.createContext({config:void 0}),h=()=>{let{config:e}=t.useContext(P);return{config:e}},E=({children:r})=>{let[n,i]=t.useState(void 0),{client:s}=a.usePrivyInternal();return t.useEffect((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e.jsx(P.Provider,{value:{config:n},children:r})},v=({config:i,children:s})=>{let{config:l}=h(),{defaultChain:o}=r.useAppConfig(),[c]=t.useState(o),{wallets:d}=r.useWallets(),{user:u}=a.usePrivy(),[m,y]=t.useState(),g=n.getEmbeddedConnectedWallet(d);return t.useEffect((()=>{(async()=>{if(!l?.enabled||!u||!g)return void y(void 0);if(m&&m.chain.id===c.id)return;let e=l.configuredNetworks.find((e=>e.chainId===`eip155:${c.id}`));if(!e)throw new a.PrivyClientError(`The chain ${c.name} (eip155:${c.id}) must be configured in the smart wallet configuration in your dashboard`);let t=u.smartWallet?.smartWalletType??l.smartWalletType;try{let r=await(async(e,t,r,a,n)=>{let i=await e.getEthereumProvider();return await p({owner:i,smartWalletType:r,chain:t,paymasterContext:n,...a})})(g,c,t,e,i?.paymasterContext);y(r)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!l?.enabled,!!u?.smartWallet,!!g]),e.jsx(f.Provider,{value:{client:m},children:s})},f=t.createContext({client:void 0}),W=({children:i})=>{let{client:s}=(()=>{let{client:e}=t.useContext(f);return{client:e}})(),{config:l}=h(),{wrapSmartAccountClient:o}=(()=>{let{noPromptOnSignature:e,openPrivyModal:t}=a.usePrivyInternal(),i=r.useAppConfig(),{setModalData:s}=n.usePrivyModal();return{wrapSmartAccountClient:r=>{let{sendTransaction:a,signMessage:l,signTypedData:o,...c}=r;return{...c,sendTransaction:async r=>{if(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)return e.current=!0,await a(r).finally((()=>e.current=!1));let l=[];"calls"in r&&void 0!==r.calls?l=[...r.calls]:"to"in r&&(l=[{to:r.to,value:r.value||BigInt(0),data:r.data||"0x"}]);let o=async()=>{if(!c.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await c.prepareUserOperation({calls:l,maxFeePerGas:r.maxFeePerGas,maxPriorityFeePerGas:r.maxPriorityFeePerGas,nonce:r.nonce?BigInt(r.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(i,u)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:d({calls:l,chain:c.chain,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,nonce:r.nonce?BigInt(r.nonce):void 0}),rootWallet:{address:c.account.address},transactingWallet:{address:c.account.address,walletIndex:null},getIsSponsored:o,onConfirm:()=>a(r),onSuccess:e=>i(e.hash),onFailure:u,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:r})=>(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)?(e.current=!0,await l({message:r}).finally((()=>e.current=!1))):new Promise((async(a,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:r,confirmAndSign:()=>l({message:r}),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})),signTypedData:async r=>(void 0===i.embeddedWallets.showWalletUIs?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUIs)?(e.current=!0,await o(r).finally((()=>e.current=!1))):new Promise((async(a,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:r,confirmAndSign:()=>o(r),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}})(),{user:c}=a.usePrivy(),{generateSiweMessageForSmartWallet:u,linkSmartWallet:m,noPromptOnSignature:y}=a.usePrivyInternal();return t.useEffect((()=>{(async()=>{if(s&&!c?.smartWallet&&l?.enabled)try{let e=await u({address:s.account.address,chainId:`eip155:${s.chain.id}`});y.current=!0;let t=await s.signMessage({message:e});await m({signature:t,message:e,smartWalletType:l.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{y.current=!1}})()}),[!!s,!!c?.smartWallet,!!l?.enabled]),e.jsx(g.Provider,{value:{client:c?.smartWallet&&s?o(s):void 0},children:i})};exports.SmartWalletsProvider=({config:t,children:r})=>e.jsx(E,{children:e.jsx(v,{config:t,children:e.jsx(W,{children:r})})}),exports.useSmartWallets=()=>{let{client:e}=t.useContext(g);return{client:e}};
@@ -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={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"}}},n={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},l={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"}}},i={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},s={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"}}},p={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},c={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},h={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},u={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"}}},d={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"}}},m={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},g={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"}}},f={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},y={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},b={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"}}},C=[a,n,y,u,d,m,g,f,c,{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"}}},s,p,{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"}}},h,{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},l,i,b,{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"}}}],w=new Set(C.map((e=>e.id))),E={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 v=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),k=e=>v.has(e),x=(e,t,r)=>r.indexOf(e)===t;const S=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(k).filter(x):e?e.filter(k).filter(x):E.appearance.walletList;function O(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let A="#FFFFFF";function _(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function T({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=A;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,"light"===p?-.04:.11),h=_(a,"light"===p?-.88:.87),u=_(a,"light"===p?-.7:.75),d=_(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=_(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=_(n,.15),f=_(n,-.06),y=_(s,.3),b=_(i,.3),C=o.default(n.getLuminance()>.5?"#040217":A),w=_(l,-.16),E=_(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 U(e,t,r){let o,a,n,l,i,s,p,c,h,d,m,g,f,y,b,w,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),d=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),y=t.loginMethods.includes("farcaster"),b=t.loginMethods.includes("telegram")):(o=e.emailAuth,a=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,g=e.githubOAuth,h=e.spotifyOAuth,d=e.instagramOAuth,c=e.tiktokOAuth,m=e.linkedinOAuth,f=e.appleOAuth,y=e.farcasterAuth,b=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?n=!1:e.passkeyAuth&&(n=!0);let k=[o,a].filter(Boolean),x=[i,s,p,g,h,d,c,m,f,y,b].filter(Boolean),A=[l].filter(Boolean);if(k.length+x.length+A.length===0)throw Error("You must enable at least one login method");let _=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&0===A.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):_||x.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"),_=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=S({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),M=(({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}),H=t?.intl?.defaultCountry??"US",{chains:F,defaultChain:I}=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=C.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?O(e,r):e}))}else a=C.concat(e??[]);let n=t?a[0]:u,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,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(w=e.legacyWalletUiConfig??1?W?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==w)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:N,...D}=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??E.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:T({backgroundTheme:t?.appearance?.theme??E.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??E.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:o,sms:a,passkey:n,google:i,twitter:s,discord:p,github:g,spotify:h,instagram:d,tiktok:c,linkedin:m,apple:f,farcaster:y,telegram:b},loginMethodsAndOrder:M,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??E.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??E.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??E.rpcConfig.rpcTimeouts},chains:F,defaultChain:I,intl:{defaultCountry:H},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??E.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??E.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof N?{requireUserOwnedRecoveryOnCreate:N}:{},...W?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...D,noPromptOnSignature:w,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??E._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??E.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??E.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??E.fundingMethodConfig.moonpay.useSandbox}}}}let L={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 M=U(L,void 0,!1);let H=t.createContext({appConfig:M,isServerConfigLoaded:!1});const F=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=M,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=C,exports.DEFAULT_SUPPORTED_CHAIN_IDS=w,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((()=>U(l??L,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(H.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=F,exports.VERSION="1.89.0",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=O,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!w.has(e.id)));return C.concat(t)},exports.arbitrum=a,exports.arbitrumSepolia=n,exports.avalanche=l,exports.avalancheFuji=i,exports.base=s,exports.baseSepolia=p,exports.celo=c,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=h,exports.mainnet=u,exports.optimism=d,exports.optimismSepolia=m,exports.polygon=g,exports.polygonAmoy=f,exports.sepolia=y,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(H);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(H);return e},exports.useWallets=function(){let e=t.useContext(F);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=b;
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={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"}}},n={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},l={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"}}},i={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},s={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"}}},p={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},c={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},h={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},u={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"}}},d={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"}}},m={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},g={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"}}},f={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},y={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},b={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"}}},C=[a,n,y,u,d,m,g,f,c,{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"}}},s,p,{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"}}},h,{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},l,i,b,{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"}}}],w=new Set(C.map((e=>e.id))),E={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 v=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),k=e=>v.has(e),x=(e,t,r)=>r.indexOf(e)===t;const S=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(k).filter(x):e?e.filter(k).filter(x):E.appearance.walletList;function O(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let A="#FFFFFF";function _(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function T({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=A;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,"light"===p?-.04:.11),h=_(a,"light"===p?-.88:.87),u=_(a,"light"===p?-.7:.75),d=_(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=_(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=_(n,.15),f=_(n,-.06),y=_(s,.3),b=_(i,.3),C=o.default(n.getLuminance()>.5?"#040217":A),w=_(l,-.16),E=_(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 U(e,t,r){let o,a,n,l,i,s,p,c,h,d,m,g,f,y,b,w,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),d=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),y=t.loginMethods.includes("farcaster"),b=t.loginMethods.includes("telegram")):(o=e.emailAuth,a=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,g=e.githubOAuth,h=e.spotifyOAuth,d=e.instagramOAuth,c=e.tiktokOAuth,m=e.linkedinOAuth,f=e.appleOAuth,y=e.farcasterAuth,b=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?n=!1:e.passkeyAuth&&(n=!0);let k=[o,a].filter(Boolean),x=[i,s,p,g,h,d,c,m,f,y,b].filter(Boolean),A=[l].filter(Boolean);if(k.length+x.length+A.length===0)throw Error("You must enable at least one login method");let _=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&0===A.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):_||x.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"),_=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=S({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),M=(({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}),H=t?.intl?.defaultCountry??"US",{chains:F,defaultChain:I}=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=C.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?O(e,r):e}))}else a=C.concat(e??[]);let n=t?a[0]:u,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,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(w=e.legacyWalletUiConfig??1?W?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==w)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:N,...D}=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??E.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:T({backgroundTheme:t?.appearance?.theme??E.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??E.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:o,sms:a,passkey:n,google:i,twitter:s,discord:p,github:g,spotify:h,instagram:d,tiktok:c,linkedin:m,apple:f,farcaster:y,telegram:b},loginMethodsAndOrder:M,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??E.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??E.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??E.rpcConfig.rpcTimeouts},chains:F,defaultChain:I,intl:{defaultCountry:H},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??E.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??E.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof N?{requireUserOwnedRecoveryOnCreate:N}:{},...W?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...D,noPromptOnSignature:w,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??E._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??E.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??E.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??E.fundingMethodConfig.moonpay.useSandbox}}}}let L={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 M=U(L,void 0,!1);let H=t.createContext({appConfig:M,isServerConfigLoaded:!1});const F=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=M,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=C,exports.DEFAULT_SUPPORTED_CHAIN_IDS=w,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((()=>U(l??L,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(H.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=F,exports.VERSION="1.89.1-beta-20241010170842",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=O,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!w.has(e.id)));return C.concat(t)},exports.arbitrum=a,exports.arbitrumSepolia=n,exports.avalanche=l,exports.avalancheFuji=i,exports.base=s,exports.baseSepolia=p,exports.celo=c,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=h,exports.mainnet=u,exports.optimism=d,exports.optimismSepolia=m,exports.polygon=g,exports.polygonAmoy=f,exports.sepolia=y,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(H);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(H);return e},exports.useWallets=function(){let e=t.useContext(F);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=b;