import{o as e}from"./rolldown-runtime.js";import{n as t,t as n}from"./jsx-runtime.js";import{Mt as r,j as i}from"./useActiveWallet-CEs8euQ3.js";import"./context-Cdw68BC2.js";import{t as a}from"./modal-context-DHfp-mFQ.js";import{t as o}from"./ScreenLayout-Dy-3vlz4.js";var s=n(),c=e(t(),1);i();var l=({title:e,subtitle:t,buttonText:n,buttonHref:r,isLoading:i=!1,helpText:a,onButtonClick:c})=>(0,s.jsx)(o,{title:e,subtitle:t,primaryCta:{label:n,onClick:()=>{r&&window.open(r,`_self`),c?.()},disabled:i},helpText:a,watermark:!0}),u={component:()=>{let{ready:e}=r(),{data:t}=a(),[n,i]=(0,c.useState)(!1);if(!t?.installWalletModalData)throw Error(`Wallet data is missing`);let{walletConfig:o,connectOnly:u,chainType:d}=t.installWalletModalData,f=o.getMobileRedirect({useUniversalLink:!n,isSolana:d===`solana`,connectOnly:u}),p=o.name.replace(/ wallet/gi,``),m={title:`Redirecting to ${p} Mobile Wallet`,description:`We'll take you to the ${p} Mobile Wallet app to continue your login experience.`,footnote:``};return e&&(m.description=`For the best experience, we'll automatically log you into the ${p} Mobile Wallet in-app browser.`,m.footnote=`You can always return here to login via other methods.`),n&&(m.title=`Still here?`,m.description=`You may need to install the ${o.name} mobile app.`,m.footnote=`Once you're done, you can connect with ${o.name} wallet to complete the login.`),(0,s.jsx)(l,{title:m.title,subtitle:m.description,buttonText:n?`Go to App Store`:`Continue`,buttonHref:f,isLoading:e&&!f,helpText:m.footnote||void 0,onButtonClick:()=>{setTimeout((()=>i(!0)),1e3)}})}};export{u as WalletInterstitialScreen,u as default,l as WalletInterstitialScreenView};