import{jsxs as t,Fragment as o,jsx as r}from"react/jsx-runtime";import{useRef as e}from"react";import{c as i,B as m}from"./ModalHeader-DffkxvO4.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as n}from"./FundWalletMethodHeader-A50eT5P4.mjs";import{N as a}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{u as p}from"./modal-context-DBwfUxD-.mjs";import{u as l}from"./useGetTokenPrice-ENX-6s3C.mjs";import{c as d}from"./ethers-VpbQV-TA.mjs";import{F as u,a as j,h,c as f,d as v}from"./styles-ByUO8DsA.mjs";import"styled-components";import"./context-BKnOUECq.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-BEfvREjE.mjs";import"viem/utils";import"./wallet-connect-58EobR5U.mjs";import"./errors-Dd6zfYtp.mjs";import"ofetch";import"./getPublicClient-D4yNgeGy.mjs";import"viem";import"viem/chains";import"eventemitter3";import"./events-context-BJ75xIIf.mjs";import"./internal-context-dfitw7Ot.mjs";import"./privy-context-Bi6vqCPc.mjs";import"@privy-io/are-addresses-equal";import"./index-BtwxknTg.mjs";import"zustand";import"react-device-detect";import"./get-entropy-details-for-user-BIWg0YxF.mjs";import"./user-D5cqJNp9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./useGetSolPrice-x7gfUIHJ.mjs";import"./LinkPasskeyScreen-C-MqivSL.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./usePrivy-BhL-ltvm.mjs";import"./use-unlink-wallet-oAguM2-k.mjs";import"@privy-io/popup";import"./paths-BH8W4zMc.mjs";import"./pkce-BinverJO.mjs";import"jose";import"./ScreenLayout-Caq5mGD8.mjs";import"./Screen-D8KNyGVj.mjs";const y={component:()=>{let{data:y,setModalData:C}=p(),g=y?.funding,x="solana"===g.chainType,k=e(null),{tokenPrice:S}=l(x?"solana":g.chain.id),T=x?void 0:g,D=!(!T?.erc20Address||T?.erc20ContractInfo),F=x?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",A=parseFloat(g.amount),I=!isNaN(A)&&A>0,L=S?d(g.amount,S):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/r(n,{}),/*#__PURE__*/r(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/r(u,{children:D?/*#__PURE__*/r(a,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(j,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/r(h,{ref:k,value:g.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...y,funding:{...g,amount:o},solanaFundingData:y?.solanaFundingData?{...y.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/r(f,{children:F})]}),!T?.erc20Address&&!(x&&g.isUSDC)&&/*#__PURE__*/r(v,{children:L&&I?`${L} USD`:""})]})}),/*#__PURE__*/r(i,{style:{marginTop:"1rem"},disabled:!I,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/r(m,{})]})}};export{y as FundingAmountEditScreen,y as default};
//# sourceMappingURL=FundingEditAmountScreen-ClBh6rHm.mjs.map
