@unifold/connect-react-native 0.1.25 → 0.1.27

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.
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
- 'use strict';var react=require('react'),reactNative=require('react-native'),reactQuery=require('@tanstack/react-query'),jsxRuntime=require('react/jsx-runtime'),reactNativeGestureHandler=require('react-native-gesture-handler'),_e=require('react-native-svg'),hs=require('react-native-qrcode-svg'),reactNativeWebview=require('react-native-webview'),Ln=require('@react-native-async-storage/async-storage');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var _e__default=/*#__PURE__*/_interopDefault(_e);var hs__default=/*#__PURE__*/_interopDefault(hs);var Ln__default=/*#__PURE__*/_interopDefault(Ln);var Ar={light:{background:"#FFFFFF",card:"#F8FAFC",cardHover:"#F1F5F9",foreground:"#0F172A",foregroundMuted:"#64748B",foregroundSubtle:"#94A3B8",border:"#E2E8F0",borderSecondary:"#CBD5E1",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"#DCFCE7",warning:"#F59E0B",warningBackground:"#FEF3C7",error:"#EF4444",errorBackground:"#FEE2E2",overlay:"rgba(0, 0, 0, 0.5)"},dark:{background:"#2D2C2F",card:"#3A393C",cardHover:"#48474A",foreground:"#F8FAFC",foregroundMuted:"#94A3B8",foregroundSubtle:"#64748B",border:"#38383A",borderSecondary:"#48484A",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"rgba(34, 197, 94, 0.1)",warning:"#F59E0B",warningBackground:"rgba(245, 158, 11, 0.1)",error:"#EF4444",errorBackground:"rgba(239, 68, 68, 0.1)",overlay:"rgba(0, 0, 0, 0.7)"}},zr=Ar;function er(e,t){return t?{...e,...t,shadowOffset:t.shadowOffset??e.shadowOffset,backShadowOffset:t.backShadowOffset??e.backShadowOffset}:e}function Eo(e,t,o){let n=o?t?.[o]:void 0,r=(l,h,x)=>{let P=n?.[l]?.[h];if(P!==void 0)return P;let I=t?.[l]?.[h];return I!==void 0?I:x},s={backgroundColor:r("card","backgroundColor",e.card),titleColor:r("card","titleColor",e.foreground),subtitleColor:r("card","subtitleColor",e.foregroundMuted),labelColor:r("card","labelColor",e.foregroundMuted),headerColor:r("card","headerColor",e.foregroundMuted),labelRightColor:r("card","labelRightColor",e.foregroundMuted),labelHighlightRightColor:r("card","labelHighlightRightColor",e.warning),textRightColor:r("card","textRightColor",e.foreground),subtextRightColor:r("card","subtextRightColor",e.foregroundMuted),rowLeftLabel:r("card","rowLeftLabel",e.foregroundMuted),rowRightLabel:r("card","rowRightLabel",e.foreground),iconColor:r("card","iconColor",e.primary),iconBackgroundColor:r("card","iconBackgroundColor",e.primary+"26"),actionColor:r("card","actionColor",e.foregroundMuted),actionIcon:r("card","actionIcon",e.foregroundMuted),descriptionColor:r("card","descriptionColor",e.foregroundMuted),borderRadius:r("card","borderRadius",12),borderWidth:r("card","borderWidth",0),borderColor:r("card","borderColor",e.border),shadowColor:r("card","shadowColor","#000"),shadowOffset:r("card","shadowOffset",{width:0,height:-4}),shadowOpacity:r("card","shadowOpacity",0),shadowRadius:r("card","shadowRadius",12),elevation:r("card","elevation",0),iconContainerBorderRadius:r("card","iconContainerBorderRadius",12),backShadowColor:"transparent",backShadowOffset:{top:4,left:4,right:-4,bottom:-4},backShadowSpacing:8},a=(n?.depositMenu??t?.depositMenu)?.card,d=(n?.transferCrypto??t?.transferCrypto)?.depositAddress?.card,f=(n?.depositCard??t?.depositCard)?.quoteProvider?.card,p=(n?.depositTracker??t?.depositTracker)?.executionRow?.card;return {header:{titleColor:r("header","titleColor",e.foreground),buttonColor:r("header","buttonColor",e.foreground)},card:s,input:{backgroundColor:r("input","backgroundColor",r("search","backgroundColor",e.card)),textColor:r("input","textColor",r("search","inputColor",e.foreground)),placeholderColor:r("input","placeholderColor",r("search","placeholderColor",e.foregroundMuted)),borderColor:r("input","borderColor",e.border),borderRadius:r("input","borderRadius",r("search","borderRadius",8)),borderWidth:r("input","borderWidth",1)},button:{primaryBackground:r("button","primaryBackground",e.primary),primaryText:r("button","primaryText",e.primaryForeground),secondaryBackground:r("button","secondaryBackground",e.card),secondaryText:r("button","secondaryText",e.foreground),borderRadius:r("button","borderRadius",12),borderWidth:r("button","borderWidth",0),borderColor:r("button","borderColor",e.border)},container:{titleColor:r("container","titleColor",e.foreground),subtitleColor:r("container","subtitleColor",e.foregroundMuted),actionColor:r("container","actionColor",e.foregroundMuted),actionTitle:r("container","actionTitle",e.foregroundMuted),buttonColor:r("container","buttonColor",e.primary),buttonTitleColor:r("container","buttonTitleColor",e.primaryForeground),iconBackgroundColor:r("container","iconBackgroundColor",e.success),iconColor:r("container","iconColor",e.foreground)},search:{backgroundColor:r("search","backgroundColor",e.card),inputColor:r("search","inputColor",e.foreground),placeholderColor:r("search","placeholderColor",e.foregroundMuted),borderRadius:r("search","borderRadius",8)},list:{titleSectionColor:r("list","titleSectionColor",e.foregroundMuted),rowBorderRadius:r("list","rowBorderRadius",12)},badge:{borderRadius:r("badge","borderRadius",8)},sheet:{shadowColor:r("sheet","shadowColor","#000"),shadowOffset:r("sheet","shadowOffset",{width:0,height:-4}),shadowOpacity:r("sheet","shadowOpacity",.1),shadowRadius:r("sheet","shadowRadius",12),elevation:r("sheet","elevation",16)},depositMenu:{card:er(s,a)},transferCrypto:{depositAddress:{card:er(s,d)}},depositCard:{quoteProvider:{card:er(s,f)}},depositTracker:{executionRow:{card:er(s,p)}}}}function Mr(e,t,o){let r={...Ar[e]};return o&&(r.primary=o),t&&(r={...r,...t}),r}var Ur=react.createContext(null);function W(){let e=react.useContext(Ur);if(!e){let t=zr.dark;return {mode:"dark",colors:t,fonts:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},components:Eo(t,void 0,"dark"),isDark:true}}return e}function mo({children:e,mode:t="auto",accentColor:o,theme:n,fontFamily:r,fonts:s,components:a}){let d=reactNative.useColorScheme(),f=react.useMemo(()=>t==="auto"?d==="dark"?"dark":"light":t,[t,d]),p=react.useMemo(()=>{let P=n?.[f];return Mr(f,P,o)},[f,n,o]),l=react.useMemo(()=>Eo(p,a,f),[p,a,f]),h=react.useMemo(()=>s?{regular:s.regular||r,medium:s.medium||r,semibold:s.semibold||r,bold:s.bold||r}:r?{regular:r,medium:r,semibold:r,bold:r}:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},[r,s]),x=react.useMemo(()=>({mode:f,colors:p,fonts:h,components:l,isDark:f==="dark"}),[f,p,h,l]);return jsxRuntime.jsx(Ur.Provider,{value:x,children:e})}var Ki="https://api.unifold.io",or,tt="pk_test_123",tr={};function Oe(){return typeof __DEV__<"u"&&__DEV__&&or?or:Ki}function rr(e){if(e.publishableKey!==void 0){if(!e.publishableKey||e.publishableKey.trim()==="")throw new Error("Unifold SDK: publishableKey cannot be empty. Please provide a valid publishable key.");!e.publishableKey.startsWith("pk_test_")&&!e.publishableKey.startsWith("pk_live_")&&console.warn('Unifold SDK: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),tt=e.publishableKey;}e.baseUrl&&typeof __DEV__<"u"&&__DEV__&&(or=e.baseUrl),e.defaultConfig&&(tr=e.defaultConfig);}function An(e){typeof __DEV__<"u"&&__DEV__?or=e:console.warn("[Unifold] setDevApiUrl() is only available in development mode");}function at(e){if(!e||e.trim()==="")throw new Error("Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function.");e==="pk_test_123"&&console.warn('Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.');}function He(e){let t=e.startsWith("/")?e:`/${e}`;return `${Oe()}/api/public${t}`}function $(e){return e?e.includes("localhost")||e.includes("127.0.0.1")?e.replace(/https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?/,Oe()):e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/api/public/")?`${Oe()}${e}`:`${Oe()}/api/public${e}`:""}async function Xt(e,t){if(!e?.external_user_id)throw new Error("external_user_id is required");let o=e?.recipient_address||tr.recipientAddress;if(!o)throw new Error("[Unifold] recipient_address is required for createDepositAddress. Pass recipientAddress in your beginDeposit() config.");let n={external_user_id:e.external_user_id,destination_chain_type:e?.destination_chain_type||"ethereum",destination_chain_id:e?.destination_chain_id||tr.destinationChainId||"8453",destination_token_address:e?.destination_token_address||tr.destinationTokenAddress||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:o,client_metadata:e?.client_metadata||{}},r=t||tt;at(r);let s=await fetch(`${Oe()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!s.ok)throw new Error(`Failed to create deposit address: ${s.statusText}`);return await s.json()}function Zt(e,t){return e.find(o=>o.chain_type===t)}async function Ao(e,t){let o=t||tt;at(o);let n=await fetch(`${Oe()}/v1/public/direct_executions/query`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({external_user_id:e})});if(!n.ok)throw new Error(`Failed to query executions: ${n.statusText}`);return n.json()}async function Hr(e,t){let o=t||tt;at(o);let n=await fetch(`${Oe()}/v1/public/direct_executions/poll`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({deposit_wallet_id:e})});if(!n.ok)throw new Error(`Failed to poll executions: ${n.statusText}`);return n.json()}function de(e,t="svg"){if(!e)return "";if(t==="svg"||!e.icon_urls||e.icon_urls.length===0)return e.icon_url;let o=e.icon_urls.find(n=>n.format===t);return o?o.url:e.icon_url}async function zo(e,t){let o=e||tt;at(o);let n=`${Oe()}/v1/public/tokens/supported_deposit_tokens`;if(t?.destination_token_address&&t?.destination_chain_id&&t?.destination_chain_type){let s=new URLSearchParams({destination_token_address:t.destination_token_address,destination_chain_id:t.destination_chain_id,destination_chain_type:t.destination_chain_type});n=`${n}?${s.toString()}`;}let r=await fetch(n,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch supported deposit tokens: ${r.statusText}`);return r.json()}async function jr(e,t){let o=t||tt;at(o);let n=new URLSearchParams({chainType:e.chain_type,chainId:e.chain_id,tokenAddress:e.token_address}),r=await fetch(`${Oe()}/v1/public/tokens/token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch token metadata: ${r.statusText}`);return r.json()}function nr(e,t,o){return !e||e.length===0?o||"":e.find(r=>r.format===t)?.url||o||e[0]?.url||""}async function Nr(e,t){let o=t||tt;at(o);let n=await fetch(`${Oe()}/v1/public/onramps/quotes`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to fetch onramp quotes: ${n.statusText}`);return n.json()}async function $r(e,t){let o=t||tt;at(o);let n=await fetch(`${Oe()}/v1/public/onramps/sessions`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to create onramp session: ${n.statusText}`);return n.json()}async function qr(e,t){let o=t||tt;at(o);let n=new URLSearchParams;e.country_code&&n.append("country_code",e.country_code),e.subdivision_code&&n.append("subdivision_code",e.subdivision_code),n.append("token_address",e.token_address),n.append("chain_id",e.chain_id),n.append("chain_type",e.chain_type);let r=await fetch(`${Oe()}/v1/public/onramps/default_token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch default onramp token: ${r.statusText}`);return r.json()}async function Qr(e){let t=e||tt;at(t);let o=await fetch(`${Oe()}/v1/public/onramps/fiat_currencies`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch fiat currencies: ${o.statusText}`);return o.json()}function ho(e,t="png"){if(!e||e.length===0)return;let o=e.find(n=>n.format===t);return o?o.url:e[0]?.url}async function Mo(e){let t=e||tt;at(t);let o=await fetch(`${Oe()}/v1/public/projects/config`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch project config: ${o.statusText}`);return o.json()}async function Uo(){let e=await fetch(`${Oe()}/v1/public/ip_address`,{method:"GET",headers:{accept:"application/json"}});if(!e.ok)throw new Error(`Failed to fetch IP address information: ${e.statusText}`);return e.json()}async function zn(e,t,o,n,r){let s=r||tt;at(s);let a=await fetch(`${Oe()}/v1/public/addresses/balance`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-publishable-key":s},body:JSON.stringify({address:e,chain_type:t,chain_id:o,token_address:n})});if(!a.ok)throw new Error(`Failed to fetch address balance: ${a.statusText}`);return a.json()}function pe({visible:e,onClose:t,children:o,closeOnBackdropPress:n=true,showHandle:r=true,heightPercent:s,noPadding:a=false,borderTopLeftRadius:d=24,borderTopRightRadius:f=24}){let{colors:p,components:l}=W(),{height:h}=reactNative.useWindowDimensions(),x=react.useRef(h);x.current=h;let P=react.useRef(new reactNative.Animated.Value(h)).current,I=react.useRef(new reactNative.Animated.Value(0)).current,C=s!=null&&s>=1;react.useEffect(()=>{let m=x.current;e?(P.setValue(m),I.setValue(0),reactNative.Animated.parallel([reactNative.Animated.spring(P,{toValue:0,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(I,{toValue:.5,duration:200,useNativeDriver:true})]).start()):reactNative.Animated.parallel([reactNative.Animated.spring(P,{toValue:m,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(I,{toValue:0,duration:200,useNativeDriver:true})]).start();},[e,P,I]);let u=()=>{n&&t();};return jsxRuntime.jsx(reactNative.Modal,{visible:e,transparent:true,animationType:"none",statusBarTranslucent:true,onRequestClose:t,children:jsxRuntime.jsxs(reactNativeGestureHandler.GestureHandlerRootView,{style:[Mt.container,reactNative.Platform.OS==="android"&&{paddingTop:reactNative.StatusBar.currentHeight}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Mt.backdrop,{backgroundColor:"#000000",opacity:I}],pointerEvents:"none"}),!C&&jsxRuntime.jsx(reactNative.TouchableWithoutFeedback,{onPress:u,children:jsxRuntime.jsx(reactNative.View,{style:Mt.backdropTouchArea})}),jsxRuntime.jsxs(reactNative.Animated.View,{style:[Mt.sheet,{maxHeight:h*.9,backgroundColor:p.background,borderTopLeftRadius:d,borderTopRightRadius:f,transform:[{translateY:P}],shadowColor:l.sheet.shadowColor,shadowOffset:l.sheet.shadowOffset,shadowOpacity:l.sheet.shadowOpacity,shadowRadius:l.sheet.shadowRadius,elevation:l.sheet.elevation,...s&&{height:h*s,maxHeight:h*s},...C&&{paddingBottom:0},...a&&{paddingBottom:0}}],children:[r&&jsxRuntime.jsx(reactNative.View,{style:Mt.handleContainer,children:jsxRuntime.jsx(reactNative.View,{style:[Mt.handle,{backgroundColor:p.border}]})}),jsxRuntime.jsx(reactNative.View,{style:[Mt.content,s&&Mt.contentFlex],children:o})]})]})})}var Mt=reactNative.StyleSheet.create({container:{flex:1},backdrop:{...reactNative.StyleSheet.absoluteFillObject},backdropTouchArea:{flex:1},sheet:{paddingBottom:reactNative.Platform.OS==="ios"?34:24},handleContainer:{alignItems:"center",paddingTop:12,paddingBottom:4},handle:{width:36,height:4,borderRadius:2},content:{},contentFlex:{flex:1}});var Co=new Map;function jn({width:e,height:t,borderRadius:o,color:n}){let r=react.useRef(new reactNative.Animated.Value(.3)).current;return react.useEffect(()=>{let s=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(r,{toValue:.7,duration:800,useNativeDriver:true}),reactNative.Animated.timing(r,{toValue:.3,duration:800,useNativeDriver:true})]));return s.start(),()=>s.stop()},[r]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",width:e,height:t,borderRadius:o,backgroundColor:n,opacity:r}})}function Ht({uri:e,width:t,height:o,borderRadius:n=0,borderWidth:r=0,borderColor:s="transparent",backgroundColor:a="transparent",style:d}){let{colors:f}=W(),[p,l]=react.useState(false),[h,x]=react.useState(false),[P,I]=react.useState(()=>{if(!e||!e.toLowerCase().endsWith(".svg"))return null;let R=Co.get(e);return R?{uri:e,xml:R}:null}),C=e?.toLowerCase().endsWith(".svg"),u=C&&e&&P?.uri===e?P.xml:null;react.useEffect(()=>{l(false),x(false);},[e]),react.useEffect(()=>{if(!C||!e)return;if(Co.has(e)){I({uri:e,xml:Co.get(e)});return}let R=false;return fetch(e).then(b=>{if(!b.ok)throw new Error(`HTTP ${b.status}`);return b.text()}).then(b=>{R||(Co.set(e,b),I({uri:e,xml:b}));}).catch(()=>{R||l(true);}),()=>{R=true;}},[e,C]);let m=f.card;if(!e)return jsxRuntime.jsx(reactNative.View,{style:[{width:t,height:o,borderRadius:n,backgroundColor:m},d]});let g={width:t,height:o,borderRadius:n,borderWidth:r,borderColor:s,backgroundColor:a,overflow:"hidden",alignItems:"center",justifyContent:"center",...d},i=t-r*2,c=o-r*2;return p?jsxRuntime.jsx(reactNative.View,{style:[g,{backgroundColor:a||m}]}):C?jsxRuntime.jsxs(reactNative.View,{style:g,children:[!!!u&&jsxRuntime.jsx(jn,{width:i,height:c,borderRadius:n,color:m}),u?jsxRuntime.jsx(_e.SvgXml,{xml:u,width:i,height:c,onError:()=>l(true)}):jsxRuntime.jsx(_e.SvgUri,{uri:e,width:i,height:c,onError:()=>l(true)})]}):jsxRuntime.jsxs(reactNative.View,{style:g,children:[!h&&jsxRuntime.jsx(jn,{width:i,height:c,borderRadius:n,color:m}),jsxRuntime.jsx(reactNative.Image,{source:{uri:e,cache:"force-cache"},style:{width:i,height:c},resizeMode:"contain",onLoad:()=>x(true),onError:()=>l(true)})]})}function Kr(e){let t=[];for(let o of e)if(o)if(o.toLowerCase().endsWith(".svg")){if(Co.has(o))continue;t.push(fetch(o).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}).then(n=>{Co.set(o,n);}).catch(()=>{}));}else t.push(reactNative.Image.prefetch(o).then(()=>{}).catch(()=>{}));return Promise.all(t).then(()=>{})}function Xr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(_e.Path,{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Zr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Rect,{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"1",y1:"10",x2:"23",y2:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function to({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"12 6 12 12 16 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function en({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Line,{x1:"19",y1:"12",x2:"5",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"12 19 5 12 12 5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ge({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function St({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(_e.Polyline,{points:"9 18 15 12 9 6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ye({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(_e.Polyline,{points:"6 9 12 15 18 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Rect,{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function We({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(_e.Polyline,{points:"20 6 9 17 4 12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function tn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Line,{x1:"12",y1:"2",x2:"12",y2:"6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"12",y1:"18",x2:"12",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"2",y1:"12",x2:"6",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"18",y1:"12",x2:"22",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function oo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Path,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"15 3 21 3 21 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"10",y1:"14",x2:"21",y2:"3",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function bo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Line,{x1:"12",y1:"1",x2:"12",y2:"23",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ar({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Path,{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"14 2 14 8 20 8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"16",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"16",y1:"17",x2:"8",y2:"17",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"10 9 9 9 8 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function jt({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(_e.Polyline,{points:"18 15 12 9 6 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Gn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Polyline,{points:"23 4 23 10 17 10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Polyline,{points:"1 20 1 14 7 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function ko({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"12",y1:"16",x2:"12",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"12",y1:"8",x2:"12.01",y2:"8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function wo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Path,{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M9 12l2 2 4-4",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function lr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Path,{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function dr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(_e__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(_e.Path,{d:"M5.43 5.43A8.06 8.06 0 0 0 4 10c0 6 8 12 8 12a29.94 29.94 0 0 0 5-5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M19.18 13.52A8.66 8.66 0 0 0 20 10a8 8 0 0 0-8-8 7.88 7.88 0 0 0-3.52.82",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M9.13 9.13A2.78 2.78 0 0 0 9 10a3 3 0 0 0 3 3 2.78 2.78 0 0 0 .87-.13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Path,{d:"M14.9 9.25a3 3 0 0 0-2.15-2.16",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(_e.Line,{x1:"2",y1:"2",x2:"22",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function rt({title:e,showBack:t=false,showClose:o=true,onBack:n,onClose:r,badge:s,showBalance:a=false,balanceAddress:d,balanceChainType:f,balanceChainId:p,balanceTokenAddress:l,publishableKey:h,projectName:x}){let{colors:P,fonts:I,components:C}=W(),[u,m]=react.useState(null),[g,i]=react.useState(false),c=react.useState(()=>new reactNative.Animated.Value(0))[0];react.useEffect(()=>{if(!g)return;let b=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(c,{toValue:1,duration:700,useNativeDriver:true}),reactNative.Animated.timing(c,{toValue:0,duration:700,useNativeDriver:true})]));return b.start(),()=>b.stop()},[g,c]),react.useEffect(()=>{if(!a||!d||!f||!p||!l||!h){m(null),i(false);return}let b=false;return i(true),zn(d,f,p,l,h).then(M=>{if(b)return;let _=M.balance,w=null;_&&(_.amount_usd!=null&&_.amount_usd!==""?w=`$${_.amount_usd}`:w="$0.00"),m(w);}).catch(()=>{b||m(null);}).finally(()=>{b||i(false);}),()=>{b=true;}},[a,d,f,p,l,h]);let R=c.interpolate({inputRange:[0,1],outputRange:[.4,1]});return jsxRuntime.jsxs(reactNative.View,{style:Ke.header,children:[jsxRuntime.jsx(reactNative.View,{style:Ke.leftContainer,children:t&&n?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,style:[Ke.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(en,{size:20,color:C.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Ke.spacer})}),jsxRuntime.jsxs(reactNative.View,{style:Ke.titleContainer,children:[jsxRuntime.jsxs(reactNative.View,{style:Ke.titleRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ke.title,{color:C.header.titleColor,fontFamily:I.medium}],children:e}),s&&s.count>0&&jsxRuntime.jsx(reactNative.View,{style:[Ke.titleBadge,{backgroundColor:P.card}],children:jsxRuntime.jsx(reactNative.Text,{style:[Ke.titleBadgeText,{color:P.foregroundMuted,fontFamily:I.regular}],children:s.count})})]}),a&&(g?jsxRuntime.jsx(reactNative.Animated.View,{style:[Ke.balanceSkeleton,{backgroundColor:P.cardHover,opacity:R}]}):u!=null?jsxRuntime.jsxs(reactNative.Text,{style:[Ke.balanceText,{color:P.foregroundMuted,fontFamily:I.regular}],children:[x?`${x} `:"","Balance: ",u]}):null)]}),jsxRuntime.jsx(reactNative.View,{style:Ke.rightContainer,children:o?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,style:[Ke.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Ge,{size:20,color:C.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Ke.spacer})})]})}var Ke=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},leftContainer:{width:40,alignItems:"flex-start"},rightContainer:{width:40,alignItems:"flex-end"},titleContainer:{flex:1,alignItems:"center"},titleRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},title:{fontSize:16,textAlign:"center"},titleBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:12},titleBadgeText:{fontSize:10,fontWeight:"400"},balanceSkeleton:{height:10,width:120,borderRadius:5,marginTop:4},balanceText:{fontSize:14,marginTop:3,textAlign:"center"},iconButton:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},spacer:{width:28,height:28}});function Le({children:e,style:t,contentStyle:o,onPress:n,activeOpacity:r=.7,cardTokens:s}){let{components:a}=W(),d=s??a.card,f=d.backShadowColor!=="transparent",p={backgroundColor:d.backgroundColor,borderRadius:d.borderRadius,borderWidth:d.borderWidth,borderColor:d.borderColor},l=[Kn.wrapper,t,f&&{marginBottom:d.backShadowSpacing}],h=[p,o];return jsxRuntime.jsxs(reactNative.View,{style:l,children:[f&&jsxRuntime.jsx(reactNative.View,{style:[Kn.backShadow,{top:d.backShadowOffset.top,left:d.backShadowOffset.left,right:d.backShadowOffset.right,bottom:d.backShadowOffset.bottom,backgroundColor:d.backShadowColor,borderRadius:d.borderRadius}]}),n!=null?jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:n,activeOpacity:r,style:h,children:e}):jsxRuntime.jsx(reactNative.View,{style:h,children:e})]})}var Kn=reactNative.StyleSheet.create({wrapper:{position:"relative"},backShadow:{position:"absolute"}});function jo({onPress:e,title:t,subtitle:o,featuredTokens:n}){let{fonts:r,components:s}=W(),a=s.depositMenu.card,d=n?[...n].sort((f,p)=>f.position-p.position):[];return jsxRuntime.jsxs(Le,{cardTokens:a,onPress:e,style:Ct.wrapper,contentStyle:Ct.container,children:[jsxRuntime.jsxs(reactNative.View,{style:Ct.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[Ct.iconContainer,{borderRadius:a.iconContainerBorderRadius}],children:jsxRuntime.jsx(Xr,{size:20,color:a.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:Ct.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Ct.title,{color:a.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[Ct.subtitle,{color:a.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:Ct.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:Ct.networkIcons,children:d.map((f,p)=>{let l=f.icon_urls.find(h=>h.format==="png")?.url||f.icon_urls.find(h=>h.format==="svg")?.url;return jsxRuntime.jsx(reactNative.View,{style:[Ct.networkIconWrapper,{marginLeft:p===0?0:-6,zIndex:d.length-p}],children:jsxRuntime.jsx(Ht,{uri:$(l),width:20,height:20})},f.name)})})})]})}var Ct=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},networkIcons:{flexDirection:"row",alignItems:"center"},networkIconWrapper:{}});function $o({onPress:e,title:t,subtitle:o,paymentNetworks:n}){let{fonts:r,components:s}=W(),a=s.depositMenu.card;return jsxRuntime.jsxs(Le,{cardTokens:a,onPress:e,style:_t.wrapper,contentStyle:_t.container,children:[jsxRuntime.jsxs(reactNative.View,{style:_t.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[_t.iconContainer,{borderRadius:a.iconContainerBorderRadius}],children:jsxRuntime.jsx(Zr,{size:20,color:a.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:_t.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[_t.title,{color:a.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[_t.subtitle,{color:a.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:_t.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:_t.paymentIcons,children:n?.map(d=>{let f=d.icon_urls.find(p=>p.format==="png")?.url||d.icon_urls.find(p=>p.format==="svg")?.url;return jsxRuntime.jsx(Ht,{uri:$(f),width:32,height:20,borderRadius:4},d.name)})})})]})}var _t=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},paymentIcons:{flexDirection:"row",alignItems:"center",gap:6}});function qo({onPress:e,title:t,subtitle:o,badge:n}){let{fonts:r,components:s}=W(),a=s.depositMenu.card;return jsxRuntime.jsx(Le,{cardTokens:a,onPress:e,style:Rt.wrapper,contentStyle:Rt.container,children:jsxRuntime.jsxs(reactNative.View,{style:Rt.leftContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[Rt.iconContainer,{borderRadius:a.iconContainerBorderRadius}],children:[jsxRuntime.jsx(to,{size:20,color:a.iconColor,strokeWidth:2}),n!==void 0&&n>0&&jsxRuntime.jsx(reactNative.View,{style:[Rt.badge,{backgroundColor:a.iconColor,borderRadius:s.badge.borderRadius}],children:jsxRuntime.jsx(reactNative.Text,{style:[Rt.badgeText,{fontFamily:r.semibold}],children:n>99?"99+":n})})]}),jsxRuntime.jsxs(reactNative.View,{style:Rt.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Rt.title,{color:a.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[Rt.subtitle,{color:a.subtitleColor,fontFamily:r.regular}],children:o})]})]})})}var Rt=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center",position:"relative"},badge:{position:"absolute",top:-4,right:-4,minWidth:18,height:18,alignItems:"center",justifyContent:"center",paddingHorizontal:4},badgeText:{color:"#FFFFFF",fontSize:10,fontWeight:"600"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"}});function Go({onPress:e,title:t,subtitle:o}){let{fonts:n,components:r}=W(),s=r.depositMenu.card;return jsxRuntime.jsxs(Le,{cardTokens:s,onPress:e,style:bt.wrapper,contentStyle:bt.container,children:[jsxRuntime.jsxs(reactNative.View,{style:bt.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[bt.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(lr,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:bt.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[bt.title,{color:s.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[bt.subtitle,{color:s.subtitleColor,fontFamily:n.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:bt.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:bt.badge,children:jsxRuntime.jsx(reactNative.Text,{style:[bt.badgeText,{fontFamily:n.regular}],children:"Stripe"})})})]})}var bt=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},badge:{paddingHorizontal:10,paddingVertical:4,borderRadius:6,backgroundColor:"#635BFF"},badgeText:{fontSize:12,fontWeight:"600",color:"#FFFFFF"}});var ti=1e4,oi=2500,ri=3e3,ni=6e4;function Yo(e){let{depositConfirmationMode:t,depositAddress:o,chain:n,externalUserId:r,publishableKey:s,modalOpenedAt:a,depositWalletId:d,depositExecutions:f,trackedExecutions:p,setDepositExecutions:l,setTrackedExecutions:h,setLatestExecution:x,setShowStatusSheet:P,onDepositSuccess:I,onExecutionsChange:C,onDepositError:u}=e,[m,g]=react.useState(false),[i,c]=react.useState(false);return react.useEffect(()=>{if(t!=="auto_ui"&&t!=="auto_silent"||!o)return;g(false),t==="auto_ui"&&c(false);let b=setTimeout(()=>{g(true),t==="auto_ui"&&c(true);},ti);return ()=>clearTimeout(b)},[t,o,n]),react.useEffect(()=>{if(!r||!a)return;let b=new Date(a.getTime()-ni),M=setInterval(async()=>{try{let Y=[...(await Ao(r,s)).data??[]].sort((A,U)=>{let K=A.created_at?new Date(A.created_at).getTime():0;return (U.created_at?new Date(U.created_at).getTime():0)-K}),J=null;for(let A of Y){let U=A.created_at?new Date(A.created_at):null;if(!U||U<=b)continue;let K=p.get(A.id);if(!K){J=A;break}if(["pending","waiting","delayed"].includes(K)&&A.status==="succeeded"){J=A;break}}if(J){let A=J;l(U=>{let K=U.findIndex(ee=>ee.id===A.id);if(K>=0){let ee=[...U];return ee[K]=A,ee}return [...U,A]}),h(U=>{let K=new Map(U);return K.set(A.id,A.status),K}),x(A),P(!0),A.status==="succeeded"&&I?.({message:"Deposit completed successfully",executionId:A.id}),C?.([...f,A]);}}catch(_){u?.({message:"Failed to check deposit status",error:_});}},oi);return ()=>clearInterval(M)},[r,s,a,p,f,C,I,u]),react.useEffect(()=>{if(!m||!d)return;let b=async()=>{try{await Hr(d,s);}catch{}};b();let M=setInterval(b,ri);return ()=>clearInterval(M)},[m,d,s]),{pollingEnabled:m,showWaitingUi:i,handleIveDeposited:()=>{g(true),c(true);}}}function _o({value:e,size:t=180,logoUri:o,logoSize:n=40,logoBackgroundColor:r}){let{colors:s,isDark:a}=W(),d=a?"#1a1a1a":"#ffffff",f=a?"#ffffff":"#000000",p=r||d;return jsxRuntime.jsxs(reactNative.View,{style:[si.container,{width:t,height:t}],children:[jsxRuntime.jsx(hs__default.default,{value:e||"placeholder",size:t,backgroundColor:d,color:f,ecl:"H",quietZone:4}),o&&jsxRuntime.jsx(reactNative.View,{style:[si.logoContainer,{width:n+12,height:n+12,backgroundColor:p,borderRadius:(n+12)/2}],children:jsxRuntime.jsx(Ht,{uri:o,width:n,height:n,borderRadius:n/2})})]})}var si=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center",position:"relative"},logoContainer:{position:"absolute",alignItems:"center",justifyContent:"center"}});function gr({size:e=56,strokeWidth:t=3,children:o,iconSize:n,style:r,gradientFrom:s,gradientTo:a}){let{colors:d}=W(),f=s??d.warning,p=a??"#FBBF24",l=react.useRef(new reactNative.Animated.Value(0)).current,h=react.useId(),x=react.useMemo(()=>`circularProgressGrad_${h.replace(/[^a-zA-Z0-9_-]/g,"")}`,[h]),P=(e-t)/2,I=2*Math.PI*P,C=e/2,u=n??Math.max(0,Math.round(e-t*2-8)),m=(e-u)/2;react.useEffect(()=>{let i=reactNative.Animated.loop(reactNative.Animated.timing(l,{toValue:1,duration:1500,easing:reactNative.Easing.linear,useNativeDriver:true}));return i.start(),()=>i.stop()},[l]);let g=l.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[{width:e,height:e},r],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,width:e,height:e,transform:[{rotate:g}]},children:jsxRuntime.jsxs(_e__default.default,{width:e,height:e,children:[jsxRuntime.jsx(_e.Defs,{children:jsxRuntime.jsxs(_e.LinearGradient,{id:x,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[jsxRuntime.jsx(_e.Stop,{offset:"0%",stopColor:f}),jsxRuntime.jsx(_e.Stop,{offset:"100%",stopColor:p})]})}),jsxRuntime.jsx(_e.Circle,{cx:C,cy:C,r:P,stroke:`url(#${x})`,strokeWidth:t,fill:"none",strokeDasharray:`${I*.75} ${I*.25}`,strokeLinecap:"round",rotation:-90,origin:`${C}, ${C}`})]})}),o!=null?jsxRuntime.jsx(reactNative.View,{style:{position:"absolute",top:m+1.5,left:m,width:u,height:u},children:o}):null]})}function ui(e){let t=e.split("/"),o=t[t.length-1];return o&&o.length>10?`${o.slice(0,6)}...${o.slice(-3)}`:o||""}function Ls(e){let o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=e.getDate(),r=e.getFullYear(),s=e.getHours(),a=e.getMinutes(),d=s>=12?"pm":"am";s=s%12,s=s||12;let f=a<10?`0${a}`:a;return `${o} ${n}, ${r} at ${s}:${f}${d}`}function Io({visible:e,status:t,tokenIconUrl:o,explorerUrl:n,completionExplorerUrl:r,date:s,amountUsd:a,onClose:d,borderTopLeftRadius:f,borderTopRightRadius:p}){let{colors:l,fonts:h,components:x}=W(),[P,I]=react.useState(false),C=t==="pending"||t==="waiting"||t==="delayed",u=t==="succeeded",m=()=>{n&&reactNative.Linking.openURL(n);},g=()=>{r&&reactNative.Linking.openURL(r);};return jsxRuntime.jsx(pe,{visible:e,onClose:d,closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:f,borderTopRightRadius:p,children:jsxRuntime.jsxs(reactNative.View,{style:he.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:he.closeButton,onPress:d,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Ge,{size:20,color:x.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:he.iconContainer,children:C?jsxRuntime.jsx(gr,{size:80,strokeWidth:4,iconSize:68,children:o?jsxRuntime.jsx(reactNative.Image,{source:{uri:$(o)},style:he.tokenIconFill}):jsxRuntime.jsx(reactNative.View,{style:[he.tokenIconFill,{backgroundColor:l.cardHover}]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o?jsxRuntime.jsx(reactNative.Image,{source:{uri:$(o)},style:he.tokenIconLarge}):jsxRuntime.jsx(reactNative.View,{style:[he.tokenIconLarge,{backgroundColor:l.cardHover}]}),jsxRuntime.jsx(reactNative.View,{style:[he.statusBadge,{backgroundColor:x.container.iconBackgroundColor}],children:jsxRuntime.jsx(We,{size:16,color:x.container.iconColor,strokeWidth:3})})]})}),jsxRuntime.jsx(reactNative.Text,{style:[he.title,{color:x.container.titleColor,fontFamily:h.semibold}],children:C?"Deposit Processing":"Deposit Complete"}),a!==void 0&&jsxRuntime.jsxs(reactNative.Text,{style:[he.amount,{color:x.container.titleColor,fontFamily:h.bold}],children:["$",a.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),s&&jsxRuntime.jsx(reactNative.Text,{style:[he.date,{color:x.container.subtitleColor,fontFamily:h.regular}],children:Ls(s)}),jsxRuntime.jsx(reactNative.Text,{style:[he.subtitle,{color:x.container.subtitleColor,fontFamily:h.regular}],children:C?"This usually takes less than a minute.":"Your account has been credited successfully!"}),u&&(n||r)&&jsxRuntime.jsxs(reactNative.View,{style:he.detailsSection,children:[jsxRuntime.jsx(reactNative.View,{style:[he.divider,{backgroundColor:l.border}]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:he.detailsToggle,onPress:()=>I(!P),children:[jsxRuntime.jsx(reactNative.Text,{style:[he.detailsToggleText,{color:x.container.actionTitle,fontFamily:h.medium}],children:P?"See less":"See more details"}),P?jsxRuntime.jsx(jt,{size:18,color:x.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(Ye,{size:18,color:x.container.actionColor,strokeWidth:2})]}),P&&jsxRuntime.jsxs(reactNative.View,{style:he.txButtonsContainer,children:[n&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[he.txButton,{backgroundColor:x.card.backgroundColor,borderColor:l.border}],onPress:m,children:[jsxRuntime.jsx(reactNative.Text,{style:[he.txLabel,{color:x.card.titleColor,fontFamily:h.medium}],children:"Deposit tx"}),jsxRuntime.jsx(reactNative.Text,{style:[he.txHash,{color:x.card.subtitleColor,fontFamily:h.regular}],children:ui(n)}),jsxRuntime.jsx(oo,{size:16,color:x.card.actionColor,strokeWidth:2})]}),r&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[he.txButton,{backgroundColor:x.card.backgroundColor,borderColor:l.border}],onPress:g,children:[jsxRuntime.jsx(reactNative.Text,{style:[he.txLabel,{color:x.card.titleColor,fontFamily:h.medium}],children:"Completion tx"}),jsxRuntime.jsx(reactNative.Text,{style:[he.txHash,{color:x.card.subtitleColor,fontFamily:h.regular}],children:ui(r)}),jsxRuntime.jsx(oo,{size:16,color:x.card.actionColor,strokeWidth:2})]})]})]})]})})}var he=reactNative.StyleSheet.create({container:{alignItems:"center",paddingHorizontal:24,paddingTop:40},closeButton:{position:"absolute",top:16,right:16,padding:4,zIndex:1},iconContainer:{position:"relative",marginBottom:16},tokenIcon:{width:64,height:64,borderRadius:32},tokenIconLarge:{width:68,height:68,borderRadius:34},tokenIconFill:{width:"100%",height:"100%",borderRadius:34},statusBadge:{position:"absolute",bottom:-2,right:-2,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center"},title:{fontSize:18,fontWeight:"600",marginBottom:4,textAlign:"center"},amount:{fontSize:28,fontWeight:"700",marginBottom:4,textAlign:"center"},date:{fontSize:13,textAlign:"center",marginBottom:12},detailsSection:{width:"100%",marginTop:16,paddingHorizontal:16},divider:{height:1,width:"100%",opacity:.15},detailsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingVertical:12},detailsToggleText:{fontSize:14,fontWeight:"500"},txButtonsContainer:{width:"100%",gap:10,marginTop:10},txButton:{flexDirection:"row",alignItems:"center",width:"100%",paddingVertical:12,paddingHorizontal:14,borderRadius:10,borderWidth:1,gap:8},txLabel:{fontSize:14,fontWeight:"500"},txHash:{fontSize:14,flex:1,textAlign:"right"},subtitle:{fontSize:14,textAlign:"center",lineHeight:20,paddingTop:8},buttonRow:{flexDirection:"row",gap:10,width:"100%"},button:{paddingVertical:14,paddingHorizontal:20,borderRadius:10,alignItems:"center",justifyContent:"center"},halfButton:{flex:1},successButton:{backgroundColor:"#22C55E"},buttonText:{color:"#fff",fontSize:14,fontWeight:"600"},hint:{fontSize:12,marginTop:12,textAlign:"center"}});function hr({depositConfirmationMode:e,depositAddress:t,showWaitingUi:o,latestExecution:n,onIveDeposited:r}){let{colors:s,fonts:a,components:d}=W();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="manual"&&t&&!o&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,activeOpacity:.8,style:[io.iveDepositedButton,{backgroundColor:s.primary,borderRadius:d.button.borderRadius,borderWidth:d.button.borderWidth,borderColor:d.button.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[io.iveDepositedButtonText,{color:s.primaryForeground??"#FFF",fontFamily:a.semibold}],children:"I've made the deposit"})}),o&&!n&&jsxRuntime.jsxs(reactNative.View,{style:[io.processingCard,{backgroundColor:d.card.backgroundColor,borderRadius:d.card.borderRadius,borderWidth:d.card.borderWidth,borderColor:d.card.borderColor,shadowColor:d.card.shadowOpacity>0?d.card.shadowColor:void 0,shadowOffset:d.card.shadowOpacity>0?d.card.shadowOffset:void 0,shadowOpacity:d.card.shadowOpacity,shadowRadius:d.card.shadowRadius,elevation:d.card.elevation}],children:[jsxRuntime.jsx(reactNative.View,{style:[io.detailIcon,{backgroundColor:d.card.iconBackgroundColor,borderRadius:d.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(tn,{size:14,color:d.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:io.processingCardText,children:[jsxRuntime.jsx(reactNative.Text,{style:[io.processingCardTitle,{color:d.card.titleColor,fontFamily:a.semibold}],children:"Processing deposit transactions."}),jsxRuntime.jsx(reactNative.Text,{style:[io.processingCardSubtitle,{color:d.card.subtitleColor,fontFamily:a.regular}],children:"We're checking if your deposit has landed."})]})]})]})}var io=reactNative.StyleSheet.create({iveDepositedButton:{paddingVertical:14,alignItems:"center",justifyContent:"center",marginBottom:12},iveDepositedButtonText:{fontSize:16},processingCard:{flexDirection:"row",alignItems:"center",padding:12,marginBottom:12,gap:12},processingCardText:{flex:1,gap:4},processingCardTitle:{fontSize:14},processingCardSubtitle:{fontSize:12,lineHeight:18},detailIcon:{width:24,height:24,alignItems:"center",justifyContent:"center"}});var Jo=(e,t)=>`${t}:${e}`,As=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function Cr({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:s,destinationTokenSymbol:a,defaultChainType:d,defaultChainId:f,defaultTokenAddress:p,depositConfirmationMode:l="auto_ui",onExecutionsChange:h,onDepositSuccess:x,onDepositError:P,borderTopLeftRadius:I,borderTopRightRadius:C,sheetBorderRadius:u}){let{colors:m,fonts:g,components:i}=W(),c=d&&f?`${d}:${f}`:"solana:mainnet",[R,b]=react.useState("USDC"),[M,_]=react.useState(c),[w,Y]=react.useState([]),[J,A]=react.useState(true),[U,K]=react.useState([]),[ee,je]=react.useState(true),[ut,Xe]=react.useState(false),[ne,Ie]=react.useState(false),[et,De]=react.useState(false),[Te,ze]=react.useState(false),[Ne,it]=react.useState([]),[Wt,Et]=react.useState(new Map),[Ot]=react.useState(()=>new Date),[pt,$e]=react.useState(null),[Tt,st]=react.useState(false),[ie,ve]=react.useState(null),[Pe,Me]=react.useState(false),qe=new Map;U.forEach(v=>{v.chains.forEach(F=>{let q=`${F.chain_type}:${F.chain_id}`;qe.has(q)||qe.set(q,F);});});let Ue=Array.from(qe.values()),Ze=As(M),Po=Ue.find(v=>v.chain_type===Ze.chainType&&v.chain_id===Ze.chainId)?.chain_type||"ethereum",At=Zt(w,Po),xe=At?.address||"",Be=react.useRef(false);react.useEffect(()=>{async function v(){try{je(!0),$e(null);let q=await zo(t,s&&r&&n?{destination_token_address:s,destination_chain_id:r,destination_chain_type:n}:void 0);if(K(q.data),q.data.length>0&&!Be.current){Be.current=!0;let H,we;if(d&&f)if(p)for(let ge of q.data){let gt=ge.chains.find(mt=>mt.chain_type===d&&mt.chain_id===f&&mt.token_address.toLowerCase()===p.toLowerCase());if(gt){H=ge,we=gt;break}}else for(let ge of q.data){let gt=ge.chains.find(mt=>mt.chain_type===d&&mt.chain_id===f);if(gt){H=ge,we=gt;break}}if(!H&&s)for(let ge of q.data){let gt=ge.chains.find(mt=>mt.token_address.toLowerCase()===s.toLowerCase());if(gt){H=ge,we=gt;break}}H||(H=q.data.find(ge=>ge.symbol==="USDC"),H&&H.chains.length>0&&(we=H.chains[0])),H||(H=q.data.find(ge=>ge.symbol==="USDT"),H&&H.chains.length>0&&(we=H.chains[0])),H||(H=q.data[0],H.chains.length>0&&(we=H.chains[0])),H&&b(H.symbol),we&&_(Jo(we.chain_id,we.chain_type));}}catch(F){console.error("Error fetching supported tokens:",F),$e("Failed to load supported tokens"),P?.({message:"Failed to load supported tokens",error:F});}finally{je(false);}}v();},[t,P,d,f,p,s,r,n]),react.useEffect(()=>{async function v(){try{A(!0),$e(null);let F=await Xt({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:s},t);Y(F.data);}catch(F){console.error("Error fetching wallets:",F),$e("Failed to load wallets"),P?.({message:"Failed to load wallets",error:F});}finally{A(false);}}v();},[e,o,n,r,s,t,P]);let Bo=At?.id??"",{showWaitingUi:uo,handleIveDeposited:po}=Yo({depositConfirmationMode:l,depositAddress:xe,chain:M,externalUserId:e,publishableKey:t,modalOpenedAt:Ot,depositWalletId:Bo,depositExecutions:Ne,trackedExecutions:Wt,setDepositExecutions:it,setTrackedExecutions:Et,setLatestExecution:ve,setShowStatusSheet:st,onDepositSuccess:x,onExecutionsChange:h,onDepositError:P});react.useEffect(()=>{if(!U.length)return;let v=U.find(q=>q.symbol===R);if(!v||v.chains.length===0)return;if(!v.chains.some(q=>Jo(q.chain_id,q.chain_type)===M)){let q=v.chains[0];_(Jo(q.chain_id,q.chain_type));}},[R,U,M]);let Ve=U.find(v=>v.symbol===R),Vo=Ve?.chains||[],Fe=Vo.find(v=>Jo(v.chain_id,v.chain_type)===M),fo=async()=>{if(xe)try{reactNative.Clipboard.setString(xe),Xe(!0),setTimeout(()=>Xe(!1),2e3);}catch(v){console.error("Failed to copy:",v);}},Kt=Fe?.estimated_price_impact_percent??0,ft=Fe?.max_slippage_percent??.25,Fo=Fe?.minimum_deposit_amount_usd??3;if(ee)return jsxRuntime.jsxs(reactNative.View,{style:y.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[y.loadingText,{color:m.foregroundMuted,fontFamily:g.regular}],children:"Loading currencies..."})]});if(pt&&U.length===0)return jsxRuntime.jsxs(reactNative.View,{style:y.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.errorText,{color:m.error,fontFamily:g.regular}],children:pt}),jsxRuntime.jsx(reactNative.Text,{style:[y.errorHint,{color:m.foregroundMuted,fontFamily:g.regular}],children:"Please check your network connection and try again."})]});let te=()=>jsxRuntime.jsxs(pe,{visible:et,onClose:()=>De(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:u?.tokenSelector?.borderTopLeftRadius??I,borderTopRightRadius:u?.tokenSelector?.borderTopRightRadius??C,children:[jsxRuntime.jsxs(reactNative.View,{style:[y.sheetHeader,{borderBottomColor:m.border}],children:[jsxRuntime.jsx(reactNative.View,{style:y.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[y.sheetTitle,{color:i.header.titleColor,fontFamily:g.medium}],children:"Select Token"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>De(false),style:y.sheetCloseButton,children:jsxRuntime.jsx(Ge,{size:20,color:i.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:y.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:U.map(v=>jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{b(v.symbol),De(false);},activeOpacity:.7,style:[y.sheetItem,{backgroundColor:R===v.symbol?i.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(v,"png"))},style:y.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:y.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.sheetItemTitle,{color:i.card.titleColor,fontFamily:g.medium}],children:v.symbol}),jsxRuntime.jsxs(reactNative.Text,{style:[y.sheetItemSubtitle,{color:i.card.subtitleColor,fontFamily:g.regular}],children:[v.chains.length," network",v.chains.length!==1?"s":""," available"]})]}),R===v.symbol&&jsxRuntime.jsx(We,{size:20,color:m.primary,strokeWidth:2})]},v.symbol))})]}),ke=()=>jsxRuntime.jsxs(pe,{visible:Te,onClose:()=>ze(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:u?.chainSelector?.borderTopLeftRadius??I,borderTopRightRadius:u?.chainSelector?.borderTopRightRadius??C,children:[jsxRuntime.jsxs(reactNative.View,{style:[y.sheetHeader,{borderBottomColor:m.border}],children:[jsxRuntime.jsx(reactNative.View,{style:y.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[y.sheetTitle,{color:i.header.titleColor,fontFamily:g.medium}],children:"Select Network"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ze(false),style:y.sheetCloseButton,children:jsxRuntime.jsx(Ge,{size:20,color:i.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:y.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:Vo.map(v=>{let F=Jo(v.chain_id,v.chain_type),q=M===F;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{_(F),ze(false);},activeOpacity:.7,style:[y.sheetItem,{backgroundColor:q?i.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(v,"png"))},style:y.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:y.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.sheetItemTitle,{color:i.card.titleColor,fontFamily:g.medium}],children:v.chain_name}),jsxRuntime.jsxs(reactNative.Text,{style:[y.sheetItemSubtitle,{color:i.card.subtitleColor,fontFamily:g.regular}],children:["Min deposit: $",v.minimum_deposit_amount_usd]})]}),q&&jsxRuntime.jsx(We,{size:20,color:m.primary,strokeWidth:2})]},F)})})]});return jsxRuntime.jsxs(reactNative.View,{style:y.container,children:[jsxRuntime.jsxs(reactNative.View,{style:y.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.selectorLabel,{color:i.card.labelColor,fontFamily:g.regular}],children:"Token"}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>De(true),style:[y.selector,{backgroundColor:i.card.backgroundColor,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[Ve&&jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(Ve,"png"))},style:y.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[y.selectorText,{color:i.card.titleColor,fontFamily:g.medium}],children:R}),jsxRuntime.jsx(Ye,{size:16,color:i.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(reactNative.View,{style:y.selectorSection,children:[jsxRuntime.jsxs(reactNative.Text,{style:[y.selectorLabel,{color:i.card.labelColor,fontFamily:g.regular}],children:["Network"," ",jsxRuntime.jsxs(reactNative.Text,{style:[y.minDeposit,{fontFamily:g.regular}],children:["($",Fo," min)"]})]}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ze(true),style:[y.selector,{backgroundColor:i.card.backgroundColor,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[Fe&&jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(Fe,"png"))},style:y.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[y.selectorText,{color:i.card.titleColor,fontFamily:g.medium}],numberOfLines:1,children:Fe?.chain_name||"Select network"}),jsxRuntime.jsx(Ye,{size:16,color:i.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:y.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[y.qrWrapper,{backgroundColor:m.background,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth>0?i.card.borderWidth:1,borderColor:i.card.borderColor}],children:J?jsxRuntime.jsxs(reactNative.View,{style:y.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[y.loadingText,{color:m.foregroundMuted,fontFamily:g.regular}],children:"Loading..."})]}):xe?jsxRuntime.jsx(_o,{value:xe,size:160,logoUri:$(de(Fe,"png")||He("/icons/networks/png/ethereum.png")),logoSize:40}):jsxRuntime.jsx(reactNative.View,{style:y.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[y.errorText,{color:m.error,fontFamily:g.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:y.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:y.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.addressLabel,{color:i.card.labelColor,fontFamily:g.medium}],children:"Deposit Address"}),ut&&jsxRuntime.jsxs(reactNative.View,{style:y.copiedIndicator,children:[jsxRuntime.jsx(We,{size:14,color:m.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[y.copiedText,{color:m.success,fontFamily:g.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(Le,{cardTokens:i.transferCrypto.depositAddress.card,onPress:!J&&xe?fo:void 0,contentStyle:y.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[y.addressText,{color:i.card.titleColor,fontFamily:g.regular}],numberOfLines:2,children:J?"Loading...":xe||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:y.addressCopyIcon,children:jsxRuntime.jsx(Ho,{size:16,color:i.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[y.detailsCard,{backgroundColor:i.card.backgroundColor,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ie(!ne),style:y.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:y.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[y.detailIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(to,{size:12,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[y.detailsLabel,{color:i.card.titleColor,fontFamily:g.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:y.chevronContainer,children:ne?jsxRuntime.jsx(jt,{size:16,color:i.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(Ye,{size:16,color:i.card.actionColor,strokeWidth:2})})]}),ne&&jsxRuntime.jsxs(reactNative.View,{style:y.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:y.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[y.detailIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(bo,{size:12,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[y.detailsLabel,{color:i.card.titleColor,fontFamily:g.regular}],children:["Price impact: ",Kt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ko,{size:14,color:i.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:y.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[y.detailIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wo,{size:12,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[y.detailsLabel,{color:i.card.titleColor,fontFamily:g.regular}],children:["Slippage: Auto \u2022 ",ft.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ko,{size:14,color:i.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:y.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[y.detailIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(ar,{size:12,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[y.detailsLabel,{color:i.card.titleColor,fontFamily:g.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(hr,{depositConfirmationMode:l,depositAddress:xe,showWaitingUi:uo,latestExecution:ie,onIveDeposited:po}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:y.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[y.termsText,{color:m.primary,fontFamily:g.regular}],children:"Terms apply"})}),te(),ke(),jsxRuntime.jsxs(pe,{visible:Pe,onClose:()=>Me(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:u?.infoSheet?.borderTopLeftRadius??I,borderTopRightRadius:u?.infoSheet?.borderTopRightRadius??C,children:[jsxRuntime.jsxs(reactNative.View,{style:[y.sheetHeader,{borderBottomColor:m.border}],children:[jsxRuntime.jsx(reactNative.View,{style:y.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[y.sheetTitle,{color:i.header.titleColor,fontFamily:g.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(false),style:y.sheetCloseButton,children:jsxRuntime.jsx(Ge,{size:20,color:i.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:y.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[y.infoCard,{backgroundColor:i.card.backgroundColor,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:y.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[y.infoCardIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(bo,{size:16,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[y.infoCardTitle,{color:i.card.titleColor,fontFamily:g.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[y.infoCardValue,{color:i.card.titleColor,fontFamily:g.medium}],children:[Kt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[y.infoCardDescription,{color:i.card.descriptionColor,fontFamily:g.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[y.infoCard,{backgroundColor:i.card.backgroundColor,borderRadius:i.card.borderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:y.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[y.infoCardIcon,{backgroundColor:i.card.iconBackgroundColor,borderRadius:i.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wo,{size:16,color:i.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[y.infoCardTitle,{color:i.card.titleColor,fontFamily:g.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[y.infoCardValue,{color:i.card.titleColor,fontFamily:g.medium}],children:[ft.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[y.infoCardDescription,{color:i.card.descriptionColor,fontFamily:g.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),ie&&jsxRuntime.jsx(Io,{visible:Tt,status:ie.status,tokenIconUrl:ie.destination_token_metadata?.icon_urls?.find(v=>v.format==="png")?.url||ie.destination_token_metadata?.icon_url||de(Ve,"png"),explorerUrl:ie.explorer_url,completionExplorerUrl:ie.destination_explorer_url,date:ie.created_at?new Date(ie.created_at):void 0,amountUsd:ie.source_amount_usd?parseFloat(ie.source_amount_usd):void 0,onClose:()=>st(false),borderTopLeftRadius:u?.depositStatus?.borderTopLeftRadius??I,borderTopRightRadius:u?.depositStatus?.borderTopRightRadius??C})]})}var y=reactNative.StyleSheet.create({container:{flex:1,padding:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:13,marginBottom:8},minDeposit:{fontSize:10},selector:{flexDirection:"row",alignItems:"center",gap:10,padding:12,borderRadius:12},selectorIcon:{width:24,height:24,borderRadius:12},selectorText:{flex:1,fontSize:14,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:16},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:13},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},spacer:{flex:1},termsContainer:{alignItems:"center"},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},sheetList:{maxHeight:400,paddingTop:8},sheetItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,marginHorizontal:8,borderRadius:12,gap:12},sheetItemIcon:{width:40,height:40,borderRadius:20},sheetItemText:{flex:1},sheetItemTitle:{fontSize:16,fontWeight:"500"},sheetItemSubtitle:{fontSize:12,marginTop:2},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});function br({currency:e,isSelected:t,onSelect:o}){let{colors:n,fonts:r,components:s}=W();return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>o(e.currency_code),activeOpacity:.7,style:[so.container,{backgroundColor:s.card.backgroundColor,borderRadius:s.list.rowBorderRadius,borderWidth:s.card.borderWidth,borderColor:s.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:so.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[so.iconContainer,{backgroundColor:n.background}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(e,"png"))},style:so.icon})}),jsxRuntime.jsxs(reactNative.View,{style:so.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[so.name,{color:s.card.titleColor,fontFamily:r.medium}],children:e.name}),jsxRuntime.jsx(reactNative.Text,{style:[so.code,{color:s.card.subtitleColor,fontFamily:r.regular}],children:e.currency_code.toUpperCase()})]})]}),t&&jsxRuntime.jsx(We,{size:16,color:n.primary,strokeWidth:2})]})}var so=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,marginHorizontal:8,marginVertical:4},leftContent:{flexDirection:"row",alignItems:"center",gap:12},iconContainer:{width:40,height:40,borderRadius:20,overflow:"hidden",alignItems:"center",justifyContent:"center"},icon:{width:40,height:40,borderRadius:20},textContainer:{gap:2},name:{fontSize:14,fontWeight:"400"},code:{fontSize:12,fontWeight:"300"}});function Xo({title:e,currencies:t,selectedCurrency:o,onSelect:n}){let{fonts:r,components:s}=W();return t.length===0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.View,{style:hi.headerContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[hi.title,{color:s.list.titleSectionColor,fontFamily:r.medium}],children:e})}),t.map(a=>jsxRuntime.jsx(br,{currency:a,isSelected:o.toLowerCase()===a.currency_code.toLowerCase(),onSelect:n},a.currency_code))]})}var hi=reactNative.StyleSheet.create({headerContainer:{paddingHorizontal:12,paddingBottom:8,paddingTop:4},title:{fontSize:14,fontWeight:"500"}});function wr({open:e,onOpenChange:t,currencies:o,preferredCurrencyCodes:n,selectedCurrency:r,onSelectCurrency:s,borderTopLeftRadius:a,borderTopRightRadius:d}){let{colors:f,fonts:p,components:l}=W(),[h,x]=react.useState(""),P=n.map(c=>o.find(R=>R.currency_code.toLowerCase()===c.toLowerCase())).filter(c=>c!==void 0),I=o.filter(c=>!n.includes(c.currency_code.toLowerCase())),C=c=>{if(!h)return c;let R=h.toLowerCase();return c.filter(b=>b.name.toLowerCase().includes(R)||b.currency_code.toLowerCase().includes(R))},u=C(P),m=C(I),g=c=>{s(c),t(false),x("");},i=()=>{t(false),x("");};return jsxRuntime.jsxs(pe,{visible:e,onClose:i,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:a,borderTopRightRadius:d,children:[jsxRuntime.jsx(rt,{title:"Currency",showBack:false,onClose:i}),jsxRuntime.jsx(reactNative.View,{style:ao.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[ao.searchInput,{backgroundColor:l.search.backgroundColor,color:l.search.inputColor,fontFamily:p.regular,borderRadius:l.input.borderRadius,borderWidth:l.input.borderWidth,borderColor:l.input.borderColor}],value:h,onChangeText:x,placeholder:"Search",placeholderTextColor:l.search.placeholderColor})}),jsxRuntime.jsx(reactNative.ScrollView,{style:ao.listContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsxs(reactNative.View,{style:ao.listContent,children:[jsxRuntime.jsx(Xo,{title:"Popular currencies",currencies:u,selectedCurrency:r,onSelect:g}),u.length>0&&m.length>0&&jsxRuntime.jsx(reactNative.View,{style:ao.sectionSpacer}),jsxRuntime.jsx(Xo,{title:"All currencies",currencies:m,selectedCurrency:r,onSelect:g}),u.length===0&&m.length===0&&jsxRuntime.jsx(reactNative.View,{style:ao.noResultsContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[ao.noResultsText,{color:l.container.subtitleColor,fontFamily:p.regular}],children:"No currencies found"})})]})})]})}var ao=reactNative.StyleSheet.create({searchContainer:{marginTop:8,paddingHorizontal:18,paddingBottom:12},searchInput:{padding:16,fontSize:14},listContainer:{flex:1,paddingHorizontal:12},listContent:{paddingBottom:24},sectionSpacer:{height:8},noResultsContainer:{paddingVertical:32,alignItems:"center"},noResultsText:{fontSize:14}});function Sn(e){try{return new Intl.NumberFormat("en",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(/\d/g,"").trim()}catch{return e.toUpperCase()}}function Sr({externalUserId:e,publishableKey:t,view:o,onViewChange:n,destinationTokenSymbol:r,recipientAddress:s,destinationChainType:a,destinationChainId:d,destinationTokenAddress:f,onDepositSuccess:p,onDepositError:l,borderTopLeftRadius:h,borderTopRightRadius:x,sheetBorderRadius:P}){let{colors:I,fonts:C,components:u}=W(),[m,g]=react.useState(""),[i,c]=react.useState("usd"),[R,b]=react.useState(false),[M,_]=react.useState(false),[w,Y]=react.useState([]),[J,A]=react.useState(false),[U,K]=react.useState(null),[ee,je]=react.useState(null),[ut,Xe]=react.useState("amount"),[ne,Ie]=react.useState(null),[et,De]=react.useState(true),[Te,ze]=react.useState(null),[Ne,it]=react.useState(false),Wt=react.useRef(null),Et=react.useRef(false);react.useEffect(()=>{Wt.current=ne;},[ne]),react.useEffect(()=>{Et.current=Ne;},[Ne]);let[Ot,pt]=react.useState([]),[$e,Tt]=react.useState(true),[st,ie]=react.useState(60),[ve,Pe]=react.useState([]),[Me,qe]=react.useState([]),[Ue,Ze]=react.useState(null),[ue,Po]=react.useState(null),[At,xe]=react.useState(true),[Be,Bo]=react.useState(null),[uo,po]=react.useState(false),[Ve,Vo]=react.useState(null),[Fe,fo]=react.useState(false),[Kt,ft]=react.useState(false),[Fo,te]=react.useState(false),[ke,v]=react.useState(null),F=o??ut,q=react.useRef(null),H=ve.find(L=>L.currency_code.toLowerCase()===i.toLowerCase()),we=react.useCallback(L=>{Xe(L),L==="quotes"?n?.(L,w.length):n?.(L);},[w.length,n]);react.useEffect(()=>{async function L(){try{let O=await Uo();Po(O);}catch(O){console.error("Error fetching user IP:",O);}finally{xe(false);}}L();},[]),react.useEffect(()=>{async function L(){try{let O=await Xt({external_user_id:e,recipient_address:s,destination_chain_type:a,destination_chain_id:d,destination_token_address:f},t);pt(O.data);}catch(O){console.error("Error fetching wallets:",O),K("Failed to load wallet addresses");}finally{Tt(false);}}L();},[e,s,a,d,f,t]);let ge=r||Ue?.symbol.toUpperCase()||"USDC",gt=ho(Ue?.icon_urls,"png")||Ue?.icon_url,mt=ho(Ue?.chain_icon_urls,"png")||Ue?.chain_icon_url;react.useEffect(()=>{async function L(){try{let O=await Qr(t);Pe(O.data),qe(O.preferred||[]);}catch(O){console.error("Error fetching fiat currencies:",O);}}L();},[t]),react.useEffect(()=>{if(R||ve.length===0||!ue?.alpha2)return;let L=ue.alpha2.toUpperCase(),O=ve.find(me=>me.country_codes.includes(L));if(O)c(O.currency_code.toLowerCase()),!m&&!M&&g(String(O.default_amount??100));else if(!m&&!M){let me=ve.find(ht=>ht.currency_code.toLowerCase()==="usd");me&&g(String(me.default_amount??100));}},[ve,ue,R,m,M]),react.useEffect(()=>{if(ve.length!==0){if(q.current!==null&&q.current!==i){let L=ve.find(O=>O.currency_code.toLowerCase()===i.toLowerCase());L&&g(String(L.default_amount??100));}q.current=i;}},[i,ve]),react.useEffect(()=>{async function L(){try{let O=await jr({chain_type:a||"",chain_id:d||"",token_address:f||""},t);Ze(O);}catch(O){console.error("Error fetching supported tokens:",O);}}L();},[a,d,f,t]),react.useEffect(()=>{async function L(){if(!(!f||!d||!a)&&!At){po(true);try{let O=await qr({country_code:ue?.alpha2?.toUpperCase()||"US",subdivision_code:ue?.state||void 0,token_address:f,chain_id:d,chain_type:a},t);Bo(O);}catch(O){console.error("Error fetching default onramp token:",O);}finally{po(false);}}}L();},[f,d,a,ue,At,t]),react.useEffect(()=>{let L=parseFloat(m);if(isNaN(L)||L<=0){Y([]),je(null);return}if(!Be||uo){Y([]),Ie(null);return}let O=ve.find(ht=>ht.currency_code.toLowerCase()===i.toLowerCase());if(O){if(L<O.minimum_amount){Y([]),Ie(null),je(`Minimum amount is ${Sn(i)}${O.minimum_amount.toLocaleString()}`);return}if(L>O.maximum_amount){Y([]),Ie(null),je(`Maximum amount is ${Sn(i)}${O.maximum_amount.toLocaleString()}`);return}}je(null);let me=setTimeout(()=>{En(L);},500);return ()=>clearTimeout(me)},[m,i,t,Be,uo,ve]);let En=async L=>{if(!Be){K("Loading token information...");return}A(true),K(null);try{let O={country_code:ue?.alpha2?.toUpperCase()||"US",source_amount:L.toString(),source_currency:i.toLowerCase(),destination_currency:Be.destination_currency,destination_network:Be.destination_network,subdivision_code:ue?.state||void 0},me=await Nr(O,t);Y(me.data);let ht=Et.current,On=Wt.current;if(ht&&On){let go=me.data.find(xt=>xt.service_provider===On.service_provider);if(go){if(Ie(go),me.data.length>0){let xt=me.data.reduce((zt,Wo)=>Wo.destination_amount>zt.destination_amount?Wo:zt);Te||ze(xt.service_provider),De(go.service_provider===Te);}}else if(me.data.length>0){let xt=me.data.reduce((zt,Wo)=>Wo.destination_amount>zt.destination_amount?Wo:zt);Ie(xt),ze(xt.service_provider),De(!0),it(!1);}}else if(me.data.length>0){let go=me.data.reduce((xt,zt)=>zt.destination_amount>xt.destination_amount?zt:xt);Ie(go),ze(go.service_provider),De(!0);}ie(60);}catch(O){console.error("Failed to fetch quotes:",O),K("Failed to fetch quotes. Please try again."),Y([]);}finally{A(false);}};react.useEffect(()=>{if(w.length===0)return;let L=setInterval(()=>{ie(O=>{if(O<=1){let me=parseFloat(m);return !isNaN(me)&&me>0&&En(me),60}return O-1});},1e3);return ()=>clearInterval(L)},[w.length,m]);let Hi=L=>{(/^\d*\.?\d{0,2}$/.test(L)||L==="")&&(g(L),_(true));},ji=L=>{g(L.toString()),_(true);},Ni=async()=>{if(ne&&Be)try{let L=Be.destination_token_metadata.chain_type,O=Zt(Ot,L);if(!O?.address){K("Wallet address not available");return}let me={service_provider:ne.service_provider,country_code:ne.country_code?.toUpperCase()||ue?.alpha2?.toUpperCase()||"US",source_currency:ne.source_currency,source_amount:m,destination_currency:ne.destination_currency,destination_network:ne.destination_network,wallet_address:O.address,subdivision_code:ue?.state||void 0},ht=await $r(me,t);Vo({provider:ne,sourceCurrency:i,sourceAmount:m,sessionUrl:ht.url}),v(ht.url),te(!0);}catch(L){console.error("Failed to create session:",L),K("Failed to start payment flow"),l?.({message:"Failed to start payment flow",error:L});}},Or=Sn(i),$i=()=>{te(false),we("onramp"),p?.({message:"Payment flow completed"});},qi=()=>jsxRuntime.jsx(Zs,{visible:Fo,onClose:$i,url:ke,providerName:ne?.service_provider_display_name||"Complete Payment",colors:I,fonts:C,borderTopLeftRadius:P?.webView?.borderTopLeftRadius??h,borderTopRightRadius:P?.webView?.borderTopRightRadius??x});return F==="amount"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:S.amountViewContainer,children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:S.scrollContainer,contentContainerStyle:S.scrollContent,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",bounces:false,children:[jsxRuntime.jsx(reactNative.View,{style:S.currencySelector,children:jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>fo(true),style:[S.currencyButton,{backgroundColor:u.card.backgroundColor,borderRadius:u.input.borderRadius,borderWidth:u.input.borderWidth,borderColor:u.input.borderColor}],children:[H&&jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(H,"png"))},style:S.currencyIcon}),jsxRuntime.jsx(reactNative.Text,{style:[S.currencyText,{color:u.card.titleColor,fontFamily:C.medium}],children:i.toUpperCase()}),jsxRuntime.jsx(Ye,{size:16,color:u.card.actionColor,strokeWidth:2})]})}),jsxRuntime.jsx(wr,{open:Fe,onOpenChange:fo,currencies:ve,preferredCurrencyCodes:Me,selectedCurrency:i,onSelectCurrency:L=>{c(L.toLowerCase()),b(true);},borderTopLeftRadius:P?.currencyModal?.borderTopLeftRadius??h,borderTopRightRadius:P?.currencyModal?.borderTopRightRadius??x}),jsxRuntime.jsx(reactNative.View,{style:S.amountContainer,children:jsxRuntime.jsxs(reactNative.View,{style:S.amountInputRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[S.currencySymbol,{color:u.container.titleColor,fontFamily:C.medium}],children:Or}),jsxRuntime.jsx(reactNative.TextInput,{style:[S.amountInput,{color:u.container.titleColor,fontFamily:C.medium}],value:m,onChangeText:Hi,keyboardType:"decimal-pad",placeholder:"0",placeholderTextColor:I.foregroundMuted})]})}),H?.suggested_amounts&&H.suggested_amounts.length>0&&jsxRuntime.jsx(reactNative.View,{style:S.quickAmounts,children:H.suggested_amounts.map(L=>jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ji(L),style:[S.quickAmountButton,{backgroundColor:u.card.backgroundColor,borderRadius:u.button.borderRadius,borderWidth:parseFloat(m)===L?2:u.button.borderWidth,borderColor:parseFloat(m)===L?I.primary:u.button.borderColor}],children:jsxRuntime.jsxs(reactNative.Text,{style:[S.quickAmountText,{color:u.card.titleColor,fontFamily:C.medium}],children:[Or,L.toLocaleString()]})},L))}),ee&&jsxRuntime.jsx(reactNative.Text,{style:[S.validationError,{color:I.error,fontFamily:C.regular}],children:ee}),jsxRuntime.jsxs(reactNative.View,{style:S.providerSection,children:[jsxRuntime.jsxs(reactNative.View,{style:S.providerHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[S.providerLabel,{color:u.card.labelColor,fontFamily:C.medium}],children:"Provider"}),w.length>0&&!J&&jsxRuntime.jsxs(reactNative.Text,{style:[S.refreshText,{color:u.card.labelRightColor,fontFamily:C.regular}],children:["Refreshing in ",st,"s"]})]}),jsxRuntime.jsx(Le,{cardTokens:u.depositCard.quoteProvider.card,onPress:J||w.length===0?void 0:()=>ft(true),contentStyle:reactNative.StyleSheet.flatten([S.providerButton,(J||w.length===0)&&S.disabled]),children:J?jsxRuntime.jsxs(reactNative.View,{style:S.providerLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:u.container.subtitleColor}),jsxRuntime.jsx(reactNative.Text,{style:[S.loadingText,{color:u.container.subtitleColor,fontFamily:C.regular}],children:"Finding best rates..."})]}):ne?jsxRuntime.jsxs(reactNative.View,{style:S.providerContent,children:[jsxRuntime.jsxs(reactNative.View,{style:S.providerInfo,children:[et&&jsxRuntime.jsx(reactNative.Text,{style:[S.autoPickedText,{color:u.container.subtitleColor,fontFamily:C.regular}],children:"Auto-picked for you"}),jsxRuntime.jsxs(reactNative.View,{style:S.providerRow,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(nr(ne.icon_urls,"png",ne.icon_url))},style:S.providerIconImage},`provider-${ne.service_provider}`),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[S.providerName,{color:u.card.titleColor,fontFamily:C.medium}],children:ne.service_provider_display_name}),jsxRuntime.jsxs(reactNative.Text,{style:[S.bestPriceText,{color:I.success,fontFamily:C.regular}],children:["Best price \u2022 ",ne.destination_amount.toFixed(2)," ","USDC"]})]})]})]}),jsxRuntime.jsx(St,{size:20,color:u.card.actionColor,strokeWidth:2})]}):jsxRuntime.jsx(reactNative.Text,{style:[S.noProviderText,{color:u.container.subtitleColor,fontFamily:C.regular}],children:parseFloat(m)>0?"No providers available":"Enter an amount to see providers"})}),U&&jsxRuntime.jsx(reactNative.Text,{style:[S.errorText,{color:I.error,fontFamily:C.regular}],children:U})]}),jsxRuntime.jsxs(pe,{visible:Kt,onClose:()=>ft(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:P?.providerModal?.borderTopLeftRadius??h,borderTopRightRadius:P?.providerModal?.borderTopRightRadius??x,children:[jsxRuntime.jsx(rt,{title:"Select Provider",showBack:false,onClose:()=>ft(false)}),jsxRuntime.jsx(reactNative.ScrollView,{style:S.providerModalList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsx(reactNative.View,{style:S.quotesList,children:[...w].sort((L,O)=>O.destination_amount-L.destination_amount).map((L,O)=>{let me=ne?.service_provider===L.service_provider,ht=O===0;return jsxRuntime.jsxs(Le,{cardTokens:u.depositCard.quoteProvider.card,onPress:()=>{Ie(L),it(true),De(L.service_provider===Te),ft(false);},contentStyle:reactNative.StyleSheet.flatten([S.quoteItem,me&&{borderWidth:2,borderColor:I.primary}]),children:[jsxRuntime.jsxs(reactNative.View,{style:S.quoteLeft,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(nr(L.icon_urls,"png",L.icon_url))},style:S.providerIconImage}),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[S.quoteName,{color:u.card.titleColor,fontFamily:C.medium}],children:L.service_provider_display_name}),ht&&jsxRuntime.jsx(reactNative.Text,{style:[S.bestPriceLabel,{color:I.success,fontFamily:C.regular}],children:"\u2713 Best price"})]})]}),jsxRuntime.jsxs(reactNative.View,{style:S.quoteRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[S.quoteAmount,{color:u.card.textRightColor,fontFamily:C.medium}],children:[L.destination_amount.toFixed(2)," USDC"]}),jsxRuntime.jsxs(reactNative.Text,{style:[S.quoteSource,{color:u.card.subtextRightColor,fontFamily:C.regular}],children:["Fee: ",Or,L.total_fee.toFixed(2)]})]})]},L.service_provider)})})})]})]}),jsxRuntime.jsx(reactNative.View,{style:[S.continueButtonContainer,{backgroundColor:I.background}],children:jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:Ni,disabled:J||$e||!ne||parseFloat(m)<=0,style:[S.continueButton,{backgroundColor:u.container.buttonColor,borderRadius:u.button.borderRadius,borderWidth:u.button.borderWidth,borderColor:u.button.borderColor},(J||$e||!ne)&&S.disabledButton],children:jsxRuntime.jsx(reactNative.Text,{style:[S.continueButtonText,{color:u.container.buttonTitleColor,fontFamily:C.medium}],children:$e?"Loading...":"Continue"})})})]}),qi()]}):F==="onramp"&&Ve?jsxRuntime.jsxs(reactNative.View,{style:S.onrampContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(nr(Ve.provider.icon_urls,"png",Ve.provider.icon_url))},style:S.onrampProviderIcon}),jsxRuntime.jsxs(reactNative.Text,{style:[S.onrampTitle,{color:u.container.titleColor,fontFamily:C.medium}],children:["Complete transaction with ",Ve.provider.service_provider_display_name]}),jsxRuntime.jsx(reactNative.Text,{style:[S.onrampSubtitle,{color:u.container.subtitleColor,fontFamily:C.regular}],children:"You can close this modal."}),jsxRuntime.jsxs(reactNative.View,{style:[S.flowDiagram,{backgroundColor:u.card.backgroundColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:S.flowStep,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:He(`/icons/currencies/png/${Ve.sourceCurrency.toLowerCase()}.png`)},style:S.flowIconImage}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowLabel,{color:u.card.subtitleColor,fontFamily:C.regular}],children:"You use"}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowValue,{color:u.card.titleColor,fontFamily:C.medium}],children:Ve.sourceCurrency.toUpperCase()})]}),jsxRuntime.jsx(St,{size:16,color:u.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:S.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:S.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:ho(Be?.destination_token_metadata?.icon_urls,"png")||Be?.destination_token_metadata?.icon_url||He("/icons/tokens/png/usdc.png")},style:S.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:ho(Be?.destination_token_metadata?.chain?.icon_urls,"png")||Be?.destination_token_metadata?.chain?.icon_url||He("/icons/networks/png/polygon.png")},style:[S.flowNetworkBadge,{borderColor:I.background,borderRadius:u.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowLabel,{color:u.card.subtitleColor,fontFamily:C.regular}],children:"You buy"}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowValue,{color:u.card.titleColor,fontFamily:C.medium}],children:"USDC"})]}),jsxRuntime.jsx(St,{size:16,color:u.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:S.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:S.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:gt||He("/icons/tokens/png/usdc.png")},style:S.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:mt||He("/icons/networks/png/polygon.png")},style:[S.flowNetworkBadge,{borderColor:I.background,borderRadius:u.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowLabel,{color:u.card.subtitleColor,fontFamily:C.regular}],children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:[S.flowValue,{color:u.card.titleColor,fontFamily:C.medium}],children:ge})]})]}),jsxRuntime.jsx(reactNative.View,{style:[S.onrampInfoBox,{backgroundColor:u.card.backgroundColor,borderRadius:u.card.borderRadius,borderWidth:u.card.borderWidth,borderColor:u.card.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[S.onrampInfoText,{color:u.card.descriptionColor,fontFamily:C.regular}],children:"The wallet address displayed in the payment provider is a temporary deposit address. Your funds will be automatically converted and deposited into your account."})})]}):null}function Zs({visible:e,onClose:t,url:o,providerName:n,colors:r,fonts:s,borderTopLeftRadius:a,borderTopRightRadius:d}){return jsxRuntime.jsxs(pe,{visible:e,onClose:t,closeOnBackdropPress:false,showHandle:false,heightPercent:.92,noPadding:true,borderTopLeftRadius:a,borderTopRightRadius:d,children:[jsxRuntime.jsxs(reactNative.View,{style:lo.header,children:[jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:lo.headerButton,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(We,{size:20,color:r.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[lo.headerTitle,{color:r.foreground,fontFamily:s.medium}],children:n}),jsxRuntime.jsx(reactNative.View,{style:lo.headerSpacer})]}),o&&jsxRuntime.jsx(reactNative.View,{style:lo.container,children:jsxRuntime.jsx(reactNativeWebview.WebView,{source:{uri:o},style:lo.webView,startInLoadingState:true,renderLoading:()=>jsxRuntime.jsx(reactNative.View,{style:lo.loading,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:r.primary})})})})]})}var lo=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},headerButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},headerSpacer:{width:28,height:28},container:{flex:1},webView:{flex:1},loading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"}}),S=reactNative.StyleSheet.create({amountViewContainer:{flex:1},scrollContainer:{flex:1},scrollContent:{padding:16,paddingBottom:16},currencySelector:{alignItems:"center",marginBottom:16},currencyButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8},currencyText:{fontSize:14,fontWeight:"500"},currencyIcon:{width:24,height:24,borderRadius:12},amountContainer:{alignItems:"center",marginBottom:24},amountInputRow:{flexDirection:"row",alignItems:"center",marginBottom:8},currencySymbol:{fontSize:48,fontWeight:"300"},amountInput:{fontSize:48,fontWeight:"300",minWidth:50},usdcPreview:{fontSize:14},quickAmounts:{flexDirection:"row",justifyContent:"center",gap:12,marginBottom:24},quickAmountButton:{paddingHorizontal:20,paddingVertical:10},quickAmountText:{fontSize:14,fontWeight:"500"},validationError:{fontSize:12,textAlign:"center",marginTop:12,paddingHorizontal:16},providerSection:{marginBottom:24},providerHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},providerLabel:{fontSize:12,fontWeight:"500"},refreshText:{fontSize:10},providerButton:{padding:16},disabled:{opacity:.5},providerLoading:{flexDirection:"row",alignItems:"center",gap:12},loadingText:{fontSize:14},providerContent:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},providerInfo:{flex:1},autoPickedText:{fontSize:12,marginBottom:6},providerRow:{flexDirection:"row",alignItems:"center",gap:12},providerIcon:{width:32,height:32,borderRadius:16},providerIconPlaceholder:{width:32,height:32,borderRadius:8},providerIconImage:{width:32,height:32,borderRadius:8},providerName:{fontSize:14,fontWeight:"500"},bestPriceText:{fontSize:11,marginTop:2},noProviderText:{fontSize:14,textAlign:"center"},errorText:{fontSize:12,marginTop:8},continueButtonContainer:{padding:16,paddingBottom:24},continueButton:{paddingVertical:16,alignItems:"center"},disabledButton:{opacity:.5},continueButtonText:{fontSize:16,fontWeight:"600"},webViewHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},webViewHeaderButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},webViewHeaderTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},webViewHeaderSpacer:{width:28,height:28},webViewContainer:{flex:1},webView:{flex:1},webViewLoading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},providerModalList:{height:468,paddingHorizontal:12,marginTop:8},quotesList:{gap:8,paddingBottom:24,minHeight:468},quoteItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:12},quoteLeft:{flexDirection:"row",alignItems:"center",gap:12},quoteIcon:{width:40,height:40,borderRadius:20},quoteName:{fontSize:14,fontWeight:"500"},bestPriceLabel:{fontSize:11,marginTop:2},quoteRight:{alignItems:"flex-end"},quoteAmount:{fontSize:14,fontWeight:"500"},quoteSource:{fontSize:12},onrampContainer:{flex:1,padding:16,alignItems:"center",paddingTop:24},onrampProviderIcon:{width:64,height:64,borderRadius:16},onrampTitle:{fontSize:18,fontWeight:"600",textAlign:"center",marginTop:20,marginBottom:8,paddingHorizontal:16},onrampSubtitle:{fontSize:14,textAlign:"center",marginBottom:24},flowDiagram:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:20,paddingHorizontal:24,borderRadius:12,width:"100%"},flowIconWithBadge:{position:"relative",width:24,height:24,marginBottom:4},flowIconImageNoBadge:{width:24,height:24,borderRadius:12},flowNetworkBadge:{position:"absolute",bottom:-4,right:-6,width:14,height:14,borderWidth:2},onrampInfoBox:{marginTop:16,padding:16,width:"100%"},onrampInfoText:{fontSize:13,lineHeight:20},flowStep:{alignItems:"center"},flowIcon:{width:28,height:28,borderRadius:14,marginBottom:4},flowIconImage:{width:24,height:24,borderRadius:12,marginBottom:4},flowLabel:{fontSize:10},flowValue:{fontSize:14,fontWeight:"500"}});function ra(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function na(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}function Ir({execution:e,onPress:t}){let {colors:o,fonts:n,components:r}=W(),s=r.depositTracker.executionRow.card,a=e.status==="pending"||e.status==="waiting"||e.status==="delayed";e.status==="succeeded";let f=$(de(e.destination_token_metadata,"png")||He("/icons/tokens/png/usdc.png")),p=a?"Deposit Processing":"Deposit Completed",l=ra(e.created_at||new Date().toISOString()),h=na(e.source_amount_usd);return jsxRuntime.jsxs(Le,{cardTokens:s,onPress:t,contentStyle:Dt.container,children:[jsxRuntime.jsxs(reactNative.View,{style:Dt.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:f},style:Dt.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[Dt.statusBadge,{backgroundColor:a?o.warning:o.success,borderColor:s.backgroundColor}],children:a?jsxRuntime.jsx(Gn,{size:12,color:"#FFFFFF",strokeWidth:2.5}):jsxRuntime.jsx(We,{size:12,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:Dt.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Dt.title,{color:s.titleColor,fontFamily:n.medium}],children:p}),jsxRuntime.jsx(reactNative.Text,{style:[Dt.dateTime,{color:s.subtitleColor,fontFamily:n.regular}],children:l})]}),jsxRuntime.jsxs(reactNative.View,{style:Dt.rightContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[Dt.amount,{color:s.textRightColor,fontFamily:n.medium}],children:h}),jsxRuntime.jsx(St,{size:20,color:s.actionColor,strokeWidth:2})]})]})}var Dt=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:12},iconContainer:{position:"relative",marginRight:12},tokenIcon:{width:40,height:40,borderRadius:20},statusBadge:{position:"absolute",bottom:-4,right:-4,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center",borderWidth:2},textContainer:{flex:1,gap:2},title:{fontSize:16,fontWeight:"500"},dateTime:{fontSize:13},rightContainer:{flexDirection:"row",alignItems:"center",gap:8},amount:{fontSize:16,fontWeight:"500"}});function Ti(e,t){let o={solana:"Solana",ethereum:"Ethereum",bitcoin:"Bitcoin"};return e==="ethereum"?{1:"Ethereum",137:"Polygon",8453:"Base",42161:"Arbitrum",10:"Optimism"}[t]||o[e]||e:o[e]||e}function xi(e,t=6){if(!e)return "\u2014";try{let o=Number(e)/Math.pow(10,t);return o===0?"0.00":o>=1?o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:8,minimumSignificantDigits:2,maximumSignificantDigits:6})}catch{return "0.00"}}function da(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}var Si=e=>!e||e.length<12?e:`${e.slice(0,12)}...${e.slice(-4)}`;function _i(e){if(!e)return "";let t=e.indexOf(".");return t===-1?e.toUpperCase():e.slice(0,t).toUpperCase()+e.slice(t)}function ca(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function Lr({visible:e,onClose:t,executions:o,externalUserId:n,publishableKey:r,borderTopLeftRadius:s,borderTopRightRadius:a}){let{height:d}=reactNative.useWindowDimensions(),{colors:f,fonts:p,components:l}=W(),[h,x]=react.useState(o),[P,I]=react.useState(false),[C,u]=react.useState(null),[m,g]=react.useState(false),i=react.useRef(null);react.useEffect(()=>{if(!e||!n)return;let w=async()=>{I(true);try{let A=[...(await Ao(n,r)).data].sort((U,K)=>{let ee=U.created_at?new Date(U.created_at).getTime():0;return (K.created_at?new Date(K.created_at).getTime():0)-ee});x(A);}catch(J){console.error("Failed to fetch executions:",J),x(o);}finally{I(false);}};w();let Y=setInterval(w,1e4);return ()=>clearInterval(Y)},[e,n,r,o]),react.useEffect(()=>{o.length>0&&x(w=>{let Y=new Set(w.map(A=>A.id)),J=o.filter(A=>!Y.has(A.id));return J.length>0?[...J,...w]:w});},[o]),react.useEffect(()=>{e||u(null);},[e]);let c=w=>{u(w);},R=()=>{u(null),g(false);},b=()=>{u(null),t();};return jsxRuntime.jsxs(pe,{visible:e,onClose:b,closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:s,borderTopRightRadius:a,children:[jsxRuntime.jsx(rt,{title:C?"Deposit Details":"Deposit Tracker",onClose:b,showClose:!C,showBack:!!C,onBack:R}),C?(()=>{if(!C)return null;let w=C,Y=w.status==="pending"||w.status==="waiting"||w.status==="delayed",J=w.status==="succeeded",A=$(de(w.destination_token_metadata,"png")||He("/icons/tokens/png/usdc.png")),U=w.provider_metadata?.details,K=U?.currencyIn,ee=U?.currencyOut;K?.currency?.symbol||"USDC";ee?.currency?.symbol||"USDC";let Xe=xi(w.source_amount_base_unit,w.source_token_metadata?.decimals),ne=xi(w.destination_amount_base_unit,w.destination_token_metadata?.decimals),Ie=da(w.source_amount_usd),et=Ti(w.source_chain_type,w.source_chain_id),De=Ti(w.destination_chain_type,w.destination_chain_id),Te=()=>{w.explorer_url&&reactNative.Linking.openURL(w.explorer_url);},ze=()=>{w.destination_explorer_url&&reactNative.Linking.openURL(w.destination_explorer_url);};return jsxRuntime.jsxs(reactNative.ScrollView,{ref:i,style:[E.scrollContainer,{maxHeight:d*.7}],contentContainerStyle:E.detailsContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsxs(reactNative.View,{style:E.iconSection,children:[jsxRuntime.jsxs(reactNative.View,{style:E.iconWrapper,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:A},style:E.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[E.statusBadge,{backgroundColor:Y?f.warning:f.success,borderColor:f.background}],children:Y?jsxRuntime.jsx(Ye,{size:14,color:"#FFFFFF",strokeWidth:2}):jsxRuntime.jsx(We,{size:14,color:"#FFFFFF",strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:E.statusRow,children:[jsxRuntime.jsx(reactNative.View,{style:[E.statusDot,{backgroundColor:Y?f.warning:f.success}]}),jsxRuntime.jsx(reactNative.Text,{style:[E.statusText,{color:l.container.titleColor,fontFamily:p.semibold}],children:Y?"Processing":"Completed"})]}),jsxRuntime.jsx(reactNative.Text,{style:[E.dateText,{color:l.container.subtitleColor,fontFamily:p.regular}],children:ca(w.created_at||new Date().toISOString())})]}),jsxRuntime.jsxs(reactNative.View,{style:[E.card,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Amount Sent"}),jsxRuntime.jsxs(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:[Xe," ",_i(w.source_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[E.cardDivider,{backgroundColor:f.border}]}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Amount Received"}),jsxRuntime.jsxs(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:[ne," ",_i(w.destination_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[E.cardDivider,{backgroundColor:f.border}]}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"USD Value"}),jsxRuntime.jsx(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:Ie})]}),jsxRuntime.jsx(reactNative.View,{style:[E.cardDivider,{backgroundColor:f.border}]}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Source Network"}),jsxRuntime.jsx(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:et})]}),jsxRuntime.jsx(reactNative.View,{style:[E.cardDivider,{backgroundColor:f.border}]}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Destination Network"}),jsxRuntime.jsx(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:De})]})]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:()=>{let Ne=!m;g(Ne),Ne?setTimeout(()=>{i.current?.scrollToEnd({animated:true});},100):i.current?.scrollTo({y:0,animated:true});},style:E.toggleButton,activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.toggleText,{color:l.container.actionTitle,fontFamily:p.regular}],children:m?"See less":"See more details"}),m?jsxRuntime.jsx(jt,{size:14,color:l.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(Ye,{size:14,color:l.container.actionColor,strokeWidth:2})]}),m&&jsxRuntime.jsxs(reactNative.View,{style:[E.card,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[w.explorer_url&&jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:Te,style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Deposit Tx"}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:Si(w.transaction_hash)}),jsxRuntime.jsx(oo,{size:14,color:l.card.actionIcon,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:[E.cardDivider,{backgroundColor:f.border}]})]}),w.destination_explorer_url&&J&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:ze,style:E.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardLabel,{color:l.card.rowLeftLabel,fontFamily:p.regular}],children:"Completion Tx"}),jsxRuntime.jsxs(reactNative.View,{style:E.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.cardValue,{color:l.card.rowRightLabel,fontFamily:p.medium}],children:Si(w.destination_transaction_hashes[0])}),jsxRuntime.jsx(oo,{size:14,color:l.card.actionIcon,strokeWidth:2})]})]})]})]})})():jsxRuntime.jsx(reactNative.ScrollView,{style:[E.scrollContainer,{maxHeight:d*.7}],contentContainerStyle:E.scrollContent,showsVerticalScrollIndicator:false,children:h.length===0?jsxRuntime.jsxs(reactNative.View,{style:E.emptyContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[E.emptyText,{color:l.container.titleColor,fontFamily:p.medium}],children:"No deposits yet"}),jsxRuntime.jsx(reactNative.Text,{style:[E.emptySubtext,{color:l.container.subtitleColor,fontFamily:p.regular}],children:"Your deposit history will appear here"})]}):jsxRuntime.jsx(reactNative.View,{style:E.executionsList,children:h.map(w=>jsxRuntime.jsx(Ir,{execution:w,onPress:()=>c(w)},w.id))})})]})}var E=reactNative.StyleSheet.create({scrollContainer:{paddingTop:16},scrollContent:{paddingHorizontal:16,paddingBottom:16},emptyContainer:{paddingVertical:40,paddingHorizontal:16,alignItems:"center"},emptyText:{fontSize:14,marginBottom:4},emptySubtext:{fontSize:12},executionsList:{paddingTop:8,gap:12},detailsContent:{paddingHorizontal:16,paddingBottom:32},iconSection:{alignItems:"center",marginBottom:24},iconWrapper:{position:"relative",marginBottom:12},tokenIcon:{width:72,height:72,borderRadius:36},statusBadge:{position:"absolute",bottom:0,right:0,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center",borderWidth:3},statusRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},statusDot:{width:8,height:8,borderRadius:4},statusText:{fontSize:16,fontWeight:"600"},dateText:{fontSize:14},card:{borderRadius:12,marginBottom:12,overflow:"hidden"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},cardRowRight:{flexDirection:"row",alignItems:"center",gap:8},cardDivider:{height:1,marginHorizontal:16},cardLabel:{fontSize:14},cardValue:{fontSize:14,fontWeight:"500"},toggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:4},toggleText:{fontSize:14},buttonSection:{marginTop:12,gap:10},actionButton:{flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:16,borderRadius:12},buttonIconLeft:{marginRight:12},buttonIconRight:{marginLeft:12},buttonText:{color:"#FFFFFF",fontSize:14,fontWeight:"600",flex:1,textAlign:"left"},hintText:{fontSize:12,textAlign:"center",marginTop:8}});function Zo(e,t=true){let[o,n]=react.useState(null),[r,s]=react.useState(null),[a,d]=react.useState(false),[f,p]=react.useState(false),[l,h]=react.useState(null),[x,P]=react.useState(null);react.useEffect(()=>{!t||o||(d(true),Uo().then(m=>{n(m),h(null);}).catch(m=>{h(m instanceof Error?m:new Error(String(m)));}).finally(()=>{d(false);}));},[t,o]),react.useEffect(()=>{!t||!e||r||(p(true),Mo(e).then(m=>{s(m),P(null);}).catch(m=>{P(m instanceof Error?m:new Error(String(m)));}).finally(()=>{p(false);}));},[t,e,r]);let I=a||f,C=l||x||null,u=null;if(o&&r){let m=r.blocked_country_codes||[],g=o.alpha2.toUpperCase();u=!m.some(i=>i.toUpperCase()===g);}return {isAllowed:u,alpha2:o?.alpha2?.toLowerCase()??null,country:o?.country??null,isLoading:I,error:C}}var Dn="unifold_recent_tokens",fa=5,Di=[{symbol:"ETH",chainType:"ethereum",chainId:"1"},{symbol:"SOL",chainType:"solana",chainId:"mainnet"},{symbol:"USDC",chainType:"solana",chainId:"mainnet"},{symbol:"POL",chainType:"ethereum",chainId:"137"},{symbol:"BNB",chainType:"ethereum",chainId:"56"},{symbol:"BTC",chainType:"bitcoin",chainId:"mainnet"}];async function Br(){try{let e=await Ln__default.default.getItem(Dn);return e?JSON.parse(e):[]}catch{return []}}async function ga(e){try{let o=(await Br()).filter(r=>!(r.symbol===e.symbol&&r.chainType===e.chainType&&r.chainId===e.chainId));o.unshift(e);let n=o.slice(0,fa);await Ln__default.default.setItem(Dn,JSON.stringify(n));}catch{}}async function ma(e){try{let o=(await Br()).filter(n=>!(n.symbol===e.symbol&&n.chainType===e.chainType&&n.chainId===e.chainId));return await Ln__default.default.setItem(Dn,JSON.stringify(o)),o}catch{return []}}function Pn({visible:e,onClose:t,tokens:o,selectedToken:n,selectedChainKey:r,onSelect:s,borderTopLeftRadius:a,borderTopRightRadius:d}){let{colors:f,fonts:p,components:l}=W(),[h,x]=react.useState(""),[P,I]=react.useState([]);react.useEffect(()=>{e&&Br().then(I);},[e]),react.useEffect(()=>{e||x("");},[e]);let C=react.useMemo(()=>{let R=[];return o.forEach(b=>{b.chains.forEach(M=>{R.push({token:b,chain:M});});}),R},[o]),u=react.useMemo(()=>{let R=[],b=new Set,M=(_,w,Y,J)=>{let A=`${_}-${w}:${Y}`;if(b.has(A))return;let U=o.find(ee=>ee.symbol===_);if(!U)return;let K=U.chains.find(ee=>ee.chain_type===w&&ee.chain_id===Y);K&&(b.add(A),R.push({token:U,chain:K,isRecent:J}));};return P.forEach(_=>{M(_.symbol,_.chainType,_.chainId,true);}),Di.forEach(_=>{M(_.symbol,_.chainType,_.chainId,false);}),R},[o,P]),m=react.useMemo(()=>{if(!h.trim())return C;let R=h.toLowerCase();return C.filter(({token:b,chain:M})=>b.symbol.toLowerCase().includes(R)||b.name.toLowerCase().includes(R)||M.chain_name.toLowerCase().includes(R))},[C,h]),g=(R,b,M)=>Di.some(_=>_.symbol===R&&_.chainType===b&&_.chainId===M),i=async(R,b)=>{let M=`${b.chain_type}:${b.chain_id}`;if(!g(R.symbol,b.chain_type,b.chain_id)){await ga({symbol:R.symbol,chainType:b.chain_type,chainId:b.chain_id});let _=await Br();I(_);}x(""),s(R.symbol,M),t();},c=async(R,b)=>{let M=await ma({symbol:R.symbol,chainType:b.chain_type,chainId:b.chain_id});I(M);};return jsxRuntime.jsxs(pe,{visible:e,onClose:t,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:a,borderTopRightRadius:d,children:[jsxRuntime.jsxs(reactNative.View,{style:re.header,children:[jsxRuntime.jsx(reactNative.View,{style:re.headerSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[re.headerTitle,{color:l.header.titleColor,fontFamily:p.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:re.closeButton,children:jsxRuntime.jsx(Ge,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.View,{style:re.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[re.searchInput,{backgroundColor:l.search.backgroundColor,color:l.search.inputColor,fontFamily:p.regular,borderRadius:l.input.borderRadius,borderWidth:l.input.borderWidth,borderColor:l.input.borderColor}],placeholder:"Search",placeholderTextColor:l.search.placeholderColor,value:h,onChangeText:x,autoCapitalize:"none",autoCorrect:false})}),u.length>0&&!h&&jsxRuntime.jsxs(reactNative.View,{style:re.quickSelectSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[re.sectionLabel,{color:l.list.titleSectionColor,fontFamily:p.regular}],children:"Quick select"}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:re.quickSelectScroll,children:u.map(({token:R,chain:b,isRecent:M})=>{let _=`${b.chain_type}:${b.chain_id}`;R.symbol===n&&_===r;return jsxRuntime.jsxs(reactNative.View,{children:[M&&jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>c(R,b),style:re.removeButton,children:jsxRuntime.jsx(Ge,{size:12,color:f.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>i(R,b),activeOpacity:.7,style:[re.quickSelectItem,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:re.tokenIconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(R,"png"))},style:re.quickSelectIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(b,"png"))},style:[re.quickSelectChainBadge,{borderColor:l.card.backgroundColor,borderRadius:l.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:re.quickSelectText,children:[jsxRuntime.jsx(reactNative.Text,{style:[re.quickSelectSymbol,{color:l.card.titleColor,fontFamily:p.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[re.quickSelectChain,{color:l.card.subtitleColor,fontFamily:p.regular}],children:b.chain_name})]})]})]},`quick-${R.symbol}-${_}`)})})]}),jsxRuntime.jsx(reactNative.Text,{style:[re.sectionLabel,{color:l.list.titleSectionColor,fontFamily:p.regular}],children:"All supported tokens"}),jsxRuntime.jsx(reactNative.ScrollView,{style:re.tokenList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:re.tokenListContent,children:m.length===0?jsxRuntime.jsx(reactNative.View,{style:re.emptyState,children:jsxRuntime.jsx(reactNative.Text,{style:[re.emptyText,{color:f.foregroundMuted,fontFamily:p.regular}],children:"No tokens found"})}):m.map(({token:R,chain:b})=>{let M=`${b.chain_type}:${b.chain_id}`,_=R.symbol===n&&M===r;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>i(R,b),activeOpacity:.7,style:[re.tokenItem,{backgroundColor:_?l.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsxs(reactNative.View,{style:re.tokenIconContainerLarge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(R,"png"))},style:re.tokenIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(b,"png"))},style:[re.tokenChainBadge,{borderColor:l.card.backgroundColor,borderRadius:l.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:re.tokenInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[re.tokenSymbol,{color:l.card.titleColor,fontFamily:p.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[re.tokenChainName,{color:l.card.subtitleColor,fontFamily:p.regular}],children:b.chain_name})]}),jsxRuntime.jsxs(reactNative.Text,{style:[re.minDeposit,{color:l.card.labelColor,fontFamily:p.regular}],children:["Minimum:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{color:l.card.labelHighlightRightColor,fontFamily:p.regular},children:["$",b.minimum_deposit_amount_usd]})]})]},`${R.symbol}-${M}`)})})]})}var re=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},closeButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",textAlign:"center",flex:1},headerSpacer:{width:28},searchContainer:{paddingHorizontal:16,paddingBottom:12},searchInput:{height:40,paddingHorizontal:16,fontSize:14},quickSelectSection:{marginBottom:12},sectionLabel:{fontSize:12,paddingHorizontal:16,marginBottom:8},quickSelectScroll:{paddingHorizontal:16,gap:8},quickSelectItem:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12},removeButton:{position:"absolute",top:-2,right:-6,zIndex:1,padding:2},tokenIconContainer:{position:"relative"},quickSelectIcon:{width:28,height:28,borderRadius:14},quickSelectChainBadge:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,borderWidth:2},quickSelectText:{alignItems:"flex-start"},quickSelectSymbol:{fontSize:12,fontWeight:"500"},quickSelectChain:{fontSize:10},tokenList:{flex:1},tokenListContent:{paddingHorizontal:16,paddingBottom:24,gap:4},emptyState:{padding:32,alignItems:"center"},emptyText:{fontSize:14},tokenItem:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:12},tokenIconContainerLarge:{position:"relative"},tokenIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenInfo:{flex:1},tokenSymbol:{fontSize:14,fontWeight:"500"},tokenChainName:{fontSize:12},minDeposit:{fontSize:12}});var Fr=(e,t)=>`${t}:${e}`,ka=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function Bn({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:s,destinationTokenSymbol:a,defaultChainType:d,defaultChainId:f,defaultTokenAddress:p,depositConfirmationMode:l="auto_ui",onExecutionsChange:h,onDepositSuccess:x,onDepositError:P,wallets:I,borderTopLeftRadius:C,borderTopRightRadius:u,sheetBorderRadius:m}){let{colors:g,fonts:i,components:c}=W(),R=d&&f?`${d}:${f}`:"solana:mainnet",[b,M]=react.useState("USDC"),[_,w]=react.useState(R),[Y,J]=react.useState([]),[A,U]=react.useState(!I?.length),K=I?.length?I:Y,[ee,je]=react.useState([]),[ut,Xe]=react.useState(true),[ne,Ie]=react.useState(false),[et,De]=react.useState(false),[Te,ze]=react.useState(false),[Ne,it]=react.useState([]),[Wt,Et]=react.useState(new Map),[Ot]=react.useState(()=>new Date),[pt,$e]=react.useState(null),[Tt,st]=react.useState(false),[ie,ve]=react.useState(null),[Pe,Me]=react.useState(false),qe=new Map;ee.forEach(te=>{te.chains.forEach(ke=>{let v=`${ke.chain_type}:${ke.chain_id}`;qe.has(v)||qe.set(v,ke);});});let Ue=Array.from(qe.values()),Ze=ka(_),ue=Ue.find(te=>te.chain_type===Ze.chainType&&te.chain_id===Ze.chainId),Po=ue?.chain_type||"ethereum",At=Zt(K,Po),xe=At?.address||"",Be=react.useRef(false);react.useEffect(()=>{async function te(){try{Xe(!0),$e(null);let v=await zo(t,s&&r&&n?{destination_token_address:s,destination_chain_id:r,destination_chain_type:n}:void 0);if(je(v.data),v.data.length>0&&!Be.current){Be.current=!0;let F,q;if(d&&f)if(p)for(let H of v.data){let we=H.chains.find(ge=>ge.chain_type===d&&ge.chain_id===f&&ge.token_address.toLowerCase()===p.toLowerCase());if(we){F=H,q=we;break}}else for(let H of v.data){let we=H.chains.find(ge=>ge.chain_type===d&&ge.chain_id===f);if(we){F=H,q=we;break}}if(!F&&s)for(let H of v.data){let we=H.chains.find(ge=>ge.token_address.toLowerCase()===s.toLowerCase());if(we){F=H,q=we;break}}F||(F=v.data.find(H=>H.symbol==="USDC"),F&&F.chains.length>0&&(q=F.chains[0])),F||(F=v.data.find(H=>H.symbol==="USDT"),F&&F.chains.length>0&&(q=F.chains[0])),F||(F=v.data[0],F.chains.length>0&&(q=F.chains[0])),F&&M(F.symbol),q&&w(Fr(q.chain_id,q.chain_type));}}catch(ke){console.error("Error fetching supported tokens:",ke),$e("Failed to load supported tokens"),P?.({message:"Failed to load supported tokens",error:ke});}finally{Xe(false);}}te();},[t,s,r,n,d,f,p,P]),react.useEffect(()=>{h&&h(Ne);},[Ne,h]),react.useEffect(()=>{if(I?.length){U(false);return}if(Y.length>0){U(false);return}let te=null,ke=false,v=async()=>{if(!ke){U(true);try{let F=await Xt({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:s},t);ke||(J(F.data),$e(null),U(!1));}catch(F){console.error("Error fetching wallets, retrying in 5s:",F),ke||($e(F instanceof Error?F.message:"Failed to load wallets"),U(false),te=setTimeout(v,5e3));}}};return v(),()=>{ke=true,te&&clearTimeout(te);}},[e,o,n,r,s,t,I,Y.length]);let Bo=At?.id??"",{showWaitingUi:uo,handleIveDeposited:po}=Yo({depositConfirmationMode:l,depositAddress:xe,chain:_,externalUserId:e,publishableKey:t,modalOpenedAt:Ot,depositWalletId:Bo,depositExecutions:Ne,trackedExecutions:Wt,setDepositExecutions:it,setTrackedExecutions:Et,setLatestExecution:ve,setShowStatusSheet:st,onDepositSuccess:x,onExecutionsChange:h,onDepositError:P});react.useEffect(()=>{if(!ee.length)return;let te=ee.find(v=>v.symbol===b);if(!te||te.chains.length===0)return;if(!te.chains.some(v=>Fr(v.chain_id,v.chain_type)===_)){let v=te.chains[0];w(Fr(v.chain_id,v.chain_type));}},[b,ee,_]);let Ve=ee.find(te=>te.symbol===b),Fe=(Ve?.chains||[]).find(te=>Fr(te.chain_id,te.chain_type)===_),fo=async()=>{if(xe)try{reactNative.Clipboard.setString(xe),Ie(!0),setTimeout(()=>Ie(!1),2e3);}catch(te){console.error("Failed to copy:",te);}},Kt=Fe?.estimated_price_impact_percent??0,ft=Fe?.max_slippage_percent??.25,Fo=Fe?.minimum_deposit_amount_usd??3;return ut?jsxRuntime.jsxs(reactNative.View,{style:T.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:g.primary}),jsxRuntime.jsx(reactNative.Text,{style:[T.loadingText,{color:g.foregroundMuted,fontFamily:i.regular}],children:"Loading currencies..."})]}):pt&&ee.length===0?jsxRuntime.jsxs(reactNative.View,{style:T.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[T.errorText,{color:g.error,fontFamily:i.regular}],children:pt}),jsxRuntime.jsx(reactNative.Text,{style:[T.errorHint,{color:g.foregroundMuted,fontFamily:i.regular}],children:"Please check your network connection and try again."})]}):jsxRuntime.jsxs(reactNative.View,{style:T.container,children:[jsxRuntime.jsxs(reactNative.View,{style:T.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[T.selectorLabel,{color:c.card.labelColor,fontFamily:i.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>ze(true),disabled:ut||ee.length===0,style:[T.tokenSelectorButton,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],activeOpacity:.7,children:ut?jsxRuntime.jsxs(reactNative.View,{style:T.tokenSelectorLoading,children:[jsxRuntime.jsx(reactNative.View,{style:[T.loadingIcon,{backgroundColor:g.cardHover}]}),jsxRuntime.jsxs(reactNative.View,{style:T.loadingTextContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[T.loadingLine,{backgroundColor:g.cardHover,width:60}]}),jsxRuntime.jsx(reactNative.View,{style:[T.loadingLine,{backgroundColor:g.cardHover,width:100,marginTop:4}]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:T.tokenIconWrapper,children:[Ve&&jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(Ve,"png"))},style:T.tokenMainIcon}),(Fe||ue)&&jsxRuntime.jsx(reactNative.Image,{source:{uri:$(de(Fe||ue,"png"))},style:[T.tokenChainBadge,{borderColor:c.card.backgroundColor,borderRadius:c.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:T.tokenSelectorInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[T.tokenSelectorSymbol,{color:c.card.titleColor,fontFamily:i.semibold}],children:Ve?.symbol||b}),jsxRuntime.jsx(reactNative.Text,{style:[T.tokenSelectorNetwork,{color:c.card.subtitleColor,fontFamily:i.regular}],numberOfLines:1,children:Fe?.chain_name||ue?.chain_name||"Select network"})]}),jsxRuntime.jsxs(reactNative.View,{style:T.tokenSelectorRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[T.minDepositText,{color:c.card.labelHighlightRightColor,fontFamily:i.medium}],children:["$",Fo," min"]}),jsxRuntime.jsx(St,{size:16,color:c.card.actionColor,strokeWidth:2})]})]})})]}),jsxRuntime.jsx(Pn,{visible:Te,onClose:()=>ze(false),tokens:ee,selectedToken:b,selectedChainKey:_,onSelect:(te,ke)=>{M(te),w(ke);},borderTopLeftRadius:m?.tokenSelector?.borderTopLeftRadius??C,borderTopRightRadius:m?.tokenSelector?.borderTopRightRadius??u}),jsxRuntime.jsx(reactNative.View,{style:T.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[T.qrWrapper,{backgroundColor:g.background,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth>0?c.card.borderWidth:1,borderColor:c.card.borderColor}],children:A?jsxRuntime.jsxs(reactNative.View,{style:T.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:g.primary}),jsxRuntime.jsx(reactNative.Text,{style:[T.loadingText,{color:g.foregroundMuted,fontFamily:i.regular}],children:"Loading..."})]}):xe?jsxRuntime.jsx(_o,{value:xe,size:180,logoUri:$(de(Fe,"png")||He("/icons/networks/png/ethereum.png")),logoSize:45}):jsxRuntime.jsx(reactNative.View,{style:T.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[T.errorText,{color:g.error,fontFamily:i.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:T.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:T.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[T.addressLabel,{color:c.card.labelColor,fontFamily:i.medium}],children:"Deposit Address"}),ne&&jsxRuntime.jsxs(reactNative.View,{style:T.copiedIndicator,children:[jsxRuntime.jsx(We,{size:14,color:g.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[T.copiedText,{color:g.success,fontFamily:i.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(Le,{cardTokens:c.transferCrypto.depositAddress.card,onPress:!A&&xe?fo:void 0,contentStyle:T.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[T.addressText,{color:c.card.titleColor,fontFamily:i.regular}],numberOfLines:2,children:A?"Loading...":xe||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:T.addressCopyIcon,children:jsxRuntime.jsx(Ho,{size:16,color:c.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[T.detailsCard,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>De(!et),style:T.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:T.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[T.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(to,{size:12,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[T.detailsLabel,{color:c.card.titleColor,fontFamily:i.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:T.chevronContainer,children:et?jsxRuntime.jsx(jt,{size:16,color:c.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(Ye,{size:16,color:c.card.actionColor,strokeWidth:2})})]}),et&&jsxRuntime.jsxs(reactNative.View,{style:T.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:T.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[T.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(bo,{size:12,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[T.detailsLabel,{color:c.card.titleColor,fontFamily:i.regular}],children:["Price impact: ",Kt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ko,{size:14,color:c.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:T.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[T.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wo,{size:12,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[T.detailsLabel,{color:c.card.titleColor,fontFamily:i.regular}],children:["Slippage: Auto \u2022 ",ft.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(ko,{size:14,color:c.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:T.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[T.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(ar,{size:12,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[T.detailsLabel,{color:c.card.titleColor,fontFamily:i.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(hr,{depositConfirmationMode:l,depositAddress:xe,showWaitingUi:uo,latestExecution:ie,onIveDeposited:po}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:T.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[T.termsText,{color:g.primary,fontFamily:i.regular}],children:"Terms apply"})}),jsxRuntime.jsxs(pe,{visible:Pe,onClose:()=>Me(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:m?.infoSheet?.borderTopLeftRadius??C,borderTopRightRadius:m?.infoSheet?.borderTopRightRadius??u,children:[jsxRuntime.jsxs(reactNative.View,{style:[T.sheetHeader,{borderBottomColor:g.border}],children:[jsxRuntime.jsx(reactNative.View,{style:T.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[T.sheetTitle,{color:c.header.titleColor,fontFamily:i.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Me(false),style:T.sheetCloseButton,children:jsxRuntime.jsx(Ge,{size:20,color:c.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:T.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[T.infoCard,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:T.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[T.infoCardIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(bo,{size:16,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[T.infoCardTitle,{color:c.card.titleColor,fontFamily:i.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[T.infoCardValue,{color:c.card.titleColor,fontFamily:i.medium}],children:[Kt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[T.infoCardDescription,{color:c.card.descriptionColor,fontFamily:i.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[T.infoCard,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:T.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[T.infoCardIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wo,{size:16,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[T.infoCardTitle,{color:c.card.titleColor,fontFamily:i.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[T.infoCardValue,{color:c.card.titleColor,fontFamily:i.medium}],children:[ft.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[T.infoCardDescription,{color:c.card.descriptionColor,fontFamily:i.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),ie&&jsxRuntime.jsx(Io,{visible:Tt,status:ie.status,tokenIconUrl:ie.destination_token_metadata?.icon_urls?.find(te=>te.format==="png")?.url||ie.destination_token_metadata?.icon_url||de(Ve,"png"),explorerUrl:ie.explorer_url,completionExplorerUrl:ie.destination_explorer_url,date:ie.created_at?new Date(ie.created_at):void 0,amountUsd:ie.source_amount_usd?parseFloat(ie.source_amount_usd):void 0,onClose:()=>st(false),borderTopLeftRadius:m?.depositStatus?.borderTopLeftRadius??C,borderTopRightRadius:m?.depositStatus?.borderTopRightRadius??u})]})}var T=reactNative.StyleSheet.create({container:{flex:1,paddingHorizontal:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:12,marginBottom:8},tokenSelectorButton:{flexDirection:"row",alignItems:"center",gap:12,padding:12},tokenSelectorLoading:{flexDirection:"row",alignItems:"center",gap:12,flex:1},loadingIcon:{width:40,height:40,borderRadius:20},loadingTextContainer:{flex:1},loadingLine:{height:12,borderRadius:6},tokenIconWrapper:{position:"relative"},tokenMainIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenSelectorInfo:{flex:1},tokenSelectorSymbol:{fontSize:14,fontWeight:"500"},tokenSelectorNetwork:{fontSize:12,marginTop:2},tokenSelectorRight:{flexDirection:"row",alignItems:"center",gap:8},minDepositText:{fontSize:12,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:8},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:12},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},termsContainer:{alignItems:"center",paddingVertical:8},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});var Bt={transferCrypto:{title:"Transfer Crypto",subtitle:"No limit \u2022 Instant"},depositWithCard:{title:"Deposit with Card",subtitle:"$50,000 limit \u2022 2 min"},stripeLinkPay:{title:"Pay with Stripe Link",subtitle:"Apple Pay or Card"},depositTracker:{title:"Deposit Tracker",subtitle:"Track your deposit progress"}};function Sa(){let{colors:e,components:t}=W(),o=react.useRef(new reactNative.Animated.Value(.5)).current,n=t.depositMenu.card.backgroundColor,r=e.cardHover;react.useEffect(()=>{let a=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(o,{toValue:1,duration:800,useNativeDriver:true}),reactNative.Animated.timing(o,{toValue:.5,duration:800,useNativeDriver:true})]));return a.start(),()=>a.stop()},[o]);let s=({rightIcons:a=2})=>jsxRuntime.jsxs(reactNative.View,{style:[Yt.card,{backgroundColor:n,borderRadius:t.depositMenu.card.borderRadius}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Yt.leftIcon,{backgroundColor:r,opacity:o,borderRadius:t.depositMenu.card.iconContainerBorderRadius}]}),jsxRuntime.jsxs(reactNative.View,{style:Yt.textBlock,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Yt.titleBar,{backgroundColor:r,opacity:o}]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[Yt.subtitleBar,{backgroundColor:r,opacity:o}]})]}),jsxRuntime.jsx(reactNative.View,{style:Yt.rightIcons,children:Array.from({length:a}).map((d,f)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[Yt.rightIcon,{backgroundColor:r,opacity:o}]},f))})]});return jsxRuntime.jsxs(reactNative.View,{style:Yt.container,children:[jsxRuntime.jsx(s,{rightIcons:3}),jsxRuntime.jsx(s,{rightIcons:2}),jsxRuntime.jsx(s,{rightIcons:0})]})}var Yt=reactNative.StyleSheet.create({container:{paddingTop:8,paddingBottom:24,gap:8},card:{marginHorizontal:16,flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:12,gap:12},leftIcon:{width:36,height:36},textBlock:{flex:1,gap:6},titleBar:{height:12,width:"70%",borderRadius:6},subtitleBar:{height:10,width:"50%",borderRadius:5},rightIcons:{flexDirection:"row",alignItems:"center",gap:4},rightIcon:{width:20,height:20,borderRadius:10}});function _a({visible:e,onClose:t,externalUserId:o,publishableKey:n,modalTitle:r="Deposit",destinationTokenSymbol:s,recipientAddress:a,destinationChainType:d,destinationChainId:f,destinationTokenAddress:p,defaultChainType:l,defaultChainId:h,defaultTokenAddress:x,showBalance:P=false,hideDepositTracker:I=false,enableStripeLinkPay:C=false,StripeOnrampComponent:u,stripeOnrampEmail:m,stripeOnrampPhone:g,stripeTheme:i,depositConfirmationMode:c="auto_ui",transferInputVariant:R="double_input",onDepositSuccess:b,onDepositError:M,sheetBorderRadius:_}){let w=_?.globalBorderTopLeftRadius,Y=_?.globalBorderTopRightRadius,{colors:J,fonts:A}=W(),[U,K]=react.useState([]),[ee,je]=react.useState(false),[ut,Xe]=react.useState(false),[ne,Ie]=react.useState(false),[et,De]=react.useState(false),[Te,ze]=react.useState(null),[Ne,it]=react.useState("amount"),{isAllowed:Wt,isLoading:Et}=Zo(n,e);react.useEffect(()=>{if(!e||Te)return;let Pe=false;return Mo(n).then(async Me=>{if(Pe)return;let qe=[];for(let Ue of Me?.transfer_crypto?.networks??[]){let Ze=Ue.icon_urls.find(ue=>ue.format==="png")?.url||Ue.icon_urls.find(ue=>ue.format==="svg")?.url;Ze&&qe.push($(Ze));}for(let Ue of Me?.payment_networks?.networks??[]){let Ze=Ue.icon_urls.find(ue=>ue.format==="png")?.url||Ue.icon_urls.find(ue=>ue.format==="svg")?.url;Ze&&qe.push($(Ze));}qe.length>0&&await Kr(qe),Pe||ze(Me);}).catch(console.error),()=>{Pe=true;}},[e,Te,n]);let Ot=()=>{t();},pt=U.filter(Pe=>Pe.status==="pending"||Pe.status==="waiting").length,Tt=!!(a&&d&&f&&p&&n)&&P!==false&&!!Te,st=Et||e&&!Te,ie=Wt===false,ve=null;if(et&&u){let Pe=jsxRuntime.jsx(u,{publishableKey:n,email:m,phone:g,externalUserId:o,recipientAddress:a??"",destinationChainType:d,destinationChainId:f,destinationTokenAddress:p,onClose:()=>De(false)});ve=i?jsxRuntime.jsx(mo,{...i,children:Pe}):Pe;}return jsxRuntime.jsxs(pe,{visible:e,onClose:Ot,closeOnBackdropPress:false,showHandle:false,borderTopLeftRadius:_?.main?.borderTopLeftRadius??w,borderTopRightRadius:_?.main?.borderTopRightRadius??Y,children:[jsxRuntime.jsx(rt,{title:r,showBack:false,onClose:Ot,showBalance:Tt,balanceAddress:a,balanceChainType:d,balanceChainId:f,balanceTokenAddress:p,publishableKey:n,projectName:Te?.project_name}),st&&jsxRuntime.jsx(Sa,{}),!st&&ie&&jsxRuntime.jsxs(reactNative.View,{style:Vt.centeredContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Vt.iconContainer,{backgroundColor:J.cardHover}],children:jsxRuntime.jsx(dr,{size:32,color:J.foreground,strokeWidth:1.5})}),jsxRuntime.jsx(reactNative.Text,{style:[Vt.blockedTitle,{color:J.foreground,fontFamily:A.semibold}],children:"No Tokens Available"}),jsxRuntime.jsx(reactNative.Text,{style:[Vt.blockedDescription,{color:J.foreground,opacity:.7,fontFamily:A.regular}],children:"There are no supported tokens available from your current location."})]}),!st&&!ie&&jsxRuntime.jsxs(reactNative.View,{style:Vt.optionsContainer,children:[jsxRuntime.jsx(jo,{onPress:()=>Xe(true),title:Bt.transferCrypto.title,subtitle:Bt.transferCrypto.subtitle,featuredTokens:Te?.transfer_crypto?.networks}),jsxRuntime.jsx($o,{onPress:()=>Ie(true),title:Bt.depositWithCard.title,subtitle:Bt.depositWithCard.subtitle,paymentNetworks:Te?.payment_networks?.networks}),C&&u&&jsxRuntime.jsx(Go,{onPress:()=>De(true),title:Bt.stripeLinkPay.title,subtitle:Bt.stripeLinkPay.subtitle}),!I&&jsxRuntime.jsx(qo,{onPress:()=>je(true),title:Bt.depositTracker.title,subtitle:Bt.depositTracker.subtitle,badge:pt>0?pt:void 0})]}),jsxRuntime.jsx(Lr,{visible:ee,onClose:()=>je(false),executions:U,externalUserId:o,publishableKey:n,borderTopLeftRadius:_?.depositsTracker?.borderTopLeftRadius??w,borderTopRightRadius:_?.depositsTracker?.borderTopRightRadius??Y}),jsxRuntime.jsxs(pe,{visible:ut,onClose:()=>Xe(false),closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:_?.transferCrypto?.borderTopLeftRadius??w,borderTopRightRadius:_?.transferCrypto?.borderTopRightRadius??Y,children:[jsxRuntime.jsx(rt,{title:Bt.transferCrypto.title,showBack:false,onClose:()=>Xe(false),showBalance:Tt,balanceAddress:a,balanceChainType:d,balanceChainId:f,balanceTokenAddress:p,publishableKey:n,projectName:Te?.project_name}),jsxRuntime.jsx(reactNative.ScrollView,{style:Vt.transferScrollContainer,contentContainerStyle:Vt.scrollContent,showsVerticalScrollIndicator:false,children:R==="single_input"?jsxRuntime.jsx(Bn,{externalUserId:o,publishableKey:n,recipientAddress:a,destinationChainType:d,destinationChainId:f,destinationTokenAddress:p,destinationTokenSymbol:s,defaultChainType:l,defaultChainId:h,defaultTokenAddress:x,depositConfirmationMode:c,onExecutionsChange:K,onDepositSuccess:b,onDepositError:M,borderTopLeftRadius:w,borderTopRightRadius:Y,sheetBorderRadius:{tokenSelector:_?.tokenSelector,infoSheet:_?.infoSheet,depositStatus:_?.depositStatus}}):jsxRuntime.jsx(Cr,{externalUserId:o,publishableKey:n,recipientAddress:a,destinationChainType:d,destinationChainId:f,destinationTokenAddress:p,destinationTokenSymbol:s,defaultChainType:l,defaultChainId:h,defaultTokenAddress:x,depositConfirmationMode:c,onExecutionsChange:K,onDepositSuccess:b,onDepositError:M,borderTopLeftRadius:w,borderTopRightRadius:Y,sheetBorderRadius:{tokenSelector:_?.tokenSelector,chainSelector:_?.chainSelector,infoSheet:_?.infoSheet,depositStatus:_?.depositStatus}})})]}),jsxRuntime.jsxs(pe,{visible:ne,onClose:()=>{Ie(false),it("amount");},closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:_?.buyWithCard?.borderTopLeftRadius??w,borderTopRightRadius:_?.buyWithCard?.borderTopRightRadius??Y,children:[jsxRuntime.jsx(rt,{title:`Deposit ${s||"USDC"}`,showBack:Ne==="onramp",onBack:()=>it("amount"),onClose:()=>{Ie(false),it("amount");},showBalance:Tt,balanceAddress:a,balanceChainType:d,balanceChainId:f,balanceTokenAddress:p,publishableKey:n,projectName:Te?.project_name}),jsxRuntime.jsx(reactNative.View,{style:Vt.buyWithCardContainer,children:jsxRuntime.jsx(Sr,{externalUserId:o,publishableKey:n,destinationTokenSymbol:s,recipientAddress:a,destinationChainType:d,destinationChainId:f,destinationTokenAddress:p,onDepositSuccess:b,onDepositError:M,view:Ne,onViewChange:Pe=>it(Pe),borderTopLeftRadius:w,borderTopRightRadius:Y,sheetBorderRadius:{providerModal:_?.providerModal,webView:_?.webView,currencyModal:_?.currencyModal}})})]}),C&&u&&jsxRuntime.jsx(pe,{visible:et,onClose:()=>De(false),closeOnBackdropPress:false,showHandle:false,heightPercent:1,borderTopLeftRadius:0,borderTopRightRadius:0,children:jsxRuntime.jsx(reactNative.View,{style:Vt.stripeLinkPayContainer,children:ve})})]})}function Wr({theme:e="auto",...t}){return jsxRuntime.jsx(_a,{...t})}var Vt=reactNative.StyleSheet.create({optionsContainer:{paddingTop:8,paddingBottom:24,gap:8},transferScrollContainer:{flex:1},scrollContent:{paddingBottom:24},buyWithCardContainer:{flex:1},stripeLinkPayContainer:{flex:1},centeredContainer:{alignItems:"center",justifyContent:"center",paddingVertical:48,paddingHorizontal:16,minHeight:200},iconContainer:{width:64,height:64,borderRadius:32,alignItems:"center",justifyContent:"center",marginBottom:16},blockedTitle:{fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},blockedDescription:{fontSize:14,textAlign:"center",maxWidth:280,lineHeight:20}});reactNative.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},text:{fontWeight:"600",textAlign:"center"},fullWidth:{width:"100%"},disabled:{opacity:.5}});reactNative.StyleSheet.create({icon:{backgroundColor:"transparent"}});var Ei="__unifold_stripe_onramp__";function Oi(e){globalThis[Ei]=e;}function Ai(){return globalThis[Ei]}var Fa=()=>new reactQuery.QueryClient({defaultOptions:{queries:{staleTime:6e4,retry:1}}}),Ui=react.createContext(null);function Wa({children:e,publishableKey:t,config:o}){let[n]=react.useState(()=>Fa()),[r,s]=react.useState(false),[a,d]=react.useState(null),f=reactNative.useColorScheme(),p=react.useRef(false);p.current||(rr({publishableKey:t}),p.current=true);let l=react.useMemo(()=>{let g=o?.appearance||"dark";return g==="auto"?f==="dark"?"dark":"light":g},[o?.appearance,f]);react.useEffect(()=>{if(!t||t.trim()===""){console.error("Unifold: publishableKey is required. Please provide a valid publishable key.");return}!t.startsWith("pk_test_")&&!t.startsWith("pk_live_")&&console.warn('Unifold: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),rr({publishableKey:t});},[t]),react.useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]);let h=react.useRef(null),x=react.useRef(null),P=react.useCallback(g=>{x.current&&(clearTimeout(x.current),x.current=null),h.current&&(console.warn("[UnifoldProvider] A deposit is already in progress. Cancelling previous deposit."),h.current.reject({message:"Deposit cancelled - new deposit started",code:"DEPOSIT_SUPERSEDED"}),h.current=null);let i=new Promise((c,R)=>{h.current={resolve:c,reject:R};});return d(g),s(true),i},[]),I=react.useCallback(()=>{h.current&&(h.current.reject({message:"Deposit cancelled by user",code:"DEPOSIT_CANCELLED"}),h.current=null),s(false),x.current=setTimeout(()=>{d(null),x.current=null;},200);},[]),C=react.useCallback(g=>{a?.onSuccess&&a.onSuccess(g),h.current&&(h.current.resolve(g),h.current=null);},[a]),u=react.useCallback(g=>{console.error("[UnifoldProvider] Deposit error:",g),a?.onError&&a.onError(g),h.current&&(h.current.reject(g),h.current=null);},[a]),m=react.useMemo(()=>({publishableKey:t,beginDeposit:P,closeDeposit:I}),[t,P,I]);return jsxRuntime.jsx(reactQuery.QueryClientProvider,{client:n,children:jsxRuntime.jsx(Ui.Provider,{value:m,children:jsxRuntime.jsxs(mo,{mode:l,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components,children:[e,a&&jsxRuntime.jsx(Wr,{visible:r,onClose:I,publishableKey:t,modalTitle:o?.modalTitle,externalUserId:a.externalUserId,destinationChainType:a.destinationChainType,destinationChainId:a.destinationChainId,destinationTokenSymbol:a.destinationTokenSymbol,recipientAddress:a.recipientAddress,destinationTokenAddress:a.destinationTokenAddress,defaultChainType:a.defaultChainType,defaultChainId:a.defaultChainId,defaultTokenAddress:a.defaultTokenAddress,showBalance:a.showBalance,stripeOnrampEmail:a.stripeOnrampEmail,stripeOnrampPhone:a.stripeOnrampPhone,stripeTheme:{mode:l,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components},depositConfirmationMode:a.depositConfirmationMode??"auto_ui",hideDepositTracker:o?.hideDepositTracker,transferInputVariant:o?.transferInputVariant,enableStripeLinkPay:o?.enableStripeLinkPay,StripeOnrampComponent:o?.enableStripeLinkPay?Ai():void 0,onDepositSuccess:C,onDepositError:u,theme:l,sheetBorderRadius:o?.sheetBorderRadius})]})})})}function Ea(){let e=react.useContext(Ui);if(!e)throw new Error("useUnifold must be used within UnifoldProvider");return e}
2
- exports.UnifoldProvider=Wa;exports.registerStripeOnramp=Oi;exports.setDevApiUrl=An;exports.useAllowedCountry=Zo;exports.useUnifold=Ea;
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),ot=require('react-native-svg'),jsxRuntime=require('react/jsx-runtime'),stripeReactNative=require('@stripe/stripe-react-native'),reactNativeGestureHandler=require('react-native-gesture-handler'),fd=require('react-native-qrcode-svg'),reactNativeWebview=require('react-native-webview'),xs=require('@react-native-async-storage/async-storage');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ot__default=/*#__PURE__*/_interopDefault(ot);var fd__default=/*#__PURE__*/_interopDefault(fd);var xs__default=/*#__PURE__*/_interopDefault(xs);var Rl=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ii={light:{background:"#FFFFFF",card:"#F8FAFC",cardHover:"#F1F5F9",foreground:"#0F172A",foregroundMuted:"#64748B",foregroundSubtle:"#94A3B8",border:"#E2E8F0",borderSecondary:"#CBD5E1",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"#DCFCE7",warning:"#F59E0B",warningBackground:"#FEF3C7",error:"#EF4444",errorBackground:"#FEE2E2",overlay:"rgba(0, 0, 0, 0.5)"},dark:{background:"#2D2C2F",card:"#3A393C",cardHover:"#48474A",foreground:"#F8FAFC",foregroundMuted:"#94A3B8",foregroundSubtle:"#64748B",border:"#38383A",borderSecondary:"#48484A",primary:"#3B82F6",primaryForeground:"#FFFFFF",success:"#22C55E",successBackground:"rgba(34, 197, 94, 0.1)",warning:"#F59E0B",warningBackground:"rgba(245, 158, 11, 0.1)",error:"#EF4444",errorBackground:"rgba(239, 68, 68, 0.1)",overlay:"rgba(0, 0, 0, 0.7)"}},vi=Ii;function _n(e,t){return t?{...e,...t,shadowOffset:t.shadowOffset??e.shadowOffset,backShadowOffset:t.backShadowOffset??e.backShadowOffset}:e}function Kr(e,t,o){let n=o?t?.[o]:void 0,r=(a,g,T)=>{let C=n?.[a]?.[g];if(C!==void 0)return C;let h=t?.[a]?.[g];return h!==void 0?h:T},i={backgroundColor:r("card","backgroundColor",e.card),titleColor:r("card","titleColor",e.foreground),subtitleColor:r("card","subtitleColor",e.foregroundMuted),labelColor:r("card","labelColor",e.foregroundMuted),headerColor:r("card","headerColor",e.foregroundMuted),labelRightColor:r("card","labelRightColor",e.foregroundMuted),labelHighlightRightColor:r("card","labelHighlightRightColor",e.warning),textRightColor:r("card","textRightColor",e.foreground),subtextRightColor:r("card","subtextRightColor",e.foregroundMuted),rowLeftLabel:r("card","rowLeftLabel",e.foregroundMuted),rowRightLabel:r("card","rowRightLabel",e.foreground),iconColor:r("card","iconColor",e.primary),iconBackgroundColor:r("card","iconBackgroundColor",e.primary+"26"),actionColor:r("card","actionColor",e.foregroundMuted),actionIcon:r("card","actionIcon",e.foregroundMuted),descriptionColor:r("card","descriptionColor",e.foregroundMuted),borderRadius:r("card","borderRadius",12),borderWidth:r("card","borderWidth",0),borderColor:r("card","borderColor",e.border),shadowColor:r("card","shadowColor","#000"),shadowOffset:r("card","shadowOffset",{width:0,height:-4}),shadowOpacity:r("card","shadowOpacity",0),shadowRadius:r("card","shadowRadius",12),elevation:r("card","elevation",0),iconContainerBorderRadius:r("card","iconContainerBorderRadius",12),backShadowColor:"transparent",backShadowOffset:{top:4,left:4,right:-4,bottom:-4},backShadowSpacing:8},s=(n?.depositMenu??t?.depositMenu)?.card,c=(n?.transferCrypto??t?.transferCrypto)?.depositAddress?.card,d=(n?.depositCard??t?.depositCard)?.quoteProvider?.card,u=(n?.depositTracker??t?.depositTracker)?.executionRow?.card;return {header:{titleColor:r("header","titleColor",e.foreground),buttonColor:r("header","buttonColor",e.foreground)},card:i,input:{backgroundColor:r("input","backgroundColor",r("search","backgroundColor",e.card)),textColor:r("input","textColor",r("search","inputColor",e.foreground)),placeholderColor:r("input","placeholderColor",r("search","placeholderColor",e.foregroundMuted)),borderColor:r("input","borderColor",e.border),borderRadius:r("input","borderRadius",r("search","borderRadius",8)),borderWidth:r("input","borderWidth",1)},button:{primaryBackground:r("button","primaryBackground",e.primary),primaryText:r("button","primaryText",e.primaryForeground),secondaryBackground:r("button","secondaryBackground",e.card),secondaryText:r("button","secondaryText",e.foreground),borderRadius:r("button","borderRadius",12),borderWidth:r("button","borderWidth",0),borderColor:r("button","borderColor",e.border)},container:{titleColor:r("container","titleColor",e.foreground),subtitleColor:r("container","subtitleColor",e.foregroundMuted),actionColor:r("container","actionColor",e.foregroundMuted),actionTitle:r("container","actionTitle",e.foregroundMuted),buttonColor:r("container","buttonColor",e.primary),buttonTitleColor:r("container","buttonTitleColor",e.primaryForeground),iconBackgroundColor:r("container","iconBackgroundColor",e.success),iconColor:r("container","iconColor",e.foreground)},search:{backgroundColor:r("search","backgroundColor",e.card),inputColor:r("search","inputColor",e.foreground),placeholderColor:r("search","placeholderColor",e.foregroundMuted),borderRadius:r("search","borderRadius",8)},list:{titleSectionColor:r("list","titleSectionColor",e.foregroundMuted),rowBorderRadius:r("list","rowBorderRadius",12)},badge:{borderRadius:r("badge","borderRadius",8)},sheet:{shadowColor:r("sheet","shadowColor","#000"),shadowOffset:r("sheet","shadowOffset",{width:0,height:-4}),shadowOpacity:r("sheet","shadowOpacity",.1),shadowRadius:r("sheet","shadowRadius",12),elevation:r("sheet","elevation",16)},depositMenu:{card:_n(i,s)},transferCrypto:{depositAddress:{card:_n(i,c)}},depositCard:{quoteProvider:{card:_n(i,d)}},depositTracker:{executionRow:{card:_n(i,u)}}}}function Pi(e,t,o){let r={...Ii[e]};return o&&(r.primary=o),t&&(r={...r,...t}),r}var Li=react.createContext(null);function O(){let e=react.useContext(Li);if(!e){let t=vi.dark;return {mode:"dark",colors:t,fonts:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},components:Kr(t,void 0,"dark"),isDark:true}}return e}function Oi({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Path,{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Vi({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Rect,{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"1",y1:"10",x2:"23",y2:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Zo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"12 6 12 12 16 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Yr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"19",y1:"12",x2:"5",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"12 19 5 12 12 5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function lt({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Co({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"9 18 15 12 9 6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function wt({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"6 9 12 15 18 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Xo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Rect,{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Be({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"20 6 9 17 4 12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Di({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"12",y1:"2",x2:"12",y2:"6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"18",x2:"12",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"2",y1:"12",x2:"6",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"18",y1:"12",x2:"22",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function er({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"15 3 21 3 21 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"10",y1:"14",x2:"21",y2:"3",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function wr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Line,{x1:"12",y1:"1",x2:"12",y2:"23",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Rn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"14 2 14 8 20 8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16",y1:"13",x2:"8",y2:"13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"16",y1:"17",x2:"8",y2:"17",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"10 9 9 9 8 9",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Wo({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx(ot.Polyline,{points:"18 15 12 9 6 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})})}function Os({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Polyline,{points:"23 4 23 10 17 10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Polyline,{points:"1 20 1 14 7 14",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Sr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Circle,{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"16",x2:"12",y2:"12",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"12",y1:"8",x2:"12.01",y2:"8",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function kr({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M9 12l2 2 4-4",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function In({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function vn({size:e=24,color:t="#fff",strokeWidth:o=2}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[jsxRuntime.jsx(ot.Path,{d:"M5.43 5.43A8.06 8.06 0 0 0 4 10c0 6 8 12 8 12a29.94 29.94 0 0 0 5-5",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M19.18 13.52A8.66 8.66 0 0 0 20 10a8 8 0 0 0-8-8 7.88 7.88 0 0 0-3.52.82",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M9.13 9.13A2.78 2.78 0 0 0 9 10a3 3 0 0 0 3 3 2.78 2.78 0 0 0 .87-.13",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Path,{d:"M14.9 9.25a3 3 0 0 0-2.15-2.16",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx(ot.Line,{x1:"2",y1:"2",x2:"22",y2:"22",stroke:t,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round"})]})}function Ds({size:e=28}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:jsxRuntime.jsxs(ot.G,{fillRule:"evenodd",children:[jsxRuntime.jsx(ot.Path,{fill:"#0052FF",fillRule:"nonzero",d:"M14 28a14 14 0 1 0 0-28 14 14 0 0 0 0 28"}),jsxRuntime.jsx(ot.Path,{fill:"#FFF",d:"M13.967 23.86c5.445 0 9.86-4.415 9.86-9.86s-4.415-9.86-9.86-9.86c-5.166 0-9.403 3.974-9.825 9.03h14.63v1.642H4.142c.413 5.065 4.654 9.047 9.826 9.047Z"})]})})}function Fs({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(ot.G,{clipPath:"url(#eth_clip)",children:[jsxRuntime.jsx(ot.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#627EEA"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 3.5V11.2612L20.9956 14.1925L14.4357 3.5Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 3.5L7.875 14.1925L14.4357 11.2612V3.5Z",fill:"white"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 19.222V24.4956L21 15.414L14.4357 19.222Z",fill:"white",fillOpacity:.602}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 24.4956V19.2211L7.875 15.414L14.4357 24.4956Z",fill:"white"}),jsxRuntime.jsx(ot.Path,{d:"M14.4357 18.0014L20.9956 14.1925L14.4357 11.263V18.0014Z",fill:"white",fillOpacity:.2}),jsxRuntime.jsx(ot.Path,{d:"M7.875 14.1925L14.4357 18.0014V11.263L7.875 14.1925Z",fill:"white",fillOpacity:.602})]}),jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsx(ot.ClipPath,{id:"eth_clip",children:jsxRuntime.jsx(ot.Rect,{width:28,height:28,fill:"white"})})})]})}function Es({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 28 28",fill:"none",children:[jsxRuntime.jsxs(ot.G,{clipPath:"url(#btc_clip)",children:[jsxRuntime.jsx(ot.Path,{d:"M14 28C21.732 28 28 21.732 28 14C28 6.26801 21.732 0 14 0C6.26801 0 0 6.26801 0 14C0 21.732 6.26801 28 14 28Z",fill:"#F7931A"}),jsxRuntime.jsx(ot.Path,{d:"M20.0594 12.1625C20.3438 10.2594 18.9 9.23124 16.9203 8.55311L17.5656 5.97186L15.9906 5.57811L15.3672 8.09374C14.9516 7.9953 14.525 7.89686 14.0985 7.79843L14.7328 5.27186L13.1578 4.87811L12.5125 7.45936C12.1735 7.3828 11.8344 7.30624 11.5063 7.22968V7.21874L9.34065 6.67186L8.92502 8.35624C8.92502 8.35624 10.0844 8.61874 10.0625 8.64061C10.6969 8.79374 10.8063 9.2203 10.7844 9.54843L10.0625 12.4578C10.1063 12.4687 10.161 12.4797 10.2266 12.5125C10.1828 12.5016 10.1281 12.4906 10.0735 12.4687L9.05627 16.5375C8.97971 16.7344 8.78284 17.0187 8.34534 16.9094C8.36721 16.9312 7.20784 16.625 7.20784 16.625L6.43127 18.4297L8.47659 18.9437C8.8594 19.0422 9.23127 19.1406 9.59221 19.2281L8.9469 21.8422L10.5219 22.2359L11.1672 19.6547C11.5938 19.775 12.0094 19.8734 12.4141 19.9828L11.7688 22.5531L13.3438 22.9469L13.9891 20.3328C16.6578 20.8359 18.6594 20.6281 19.5016 18.2219C20.1797 16.2859 19.4688 15.1703 18.0688 14.4375C19.086 14.2078 19.8516 13.5406 20.0594 12.1625ZM16.4938 17.1609C16.0125 19.0969 12.7531 18.0469 11.6922 17.7844L12.5453 14.35C13.6063 14.6125 16.9969 15.1484 16.4938 17.1609ZM16.975 12.1297C16.5375 13.8906 13.825 12.9937 12.95 12.775L13.7266 9.6578C14.6016 9.87655 17.4344 10.2812 16.975 12.1297Z",fill:"white"})]}),jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsx(ot.ClipPath,{id:"btc_clip",children:jsxRuntime.jsx(ot.Rect,{width:28,height:28,fill:"white"})})})]})}function zs({size:e=28}){return jsxRuntime.jsxs(ot__default.default,{width:e,height:e,viewBox:"0 0 256 256",fill:"none",children:[jsxRuntime.jsxs(ot.Defs,{children:[jsxRuntime.jsxs(ot.LinearGradient,{id:"sol1",x1:"360.9",y1:"-37.5",x2:"141.2",y2:"383.3",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(ot.LinearGradient,{id:"sol2",x1:"264.8",y1:"-87.6",x2:"45.16",y2:"333.15",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]}),jsxRuntime.jsxs(ot.LinearGradient,{id:"sol3",x1:"312.55",y1:"-62.69",x2:"92.88",y2:"358.06",gradientUnits:"userSpaceOnUse",children:[jsxRuntime.jsx(ot.Stop,{offset:"0",stopColor:"#00FFA3"}),jsxRuntime.jsx(ot.Stop,{offset:"1",stopColor:"#DC1FFF"})]})]}),jsxRuntime.jsx(ot.Circle,{cx:128,cy:128,r:128,fill:"black"}),jsxRuntime.jsxs(ot.G,{transform:"translate(128,128) scale(0.35) translate(-198.85,-156)",children:[jsxRuntime.jsx(ot.Path,{fill:"url(#sol2)",d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z"}),jsxRuntime.jsx(ot.Path,{fill:"url(#sol3)",d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4c5.8,0,8.7-7,4.6-11.1L333.1,120.1z"}),jsxRuntime.jsx(ot.Path,{fill:"url(#sol1)",d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z"})]})]})}function Ms({size:e=28}){return jsxRuntime.jsx(ot__default.default,{width:e,height:e,viewBox:"0 0 32 32",fill:"none",children:jsxRuntime.jsxs(ot.G,{children:[jsxRuntime.jsx(ot.Circle,{cx:16,cy:16,r:16,fill:"#6F41D8"}),jsxRuntime.jsx(ot.Path,{fill:"#FFF",d:"M21.092 12.693c-.369-.215-.848-.215-1.254 0l-2.879 1.654-1.955 1.078-2.879 1.653c-.369.216-.848.216-1.254 0l-2.288-1.294c-.369-.215-.627-.61-.627-1.042V12.19c0-.431.221-.826.627-1.042l2.25-1.258c.37-.216.85-.216 1.256 0l2.25 1.258c.37.216.628.611.628 1.042v1.654l1.955-1.115v-1.653a1.16 1.16 0 0 0-.627-1.042l-4.17-2.372c-.369-.216-.848-.216-1.254 0l-4.244 2.372A1.16 1.16 0 0 0 6 11.076v4.78c0 .432.221.827.627 1.043l4.244 2.372c.369.215.849.215 1.254 0l2.879-1.618 1.955-1.114 2.879-1.617c.369-.216.848-.216 1.254 0l2.251 1.258c.37.215.627.61.627 1.042v2.552c0 .431-.22.826-.627 1.042l-2.25 1.294c-.37.216-.85.216-1.255 0l-2.251-1.258c-.37-.216-.628-.611-.628-1.042v-1.654l-1.955 1.115v1.653c0 .431.221.827.627 1.042l4.244 2.372c.369.216.848.216 1.254 0l4.244-2.372c.369-.215.627-.61.627-1.042v-4.78a1.16 1.16 0 0 0-.627-1.042l-4.28-2.409z"})]})})}var _r=[{label:"Base",value:stripeReactNative.Onramp.CryptoNetwork.base,defaultCrypto:"usdc",Icon:Ds},{label:"Ethereum",value:stripeReactNative.Onramp.CryptoNetwork.ethereum,defaultCrypto:"eth",Icon:Fs},{label:"Bitcoin",value:stripeReactNative.Onramp.CryptoNetwork.bitcoin,defaultCrypto:"btc",Icon:Es},{label:"Solana",value:stripeReactNative.Onramp.CryptoNetwork.solana,defaultCrypto:"sol",Icon:zs},{label:"Polygon",value:stripeReactNative.Onramp.CryptoNetwork.polygon,defaultCrypto:"matic",Icon:Ms}];function Hs(e,t=8,o=4){let n=e.trim();return n.length<=t+o+3?n:`${n.slice(0,t)}...${n.slice(-o)}`}function Pn(e,t){let o=parseFloat(e);if(isNaN(o))return e;let n=t.toLowerCase(),r=["eth","btc"].includes(n)?4:2;return o.toFixed(r)}function Ln(e){let t=e.trim().toLowerCase();if(!t)return e.trim();let o=_r.find(r=>r.label.toLowerCase()===t);if(o)return o.label;let n=_r.find(r=>String(r.value).toLowerCase()===t);return n?n.label:e.trim()}function $e({onPress:e,title:t}){let{components:o,fonts:n}=O(),r=jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Rr.closeBtn,onPress:e,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(lt,{size:20,color:o.header.buttonColor,strokeWidth:2})});return t?jsxRuntime.jsxs(reactNative.View,{style:Rr.headerWithTitle,children:[jsxRuntime.jsx(reactNative.View,{style:Rr.headerSide}),jsxRuntime.jsx(reactNative.Text,{style:[Rr.headerTitleText,{color:o.header.titleColor},...n.bold?[{fontFamily:n.bold}]:[]],numberOfLines:1,ellipsizeMode:"tail",accessibilityRole:"header",children:t}),r]}):jsxRuntime.jsxs(reactNative.View,{style:Rr.header,children:[jsxRuntime.jsx(reactNative.View,{style:Rr.headerSpacer}),r]})}var On={paddingTop:60,paddingBottom:16},Rr=reactNative.StyleSheet.create({header:{flexDirection:"row",justifyContent:"flex-end",...On},headerWithTitle:{flexDirection:"row",alignItems:"center",...On},headerSpacer:{flex:1},headerSide:{width:28},headerTitleText:{flex:1,textAlign:"center",fontSize:17},closeBtn:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"}});function pt({error:e,progress:t,loading:o}){let{colors:n,fonts:r}=O();return e?jsxRuntime.jsx(reactNative.Text,{style:[Ns.errorText,{color:n.error},...r.regular?[{fontFamily:r.regular}]:[]],children:e.message}):t&&o&&__DEV__?jsxRuntime.jsx(reactNative.Text,{style:[Ns.progressText,{color:n.foregroundSubtle},...r.regular?[{fontFamily:r.regular}]:[]],children:t}):null}var Ns=reactNative.StyleSheet.create({errorText:{fontSize:14,textAlign:"center",lineHeight:20,marginTop:24},progressText:{fontSize:13,textAlign:"center",lineHeight:18,marginTop:24}});function Ao({quote:e,label:t,value:o,mono:n,last:r}){return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,n&&e.rowMono],children:o})]}),r?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function Ei({quote:e,label:t,address:o,last:n}){let[r,i]=react.useState(false),{colors:s,components:c}=O(),d=()=>{reactNative.Clipboard.setString(o),i(true),setTimeout(()=>i(false),2e3);},u=Hs(o);return jsxRuntime.jsxs(react.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:e.row,children:[jsxRuntime.jsx(reactNative.Text,{style:e.rowLabel,children:t}),jsxRuntime.jsxs(reactNative.View,{style:e.rowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[e.rowValue,e.rowMono,{flexShrink:1,minWidth:0}],numberOfLines:1,ellipsizeMode:"middle",selectable:true,children:u}),jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:d,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:`Copy ${t}`,children:r?jsxRuntime.jsx(Be,{size:14,color:s.success,strokeWidth:2.5}):jsxRuntime.jsx(Xo,{size:14,color:c.card.actionIcon,strokeWidth:2})})]})]}),n?null:jsxRuntime.jsx(reactNative.View,{style:e.rowDivider})]})}function Ir(){let{colors:e,fonts:t,components:o}=O(),n=o.input,r=o.button,i=o.container,s=o.card,c=o.header;return react.useMemo(()=>{let d=s.borderRadius,u=reactNative.Platform.OS==="ios"?"Menlo":"monospace",a={flex:{flex:1},screen:{flex:1,backgroundColor:e.background,paddingHorizontal:24,paddingBottom:48},content:{flex:1,paddingTop:16},title:{fontSize:28,color:c.titleColor,marginBottom:8,...t.bold?{fontFamily:t.bold}:{}},subtitle:{fontSize:15,color:e.foregroundMuted,marginBottom:36,lineHeight:22,...t.regular?{fontFamily:t.regular}:{}},fieldWrap:{marginBottom:20},fieldLabel:{fontSize:13,color:e.foregroundSubtle,marginBottom:8,textTransform:"uppercase",letterSpacing:.5,...t.semibold?{fontFamily:t.semibold}:{}},input:{backgroundColor:n.backgroundColor,borderRadius:n.borderRadius,padding:16,fontSize:17,color:n.textColor,borderWidth:n.borderWidth,borderColor:n.borderColor,...t.regular?{fontFamily:t.regular}:{}},hint:{fontSize:12,color:e.foregroundSubtle,marginTop:8,...t.regular?{fontFamily:t.regular}:{}},emailRow:{flexDirection:"row",alignItems:"center",gap:6,marginTop:4,backgroundColor:e.card,paddingHorizontal:14,paddingVertical:10,borderRadius:Math.min(d,12)},emailLabel:{fontSize:13,color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},emailValue:{fontSize:13,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},footer:{gap:4},continueBtn:{backgroundColor:i.buttonColor,borderRadius:r.borderRadius,paddingVertical:18,alignItems:"center"},continueBtnDisabled:{backgroundColor:e.card},continueBtnText:{color:i.buttonTitleColor,fontSize:17,...t.bold?{fontFamily:t.bold}:{}},continueBtnTextDisabled:{color:e.foregroundSubtle,...t.regular?{fontFamily:t.regular}:{}},ghostBtn:{paddingVertical:16,alignItems:"center"},ghostBtnText:{color:e.foregroundMuted,fontSize:15,...t.medium?{fontFamily:t.medium}:{}},loaderInButton:{justifyContent:"center",alignItems:"center"}},g={amountContainer:{flex:1,alignItems:"center",justifyContent:"center",gap:8},amountText:{fontSize:64,color:e.foreground,letterSpacing:-2,minWidth:80,textAlign:"center",...t.regular?{fontFamily:t.regular}:{}},amountPlaceholder:{color:e.foregroundSubtle},currencyLabel:{fontSize:15,color:e.foregroundMuted,letterSpacing:1,...t.medium?{fontFamily:t.medium}:{}},numpad:{gap:4,marginBottom:24},numpadRow:{flexDirection:"row",justifyContent:"space-between"},numpadKey:{flex:1,height:68,alignItems:"center",justifyContent:"center",marginHorizontal:4},numpadKeyText:{fontSize:28,color:e.foreground,...t.regular?{fontFamily:t.regular}:{}},backspaceText:{fontSize:22,color:e.foregroundMuted,...t.regular?{fontFamily:t.regular}:{}}},T={heroBox:{backgroundColor:s.backgroundColor,borderRadius:d,padding:24,alignItems:"center",marginBottom:16,marginTop:8,borderWidth:s.borderWidth,borderColor:s.borderColor,gap:4},heroLabel:{fontSize:12,color:e.foregroundSubtle,letterSpacing:.5,textTransform:"uppercase",...t.semibold?{fontFamily:t.semibold}:{}},heroAmount:{fontSize:48,color:e.foreground,letterSpacing:-1,...t.bold?{fontFamily:t.bold}:{}},heroCurrency:{fontSize:22,color:e.primary,...t.medium?{fontFamily:t.medium}:{}},heroNetwork:{fontSize:15,color:e.foregroundSubtle,marginTop:2,...t.medium?{fontFamily:t.medium}:{}},card:{backgroundColor:s.backgroundColor,borderRadius:d,borderWidth:s.borderWidth,borderColor:s.borderColor,overflow:"hidden",marginBottom:12},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},rowRight:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:8},rowDivider:{height:1,marginHorizontal:16,backgroundColor:e.border},rowLabel:{fontSize:14,color:s.rowLeftLabel,...t.regular?{fontFamily:t.regular}:{}},rowValue:{fontSize:14,fontWeight:"500",color:s.rowRightLabel,...t.medium?{fontFamily:t.medium}:{}},rowMono:{fontFamily:u,fontSize:13}},C=Math.max(16,Math.min(d,22)),h={stackWrapper:{width:"100%",marginBottom:8,marginTop:4},swapCard:{backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,paddingHorizontal:16,paddingVertical:16},swapCardTop:{borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomLeftRadius:10,borderBottomRightRadius:10},swapCardBottom:{borderBottomLeftRadius:C,borderBottomRightRadius:C,borderTopLeftRadius:10,borderTopRightRadius:10,marginTop:16},swapConnectorWrap:{alignSelf:"center",zIndex:3,marginTop:-24,marginBottom:-32},swapConnectorCircle:{width:48,height:48,borderRadius:24,backgroundColor:e.primary,alignItems:"center",justifyContent:"center",borderWidth:4,borderColor:e.background},swapRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginTop:8,gap:12},swapLeftCol:{flex:1,minWidth:0},swapSpendAmount:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceivePrimary:{fontSize:40,color:e.foreground,letterSpacing:-1,...t.regular?{fontFamily:t.regular}:{}},swapReceiveSub:{fontSize:13,color:e.foregroundMuted,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},swapPill:{flexDirection:"row",alignItems:"center",gap:6,paddingVertical:10,paddingHorizontal:14,borderRadius:999,backgroundColor:e.cardHover,borderWidth:s.borderWidth,borderColor:e.border},swapPillText:{fontSize:16,color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},payHint:{fontSize:15,color:e.foregroundMuted,textAlign:"center",marginBottom:18,marginTop:4,...t.regular?{fontFamily:t.regular}:{}},summaryLabel:{fontSize:12,color:e.foregroundSubtle,textTransform:"uppercase",letterSpacing:.3,...t.semibold?{fontFamily:t.semibold}:{}},applePayBtn:{backgroundColor:r.secondaryBackground,borderRadius:r.borderRadius,borderWidth:r.borderWidth>0?r.borderWidth:1,borderColor:r.borderWidth>0?r.borderColor:e.border,paddingVertical:18,alignItems:"center",marginBottom:10},applePayBtnText:{color:r.secondaryText,fontSize:17,...t.bold?{fontFamily:t.bold}:{}}},b={input:{fontSize:14,fontFamily:u},list:{gap:8},row:{flexDirection:"row",alignItems:"center",paddingVertical:14,paddingHorizontal:16,borderRadius:Math.min(d,14),borderWidth:s.borderWidth,borderColor:e.border,backgroundColor:e.card},rowSelected:{borderColor:e.primary,backgroundColor:e.successBackground},iconWrap:{width:32,height:32,alignItems:"center",justifyContent:"center",marginRight:12},rowText:{flex:1,fontSize:15,color:e.foregroundMuted,...t.medium?{fontFamily:t.medium}:{}},rowTextSelected:{color:e.foreground,...t.semibold?{fontFamily:t.semibold}:{}},checkCircle:{width:24,height:24,borderRadius:12,backgroundColor:e.primary,alignItems:"center",justifyContent:"center"}},p={centered:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:24},spinnerWrap:{width:80,height:80,borderRadius:40,backgroundColor:e.card,borderWidth:s.borderWidth,borderColor:e.border,alignItems:"center",justifyContent:"center",marginBottom:28},idIcon:{fontSize:36},checkCircle:{width:80,height:80,borderRadius:40,backgroundColor:e.successBackground,borderWidth:2,borderColor:e.success,alignItems:"center",justifyContent:"center",marginBottom:28},heading:{fontSize:28,color:c.titleColor,textAlign:"center",marginBottom:10,...t.bold?{fontFamily:t.bold}:{}},sub:{fontSize:15,color:e.foregroundMuted,textAlign:"center",lineHeight:22,marginBottom:36,...t.regular?{fontFamily:t.regular}:{}},successScrollContent:{flexGrow:1,width:"100%",alignItems:"center",paddingBottom:24},detailCard:{width:"100%"}};return {form:a,quote:T,pm:h,wallet:b,flow:p,amount:g}},[e,t,n,r,i,s,c])}var oc=[["1","2","3"],["4","5","6"],["7","8","9"],["\u232B","0","."]];function Bn({initialAmount:e="",currency:t="USD",onConfirm:o,onCancel:n}){let r=Ir(),[i,s]=react.useState(e),c=g=>{if(g==="\u232B"){s(T=>T.slice(0,-1));return}if(g==="."){if(i.includes("."))return;s(T=>T===""?"0.":T+".");return}s(T=>{let C=T.indexOf(".");return C!==-1&&T.length-C>2?T:T==="0"&&g!=="."?g:T+g});},d=i===""?"0":i,u=parseFloat(i),a=i!==""&&!isNaN(u)&&u>0;return jsxRuntime.jsxs(reactNative.View,{style:r.form.screen,children:[jsxRuntime.jsx($e,{onPress:n,title:"Enter amount"}),jsxRuntime.jsxs(reactNative.View,{style:r.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:r.amount.amountContainer,children:[jsxRuntime.jsxs(reactNative.Text,{style:[r.amount.amountText,d==="0"&&r.amount.amountPlaceholder],adjustsFontSizeToFit:true,numberOfLines:1,children:["$",d]}),jsxRuntime.jsx(reactNative.Text,{style:r.amount.currencyLabel,children:t.toUpperCase()})]}),jsxRuntime.jsx(reactNative.View,{style:r.amount.numpad,children:oc.map((g,T)=>jsxRuntime.jsx(reactNative.View,{style:r.amount.numpadRow,children:g.map(C=>jsxRuntime.jsx(reactNative.TouchableOpacity,{style:r.amount.numpadKey,onPress:()=>c(C),activeOpacity:.6,children:jsxRuntime.jsx(reactNative.Text,{style:C==="\u232B"?r.amount.backspaceText:r.amount.numpadKeyText,children:C})},C))},T))}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[r.form.continueBtn,!a&&r.form.continueBtnDisabled],onPress:()=>a&&o(i),disabled:!a,children:jsxRuntime.jsx(reactNative.Text,{style:[r.form.continueBtnText,!a&&r.form.continueBtnTextDisabled],children:"Continue"})})]})]})}function Ie({size:e=56,strokeWidth:t=3,children:o,iconSize:n,style:r,gradientFrom:i,gradientTo:s}){let{colors:c}=O(),d=i??c.warning,u=s??"#FBBF24",a=react.useRef(new reactNative.Animated.Value(0)).current,g=react.useId(),T=react.useMemo(()=>`circularProgressGrad_${g.replace(/[^a-zA-Z0-9_-]/g,"")}`,[g]),C=(e-t)/2,h=2*Math.PI*C,b=e/2,p=n??Math.max(0,Math.round(e-t*2-8)),y=(e-p)/2;react.useEffect(()=>{let l=reactNative.Animated.loop(reactNative.Animated.timing(a,{toValue:1,duration:1500,easing:reactNative.Easing.linear,useNativeDriver:true}));return l.start(),()=>l.stop()},[a]);let m=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return jsxRuntime.jsxs(reactNative.View,{style:[{width:e,height:e},r],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",top:0,left:0,width:e,height:e,transform:[{rotate:m}]},children:jsxRuntime.jsxs(ot__default.default,{width:e,height:e,children:[jsxRuntime.jsx(ot.Defs,{children:jsxRuntime.jsxs(ot.LinearGradient,{id:T,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[jsxRuntime.jsx(ot.Stop,{offset:"0%",stopColor:d}),jsxRuntime.jsx(ot.Stop,{offset:"100%",stopColor:u})]})}),jsxRuntime.jsx(ot.Circle,{cx:b,cy:b,r:C,stroke:`url(#${T})`,strokeWidth:t,fill:"none",strokeDasharray:`${h*.75} ${h*.25}`,strokeLinecap:"round",rotation:-90,origin:`${b}, ${b}`})]})}),o!=null?jsxRuntime.jsx(reactNative.View,{style:{position:"absolute",top:y+1.5,left:y,width:p,height:p},children:o}):null]})}var Zr=4;function Wn({initialData:e={},loading:t=false,onComplete:o,onCancel:n}){let r=Ir(),{colors:i,fonts:s,components:c}=O(),d=c.input.placeholderColor,[u,a]=react.useState(1),[g,T]=react.useState(e.firstName??""),[C,h]=react.useState(e.lastName??""),[b,p]=react.useState(e.dobMonth??""),[y,m]=react.useState(e.dobDay??""),[l,f]=react.useState(e.dobYear??""),[R,S]=react.useState(e.addressLine1??""),[A,B]=react.useState(e.addressLine2??""),[k,J]=react.useState(e.city??""),[q,M]=react.useState(e.state??""),[H,X]=react.useState(e.postalCode??""),[U,Qe]=react.useState(e.country??"US"),[We,Ge]=react.useState(e.idNumber??""),ee=react.useRef(null),Te=react.useRef(null),Ae=react.useRef(null),xe=react.useRef(null),Oe=react.useRef(null),te=react.useRef(null),Ee=react.useRef(null),it=react.useRef(null),st=()=>{switch(u){case 1:return g.trim().length>0&&C.trim().length>0;case 2:return b.length===2&&y.length===2&&l.length===4;case 3:return R.trim().length>0&&k.trim().length>0&&q.trim().length>0&&H.trim().length>0;case 4:return We.trim().length>0;default:return false}},dt=()=>{st()&&(u<Zr?a(ce=>ce+1):o({firstName:g,lastName:C,idNumber:We,dobMonth:b,dobDay:y,dobYear:l,addressLine1:R,addressLine2:A,city:k,state:q,postalCode:H,country:U}));},at=()=>{u>1?a(ce=>ce-1):n();},Ct=["Enter your name","Enter your date of birth","Enter your address","Enter your SSN"],Je=["Use your full legal name as it appears on your ID.","We use this to verify your identity.","Enter the address associated with your ID.","Your SSN is encrypted and used only for identity verification."],oo=[He.stepCounter,{color:i.foregroundMuted},...s.semibold?[{fontFamily:s.semibold}]:[]];return jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:r.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:r.form.screen,children:[jsxRuntime.jsxs(reactNative.View,{style:He.header,children:[jsxRuntime.jsx(reactNative.View,{style:He.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:He.iconButton,onPress:at,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:u>1?"Back":"Cancel",children:jsxRuntime.jsx(Yr,{size:20,color:c.header.buttonColor,strokeWidth:2})})}),jsxRuntime.jsx(reactNative.View,{style:He.headerCenter,children:jsxRuntime.jsxs(reactNative.Text,{style:oo,children:[u," of ",Zr]})}),jsxRuntime.jsx(reactNative.View,{style:He.headerSide,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:He.iconButton,onPress:n,hitSlop:{top:10,bottom:10,left:10,right:10},accessibilityRole:"button",accessibilityLabel:"Close",children:jsxRuntime.jsx(lt,{size:20,color:c.header.buttonColor,strokeWidth:2})})})]}),jsxRuntime.jsx(reactNative.View,{style:He.progressTrack,children:Array.from({length:Zr}).map((ce,j)=>jsxRuntime.jsx(reactNative.View,{style:[He.progressSegment,{backgroundColor:j<u||j+1===u?i.primary:i.border}]},j))}),jsxRuntime.jsxs(reactNative.ScrollView,{style:r.form.flex,contentContainerStyle:He.scrollContent,keyboardShouldPersistTaps:"handled",children:[jsxRuntime.jsx(reactNative.Text,{style:r.form.title,children:Ct[u-1]}),jsxRuntime.jsx(reactNative.Text,{style:r.form.subtitle,children:Je[u-1]}),u===1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wo,{form:r.form,label:"First name",children:jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"Jane",placeholderTextColor:d,value:g,onChangeText:T,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>ee.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"Last name",children:jsxRuntime.jsx(reactNative.TextInput,{ref:ee,style:r.form.input,placeholder:"Doe",placeholderTextColor:d,value:C,onChangeText:h,autoCapitalize:"words",returnKeyType:"done",onSubmitEditing:dt})})]}),u===2&&jsxRuntime.jsxs(reactNative.View,{style:He.dobRow,children:[jsxRuntime.jsxs(reactNative.View,{style:He.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Month"}),jsxRuntime.jsx(reactNative.TextInput,{style:[r.form.input,He.dobInput],placeholder:"MM",placeholderTextColor:d,value:b,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,2);p(j),j.length===2&&Te.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:He.dobCol,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Day"}),jsxRuntime.jsx(reactNative.TextInput,{ref:Te,style:[r.form.input,He.dobInput],placeholder:"DD",placeholderTextColor:d,value:y,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,2);m(j),j.length===2&&Ae.current?.focus();},keyboardType:"number-pad",maxLength:2})]}),jsxRuntime.jsxs(reactNative.View,{style:He.dobColWide,children:[jsxRuntime.jsx(reactNative.Text,{style:[r.form.fieldLabel,He.dobLabel],children:"Year"}),jsxRuntime.jsx(reactNative.TextInput,{ref:Ae,style:[r.form.input,He.dobInput],placeholder:"YYYY",placeholderTextColor:d,value:l,onChangeText:ce=>{let j=ce.replace(/\D/g,"").slice(0,4);f(j);},keyboardType:"number-pad",maxLength:4,returnKeyType:"done",onSubmitEditing:dt})]})]}),u===3&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(wo,{form:r.form,label:"Street address",children:jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"123 Main St",placeholderTextColor:d,value:R,onChangeText:S,returnKeyType:"next",onSubmitEditing:()=>xe.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"Apt, suite, etc. (optional)",children:jsxRuntime.jsx(reactNative.TextInput,{ref:xe,style:r.form.input,placeholder:"Apt 2",placeholderTextColor:d,value:A,onChangeText:B,returnKeyType:"next",onSubmitEditing:()=>Oe.current?.focus()})}),jsxRuntime.jsx(wo,{form:r.form,label:"City",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Oe,style:r.form.input,placeholder:"San Francisco",placeholderTextColor:d,value:k,onChangeText:J,autoCapitalize:"words",returnKeyType:"next",onSubmitEditing:()=>te.current?.focus()})}),jsxRuntime.jsxs(reactNative.View,{style:He.row,children:[jsxRuntime.jsx(reactNative.View,{style:[r.form.flex,{marginRight:8}],children:jsxRuntime.jsx(wo,{form:r.form,label:"State",children:jsxRuntime.jsx(reactNative.TextInput,{ref:te,style:r.form.input,placeholder:"NY",placeholderTextColor:d,value:q,onChangeText:ce=>M(ce.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"next",onSubmitEditing:()=>Ee.current?.focus()})})}),jsxRuntime.jsx(reactNative.View,{style:r.form.flex,children:jsxRuntime.jsx(wo,{form:r.form,label:"ZIP code",children:jsxRuntime.jsx(reactNative.TextInput,{ref:Ee,style:r.form.input,placeholder:"11201",placeholderTextColor:d,value:H,onChangeText:X,keyboardType:"number-pad",maxLength:10,returnKeyType:"next",onSubmitEditing:()=>it.current?.focus()})})})]}),jsxRuntime.jsx(wo,{form:r.form,label:"Country",children:jsxRuntime.jsx(reactNative.TextInput,{ref:it,style:r.form.input,placeholder:"US",placeholderTextColor:d,value:U,onChangeText:ce=>Qe(ce.toUpperCase().slice(0,2)),autoCapitalize:"characters",maxLength:2,returnKeyType:"done",onSubmitEditing:dt})})]}),u===4&&jsxRuntime.jsxs(wo,{form:r.form,label:"Social Security Number",children:[jsxRuntime.jsx(reactNative.TextInput,{style:r.form.input,placeholder:"123-45-6789",placeholderTextColor:d,value:We,onChangeText:Ge,keyboardType:"number-pad",secureTextEntry:true,returnKeyType:"done",onSubmitEditing:dt}),jsxRuntime.jsx(reactNative.Text,{style:[r.form.hint,He.ssnHint],children:"Your SSN is transmitted securely and never stored on this device."})]})]}),jsxRuntime.jsx(reactNative.View,{style:r.form.footer,children:t&&u===Zr?jsxRuntime.jsx(reactNative.View,{style:[r.form.continueBtn,r.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[r.form.continueBtn,!st()&&r.form.continueBtnDisabled],onPress:dt,disabled:!st(),children:jsxRuntime.jsx(reactNative.Text,{style:[r.form.continueBtnText,!st()&&r.form.continueBtnTextDisabled],children:u===Zr?"Submit":"Continue"})})})]})})}function wo({form:e,label:t,children:o}){return jsxRuntime.jsxs(reactNative.View,{style:e.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.fieldLabel,children:t}),o]})}var He=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:60,paddingBottom:16},headerSide:{width:40,alignItems:"center"},headerCenter:{flex:1,alignItems:"center",justifyContent:"center"},iconButton:{width:28,height:28,borderRadius:8,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},stepCounter:{fontSize:15},progressTrack:{flexDirection:"row",gap:4,marginBottom:32},progressSegment:{flex:1,height:3,borderRadius:2},scrollContent:{flexGrow:1,paddingBottom:16,paddingTop:16},dobRow:{flexDirection:"row",gap:10,marginBottom:20},dobCol:{flex:1},dobColWide:{flex:1.5},dobLabel:{textAlign:"center"},dobInput:{textAlign:"center"},row:{flexDirection:"row"},ssnHint:{marginTop:10,lineHeight:18}});var hc="https://api.unifold.io",Hi="__UnifoldDevApiBaseUrl__",Et="pk_test_123",An={};function yc(){if(typeof __DEV__>"u"||!__DEV__||typeof globalThis>"u")return;let e=globalThis[Hi];if(typeof e!="string")return;let t=e.trim();return t.length>0?t:void 0}function ft(){return yc()??hc}function En(e){if(e.publishableKey!==void 0){if(!e.publishableKey||e.publishableKey.trim()==="")throw new Error("Unifold SDK: publishableKey cannot be empty. Please provide a valid publishable key.");!e.publishableKey.startsWith("pk_test_")&&!e.publishableKey.startsWith("pk_live_")&&console.warn('Unifold SDK: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),Et=e.publishableKey;}e.defaultConfig&&(An=e.defaultConfig);}function Gs(e){if(typeof __DEV__>"u"||!__DEV__){console.warn("[Unifold] setDevApiUrl() is only available in development mode");return}if(typeof globalThis>"u")return;let t=e.trim();t.length>0?globalThis[Hi]=t:delete globalThis[Hi];}function Xr(){return ft()}function zn(){return Et}function Qt(e){if(!e||e.trim()==="")throw new Error("Unifold SDK: No publishable key configured. Please provide a valid publishable key via setApiConfig() or pass it directly to the API function.");e==="pk_test_123"&&console.warn('Unifold SDK: Using default test key "pk_test_123". This should only be used for local development. Please use a real publishable key in production.');}function _t(e){let t=e.startsWith("/")?e:`/${e}`;return `${ft()}/api/public${t}`}function se(e){return e?e.includes("localhost")||e.includes("127.0.0.1")?e.replace(/https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?/,ft()):e.startsWith("http://")||e.startsWith("https://")?e:e.startsWith("/api/public/")?`${ft()}${e}`:`${ft()}/api/public${e}`:""}async function nr(e,t){if(!e?.external_user_id)throw new Error("external_user_id is required");let o=e?.recipient_address||An.recipientAddress;if(!o)throw new Error("[Unifold] recipient_address is required for createDepositAddress. Pass recipientAddress in your beginDeposit() config.");let n={external_user_id:e.external_user_id,destination_chain_type:e?.destination_chain_type||"ethereum",destination_chain_id:e?.destination_chain_id||An.destinationChainId||"8453",destination_token_address:e?.destination_token_address||An.destinationTokenAddress||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:o,client_metadata:e?.client_metadata||{}},r=t||Et;Qt(r);let i=await fetch(`${ft()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":r,"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to create deposit address: ${i.statusText}`);return await i.json()}function ir(e,t){return e.find(o=>o.chain_type===t)}async function en(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/direct_executions/query`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({external_user_id:e})});if(!n.ok)throw new Error(`Failed to query executions: ${n.statusText}`);return n.json()}async function Ni(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/direct_executions/poll`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify({deposit_wallet_id:e})});if(!n.ok)throw new Error(`Failed to poll executions: ${n.statusText}`);return n.json()}function Re(e,t="svg"){if(!e)return "";if(t==="svg"||!e.icon_urls||e.icon_urls.length===0)return e.icon_url;let o=e.icon_urls.find(n=>n.format===t);return o?o.url:e.icon_url}async function tn(e,t){let o=e||Et;Qt(o);let n=`${ft()}/v1/public/tokens/supported_deposit_tokens`;if(t?.destination_token_address&&t?.destination_chain_id&&t?.destination_chain_type){let i=new URLSearchParams({destination_token_address:t.destination_token_address,destination_chain_id:t.destination_chain_id,destination_chain_type:t.destination_chain_type});n=`${n}?${i.toString()}`;}let r=await fetch(n,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch supported deposit tokens: ${r.statusText}`);return r.json()}async function Ui(e,t){let o=t||Et;Qt(o);let n=new URLSearchParams({chainType:e.chain_type,chainId:e.chain_id,tokenAddress:e.token_address}),r=await fetch(`${ft()}/v1/public/tokens/token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch token metadata: ${r.statusText}`);return r.json()}function Mn(e,t,o){return !e||e.length===0?o||"":e.find(r=>r.format===t)?.url||o||e[0]?.url||""}async function ji(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/onramps/quotes`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to fetch onramp quotes: ${n.statusText}`);return n.json()}async function $i(e,t){let o=t||Et;Qt(o);let n=await fetch(`${ft()}/v1/public/onramps/sessions`,{method:"POST",headers:{accept:"application/json","x-publishable-key":o,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw new Error(`Failed to create onramp session: ${n.statusText}`);return n.json()}async function qi(e,t){let o=t||Et;Qt(o);let n=new URLSearchParams;e.country_code&&n.append("country_code",e.country_code),e.subdivision_code&&n.append("subdivision_code",e.subdivision_code),n.append("token_address",e.token_address),n.append("chain_id",e.chain_id),n.append("chain_type",e.chain_type);let r=await fetch(`${ft()}/v1/public/onramps/default_token?${n.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":o}});if(!r.ok)throw new Error(`Failed to fetch default onramp token: ${r.statusText}`);return r.json()}async function Ki(e){let t=e||Et;Qt(t);let o=await fetch(`${ft()}/v1/public/onramps/fiat_currencies`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch fiat currencies: ${o.statusText}`);return o.json()}function Pr(e,t="png"){if(!e||e.length===0)return;let o=e.find(n=>n.format===t);return o?o.url:e[0]?.url}async function on(e){let t=e||Et;Qt(t);let o=await fetch(`${ft()}/v1/public/projects/config`,{method:"GET",headers:{accept:"application/json","x-publishable-key":t}});if(!o.ok)throw new Error(`Failed to fetch project config: ${o.statusText}`);return o.json()}async function rn(){let e=await fetch(`${ft()}/v1/public/ip_address`,{method:"GET",headers:{accept:"application/json"}});if(!e.ok)throw new Error(`Failed to fetch IP address information: ${e.statusText}`);return e.json()}async function Js(e,t,o,n,r){let i=r||Et;Qt(i);let s=await fetch(`${ft()}/v1/public/addresses/balance`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json","x-publishable-key":i},body:JSON.stringify({address:e,chain_type:t,chain_id:o,token_address:n})});if(!s.ok)throw new Error(`Failed to fetch address balance: ${s.statusText}`);return s.json()}var Zs="",Xs;function Hn(e){Zs=e;}function Nn(e){Xs=e;}function ao(){let e=Zs||zn();if(!e)throw new Error("[Unifold] No publishable key configured. Set via UnifoldProvider or setStripeOnrampPublishableKey().");return e}function lo(){return Xs??Xr()}async function Un(){let e=`${lo()}/v1/public/onramps/headless/stripe/config`,t=ao(),o=await fetch(e,{method:"GET",headers:{"x-publishable-key":t,"Content-Type":"application/json"}});if(!o.ok)throw new Error(`Failed to load Stripe config: ${o.status}`);let n=await o.json();if(!n?.publishable_key)throw new Error("Missing Stripe publishable key in config response");return n.publishable_key}async function ea(e){let t=await fetch(`${lo()}/v1/public/onramps/headless/stripe/oauth/start`,{method:"POST",headers:{"x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify({email:e})});if(!t.ok)throw new Error(`Failed to create auth intent: ${t.status}`);let o=await t.json();return o.auth_intent_id??o.id}async function ta(e){let t=await fetch(`${lo()}/v1/public/onramps/headless/stripe/oauth/token`,{method:"POST",headers:{"x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify({auth_intent_id:e})});if(!t.ok)throw new Error(`Failed to exchange auth intent for tokens: ${t.status}`);return t.json()}async function oa(e,t){let o={crypto_customer_id:e.cryptoCustomerId,payment_token:e.paymentToken,source_amount:e.sourceAmount,source_currency:e.sourceCurrency,destination_currency:e.destinationCurrency,wallet_address:e.walletAddress,destination_network:e.destinationNetwork},n=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"},body:JSON.stringify(o)}),r=await n.text();if(!n.ok)throw new Error(`Failed to create onramp session: ${n.status} ${r}`);return JSON.parse(r)}async function ra(e,t){let o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}/confirm`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}}),n=await o.text();if(!o.ok)throw new Error(`Failed to confirm onramp session: ${o.status} ${n}`);return JSON.parse(n)}async function na(e,t){let o=`${lo()}/v1/public/onramps/headless/stripe/customers/${e}`,n=await fetch(o,{method:"GET",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t}}),r=await n.text();if(!n.ok)throw new Error(`Failed to get onramp customer: ${n.status} ${r}`);return JSON.parse(r)}async function ia(e,t){let o=`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}`,n=await fetch(o,{method:"GET",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t}}),r=await n.text();if(!n.ok)throw new Error(`Failed to get onramp session: ${n.status} ${r}`);return JSON.parse(r)}async function sa(e,t){let o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/sessions/${e}/quote/refresh`,{method:"POST",headers:{"x-publishable-key":ao(),"x-stripe-oauth-token":t,"Content-Type":"application/json"}});if(!o.ok){let n=await o.text();throw new Error(`Failed to refresh quote: ${o.status} ${n}`)}return o.json()}async function aa(e){if(!e.recipient_address)throw new Error("[Unifold] recipient_address is required for fetchDepositAddress. Pass recipientAddress in your onramp config.");let t={external_user_id:e.external_user_id,destination_chain_type:e.destination_chain_type||"ethereum",destination_chain_id:e.destination_chain_id||"8453",destination_token_address:e.destination_token_address||"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",recipient_address:e.recipient_address,client_metadata:{}},o=await fetch(`${lo()}/v1/public/deposit_addresses`,{method:"POST",headers:{accept:"application/json","x-publishable-key":ao(),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!o.ok)throw new Error(`Failed to create deposit address: ${o.status}`);return o.json()}async function la(e){let t=new URLSearchParams({token_address:e.token_address,chain_id:e.chain_id,chain_type:e.chain_type}),o=await fetch(`${lo()}/v1/public/onramps/headless/stripe/default_token?${t.toString()}`,{method:"GET",headers:{accept:"application/json","x-publishable-key":ao()}});if(!o.ok)throw new Error(`Failed to fetch default onramp token: ${o.status}`);return o.json()}var kc=5,ca={firstName:"",lastName:"",idNumber:"",dobDay:"",dobMonth:"",dobYear:"",addressLine1:"",addressLine2:"",city:"",state:"",postalCode:"",country:"US"};function jn(e){let t=e?.flowOrder==="amount_first",o=t?"session_params":"email",{configure:n,hasLinkAccount:r,registerLinkUser:i,authorize:s,attachKycInfo:c,presentKycInfoVerification:d,verifyIdentity:u,registerWalletAddress:a,collectPaymentMethod:g,createCryptoPaymentToken:T}=stripeReactNative.useOnramp(),[C,h]=react.useState(o),[b,p]=react.useState(false),[y,m]=react.useState(""),[l,f]=react.useState(null),[R,S]=react.useState(e?.email??""),[A,B]=react.useState(e?.phone??""),[k,J]=react.useState(""),[q,M]=react.useState("US"),[H,X]=react.useState(""),[U,Qe]=react.useState(""),[We,Ge]=react.useState(false),[ee,Te]=react.useState(false),Ae=react.useRef(0),xe=react.useRef(false),Oe=react.useRef(false),te=react.useRef(false),Ee=react.useRef(""),it=react.useRef(null),[st,dt]=react.useState(ca),[at,Ct]=react.useState(e?.defaultWalletAddress??"0x102471956A026866171C44F326e1DfafB6C6e34c"),[Je,oo]=react.useState(""),[ce,j]=react.useState(e?.defaultNetwork??stripeReactNative.Onramp.CryptoNetwork.base),[_e,Kt]=react.useState(e?.defaultSourceAmount??"100"),[Ce,bt]=react.useState(e?.defaultSourceCurrency??"usd"),[Xe,ut]=react.useState(e?.defaultDestinationCurrency??"usdc"),[de,et]=react.useState(null),[ro,ze]=react.useState(false),ge=react.useRef(null),Ht=react.useRef(false),Dt=react.useRef(0),ho=react.useRef(e?.onComplete),Ze=react.useRef(e?.onError),Do=react.useRef(e?.onStepChange),je=react.useRef(o);react.useEffect(()=>{ho.current=e?.onComplete;},[e?.onComplete]),react.useEffect(()=>{Ze.current=e?.onError;},[e?.onError]),react.useEffect(()=>{Do.current=e?.onStepChange;},[e?.onStepChange]);let no=react.useRef(o);react.useEffect(()=>{C!==no.current&&(Do.current?.(C,no.current),no.current=C),je.current=C;},[C]);let F=react.useCallback((_,E,K)=>{let w={code:_,message:E,step:je.current,stripeErrorCode:K};f(w),m(""),Ze.current?.(w);},[]),Bt=react.useCallback(_=>{let E={sessionId:_.id,status:_.status,sourceAmount:_.transaction_details.source_amount,sourceCurrency:_.transaction_details.source_currency,destinationAmount:_.transaction_details.destination_amount,destinationCurrency:_.transaction_details.destination_currency,destinationNetwork:_.transaction_details.destination_network,walletAddress:_.transaction_details.wallet_address,fees:{networkFee:_.transaction_details.fees.network_fee_amount,transactionFee:_.transaction_details.fees.transaction_fee_amount}};return ho.current?.(E),E},[]),he=react.useCallback(()=>f(null),[]);react.useEffect(()=>{if(!(e?.merchantIdentifier?.trim()??"")){ze(false);return}let E=false;return stripeReactNative.isPlatformPaySupported().then(K=>{E||ze(K);}),()=>{E=true;}},[e?.merchantIdentifier]),react.useEffect(()=>(Ht.current=false,()=>{Ht.current=true,ge.current&&clearTimeout(ge.current);}),[]),react.useEffect(()=>{if(!e?.publishableKey||!e?.externalUserId||!e?.recipientAddress||We||ee)return;let _=false;Te(true);async function E(){try{let[K,w]=await Promise.all([aa({external_user_id:e.externalUserId,recipient_address:e.recipientAddress,destination_chain_type:e?.destinationChainType,destination_chain_id:e?.destinationChainId,destination_token_address:e?.destinationTokenAddress}),e?.destinationTokenAddress&&e?.destinationChainId&&e?.destinationChainType?la({token_address:e.destinationTokenAddress,chain_id:e.destinationChainId,chain_type:e.destinationChainType}).catch(Me=>(console.warn("[useStripeOnramp] fetchDefaultOnrampToken failed, using chain_id fallback:",Me?.message),null)):Promise.resolve(null)]);if(_)return;let P=e?.destinationChainType??"ethereum",ie=K.data.find(Me=>Me.chain_type===P);if(ie?.address){let Me=ie.address.toLowerCase();Ct(Me),Ee.current=Me,ie.recipient_address&&oo(ie.recipient_address);}else console.warn("[resolveWallet] No wallet found for chain_type",P,"in",K.data?.length,"wallets");let De={base:stripeReactNative.Onramp.CryptoNetwork.base,ethereum:stripeReactNative.Onramp.CryptoNetwork.ethereum,solana:stripeReactNative.Onramp.CryptoNetwork.solana,bitcoin:stripeReactNative.Onramp.CryptoNetwork.bitcoin,polygon:stripeReactNative.Onramp.CryptoNetwork.polygon},Bo={8453:"base",1:"ethereum",137:"polygon"},Ft=w?.destination_network,xt="none";if(Ft&&De[Ft])j(De[Ft]),xt=Ft+" (from default_token API)";else if(e?.destinationChainId&&Bo[e.destinationChainId]){let Me=Bo[e.destinationChainId];De[Me]&&j(De[Me]),xt=Me+" (from chain_id "+e.destinationChainId+")";}else De[P]&&(j(De[P]),xt=P+" (from chain_type fallback)");w?.destination_currency&&ut(w.destination_currency.toLowerCase()),Ge(!0),te.current=!0;}catch(K){console.error("[useStripeOnramp] Failed to resolve wallet:",K?.message),Ge(true),te.current=true;}finally{_||Te(false);}}return E(),()=>{_=true;}},[e?.publishableKey,e?.externalUserId]);let ne=react.useCallback(async()=>{if(it.current)return it.current;let _=n({merchantDisplayName:e?.merchantDisplayName??"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(E=>(E.error&&(console.error("[useStripeOnramp] configureSDK error:",E.error.message,E.error.code),it.current=null),E)).catch(E=>{throw console.error("[useStripeOnramp] configureSDK threw:",E?.message??E),it.current=null,E});return it.current=_,_},[n,e?.merchantDisplayName]);react.useEffect(()=>{ne();},[]);let be=react.useCallback(async _=>{if(!xe.current){xe.current=true,p(true),he(),m("Creating auth intent...");try{let E=await ea(_);m("Waiting for authorization...");let K=await s(E);if(K?.error){F("authorization_error",K.error.message,K.error.code),h("email");return}if(K?.status==="Denied"){F("authorization_error","Authorization denied by user."),h("email");return}if(K?.status!=="Consented"||!K.customerId){F("authorization_error","Authorization was canceled."),h("email");return}m("Exchanging tokens...");let w=await ta(E),P=K.customerId,ie=w.access_token;X(P),Qe(ie),m("Checking verification status...");try{let De=await na(P,ie),Bo=De.verifications.find(yo=>yo.name==="kyc_verified"),Ft=De.verifications.find(yo=>yo.name==="id_document_verified"),xt=Bo?.status==="verified",Me=Bo?.status==="rejected",Fo=Ft?.status==="verified",Ri=De.provided_fields.includes("first_name");if(m(""),Me&&!Ri)F("kyc_error","KYC was previously rejected. Please submit with correct info."),h("kyc");else if(Me&&Ri)h(Fo?"wallet":"identity");else if(!xt&&!Ri)h("kyc");else if(!Fo)h("identity");else if(te.current&&Ee.current)try{let yo=await a(Ee.current,ce);yo?.error?(F("wallet_error",yo.error.message,yo.error.code),h("wallet")):h(t?"payment_method":"session_params");}catch(yo){console.warn("[proceedToAuthorize] Inline wallet registration failed, falling back to wallet step:",yo?.message),h("wallet");}else h("wallet");}catch(De){console.warn("[getOnrampCustomer] failed, defaulting to kyc:",De?.message),m(""),h("kyc");}}catch(E){F("authorization_error",E?.message??String(E)),h("email");}finally{xe.current=false,p(false);}}},[s,he,F,a,ce,t]),V=react.useCallback(async()=>{if(reactNative.Keyboard.dismiss(),!R){F("validation_error","Please enter an email address.");return}p(true),he(),m("");try{m("Configuring...");let _=await ne();if(_.error){F("configuration_error",_.error.message,_.error.code);return}m("Checking Link account...");let E=await r(R);if(E.error){F("authorization_error",E.error.message,E.error.code);return}E.hasLinkAccount?await be(R):(m(""),h("register"));}catch(_){F("unknown_error",_?.message??String(_));}finally{p(false);}},[he,ne,R,F,r,be]),N=react.useCallback(async()=>{if(!A){F("validation_error","Please enter your phone number.");return}p(true),he(),m("");try{m("Creating Link account...");let _=await i({email:R,phone:A,fullName:k||R,country:q||"US"});if(_.error){F("registration_error",_.error.message,_.error.code);return}await be(R);}catch(_){F("registration_error",_?.message??String(_));}finally{p(false);}},[he,q,R,F,k,A,i,be]);react.useEffect(()=>{if(C!=="email"||!e?.email)return;let _=++Ae.current,E=false,K=()=>E||Ae.current!==_;return e?.phone?(async()=>{p(true),he();try{m("Configuring...");let w=await ne();if(K())return;if(w.error){F("configuration_error",w.error.message,w.error.code);return}m("Checking Link account...");let P=await r(e.email);if(K())return;if(P.error){F("authorization_error",P.error.message,P.error.code);return}if(P.hasLinkAccount){if(K())return;await be(e.email);}else {m("Creating Link account...");let ie=await i({email:e.email,phone:e.phone,fullName:e.email,country:"US"});if(K())return;if(ie.error){F("registration_error",ie.error.message,ie.error.code);return}if(K())return;await be(e.email);}}catch(w){K()||F("unknown_error",w?.message??String(w));}finally{p(false);}})():(async()=>{p(true),he();try{m("Configuring...");let w=await ne();if(K())return;if(w.error){F("configuration_error",w.error.message,w.error.code);return}m("Checking Link account...");let P=await r(e.email);if(K())return;if(P.error){F("authorization_error",P.error.message,P.error.code);return}if(P.hasLinkAccount){if(K())return;await be(e.email);}else {if(K())return;m(""),h("register");}}catch(w){K()||F("unknown_error",w?.message??String(w));}finally{p(false);}})(),()=>{E=true;}},[C,e?.email,e?.phone]);let re=react.useCallback(async _=>{p(true),he(),m(""),dt(_);try{let E={firstName:_.firstName,lastName:_.lastName,idNumber:_.idNumber||void 0,dateOfBirth:{day:parseInt(_.dobDay,10),month:parseInt(_.dobMonth,10),year:parseInt(_.dobYear,10)},address:{line1:_.addressLine1,line2:_.addressLine2||void 0,city:_.city,state:_.state,postalCode:_.postalCode,country:_.country}},K=await c(E);if(K?.error){if(K.error.stripeErrorCode==="consumer_person_already_verified"){m(""),h("identity");return}F("kyc_error",K.error.message,K.error.stripeErrorCode??K.error.code),h("kyc");return}m("Please review your KYC information...");let w=await d(null);if(w?.error){F("kyc_error",w.error.message,w.error.stripeErrorCode??w.error.code),h("kyc");return}if(w?.status==="UpdateAddress"){F("kyc_error","Please update your address and resubmit."),h("kyc");return}m(""),h("identity");}catch(E){F("kyc_error",E?.message??String(E)),h("kyc");}finally{p(false);}},[c,he,F,d]),Q=react.useCallback(async()=>{if(!Oe.current){Oe.current=true,p(true),he(),m("Launching identity verification...");try{let _=await u();if(_?.error){F("identity_error",_.error.message,_.error.code);return}m(""),h("wallet");}catch(_){F("identity_error",_?.message??String(_));}finally{Oe.current=false,p(false);}}},[he,F,u]);react.useEffect(()=>{C==="identity"&&!b&&Q();},[C]);let Ve=react.useCallback(async()=>{if(!at){F("validation_error","Please enter a wallet address.");return}p(true),he(),m("");try{let _=await a(at.toLowerCase(),ce);if(_?.error){F("wallet_error",_.error.message,_.error.code);return}m(""),h(t?"payment_method":"session_params");}catch(_){F("wallet_error",_?.message??String(_));}finally{p(false);}},[he,F,at,ce,a,t]);react.useEffect(()=>{C==="wallet"&&We&&at&&!b&&Ve();},[C,We,at]);let we=react.useCallback((_,E)=>{Ht.current=false,Dt.current=0;let K=async()=>{try{let w=await ia(_,E);if(Ht.current)return;Dt.current=0,w.status==="fulfillment_complete"?(et(w),h("success"),Bt(w)):ge.current=setTimeout(K,3e3);}catch(w){if(Ht.current)return;if(Dt.current+=1,console.error("[pollSessionStatus] error:",w?.message),Dt.current>=kc){F("session_error","We couldn't confirm delivery status. Your purchase may still complete \u2014 try again, or close and check your wallet.");return}ge.current=setTimeout(K,5e3);}};ge.current=setTimeout(K,3e3);},[Bt,F]),Nt=react.useCallback(()=>{je.current==="processing"&&(!de?.id||!U||(he(),Dt.current=0,ge.current&&(clearTimeout(ge.current),ge.current=null),we(de.id,U)));},[U,he,we,de?.id]),Tt=react.useCallback(async _=>{p(true),he(),m("");try{m("Confirming purchase...");let E=await ra(_,U);et(E),h("processing"),m(""),we(E.id,U);}finally{p(false);}},[U,he,we]),xn=react.useCallback(async()=>{if(de)try{await Tt(de.id);}catch(_){F("session_error",_?.message??String(_)),h("quote");}},[F,Tt,de]),Ti=react.useCallback(async(_=false)=>{if(!_e||isNaN(Number(_e))||Number(_e)<=0){F("validation_error","Please enter a valid amount.");return}p(true),he(),m("");try{let E;if(_){if(!e?.merchantIdentifier?.trim()){F("configuration_error","Apple Pay is not configured. Pass merchantIdentifier on StripeOnramp or in onramp config."),h("payment_method");return}m("Opening Apple Pay...");let ie={applePay:{merchantCountryCode:"US",currencyCode:Ce.toUpperCase(),cartItems:[{paymentType:stripeReactNative.PlatformPay.PaymentType.Immediate,label:`${Xe.toUpperCase()} purchase + fees`,amount:_e||"0.00"}]}};E=await g("PlatformPay",ie);}else m("Select a payment method..."),E=await g("Card");if(E?.error){F("payment_error",E.error.message,E.error.code),h("payment_method");return}if(!E?.displayData){F("payment_error","Payment method selection was canceled."),h("payment_method");return}m("Creating payment token...");let K=await T();if(K?.error){F("payment_error",K.error.message,K.error.code),h("payment_method");return}let w=K.cryptoPaymentToken;m("Creating onramp session...");let P=await oa({cryptoCustomerId:H,paymentToken:w,sourceAmount:Number(_e),sourceCurrency:Ce,destinationCurrency:Xe,walletAddress:at.toLowerCase(),destinationNetwork:ce},U);et(P),m(""),_?await Tt(P.id):h("quote");}catch(E){F("session_error",E?.message??String(E)),h("payment_method");}finally{p(false);}},[U,he,g,T,H,Xe,F,Tt,_e,Ce,at,ce,e?.merchantIdentifier]),xi=react.useCallback(async()=>{if(de){p(true),he(),m("");try{let _=await sa(de.id,U);et(_);}catch(_){F("session_error",_?.message??String(_));}finally{p(false);}}},[U,he,F,de]),_i=react.useCallback(()=>{Ht.current=true,Dt.current=0,ge.current&&(clearTimeout(ge.current),ge.current=null),h(o),p(false),m(""),f(null),S(e?.email??""),B(e?.phone??""),J(""),M("US"),X(""),Qe(""),Ge(false),Te(false),dt(ca),Ct(e?.recipientAddress??""),j(stripeReactNative.Onramp.CryptoNetwork.ethereum),Kt(e?.defaultSourceAmount??"100"),bt(e?.defaultSourceCurrency??"usd"),ut(e?.defaultDestinationCurrency??"usdc"),et(null),Ae.current+=1,xe.current=false,Oe.current=false;},[e,o]);return {step:C,loading:b,status:y,error:l,email:R,phone:A,fullName:k,country:q,customerId:H,accessToken:U,session:de,kycData:st,walletAddress:at,resolvedRecipientAddress:Je,walletNetwork:ce,sourceAmount:_e,sourceCurrency:Ce,destinationCurrency:Xe,applePaySupported:ro,walletReady:We,walletLoading:ee,setStep:h,setStatus:m,setEmail:S,setPhone:B,setFullName:J,setCountry:M,setWalletAddress:Ct,setWalletNetwork:j,setSourceAmount:Kt,setSourceCurrency:bt,setDestinationCurrency:ut,checkEmail:V,register:N,attachKyc:re,verifyIdentity:Q,registerWallet:Ve,collectPaymentMethod:Ti,refreshQuote:xi,confirmCheckout:xn,reset:_i,clearError:he,resumeFulfillmentPolling:Nt,amountFirst:t}}function da({styles:e,placeholderColor:t,hasPrefilledEmail:o,loading:n,error:r,status:i,email:s,setEmail:c,checkEmail:d,onClose:u}){return o?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:r,progress:i,loading:n})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your email"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll check if you have a Link account or create one for you."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Email address"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"jane@example.com",placeholderTextColor:t,keyboardType:"email-address",autoCapitalize:"none",autoCorrect:false,value:s,onChangeText:c,autoFocus:true,returnKeyType:"done",onSubmitEditing:d})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[n?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:d,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:r,progress:i,loading:n})]})]})})}function pa({styles:e,loading:t,status:o,error:n,verifyIdentity:r,onClose:i}){return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:i}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(Ie,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Verifying identity"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:o||"Preparing identity verification..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(reactNative.Text,{style:e.flow.idIcon,children:"\u{1FAAA}"})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Identity verification"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:o||"Tap below to continue verification."})]}),jsxRuntime.jsx(pt,{error:n,progress:o,loading:false})]}),!t&&jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Continue Verification"})})})]})}function fa({styles:e,loading:t,error:o,status:n,sourceAmount:r,sourceCurrency:i,destinationCurrency:s,walletNetwork:c,applePaySupported:d,collectPaymentMethod:u,onClose:a}){let{colors:g}=O(),T=_r.find(b=>b.value===c)?.label??c,C=r===""||r===void 0?"0":r,h=g.primaryForeground;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:a,title:"How do you want to pay?"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.payHint,children:"Select a payment method to continue"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.stackWrapper,children:[jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardTop],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You pay"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsxs(reactNative.Text,{style:e.pm.swapSpendAmount,numberOfLines:1,adjustsFontSizeToFit:true,children:["$",C]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:i.toUpperCase()})})]})]}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorWrap,pointerEvents:"none",children:jsxRuntime.jsx(reactNative.View,{style:e.pm.swapConnectorCircle,children:jsxRuntime.jsx(wt,{size:20,color:h,strokeWidth:2.5})})}),jsxRuntime.jsxs(reactNative.View,{style:[e.pm.swapCard,e.pm.swapCardBottom],children:[jsxRuntime.jsx(reactNative.Text,{style:e.pm.summaryLabel,children:"You receive"}),jsxRuntime.jsxs(reactNative.View,{style:e.pm.swapRow,children:[jsxRuntime.jsx(reactNative.View,{style:e.pm.swapLeftCol,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapReceivePrimary,numberOfLines:1,adjustsFontSizeToFit:true,children:s.toUpperCase()})}),jsxRuntime.jsx(reactNative.View,{style:e.pm.swapPill,children:jsxRuntime.jsx(reactNative.Text,{style:e.pm.swapPillText,children:T.toUpperCase()})})]})]})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[t?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[d&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.pm.applePayBtn,onPress:()=>u(true),children:jsxRuntime.jsxs(reactNative.Text,{style:e.pm.applePayBtnText,children:["Pay with ","\uF8FF"," Pay"]})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:()=>u(false),children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Pay with Card"})})]}),jsxRuntime.jsx(pt,{error:o,progress:n,loading:t})]})]})}function ha({styles:e,error:t,status:o,loading:n,onClose:r,onRetryStatusCheck:i}){let s=!!t;return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[s?jsxRuntime.jsx($e,{onPress:r}):jsxRuntime.jsx(reactNative.View,{style:On}),jsxRuntime.jsx(reactNative.View,{style:e.flow.centered,children:t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Could not confirm status"}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your payment may still be completing. Try checking again, or close this screen and verify your wallet balance."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.spinnerWrap,children:jsxRuntime.jsx(Ie,{size:48,strokeWidth:3})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.heading,children:"Processing your purchase"}),jsxRuntime.jsxs(reactNative.Text,{style:e.flow.sub,children:["Your payment has been confirmed.",`
2
+ `,"We're sending your crypto \u2014 this usually takes less than a minute."]})]})}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[jsxRuntime.jsx(pt,{error:t,progress:o,loading:n}),t?jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Check status again"})}):null]})]})}function Ca({styles:e,session:t,loading:o,error:n,status:r,confirmCheckout:i,refreshQuote:s,onClose:c}){let d=t.transaction_details,u=new Date(d.quote_expiration*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),a=d.wallet_address.slice(0,6)+"..."+d.wallet_address.slice(-4),g=Pn(d.destination_amount,d.destination_currency);return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:c,title:"Review your purchase"}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsxs(reactNative.View,{style:e.quote.heroBox,children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:g}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[d.destination_currency.toUpperCase()," ",Ln(d.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.quote.card,children:[jsxRuntime.jsx(Ao,{quote:e.quote,label:"You pay",value:`${d.source_amount} ${d.source_currency.toUpperCase()}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Network fee",value:`$${d.fees.network_fee_amount}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Transaction fee",value:`$${d.fees.transaction_fee_amount}`}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Wallet",value:a,mono:true}),jsxRuntime.jsx(Ao,{quote:e.quote,label:"Quote expires",value:u,last:true})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:i,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Confirm Purchase"})}),jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.ghostBtn,onPress:s,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.ghostBtnText,children:"Refresh Quote"})})]}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})}function ba({styles:e,hasPrefilledPhone:t,loading:o,error:n,status:r,email:i,phone:s,setPhone:c,register:d,onClose:u}){let a=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:u}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Enter your phone"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"We'll send a verification code to confirm your number."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Phone number"}),jsxRuntime.jsx(reactNative.TextInput,{style:e.form.input,placeholder:"+12125551234",placeholderTextColor:a.components.input.placeholderColor,keyboardType:"phone-pad",value:s,onChangeText:g=>c(g.replace(/[^\d+]/g,"").replace(/(?!^)\+/g,"")),autoFocus:true,returnKeyType:"done",onSubmitEditing:d}),jsxRuntime.jsx(reactNative.Text,{style:e.form.hint,children:"Include country code, e.g. +12125551234"})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.emailRow,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.emailLabel,children:"Signing up as"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.emailValue,children:i})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!s&&e.form.continueBtnDisabled],onPress:d,disabled:!s,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!s&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})})}function wa({styles:e,session:t,resolvedRecipientAddress:o,recipientFromConfig:n,onDone:r}){let{colors:i}=O(),s=t.transaction_details,c=Pn(s.destination_amount,s.destination_currency),d=o||n||"";return jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:r,title:"Purchase complete"}),jsxRuntime.jsx(reactNative.View,{style:e.form.content,children:jsxRuntime.jsxs(reactNative.ScrollView,{style:e.form.flex,contentContainerStyle:e.flow.successScrollContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsx(reactNative.View,{style:e.flow.checkCircle,children:jsxRuntime.jsx(Be,{size:40,color:i.success,strokeWidth:2.5})}),jsxRuntime.jsx(reactNative.Text,{style:e.flow.sub,children:"Your crypto is on its way to your wallet."}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.heroBox,e.flow.detailCard],children:[jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroLabel,children:"You received"}),jsxRuntime.jsx(reactNative.Text,{style:e.quote.heroAmount,children:c}),jsxRuntime.jsxs(reactNative.Text,{style:e.quote.heroNetwork,children:[s.destination_currency.toUpperCase()," ",Ln(s.destination_network)]})]}),jsxRuntime.jsxs(reactNative.View,{style:[e.quote.card,e.flow.detailCard],children:[jsxRuntime.jsx(Ei,{quote:e.quote,label:"Deposit Address",address:s.wallet_address}),d?jsxRuntime.jsx(Ei,{quote:e.quote,label:"Recipient Address",address:d,last:true}):jsxRuntime.jsx(Ao,{quote:e.quote,label:"Session",value:t.id.slice(0,8)+"..."+t.id.slice(-6),mono:true,last:true})]})]})}),jsxRuntime.jsx(reactNative.View,{style:e.form.footer,children:jsxRuntime.jsx(reactNative.TouchableOpacity,{style:e.form.continueBtn,onPress:r,children:jsxRuntime.jsx(reactNative.Text,{style:e.form.continueBtnText,children:"Done"})})})]})}function ka({styles:e,hasAutoWallet:t,loading:o,error:n,status:r,walletAddress:i,walletNetwork:s,setWalletAddress:c,setWalletNetwork:d,setDestinationCurrency:u,registerWallet:a,onClose:g}){let{components:T}=O();return t?jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.flow.centered,children:[jsxRuntime.jsx(Ie,{size:56,strokeWidth:3}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]}):jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{style:e.form.flex,behavior:reactNative.Platform.OS==="ios"?"padding":void 0,children:jsxRuntime.jsxs(reactNative.View,{style:e.form.screen,children:[jsxRuntime.jsx($e,{onPress:g}),jsxRuntime.jsxs(reactNative.View,{style:e.form.content,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.title,children:"Your crypto wallet"}),jsxRuntime.jsx(reactNative.Text,{style:e.form.subtitle,children:"Enter the wallet address where you'd like to receive your crypto."}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Wallet address"}),jsxRuntime.jsx(reactNative.TextInput,{style:[e.form.input,e.wallet.input],placeholder:"0x...",placeholderTextColor:T.input.placeholderColor,autoCapitalize:"none",autoCorrect:false,value:i,onChangeText:c})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.fieldWrap,children:[jsxRuntime.jsx(reactNative.Text,{style:e.form.fieldLabel,children:"Network"}),jsxRuntime.jsx(reactNative.View,{style:e.wallet.list,children:_r.map(C=>{let h=s===C.value;return jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[e.wallet.row,h&&e.wallet.rowSelected],onPress:()=>{d(C.value),u(C.defaultCrypto);},children:[jsxRuntime.jsx(reactNative.View,{style:e.wallet.iconWrap,children:jsxRuntime.jsx(C.Icon,{size:24})}),jsxRuntime.jsx(reactNative.Text,{style:[e.wallet.rowText,h&&e.wallet.rowTextSelected],children:C.label}),h&&jsxRuntime.jsx(reactNative.View,{style:e.wallet.checkCircle,children:jsxRuntime.jsx(Be,{size:14,color:T.container.buttonTitleColor,strokeWidth:2.5})})]},C.value)})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:e.form.footer,children:[o?jsxRuntime.jsx(reactNative.View,{style:[e.form.continueBtn,e.form.loaderInButton],children:jsxRuntime.jsx(Ie,{size:28,strokeWidth:2})}):jsxRuntime.jsx(reactNative.TouchableOpacity,{style:[e.form.continueBtn,!i&&e.form.continueBtnDisabled],onPress:a,disabled:!i,children:jsxRuntime.jsx(reactNative.Text,{style:[e.form.continueBtnText,!i&&e.form.continueBtnTextDisabled],children:"Continue"})}),jsxRuntime.jsx(pt,{error:n,progress:r,loading:o})]})]})})}function Kn({config:e,onComplete:t}){let o=O(),n=Ir(),{step:r,loading:i,status:s,error:c,email:d,phone:u,session:a,kycData:g,walletAddress:T,resolvedRecipientAddress:C,walletNetwork:h,sourceAmount:b,sourceCurrency:p,destinationCurrency:y,applePaySupported:m,setStep:l,setEmail:f,setPhone:R,setWalletAddress:S,setWalletNetwork:A,setSourceAmount:B,setDestinationCurrency:k,checkEmail:J,register:q,attachKyc:M,verifyIdentity:H,registerWallet:X,collectPaymentMethod:U,refreshQuote:Qe,confirmCheckout:We,reset:Ge,resumeFulfillmentPolling:ee,amountFirst:Te}=jn(e),Ae=!!e?.email,xe=!!e?.phone,Oe=!!e?.publishableKey&&!!e?.externalUserId,te=()=>{Ge(),t?.();};return r==="email"?jsxRuntime.jsx(da,{styles:n,placeholderColor:o.components.input.placeholderColor,hasPrefilledEmail:Ae,loading:i,error:c,status:s,email:d,setEmail:f,checkEmail:J,onClose:te}):r==="register"?jsxRuntime.jsx(ba,{styles:n,hasPrefilledPhone:xe,loading:i,error:c,status:s,email:d,phone:u,setPhone:R,register:q,onClose:te}):r==="kyc"?jsxRuntime.jsx(Wn,{initialData:g,loading:i,onComplete:M,onCancel:()=>l("email")}):r==="identity"?jsxRuntime.jsx(pa,{styles:n,loading:i,status:s,error:c,verifyIdentity:H,onClose:te}):r==="wallet"?jsxRuntime.jsx(ka,{styles:n,hasAutoWallet:Oe,loading:i,error:c,status:s,walletAddress:T,walletNetwork:h,setWalletAddress:S,setWalletNetwork:A,setDestinationCurrency:k,registerWallet:X,onClose:te}):r==="session_params"?jsxRuntime.jsx(Bn,{initialAmount:b,currency:p,onConfirm:Ee=>{B(Ee),l(Te?"email":"payment_method");},onCancel:()=>{Te?te():l("wallet");}}):r==="payment_method"?jsxRuntime.jsx(fa,{styles:n,loading:i,error:c,status:s,sourceAmount:b,sourceCurrency:p,destinationCurrency:y,walletNetwork:h,applePaySupported:m,collectPaymentMethod:U,onClose:te}):r==="quote"&&a?jsxRuntime.jsx(Ca,{styles:n,session:a,loading:i,error:c,status:s,confirmCheckout:We,refreshQuote:Qe,onClose:te}):r==="processing"?jsxRuntime.jsx(ha,{styles:n,error:c,status:s,loading:i,onClose:te,onRetryStatusCheck:ee}):r==="success"&&a?jsxRuntime.jsx(wa,{styles:n,session:a,resolvedRecipientAddress:C,recipientFromConfig:e?.recipientAddress,onDone:()=>{Ge(),t?.();}}):null}function Ta(){try{let t=Rl("expo-constants").default?.expoConfig?.plugins;if(!Array.isArray(t))return;for(let o of t){if(!Array.isArray(o))continue;let[n,r]=o;if(n!=="@stripe/stripe-react-native"||!r||typeof r!="object")continue;let i=r.merchantIdentifier;if(typeof i=="string"){let s=i.trim();if(s.length>0)return s}}}catch{}}function Yn({publishableKey:e,email:t,phone:o,externalUserId:n,flowOrder:r,destinationChainType:i="ethereum",destinationChainId:s="8453",destinationTokenAddress:c,recipientAddress:d,onComplete:u,onError:a,onStepChange:g,onClose:T,merchantIdentifier:C="",urlScheme:h="unifoldOnramp"}){let b=e||zn(),p=react.useMemo(()=>{let S=C.trim();return S.length>0?S:Ta()??""},[C]),[y,m]=react.useState("loading"),[l,f]=react.useState(null);react.useEffect(()=>{let S=false;async function A(){try{b&&(Hn(b),Nn(Xr()));let B=await Un();if(S)return;let k=p.trim();if(await stripeReactNative.initStripe({publishableKey:B,urlScheme:h,...k?{merchantIdentifier:k}:{}}),S)return;m("ready");}catch(B){if(S)return;console.error("[StripeOnramp] Init failed:",B),f(B?.message??"Failed to load Stripe configuration"),m("error");}}return A(),()=>{S=true;}},[b,p,h]);let R=react.useMemo(()=>{let S={publishableKey:b,externalUserId:n,destinationChainType:i,destinationChainId:s,onComplete:u,onError:a,onStepChange:g};return c&&(S.destinationTokenAddress=c),d&&(S.recipientAddress=d),t&&(S.email=t),o&&(S.phone=o),r&&(S.flowOrder=r),S.merchantIdentifier=p,S},[b,n,i,s,c,d,t,o,r,p,u,a,g]);return y==="error"?jsxRuntime.jsxs(reactNative.View,{style:Fr.centered,children:[jsxRuntime.jsx(reactNative.Text,{style:Fr.errorText,children:"Unable to initialize"}),jsxRuntime.jsx(reactNative.Text,{style:Fr.errorDetail,children:l}),T&&jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Fr.retryBtn,onPress:T,children:jsxRuntime.jsx(reactNative.Text,{style:Fr.retryBtnText,children:"Go Back"})})]}):y==="loading"?jsxRuntime.jsx(reactNative.View,{style:Fr.centered,children:jsxRuntime.jsx(Ie,{size:56,strokeWidth:3})}):jsxRuntime.jsx(Kn,{config:R,onComplete:T})}var Fr=reactNative.StyleSheet.create({centered:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:"#000000",paddingHorizontal:24},errorText:{color:"#FF453A",fontSize:18,fontWeight:"600",marginBottom:8},errorDetail:{color:"#8E8E93",fontSize:14,textAlign:"center",marginBottom:24},retryBtn:{backgroundColor:"#00D924",borderRadius:24,paddingVertical:14,paddingHorizontal:32},retryBtnText:{color:"#000000",fontSize:16,fontWeight:"700"}});function Ia(){let{configure:e}=stripeReactNative.useOnramp(),t=react.useRef(false);return react.useEffect(()=>{t.current||(t.current=true,e({merchantDisplayName:"Unifold",appearance:{lightColors:{primary:"#2d22a1",contentOnPrimary:"#ffffff",borderSelected:"#07b8b8"},darkColors:{primary:"#800080",contentOnPrimary:"#ffffff",borderSelected:"#526f3e"},style:"ALWAYS_DARK",primaryButton:{cornerRadius:8,height:48}}}).then(o=>{o.error&&console.error("[StripeOnrampPreconfigure] error:",o.error.message);}).catch(o=>{console.error("[StripeOnrampPreconfigure] threw:",o?.message);}));},[e]),null}var va="__unifold_stripe_onramp__";function Qn(e){globalThis[va]=e;}function Pa(){return globalThis[va]}Qn(Yn);function Wr({children:e,mode:t="auto",accentColor:o,theme:n,fontFamily:r,fonts:i,components:s}){let c=reactNative.useColorScheme(),d=react.useMemo(()=>t==="auto"?c==="dark"?"dark":"light":t,[t,c]),u=react.useMemo(()=>{let C=n?.[d];return Pi(d,C,o)},[d,n,o]),a=react.useMemo(()=>Kr(u,s,d),[u,s,d]),g=react.useMemo(()=>i?{regular:i.regular||r,medium:i.medium||r,semibold:i.semibold||r,bold:i.bold||r}:r?{regular:r,medium:r,semibold:r,bold:r}:{regular:void 0,medium:void 0,semibold:void 0,bold:void 0},[r,i]),T=react.useMemo(()=>({mode:d,colors:u,fonts:g,components:a,isDark:d==="dark"}),[d,u,g,a]);return jsxRuntime.jsx(Li.Provider,{value:T,children:e})}function Pe({visible:e,onClose:t,children:o,closeOnBackdropPress:n=true,showHandle:r=true,heightPercent:i,noPadding:s=false,borderTopLeftRadius:c=24,borderTopRightRadius:d=24}){let{colors:u,components:a}=O(),{height:g}=reactNative.useWindowDimensions(),T=react.useRef(g);T.current=g;let C=react.useRef(new reactNative.Animated.Value(g)).current,h=react.useRef(new reactNative.Animated.Value(0)).current,b=i!=null&&i>=1;react.useEffect(()=>{let y=T.current;e?(C.setValue(y),h.setValue(0),reactNative.Animated.parallel([reactNative.Animated.spring(C,{toValue:0,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(h,{toValue:.5,duration:200,useNativeDriver:true})]).start()):reactNative.Animated.parallel([reactNative.Animated.spring(C,{toValue:y,useNativeDriver:true,tension:65,friction:11}),reactNative.Animated.timing(h,{toValue:0,duration:200,useNativeDriver:true})]).start();},[e,C,h]);let p=()=>{n&&t();};return jsxRuntime.jsx(reactNative.Modal,{visible:e,transparent:true,animationType:"none",statusBarTranslucent:true,onRequestClose:t,children:jsxRuntime.jsxs(reactNativeGestureHandler.GestureHandlerRootView,{style:[No.container,reactNative.Platform.OS==="android"&&{paddingTop:reactNative.StatusBar.currentHeight}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[No.backdrop,{backgroundColor:"#000000",opacity:h}],pointerEvents:"none"}),!b&&jsxRuntime.jsx(reactNative.TouchableWithoutFeedback,{onPress:p,children:jsxRuntime.jsx(reactNative.View,{style:No.backdropTouchArea})}),jsxRuntime.jsxs(reactNative.Animated.View,{style:[No.sheet,{maxHeight:g*.9,backgroundColor:u.background,borderTopLeftRadius:c,borderTopRightRadius:d,transform:[{translateY:C}],shadowColor:a.sheet.shadowColor,shadowOffset:a.sheet.shadowOffset,shadowOpacity:a.sheet.shadowOpacity,shadowRadius:a.sheet.shadowRadius,elevation:a.sheet.elevation,...i&&{height:g*i,maxHeight:g*i},...b&&{paddingBottom:0},...s&&{paddingBottom:0}}],children:[r&&jsxRuntime.jsx(reactNative.View,{style:No.handleContainer,children:jsxRuntime.jsx(reactNative.View,{style:[No.handle,{backgroundColor:u.border}]})}),jsxRuntime.jsx(reactNative.View,{style:[No.content,i&&No.contentFlex],children:o})]})]})})}var No=reactNative.StyleSheet.create({container:{flex:1},backdrop:{...reactNative.StyleSheet.absoluteFillObject},backdropTouchArea:{flex:1},sheet:{paddingBottom:reactNative.Platform.OS==="ios"?34:24},handleContainer:{alignItems:"center",paddingTop:12,paddingBottom:4},handle:{width:36,height:4,borderRadius:2},content:{},contentFlex:{flex:1}});var Er=new Map;function Da({width:e,height:t,borderRadius:o,color:n}){let r=react.useRef(new reactNative.Animated.Value(.3)).current;return react.useEffect(()=>{let i=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(r,{toValue:.7,duration:800,useNativeDriver:true}),reactNative.Animated.timing(r,{toValue:.3,duration:800,useNativeDriver:true})]));return i.start(),()=>i.stop()},[r]),jsxRuntime.jsx(reactNative.Animated.View,{style:{position:"absolute",width:e,height:t,borderRadius:o,backgroundColor:n,opacity:r}})}function jo({uri:e,width:t,height:o,borderRadius:n=0,borderWidth:r=0,borderColor:i="transparent",backgroundColor:s="transparent",style:c}){let{colors:d}=O(),[u,a]=react.useState(false),[g,T]=react.useState(false),[C,h]=react.useState(()=>{if(!e||!e.toLowerCase().endsWith(".svg"))return null;let R=Er.get(e);return R?{uri:e,xml:R}:null}),b=e?.toLowerCase().endsWith(".svg"),p=b&&e&&C?.uri===e?C.xml:null;react.useEffect(()=>{a(false),T(false);},[e]),react.useEffect(()=>{if(!b||!e)return;if(Er.has(e)){h({uri:e,xml:Er.get(e)});return}let R=false;return fetch(e).then(S=>{if(!S.ok)throw new Error(`HTTP ${S.status}`);return S.text()}).then(S=>{R||(Er.set(e,S),h({uri:e,xml:S}));}).catch(()=>{R||a(true);}),()=>{R=true;}},[e,b]);let y=d.card;if(!e)return jsxRuntime.jsx(reactNative.View,{style:[{width:t,height:o,borderRadius:n,backgroundColor:y},c]});let m={width:t,height:o,borderRadius:n,borderWidth:r,borderColor:i,backgroundColor:s,overflow:"hidden",alignItems:"center",justifyContent:"center",...c},l=t-r*2,f=o-r*2;return u?jsxRuntime.jsx(reactNative.View,{style:[m,{backgroundColor:s||y}]}):b?jsxRuntime.jsxs(reactNative.View,{style:m,children:[!!!p&&jsxRuntime.jsx(Da,{width:l,height:f,borderRadius:n,color:y}),p?jsxRuntime.jsx(ot.SvgXml,{xml:p,width:l,height:f,onError:()=>a(true)}):jsxRuntime.jsx(ot.SvgUri,{uri:e,width:l,height:f,onError:()=>a(true)})]}):jsxRuntime.jsxs(reactNative.View,{style:m,children:[!g&&jsxRuntime.jsx(Da,{width:l,height:f,borderRadius:n,color:y}),jsxRuntime.jsx(reactNative.Image,{source:{uri:e,cache:"force-cache"},style:{width:l,height:f},resizeMode:"contain",onLoad:()=>T(true),onError:()=>a(true)})]})}function Zi(e){let t=[];for(let o of e)if(o)if(o.toLowerCase().endsWith(".svg")){if(Er.has(o))continue;t.push(fetch(o).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.text()}).then(n=>{Er.set(o,n);}).catch(()=>{}));}else t.push(reactNative.Image.prefetch(o).then(()=>{}).catch(()=>{}));return Promise.all(t).then(()=>{})}function $t({title:e,showBack:t=false,showClose:o=true,onBack:n,onClose:r,badge:i,showBalance:s=false,balanceAddress:c,balanceChainType:d,balanceChainId:u,balanceTokenAddress:a,publishableKey:g,projectName:T}){let{colors:C,fonts:h,components:b}=O(),[p,y]=react.useState(null),[m,l]=react.useState(false),f=react.useState(()=>new reactNative.Animated.Value(0))[0];react.useEffect(()=>{if(!m)return;let S=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(f,{toValue:1,duration:700,useNativeDriver:true}),reactNative.Animated.timing(f,{toValue:0,duration:700,useNativeDriver:true})]));return S.start(),()=>S.stop()},[m,f]),react.useEffect(()=>{if(!s||!c||!d||!u||!a||!g){y(null),l(false);return}let S=false;return l(true),Js(c,d,u,a,g).then(A=>{if(S)return;let B=A.balance,k=null;B&&(B.amount_usd!=null&&B.amount_usd!==""?k=`$${B.amount_usd}`:k="$0.00"),y(k);}).catch(()=>{S||y(null);}).finally(()=>{S||l(false);}),()=>{S=true;}},[s,c,d,u,a,g]);let R=f.interpolate({inputRange:[0,1],outputRange:[.4,1]});return jsxRuntime.jsxs(reactNative.View,{style:Vt.header,children:[jsxRuntime.jsx(reactNative.View,{style:Vt.leftContainer,children:t&&n?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:n,style:[Vt.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Yr,{size:20,color:b.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Vt.spacer})}),jsxRuntime.jsxs(reactNative.View,{style:Vt.titleContainer,children:[jsxRuntime.jsxs(reactNative.View,{style:Vt.titleRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[Vt.title,{color:b.header.titleColor,fontFamily:h.medium}],children:e}),i&&i.count>0&&jsxRuntime.jsx(reactNative.View,{style:[Vt.titleBadge,{backgroundColor:C.card}],children:jsxRuntime.jsx(reactNative.Text,{style:[Vt.titleBadgeText,{color:C.foregroundMuted,fontFamily:h.regular}],children:i.count})})]}),s&&(m?jsxRuntime.jsx(reactNative.Animated.View,{style:[Vt.balanceSkeleton,{backgroundColor:C.cardHover,opacity:R}]}):p!=null?jsxRuntime.jsxs(reactNative.Text,{style:[Vt.balanceText,{color:C.foregroundMuted,fontFamily:h.regular}],children:[T?`${T} `:"","Balance: ",p]}):null)]}),jsxRuntime.jsx(reactNative.View,{style:Vt.rightContainer,children:o?jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,style:[Vt.iconButton,{backgroundColor:"transparent"}],hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(lt,{size:20,color:b.header.buttonColor,strokeWidth:2})}):jsxRuntime.jsx(reactNative.View,{style:Vt.spacer})})]})}var Vt=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},leftContainer:{width:40,alignItems:"flex-start"},rightContainer:{width:40,alignItems:"flex-end"},titleContainer:{flex:1,alignItems:"center"},titleRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},title:{fontSize:16,textAlign:"center"},titleBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:12},titleBadgeText:{fontSize:10,fontWeight:"400"},balanceSkeleton:{height:10,width:120,borderRadius:5,marginTop:4},balanceText:{fontSize:14,marginTop:3,textAlign:"center"},iconButton:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},spacer:{width:28,height:28}});function ct({children:e,style:t,contentStyle:o,onPress:n,activeOpacity:r=.7,cardTokens:i}){let{components:s}=O(),c=i??s.card,d=c.backShadowColor!=="transparent",u={backgroundColor:c.backgroundColor,borderRadius:c.borderRadius,borderWidth:c.borderWidth,borderColor:c.borderColor},a=[Ea.wrapper,t,d&&{marginBottom:c.backShadowSpacing}],g=[u,o];return jsxRuntime.jsxs(reactNative.View,{style:a,children:[d&&jsxRuntime.jsx(reactNative.View,{style:[Ea.backShadow,{top:c.backShadowOffset.top,left:c.backShadowOffset.left,right:c.backShadowOffset.right,bottom:c.backShadowOffset.bottom,backgroundColor:c.backShadowColor,borderRadius:c.borderRadius}]}),n!=null?jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:n,activeOpacity:r,style:g,children:e}):jsxRuntime.jsx(reactNative.View,{style:g,children:e})]})}var Ea=reactNative.StyleSheet.create({wrapper:{position:"relative"},backShadow:{position:"absolute"}});function mn({onPress:e,title:t,subtitle:o,featuredTokens:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card,c=n?[...n].sort((d,u)=>d.position-u.position):[];return jsxRuntime.jsxs(ct,{cardTokens:s,onPress:e,style:po.wrapper,contentStyle:po.container,children:[jsxRuntime.jsxs(reactNative.View,{style:po.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[po.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Oi,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:po.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[po.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[po.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:po.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:po.networkIcons,children:c.map((d,u)=>{let a=d.icon_urls.find(g=>g.format==="png")?.url||d.icon_urls.find(g=>g.format==="svg")?.url;return jsxRuntime.jsx(reactNative.View,{style:[po.networkIconWrapper,{marginLeft:u===0?0:-6,zIndex:c.length-u}],children:jsxRuntime.jsx(jo,{uri:se(a),width:20,height:20})},d.name)})})})]})}var po=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},networkIcons:{flexDirection:"row",alignItems:"center"},networkIconWrapper:{}});function gn({onPress:e,title:t,subtitle:o,paymentNetworks:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsxs(ct,{cardTokens:s,onPress:e,style:To.wrapper,contentStyle:To.container,children:[jsxRuntime.jsxs(reactNative.View,{style:To.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[To.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:jsxRuntime.jsx(Vi,{size:20,color:s.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:To.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[To.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[To.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:To.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:To.paymentIcons,children:n?.map(c=>{let d=c.icon_urls.find(u=>u.format==="png")?.url||c.icon_urls.find(u=>u.format==="svg")?.url;return jsxRuntime.jsx(jo,{uri:se(d),width:32,height:20,borderRadius:4},c.name)})})})]})}var To=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},paymentIcons:{flexDirection:"row",alignItems:"center",gap:6}});function hn({onPress:e,title:t,subtitle:o,badge:n}){let{fonts:r,components:i}=O(),s=i.depositMenu.card;return jsxRuntime.jsx(ct,{cardTokens:s,onPress:e,style:xo.wrapper,contentStyle:xo.container,children:jsxRuntime.jsxs(reactNative.View,{style:xo.leftContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[xo.iconContainer,{borderRadius:s.iconContainerBorderRadius}],children:[jsxRuntime.jsx(Zo,{size:20,color:s.iconColor,strokeWidth:2}),n!==void 0&&n>0&&jsxRuntime.jsx(reactNative.View,{style:[xo.badge,{backgroundColor:s.iconColor,borderRadius:i.badge.borderRadius}],children:jsxRuntime.jsx(reactNative.Text,{style:[xo.badgeText,{fontFamily:r.semibold}],children:n>99?"99+":n})})]}),jsxRuntime.jsxs(reactNative.View,{style:xo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[xo.title,{color:s.titleColor,fontFamily:r.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[xo.subtitle,{color:s.subtitleColor,fontFamily:r.regular}],children:o})]})]})})}var xo=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center",position:"relative"},badge:{position:"absolute",top:-4,right:-4,minWidth:18,height:18,alignItems:"center",justifyContent:"center",paddingHorizontal:4},badgeText:{color:"#FFFFFF",fontSize:10,fontWeight:"600"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"}});function Cn({onPress:e,title:t,subtitle:o}){let{fonts:n,components:r}=O(),i=r.depositMenu.card;return jsxRuntime.jsxs(ct,{cardTokens:i,onPress:e,style:mo.wrapper,contentStyle:mo.container,children:[jsxRuntime.jsxs(reactNative.View,{style:mo.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[mo.iconContainer,{borderRadius:i.iconContainerBorderRadius}],children:jsxRuntime.jsx(In,{size:20,color:i.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:mo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[mo.title,{color:i.titleColor,fontFamily:n.regular}],children:t}),jsxRuntime.jsx(reactNative.Text,{style:[mo.subtitle,{color:i.subtitleColor,fontFamily:n.regular}],children:o})]})]}),jsxRuntime.jsx(reactNative.View,{style:mo.rightContent,children:jsxRuntime.jsx(reactNative.View,{style:mo.badge,children:jsxRuntime.jsx(reactNative.Text,{style:[mo.badgeText,{fontFamily:n.regular}],children:"Stripe"})})})]})}var mo=reactNative.StyleSheet.create({wrapper:{marginHorizontal:16},container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:16,paddingHorizontal:12},leftContent:{flexDirection:"row",alignItems:"center",gap:12,flex:1},iconContainer:{width:36,height:36,alignItems:"center",justifyContent:"center"},textContainer:{flex:1},title:{fontSize:14,fontWeight:"400",marginBottom:2},subtitle:{fontSize:12,fontWeight:"300"},rightContent:{flexDirection:"row",alignItems:"center",gap:8},badge:{paddingHorizontal:10,paddingVertical:4,borderRadius:6,backgroundColor:"#635BFF"},badgeText:{fontSize:12,fontWeight:"600",color:"#FFFFFF"}});var Na=1e4,Ua=2500,ja=3e3,$a=6e4;function bn(e){let{depositConfirmationMode:t,depositAddress:o,chain:n,externalUserId:r,publishableKey:i,modalOpenedAt:s,depositWalletId:c,depositExecutions:d,trackedExecutions:u,setDepositExecutions:a,setTrackedExecutions:g,setLatestExecution:T,setShowStatusSheet:C,onDepositSuccess:h,onExecutionsChange:b,onDepositError:p}=e,[y,m]=react.useState(false),[l,f]=react.useState(false);return react.useEffect(()=>{if(t!=="auto_ui"&&t!=="auto_silent"||!o)return;m(false),t==="auto_ui"&&f(false);let S=setTimeout(()=>{m(true),t==="auto_ui"&&f(true);},Na);return ()=>clearTimeout(S)},[t,o,n]),react.useEffect(()=>{if(!r||!s)return;let S=new Date(s.getTime()-$a),A=setInterval(async()=>{try{let J=[...(await en(r,i)).data??[]].sort((M,H)=>{let X=M.created_at?new Date(M.created_at).getTime():0;return (H.created_at?new Date(H.created_at).getTime():0)-X}),q=null;for(let M of J){let H=M.created_at?new Date(M.created_at):null;if(!H||H<=S)continue;let X=u.get(M.id);if(!X){q=M;break}if(["pending","waiting","delayed"].includes(X)&&M.status==="succeeded"){q=M;break}}if(q){let M=q;a(H=>{let X=H.findIndex(U=>U.id===M.id);if(X>=0){let U=[...H];return U[X]=M,U}return [...H,M]}),g(H=>{let X=new Map(H);return X.set(M.id,M.status),X}),T(M),C(!0),M.status==="succeeded"&&h?.({message:"Deposit completed successfully",executionId:M.id}),b?.([...d,M]);}}catch(B){p?.({message:"Failed to check deposit status",error:B});}},Ua);return ()=>clearInterval(A)},[r,i,s,u,d,b,h,p]),react.useEffect(()=>{if(!y||!c)return;let S=async()=>{try{await Ni(c,i);}catch{}};S();let A=setInterval(S,ja);return ()=>clearInterval(A)},[y,c,i]),{pollingEnabled:y,showWaitingUi:l,handleIveDeposited:()=>{m(true),f(true);}}}function Nr({value:e,size:t=180,logoUri:o,logoSize:n=40,logoBackgroundColor:r}){let{colors:i,isDark:s}=O(),c=s?"#1a1a1a":"#ffffff",d=s?"#ffffff":"#000000",u=r||c;return jsxRuntime.jsxs(reactNative.View,{style:[Ka.container,{width:t,height:t}],children:[jsxRuntime.jsx(fd__default.default,{value:e||"placeholder",size:t,backgroundColor:c,color:d,ecl:"H",quietZone:4}),o&&jsxRuntime.jsx(reactNative.View,{style:[Ka.logoContainer,{width:n+12,height:n+12,backgroundColor:u,borderRadius:(n+12)/2}],children:jsxRuntime.jsx(jo,{uri:o,width:n,height:n,borderRadius:n/2})})]})}var Ka=reactNative.StyleSheet.create({container:{alignItems:"center",justifyContent:"center",position:"relative"},logoContainer:{position:"absolute",alignItems:"center",justifyContent:"center"}});function Ga(e){let t=e.split("/"),o=t[t.length-1];return o&&o.length>10?`${o.slice(0,6)}...${o.slice(-3)}`:o||""}function Cd(e){let o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=e.getDate(),r=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),c=i>=12?"pm":"am";i=i%12,i=i||12;let d=s<10?`0${s}`:s;return `${o} ${n}, ${r} at ${i}:${d}${c}`}function Ur({visible:e,status:t,tokenIconUrl:o,explorerUrl:n,completionExplorerUrl:r,date:i,amountUsd:s,onClose:c,borderTopLeftRadius:d,borderTopRightRadius:u}){let{colors:a,fonts:g,components:T}=O(),[C,h]=react.useState(false),b=t==="pending"||t==="waiting"||t==="delayed",p=t==="succeeded",y=()=>{n&&reactNative.Linking.openURL(n);},m=()=>{r&&reactNative.Linking.openURL(r);};return jsxRuntime.jsx(Pe,{visible:e,onClose:c,closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:d,borderTopRightRadius:u,children:jsxRuntime.jsxs(reactNative.View,{style:Fe.container,children:[jsxRuntime.jsx(reactNative.TouchableOpacity,{style:Fe.closeButton,onPress:c,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(lt,{size:20,color:T.header.buttonColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.View,{style:Fe.iconContainer,children:b?jsxRuntime.jsx(Ie,{size:80,strokeWidth:4,iconSize:68,children:o?jsxRuntime.jsx(reactNative.Image,{source:{uri:se(o)},style:Fe.tokenIconFill}):jsxRuntime.jsx(reactNative.View,{style:[Fe.tokenIconFill,{backgroundColor:a.cardHover}]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[o?jsxRuntime.jsx(reactNative.Image,{source:{uri:se(o)},style:Fe.tokenIconLarge}):jsxRuntime.jsx(reactNative.View,{style:[Fe.tokenIconLarge,{backgroundColor:a.cardHover}]}),jsxRuntime.jsx(reactNative.View,{style:[Fe.statusBadge,{backgroundColor:T.container.iconBackgroundColor}],children:jsxRuntime.jsx(Be,{size:16,color:T.container.iconColor,strokeWidth:3})})]})}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.title,{color:T.container.titleColor,fontFamily:g.semibold}],children:b?"Deposit Processing":"Deposit Complete"}),s!==void 0&&jsxRuntime.jsxs(reactNative.Text,{style:[Fe.amount,{color:T.container.titleColor,fontFamily:g.bold}],children:["$",s.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i&&jsxRuntime.jsx(reactNative.Text,{style:[Fe.date,{color:T.container.subtitleColor,fontFamily:g.regular}],children:Cd(i)}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.subtitle,{color:T.container.subtitleColor,fontFamily:g.regular}],children:b?"This usually takes less than a minute.":"Your account has been credited successfully!"}),p&&(n||r)&&jsxRuntime.jsxs(reactNative.View,{style:Fe.detailsSection,children:[jsxRuntime.jsx(reactNative.View,{style:[Fe.divider,{backgroundColor:a.border}]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:Fe.detailsToggle,onPress:()=>h(!C),children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.detailsToggleText,{color:T.container.actionTitle,fontFamily:g.medium}],children:C?"See less":"See more details"}),C?jsxRuntime.jsx(Wo,{size:18,color:T.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:18,color:T.container.actionColor,strokeWidth:2})]}),C&&jsxRuntime.jsxs(reactNative.View,{style:Fe.txButtonsContainer,children:[n&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[Fe.txButton,{backgroundColor:T.card.backgroundColor,borderColor:a.border}],onPress:y,children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.txLabel,{color:T.card.titleColor,fontFamily:g.medium}],children:"Deposit tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.txHash,{color:T.card.subtitleColor,fontFamily:g.regular}],children:Ga(n)}),jsxRuntime.jsx(er,{size:16,color:T.card.actionColor,strokeWidth:2})]}),r&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{style:[Fe.txButton,{backgroundColor:T.card.backgroundColor,borderColor:a.border}],onPress:m,children:[jsxRuntime.jsx(reactNative.Text,{style:[Fe.txLabel,{color:T.card.titleColor,fontFamily:g.medium}],children:"Completion tx"}),jsxRuntime.jsx(reactNative.Text,{style:[Fe.txHash,{color:T.card.subtitleColor,fontFamily:g.regular}],children:Ga(r)}),jsxRuntime.jsx(er,{size:16,color:T.card.actionColor,strokeWidth:2})]})]})]})]})})}var Fe=reactNative.StyleSheet.create({container:{alignItems:"center",paddingHorizontal:24,paddingTop:40},closeButton:{position:"absolute",top:16,right:16,padding:4,zIndex:1},iconContainer:{position:"relative",marginBottom:16},tokenIcon:{width:64,height:64,borderRadius:32},tokenIconLarge:{width:68,height:68,borderRadius:34},tokenIconFill:{width:"100%",height:"100%",borderRadius:34},statusBadge:{position:"absolute",bottom:-2,right:-2,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center"},title:{fontSize:18,fontWeight:"600",marginBottom:4,textAlign:"center"},amount:{fontSize:28,fontWeight:"700",marginBottom:4,textAlign:"center"},date:{fontSize:13,textAlign:"center",marginBottom:12},detailsSection:{width:"100%",marginTop:16,paddingHorizontal:16},divider:{height:1,width:"100%",opacity:.15},detailsToggle:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingVertical:12},detailsToggleText:{fontSize:14,fontWeight:"500"},txButtonsContainer:{width:"100%",gap:10,marginTop:10},txButton:{flexDirection:"row",alignItems:"center",width:"100%",paddingVertical:12,paddingHorizontal:14,borderRadius:10,borderWidth:1,gap:8},txLabel:{fontSize:14,fontWeight:"500"},txHash:{fontSize:14,flex:1,textAlign:"right"},subtitle:{fontSize:14,textAlign:"center",lineHeight:20,paddingTop:8},buttonRow:{flexDirection:"row",gap:10,width:"100%"},button:{paddingVertical:14,paddingHorizontal:20,borderRadius:10,alignItems:"center",justifyContent:"center"},halfButton:{flex:1},successButton:{backgroundColor:"#22C55E"},buttonText:{color:"#fff",fontSize:14,fontWeight:"600"},hint:{fontSize:12,marginTop:12,textAlign:"center"}});function oi({depositConfirmationMode:e,depositAddress:t,showWaitingUi:o,latestExecution:n,onIveDeposited:r}){let{colors:i,fonts:s,components:c}=O();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e==="manual"&&t&&!o&&jsxRuntime.jsx(reactNative.TouchableOpacity,{onPress:r,activeOpacity:.8,style:[gr.iveDepositedButton,{backgroundColor:i.primary,borderRadius:c.button.borderRadius,borderWidth:c.button.borderWidth,borderColor:c.button.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[gr.iveDepositedButtonText,{color:i.primaryForeground??"#FFF",fontFamily:s.semibold}],children:"I've made the deposit"})}),o&&!n&&jsxRuntime.jsxs(reactNative.View,{style:[gr.processingCard,{backgroundColor:c.card.backgroundColor,borderRadius:c.card.borderRadius,borderWidth:c.card.borderWidth,borderColor:c.card.borderColor,shadowColor:c.card.shadowOpacity>0?c.card.shadowColor:void 0,shadowOffset:c.card.shadowOpacity>0?c.card.shadowOffset:void 0,shadowOpacity:c.card.shadowOpacity,shadowRadius:c.card.shadowRadius,elevation:c.card.elevation}],children:[jsxRuntime.jsx(reactNative.View,{style:[gr.detailIcon,{backgroundColor:c.card.iconBackgroundColor,borderRadius:c.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Di,{size:14,color:c.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.View,{style:gr.processingCardText,children:[jsxRuntime.jsx(reactNative.Text,{style:[gr.processingCardTitle,{color:c.card.titleColor,fontFamily:s.semibold}],children:"Processing deposit transactions."}),jsxRuntime.jsx(reactNative.Text,{style:[gr.processingCardSubtitle,{color:c.card.subtitleColor,fontFamily:s.regular}],children:"We're checking if your deposit has landed."})]})]})]})}var gr=reactNative.StyleSheet.create({iveDepositedButton:{paddingVertical:14,alignItems:"center",justifyContent:"center",marginBottom:12},iveDepositedButtonText:{fontSize:16},processingCard:{flexDirection:"row",alignItems:"center",padding:12,marginBottom:12,gap:12},processingCardText:{flex:1,gap:4},processingCardTitle:{fontSize:14},processingCardSubtitle:{fontSize:12,lineHeight:18},detailIcon:{width:24,height:24,alignItems:"center",justifyContent:"center"}});var wn=(e,t)=>`${t}:${e}`,Id=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function ni({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:c,defaultChainId:d,defaultTokenAddress:u,depositConfirmationMode:a="auto_ui",onExecutionsChange:g,onDepositSuccess:T,onDepositError:C,borderTopLeftRadius:h,borderTopRightRadius:b,sheetBorderRadius:p}){let{colors:y,fonts:m,components:l}=O(),f=c&&d?`${c}:${d}`:"solana:mainnet",[R,S]=react.useState("USDC"),[A,B]=react.useState(f),[k,J]=react.useState([]),[q,M]=react.useState(true),[H,X]=react.useState([]),[U,Qe]=react.useState(true),[We,Ge]=react.useState(false),[ee,Te]=react.useState(false),[Ae,xe]=react.useState(false),[Oe,te]=react.useState(false),[Ee,it]=react.useState([]),[st,dt]=react.useState(new Map),[at]=react.useState(()=>new Date),[Ct,Je]=react.useState(null),[oo,ce]=react.useState(false),[j,_e]=react.useState(null),[Kt,Ce]=react.useState(false),bt=new Map;H.forEach(V=>{V.chains.forEach(N=>{let re=`${N.chain_type}:${N.chain_id}`;bt.has(re)||bt.set(re,N);});});let Xe=Array.from(bt.values()),ut=Id(A),et=Xe.find(V=>V.chain_type===ut.chainType&&V.chain_id===ut.chainId)?.chain_type||"ethereum",ro=ir(k,et),ze=ro?.address||"",ge=react.useRef(false);react.useEffect(()=>{async function V(){try{Qe(!0),Je(null);let re=await tn(t,i&&r&&n?{destination_token_address:i,destination_chain_id:r,destination_chain_type:n}:void 0);if(X(re.data),re.data.length>0&&!ge.current){ge.current=!0;let Q,Ve;if(c&&d)if(u)for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.chain_type===c&&Tt.chain_id===d&&Tt.token_address.toLowerCase()===u.toLowerCase());if(Nt){Q=we,Ve=Nt;break}}else for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.chain_type===c&&Tt.chain_id===d);if(Nt){Q=we,Ve=Nt;break}}if(!Q&&i)for(let we of re.data){let Nt=we.chains.find(Tt=>Tt.token_address.toLowerCase()===i.toLowerCase());if(Nt){Q=we,Ve=Nt;break}}Q||(Q=re.data.find(we=>we.symbol==="USDC"),Q&&Q.chains.length>0&&(Ve=Q.chains[0])),Q||(Q=re.data.find(we=>we.symbol==="USDT"),Q&&Q.chains.length>0&&(Ve=Q.chains[0])),Q||(Q=re.data[0],Q.chains.length>0&&(Ve=Q.chains[0])),Q&&S(Q.symbol),Ve&&B(wn(Ve.chain_id,Ve.chain_type));}}catch(N){console.error("Error fetching supported tokens:",N),Je("Failed to load supported tokens"),C?.({message:"Failed to load supported tokens",error:N});}finally{Qe(false);}}V();},[t,C,c,d,u,i,r,n]),react.useEffect(()=>{async function V(){try{M(!0),Je(null);let N=await nr({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:i},t);J(N.data);}catch(N){console.error("Error fetching wallets:",N),Je("Failed to load wallets"),C?.({message:"Failed to load wallets",error:N});}finally{M(false);}}V();},[e,o,n,r,i,t,C]);let Ht=ro?.id??"",{showWaitingUi:Dt,handleIveDeposited:ho}=bn({depositConfirmationMode:a,depositAddress:ze,chain:A,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Ht,depositExecutions:Ee,trackedExecutions:st,setDepositExecutions:it,setTrackedExecutions:dt,setLatestExecution:_e,setShowStatusSheet:ce,onDepositSuccess:T,onExecutionsChange:g,onDepositError:C});react.useEffect(()=>{if(!H.length)return;let V=H.find(re=>re.symbol===R);if(!V||V.chains.length===0)return;if(!V.chains.some(re=>wn(re.chain_id,re.chain_type)===A)){let re=V.chains[0];B(wn(re.chain_id,re.chain_type));}},[R,H,A]);let Ze=H.find(V=>V.symbol===R),Do=Ze?.chains||[],je=Do.find(V=>wn(V.chain_id,V.chain_type)===A),no=async()=>{if(ze)try{reactNative.Clipboard.setString(ze),Ge(!0),setTimeout(()=>Ge(!1),2e3);}catch(V){console.error("Failed to copy:",V);}},F=je?.estimated_price_impact_percent??0,Bt=je?.max_slippage_percent??.25,he=je?.minimum_deposit_amount_usd??3;if(U)return jsxRuntime.jsxs(reactNative.View,{style:x.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:y.primary}),jsxRuntime.jsx(reactNative.Text,{style:[x.loadingText,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Loading currencies..."})]});if(Ct&&H.length===0)return jsxRuntime.jsxs(reactNative.View,{style:x.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.errorText,{color:y.error,fontFamily:m.regular}],children:Ct}),jsxRuntime.jsx(reactNative.Text,{style:[x.errorHint,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Please check your network connection and try again."})]});let ne=()=>jsxRuntime.jsxs(Pe,{visible:Ae,onClose:()=>xe(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:p?.tokenSelector?.borderTopLeftRadius??h,borderTopRightRadius:p?.tokenSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Select Token"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:x.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:H.map(V=>jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{S(V.symbol),xe(false);},activeOpacity:.7,style:[x.sheetItem,{backgroundColor:R===V.symbol?l.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(V,"png"))},style:x.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:x.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.sheetItemTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:V.symbol}),jsxRuntime.jsxs(reactNative.Text,{style:[x.sheetItemSubtitle,{color:l.card.subtitleColor,fontFamily:m.regular}],children:[V.chains.length," network",V.chains.length!==1?"s":""," available"]})]}),R===V.symbol&&jsxRuntime.jsx(Be,{size:20,color:y.primary,strokeWidth:2})]},V.symbol))})]}),be=()=>jsxRuntime.jsxs(Pe,{visible:Oe,onClose:()=>te(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:p?.chainSelector?.borderTopLeftRadius??h,borderTopRightRadius:p?.chainSelector?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Select Network"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.ScrollView,{style:x.sheetList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:Do.map(V=>{let N=wn(V.chain_id,V.chain_type),re=A===N;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>{B(N),te(false);},activeOpacity:.7,style:[x.sheetItem,{backgroundColor:re?l.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(V,"png"))},style:x.sheetItemIcon}),jsxRuntime.jsxs(reactNative.View,{style:x.sheetItemText,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.sheetItemTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:V.chain_name}),jsxRuntime.jsxs(reactNative.Text,{style:[x.sheetItemSubtitle,{color:l.card.subtitleColor,fontFamily:m.regular}],children:["Min deposit: $",V.minimum_deposit_amount_usd]})]}),re&&jsxRuntime.jsx(Be,{size:20,color:y.primary,strokeWidth:2})]},N)})})]});return jsxRuntime.jsxs(reactNative.View,{style:x.container,children:[jsxRuntime.jsxs(reactNative.View,{style:x.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.selectorLabel,{color:l.card.labelColor,fontFamily:m.regular}],children:"Token"}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(true),style:[x.selector,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[Ze&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Ze,"png"))},style:x.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[x.selectorText,{color:l.card.titleColor,fontFamily:m.medium}],children:R}),jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsxs(reactNative.View,{style:x.selectorSection,children:[jsxRuntime.jsxs(reactNative.Text,{style:[x.selectorLabel,{color:l.card.labelColor,fontFamily:m.regular}],children:["Network"," ",jsxRuntime.jsxs(reactNative.Text,{style:[x.minDeposit,{fontFamily:m.regular}],children:["($",he," min)"]})]}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(true),style:[x.selector,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[je&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(je,"png"))},style:x.selectorIcon}),jsxRuntime.jsx(reactNative.Text,{style:[x.selectorText,{color:l.card.titleColor,fontFamily:m.medium}],numberOfLines:1,children:je?.chain_name||"Select network"}),jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:x.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[x.qrWrapper,{backgroundColor:y.background,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth>0?l.card.borderWidth:1,borderColor:l.card.borderColor}],children:q?jsxRuntime.jsxs(reactNative.View,{style:x.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:y.primary}),jsxRuntime.jsx(reactNative.Text,{style:[x.loadingText,{color:y.foregroundMuted,fontFamily:m.regular}],children:"Loading..."})]}):ze?jsxRuntime.jsx(Nr,{value:ze,size:160,logoUri:se(Re(je,"png")||_t("/icons/networks/png/ethereum.png")),logoSize:40}):jsxRuntime.jsx(reactNative.View,{style:x.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[x.errorText,{color:y.error,fontFamily:m.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:x.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:x.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.addressLabel,{color:l.card.labelColor,fontFamily:m.medium}],children:"Deposit Address"}),We&&jsxRuntime.jsxs(reactNative.View,{style:x.copiedIndicator,children:[jsxRuntime.jsx(Be,{size:14,color:y.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[x.copiedText,{color:y.success,fontFamily:m.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(ct,{cardTokens:l.transferCrypto.depositAddress.card,onPress:!q&&ze?no:void 0,contentStyle:x.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[x.addressText,{color:l.card.titleColor,fontFamily:m.regular}],numberOfLines:2,children:q?"Loading...":ze||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:x.addressCopyIcon,children:jsxRuntime.jsx(Xo,{size:16,color:l.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[x.detailsCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Te(!ee),style:x.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Zo,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:x.chevronContainer,children:ee?jsxRuntime.jsx(Wo,{size:16,color:l.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:16,color:l.card.actionColor,strokeWidth:2})})]}),ee&&jsxRuntime.jsxs(reactNative.View,{style:x.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Price impact: ",F.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:l.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Slippage: Auto \u2022 ",Bt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:l.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[x.detailIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Rn,{size:12,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[x.detailsLabel,{color:l.card.titleColor,fontFamily:m.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(oi,{depositConfirmationMode:a,depositAddress:ze,showWaitingUi:Dt,latestExecution:j,onIveDeposited:ho}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:x.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[x.termsText,{color:y.primary,fontFamily:m.regular}],children:"Terms apply"})}),ne(),be(),jsxRuntime.jsxs(Pe,{visible:Kt,onClose:()=>Ce(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:p?.infoSheet?.borderTopLeftRadius??h,borderTopRightRadius:p?.infoSheet?.borderTopRightRadius??b,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.sheetHeader,{borderBottomColor:y.border}],children:[jsxRuntime.jsx(reactNative.View,{style:x.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[x.sheetTitle,{color:l.header.titleColor,fontFamily:m.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(false),style:x.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:l.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:x.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[x.infoCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:x.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[x.infoCardIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:16,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[x.infoCardValue,{color:l.card.titleColor,fontFamily:m.medium}],children:[F.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardDescription,{color:l.card.descriptionColor,fontFamily:m.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[x.infoCard,{backgroundColor:l.card.backgroundColor,borderRadius:l.card.borderRadius,borderWidth:l.card.borderWidth,borderColor:l.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:x.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[x.infoCardIcon,{backgroundColor:l.card.iconBackgroundColor,borderRadius:l.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:16,color:l.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardTitle,{color:l.card.titleColor,fontFamily:m.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[x.infoCardValue,{color:l.card.titleColor,fontFamily:m.medium}],children:[Bt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[x.infoCardDescription,{color:l.card.descriptionColor,fontFamily:m.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),j&&jsxRuntime.jsx(Ur,{visible:oo,status:j.status,tokenIconUrl:j.destination_token_metadata?.icon_urls?.find(V=>V.format==="png")?.url||j.destination_token_metadata?.icon_url||Re(Ze,"png"),explorerUrl:j.explorer_url,completionExplorerUrl:j.destination_explorer_url,date:j.created_at?new Date(j.created_at):void 0,amountUsd:j.source_amount_usd?parseFloat(j.source_amount_usd):void 0,onClose:()=>ce(false),borderTopLeftRadius:p?.depositStatus?.borderTopLeftRadius??h,borderTopRightRadius:p?.depositStatus?.borderTopRightRadius??b})]})}var x=reactNative.StyleSheet.create({container:{flex:1,padding:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:13,marginBottom:8},minDeposit:{fontSize:10},selector:{flexDirection:"row",alignItems:"center",gap:10,padding:12,borderRadius:12},selectorIcon:{width:24,height:24,borderRadius:12},selectorText:{flex:1,fontSize:14,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:16},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:13},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},spacer:{flex:1},termsContainer:{alignItems:"center"},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},sheetList:{maxHeight:400,paddingTop:8},sheetItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,marginHorizontal:8,borderRadius:12,gap:12},sheetItemIcon:{width:40,height:40,borderRadius:20},sheetItemText:{flex:1},sheetItemTitle:{fontSize:16,fontWeight:"500"},sheetItemSubtitle:{fontSize:12,marginTop:2},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});function ii({currency:e,isSelected:t,onSelect:o}){let{colors:n,fonts:r,components:i}=O();return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>o(e.currency_code),activeOpacity:.7,style:[hr.container,{backgroundColor:i.card.backgroundColor,borderRadius:i.list.rowBorderRadius,borderWidth:i.card.borderWidth,borderColor:i.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:hr.leftContent,children:[jsxRuntime.jsx(reactNative.View,{style:[hr.iconContainer,{backgroundColor:n.background}],children:jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(e,"png"))},style:hr.icon})}),jsxRuntime.jsxs(reactNative.View,{style:hr.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[hr.name,{color:i.card.titleColor,fontFamily:r.medium}],children:e.name}),jsxRuntime.jsx(reactNative.Text,{style:[hr.code,{color:i.card.subtitleColor,fontFamily:r.regular}],children:e.currency_code.toUpperCase()})]})]}),t&&jsxRuntime.jsx(Be,{size:16,color:n.primary,strokeWidth:2})]})}var hr=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:12,marginHorizontal:8,marginVertical:4},leftContent:{flexDirection:"row",alignItems:"center",gap:12},iconContainer:{width:40,height:40,borderRadius:20,overflow:"hidden",alignItems:"center",justifyContent:"center"},icon:{width:40,height:40,borderRadius:20},textContainer:{gap:2},name:{fontSize:14,fontWeight:"400"},code:{fontSize:12,fontWeight:"300"}});function kn({title:e,currencies:t,selectedCurrency:o,onSelect:n}){let{fonts:r,components:i}=O();return t.length===0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.View,{style:tl.headerContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[tl.title,{color:i.list.titleSectionColor,fontFamily:r.medium}],children:e})}),t.map(s=>jsxRuntime.jsx(ii,{currency:s,isSelected:o.toLowerCase()===s.currency_code.toLowerCase(),onSelect:n},s.currency_code))]})}var tl=reactNative.StyleSheet.create({headerContainer:{paddingHorizontal:12,paddingBottom:8,paddingTop:4},title:{fontSize:14,fontWeight:"500"}});function ai({open:e,onOpenChange:t,currencies:o,preferredCurrencyCodes:n,selectedCurrency:r,onSelectCurrency:i,borderTopLeftRadius:s,borderTopRightRadius:c}){let{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(""),C=n.map(f=>o.find(R=>R.currency_code.toLowerCase()===f.toLowerCase())).filter(f=>f!==void 0),h=o.filter(f=>!n.includes(f.currency_code.toLowerCase())),b=f=>{if(!g)return f;let R=g.toLowerCase();return f.filter(S=>S.name.toLowerCase().includes(R)||S.currency_code.toLowerCase().includes(R))},p=b(C),y=b(h),m=f=>{i(f),t(false),T("");},l=()=>{t(false),T("");};return jsxRuntime.jsxs(Pe,{visible:e,onClose:l,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsx($t,{title:"Currency",showBack:false,onClose:l}),jsxRuntime.jsx(reactNative.View,{style:yr.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[yr.searchInput,{backgroundColor:a.search.backgroundColor,color:a.search.inputColor,fontFamily:u.regular,borderRadius:a.input.borderRadius,borderWidth:a.input.borderWidth,borderColor:a.input.borderColor}],value:g,onChangeText:T,placeholder:"Search",placeholderTextColor:a.search.placeholderColor})}),jsxRuntime.jsx(reactNative.ScrollView,{style:yr.listContainer,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsxs(reactNative.View,{style:yr.listContent,children:[jsxRuntime.jsx(kn,{title:"Popular currencies",currencies:p,selectedCurrency:r,onSelect:m}),p.length>0&&y.length>0&&jsxRuntime.jsx(reactNative.View,{style:yr.sectionSpacer}),jsxRuntime.jsx(kn,{title:"All currencies",currencies:y,selectedCurrency:r,onSelect:m}),p.length===0&&y.length===0&&jsxRuntime.jsx(reactNative.View,{style:yr.noResultsContainer,children:jsxRuntime.jsx(reactNative.Text,{style:[yr.noResultsText,{color:a.container.subtitleColor,fontFamily:u.regular}],children:"No currencies found"})})]})})]})}var yr=reactNative.StyleSheet.create({searchContainer:{marginTop:8,paddingHorizontal:18,paddingBottom:12},searchInput:{padding:16,fontSize:14},listContainer:{flex:1,paddingHorizontal:12},listContent:{paddingBottom:24},sectionSpacer:{height:8},noResultsContainer:{paddingVertical:32,alignItems:"center"},noResultsText:{fontSize:14}});function bs(e){try{return new Intl.NumberFormat("en",{style:"currency",currency:e.toUpperCase(),minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(/\d/g,"").trim()}catch{return e.toUpperCase()}}function di({externalUserId:e,publishableKey:t,view:o,onViewChange:n,destinationTokenSymbol:r,recipientAddress:i,destinationChainType:s,destinationChainId:c,destinationTokenAddress:d,onDepositSuccess:u,onDepositError:a,borderTopLeftRadius:g,borderTopRightRadius:T,sheetBorderRadius:C}){let{colors:h,fonts:b,components:p}=O(),[y,m]=react.useState(""),[l,f]=react.useState("usd"),[R,S]=react.useState(false),[A,B]=react.useState(false),[k,J]=react.useState([]),[q,M]=react.useState(false),[H,X]=react.useState(null),[U,Qe]=react.useState(null),[We,Ge]=react.useState("amount"),[ee,Te]=react.useState(null),[Ae,xe]=react.useState(true),[Oe,te]=react.useState(null),[Ee,it]=react.useState(false),st=react.useRef(null),dt=react.useRef(false);react.useEffect(()=>{st.current=ee;},[ee]),react.useEffect(()=>{dt.current=Ee;},[Ee]);let[at,Ct]=react.useState([]),[Je,oo]=react.useState(true),[ce,j]=react.useState(60),[_e,Kt]=react.useState([]),[Ce,bt]=react.useState([]),[Xe,ut]=react.useState(null),[de,et]=react.useState(null),[ro,ze]=react.useState(true),[ge,Ht]=react.useState(null),[Dt,ho]=react.useState(false),[Ze,Do]=react.useState(null),[je,no]=react.useState(false),[F,Bt]=react.useState(false),[he,ne]=react.useState(false),[be,V]=react.useState(null),N=o??We,re=react.useRef(null),Q=_e.find(w=>w.currency_code.toLowerCase()===l.toLowerCase()),Ve=react.useCallback(w=>{Ge(w),w==="quotes"?n?.(w,k.length):n?.(w);},[k.length,n]);react.useEffect(()=>{async function w(){try{let P=await rn();et(P);}catch(P){console.error("Error fetching user IP:",P);}finally{ze(false);}}w();},[]),react.useEffect(()=>{async function w(){try{let P=await nr({external_user_id:e,recipient_address:i,destination_chain_type:s,destination_chain_id:c,destination_token_address:d},t);Ct(P.data);}catch(P){console.error("Error fetching wallets:",P),X("Failed to load wallet addresses");}finally{oo(false);}}w();},[e,i,s,c,d,t]);let we=r||Xe?.symbol.toUpperCase()||"USDC",Nt=Pr(Xe?.icon_urls,"png")||Xe?.icon_url,Tt=Pr(Xe?.chain_icon_urls,"png")||Xe?.chain_icon_url;react.useEffect(()=>{async function w(){try{let P=await Ki(t);Kt(P.data),bt(P.preferred||[]);}catch(P){console.error("Error fetching fiat currencies:",P);}}w();},[t]),react.useEffect(()=>{if(R||_e.length===0||!de?.alpha2)return;let w=de.alpha2.toUpperCase(),P=_e.find(ie=>ie.country_codes.includes(w));if(P)f(P.currency_code.toLowerCase()),!y&&!A&&m(String(P.default_amount??100));else if(!y&&!A){let ie=_e.find(De=>De.currency_code.toLowerCase()==="usd");ie&&m(String(ie.default_amount??100));}},[_e,de,R,y,A]),react.useEffect(()=>{if(_e.length!==0){if(re.current!==null&&re.current!==l){let w=_e.find(P=>P.currency_code.toLowerCase()===l.toLowerCase());w&&m(String(w.default_amount??100));}re.current=l;}},[l,_e]),react.useEffect(()=>{async function w(){try{let P=await Ui({chain_type:s||"",chain_id:c||"",token_address:d||""},t);ut(P);}catch(P){console.error("Error fetching supported tokens:",P);}}w();},[s,c,d,t]),react.useEffect(()=>{async function w(){if(!(!d||!c||!s)&&!ro){ho(true);try{let P=await qi({country_code:de?.alpha2?.toUpperCase()||"US",subdivision_code:de?.state||void 0,token_address:d,chain_id:c,chain_type:s},t);Ht(P);}catch(P){console.error("Error fetching default onramp token:",P);}finally{ho(false);}}}w();},[d,c,s,de,ro,t]),react.useEffect(()=>{let w=parseFloat(y);if(isNaN(w)||w<=0){J([]),Qe(null);return}if(!ge||Dt){J([]),Te(null);return}let P=_e.find(De=>De.currency_code.toLowerCase()===l.toLowerCase());if(P){if(w<P.minimum_amount){J([]),Te(null),Qe(`Minimum amount is ${bs(l)}${P.minimum_amount.toLocaleString()}`);return}if(w>P.maximum_amount){J([]),Te(null),Qe(`Maximum amount is ${bs(l)}${P.maximum_amount.toLocaleString()}`);return}}Qe(null);let ie=setTimeout(()=>{xn(w);},500);return ()=>clearTimeout(ie)},[y,l,t,ge,Dt,_e]);let xn=async w=>{if(!ge){X("Loading token information...");return}M(true),X(null);try{let P={country_code:de?.alpha2?.toUpperCase()||"US",source_amount:w.toString(),source_currency:l.toLowerCase(),destination_currency:ge.destination_currency,destination_network:ge.destination_network,subdivision_code:de?.state||void 0},ie=await ji(P,t);J(ie.data);let De=dt.current,Bo=st.current;if(De&&Bo){let Ft=ie.data.find(xt=>xt.service_provider===Bo.service_provider);if(Ft){if(Te(Ft),ie.data.length>0){let xt=ie.data.reduce((Me,Fo)=>Fo.destination_amount>Me.destination_amount?Fo:Me);Oe||te(xt.service_provider),xe(Ft.service_provider===Oe);}}else if(ie.data.length>0){let xt=ie.data.reduce((Me,Fo)=>Fo.destination_amount>Me.destination_amount?Fo:Me);Te(xt),te(xt.service_provider),xe(!0),it(!1);}}else if(ie.data.length>0){let Ft=ie.data.reduce((xt,Me)=>Me.destination_amount>xt.destination_amount?Me:xt);Te(Ft),te(Ft.service_provider),xe(!0);}j(60);}catch(P){console.error("Failed to fetch quotes:",P),X("Failed to fetch quotes. Please try again."),J([]);}finally{M(false);}};react.useEffect(()=>{if(k.length===0)return;let w=setInterval(()=>{j(P=>{if(P<=1){let ie=parseFloat(y);return !isNaN(ie)&&ie>0&&xn(ie),60}return P-1});},1e3);return ()=>clearInterval(w)},[k.length,y]);let Ti=w=>{(/^\d*\.?\d{0,2}$/.test(w)||w==="")&&(m(w),B(true));},xi=w=>{m(w.toString()),B(true);},_i=async()=>{if(ee&&ge)try{let w=ge.destination_token_metadata.chain_type,P=ir(at,w);if(!P?.address){X("Wallet address not available");return}let ie={service_provider:ee.service_provider,country_code:ee.country_code?.toUpperCase()||de?.alpha2?.toUpperCase()||"US",source_currency:ee.source_currency,source_amount:y,destination_currency:ee.destination_currency,destination_network:ee.destination_network,wallet_address:P.address,subdivision_code:de?.state||void 0},De=await $i(ie,t);Do({provider:ee,sourceCurrency:l,sourceAmount:y,sessionUrl:De.url}),V(De.url),ne(!0);}catch(w){console.error("Failed to create session:",w),X("Failed to start payment flow"),a?.({message:"Failed to start payment flow",error:w});}},_=bs(l),E=()=>{ne(false),Ve("onramp"),u?.({message:"Payment flow completed"});},K=()=>jsxRuntime.jsx(Nd,{visible:he,onClose:E,url:be,providerName:ee?.service_provider_display_name||"Complete Payment",colors:h,fonts:b,borderTopLeftRadius:C?.webView?.borderTopLeftRadius??g,borderTopRightRadius:C?.webView?.borderTopRightRadius??T});return N==="amount"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:L.amountViewContainer,children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:L.scrollContainer,contentContainerStyle:L.scrollContent,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",bounces:false,children:[jsxRuntime.jsx(reactNative.View,{style:L.currencySelector,children:jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>no(true),style:[L.currencyButton,{backgroundColor:p.card.backgroundColor,borderRadius:p.input.borderRadius,borderWidth:p.input.borderWidth,borderColor:p.input.borderColor}],children:[Q&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Q,"png"))},style:L.currencyIcon}),jsxRuntime.jsx(reactNative.Text,{style:[L.currencyText,{color:p.card.titleColor,fontFamily:b.medium}],children:l.toUpperCase()}),jsxRuntime.jsx(wt,{size:16,color:p.card.actionColor,strokeWidth:2})]})}),jsxRuntime.jsx(ai,{open:je,onOpenChange:no,currencies:_e,preferredCurrencyCodes:Ce,selectedCurrency:l,onSelectCurrency:w=>{f(w.toLowerCase()),S(true);},borderTopLeftRadius:C?.currencyModal?.borderTopLeftRadius??g,borderTopRightRadius:C?.currencyModal?.borderTopRightRadius??T}),jsxRuntime.jsx(reactNative.View,{style:L.amountContainer,children:jsxRuntime.jsxs(reactNative.View,{style:L.amountInputRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[L.currencySymbol,{color:p.container.titleColor,fontFamily:b.medium}],children:_}),jsxRuntime.jsx(reactNative.TextInput,{style:[L.amountInput,{color:p.container.titleColor,fontFamily:b.medium}],value:y,onChangeText:Ti,keyboardType:"decimal-pad",placeholder:"0",placeholderTextColor:h.foregroundMuted})]})}),Q?.suggested_amounts&&Q.suggested_amounts.length>0&&jsxRuntime.jsx(reactNative.View,{style:L.quickAmounts,children:Q.suggested_amounts.map(w=>jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xi(w),style:[L.quickAmountButton,{backgroundColor:p.card.backgroundColor,borderRadius:p.button.borderRadius,borderWidth:parseFloat(y)===w?2:p.button.borderWidth,borderColor:parseFloat(y)===w?h.primary:p.button.borderColor}],children:jsxRuntime.jsxs(reactNative.Text,{style:[L.quickAmountText,{color:p.card.titleColor,fontFamily:b.medium}],children:[_,w.toLocaleString()]})},w))}),U&&jsxRuntime.jsx(reactNative.Text,{style:[L.validationError,{color:h.error,fontFamily:b.regular}],children:U}),jsxRuntime.jsxs(reactNative.View,{style:L.providerSection,children:[jsxRuntime.jsxs(reactNative.View,{style:L.providerHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[L.providerLabel,{color:p.card.labelColor,fontFamily:b.medium}],children:"Provider"}),k.length>0&&!q&&jsxRuntime.jsxs(reactNative.Text,{style:[L.refreshText,{color:p.card.labelRightColor,fontFamily:b.regular}],children:["Refreshing in ",ce,"s"]})]}),jsxRuntime.jsx(ct,{cardTokens:p.depositCard.quoteProvider.card,onPress:q||k.length===0?void 0:()=>Bt(true),contentStyle:reactNative.StyleSheet.flatten([L.providerButton,(q||k.length===0)&&L.disabled]),children:q?jsxRuntime.jsxs(reactNative.View,{style:L.providerLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:p.container.subtitleColor}),jsxRuntime.jsx(reactNative.Text,{style:[L.loadingText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"Finding best rates..."})]}):ee?jsxRuntime.jsxs(reactNative.View,{style:L.providerContent,children:[jsxRuntime.jsxs(reactNative.View,{style:L.providerInfo,children:[Ae&&jsxRuntime.jsx(reactNative.Text,{style:[L.autoPickedText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"Auto-picked for you"}),jsxRuntime.jsxs(reactNative.View,{style:L.providerRow,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(ee.icon_urls,"png",ee.icon_url))},style:L.providerIconImage},`provider-${ee.service_provider}`),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[L.providerName,{color:p.card.titleColor,fontFamily:b.medium}],children:ee.service_provider_display_name}),jsxRuntime.jsxs(reactNative.Text,{style:[L.bestPriceText,{color:h.success,fontFamily:b.regular}],children:["Best price \u2022 ",ee.destination_amount.toFixed(2)," ","USDC"]})]})]})]}),jsxRuntime.jsx(Co,{size:20,color:p.card.actionColor,strokeWidth:2})]}):jsxRuntime.jsx(reactNative.Text,{style:[L.noProviderText,{color:p.container.subtitleColor,fontFamily:b.regular}],children:parseFloat(y)>0?"No providers available":"Enter an amount to see providers"})}),H&&jsxRuntime.jsx(reactNative.Text,{style:[L.errorText,{color:h.error,fontFamily:b.regular}],children:H})]}),jsxRuntime.jsxs(Pe,{visible:F,onClose:()=>Bt(false),closeOnBackdropPress:true,showHandle:false,borderTopLeftRadius:C?.providerModal?.borderTopLeftRadius??g,borderTopRightRadius:C?.providerModal?.borderTopRightRadius??T,children:[jsxRuntime.jsx($t,{title:"Select Provider",showBack:false,onClose:()=>Bt(false)}),jsxRuntime.jsx(reactNative.ScrollView,{style:L.providerModalList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",children:jsxRuntime.jsx(reactNative.View,{style:L.quotesList,children:[...k].sort((w,P)=>P.destination_amount-w.destination_amount).map((w,P)=>{let ie=ee?.service_provider===w.service_provider,De=P===0;return jsxRuntime.jsxs(ct,{cardTokens:p.depositCard.quoteProvider.card,onPress:()=>{Te(w),it(true),xe(w.service_provider===Oe),Bt(false);},contentStyle:reactNative.StyleSheet.flatten([L.quoteItem,ie&&{borderWidth:2,borderColor:h.primary}]),children:[jsxRuntime.jsxs(reactNative.View,{style:L.quoteLeft,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(w.icon_urls,"png",w.icon_url))},style:L.providerIconImage}),jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(reactNative.Text,{style:[L.quoteName,{color:p.card.titleColor,fontFamily:b.medium}],children:w.service_provider_display_name}),De&&jsxRuntime.jsx(reactNative.Text,{style:[L.bestPriceLabel,{color:h.success,fontFamily:b.regular}],children:"\u2713 Best price"})]})]}),jsxRuntime.jsxs(reactNative.View,{style:L.quoteRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[L.quoteAmount,{color:p.card.textRightColor,fontFamily:b.medium}],children:[w.destination_amount.toFixed(2)," USDC"]}),jsxRuntime.jsxs(reactNative.Text,{style:[L.quoteSource,{color:p.card.subtextRightColor,fontFamily:b.regular}],children:["Fee: ",_,w.total_fee.toFixed(2)]})]})]},w.service_provider)})})})]})]}),jsxRuntime.jsx(reactNative.View,{style:[L.continueButtonContainer,{backgroundColor:h.background}],children:jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:_i,disabled:q||Je||!ee||parseFloat(y)<=0,style:[L.continueButton,{backgroundColor:p.container.buttonColor,borderRadius:p.button.borderRadius,borderWidth:p.button.borderWidth,borderColor:p.button.borderColor},(q||Je||!ee)&&L.disabledButton],children:jsxRuntime.jsx(reactNative.Text,{style:[L.continueButtonText,{color:p.container.buttonTitleColor,fontFamily:b.medium}],children:Je?"Loading...":"Continue"})})})]}),K()]}):N==="onramp"&&Ze?jsxRuntime.jsxs(reactNative.View,{style:L.onrampContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Mn(Ze.provider.icon_urls,"png",Ze.provider.icon_url))},style:L.onrampProviderIcon}),jsxRuntime.jsxs(reactNative.Text,{style:[L.onrampTitle,{color:p.container.titleColor,fontFamily:b.medium}],children:["Complete transaction with ",Ze.provider.service_provider_display_name]}),jsxRuntime.jsx(reactNative.Text,{style:[L.onrampSubtitle,{color:p.container.subtitleColor,fontFamily:b.regular}],children:"You can close this modal."}),jsxRuntime.jsxs(reactNative.View,{style:[L.flowDiagram,{backgroundColor:p.card.backgroundColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:_t(`/icons/currencies/png/${Ze.sourceCurrency.toLowerCase()}.png`)},style:L.flowIconImage}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You use"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:Ze.sourceCurrency.toUpperCase()})]}),jsxRuntime.jsx(Co,{size:16,color:p.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:Pr(ge?.destination_token_metadata?.icon_urls,"png")||ge?.destination_token_metadata?.icon_url||_t("/icons/tokens/png/usdc.png")},style:L.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:Pr(ge?.destination_token_metadata?.chain?.icon_urls,"png")||ge?.destination_token_metadata?.chain?.icon_url||_t("/icons/networks/png/polygon.png")},style:[L.flowNetworkBadge,{borderColor:h.background,borderRadius:p.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You buy"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:"USDC"})]}),jsxRuntime.jsx(Co,{size:16,color:p.card.actionColor,strokeWidth:2}),jsxRuntime.jsxs(reactNative.View,{style:L.flowStep,children:[jsxRuntime.jsxs(reactNative.View,{style:L.flowIconWithBadge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:Nt||_t("/icons/tokens/png/usdc.png")},style:L.flowIconImageNoBadge}),jsxRuntime.jsx(reactNative.Image,{source:{uri:Tt||_t("/icons/networks/png/polygon.png")},style:[L.flowNetworkBadge,{borderColor:h.background,borderRadius:p.badge.borderRadius}]})]}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowLabel,{color:p.card.subtitleColor,fontFamily:b.regular}],children:"You receive"}),jsxRuntime.jsx(reactNative.Text,{style:[L.flowValue,{color:p.card.titleColor,fontFamily:b.medium}],children:we})]})]}),jsxRuntime.jsx(reactNative.View,{style:[L.onrampInfoBox,{backgroundColor:p.card.backgroundColor,borderRadius:p.card.borderRadius,borderWidth:p.card.borderWidth,borderColor:p.card.borderColor}],children:jsxRuntime.jsx(reactNative.Text,{style:[L.onrampInfoText,{color:p.card.descriptionColor,fontFamily:b.regular}],children:"The wallet address displayed in the payment provider is a temporary deposit address. Your funds will be automatically converted and deposited into your account."})})]}):null}function Nd({visible:e,onClose:t,url:o,providerName:n,colors:r,fonts:i,borderTopLeftRadius:s,borderTopRightRadius:c}){return jsxRuntime.jsxs(Pe,{visible:e,onClose:t,closeOnBackdropPress:false,showHandle:false,heightPercent:.92,noPadding:true,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsxs(reactNative.View,{style:Cr.header,children:[jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:Cr.headerButton,hitSlop:{top:10,bottom:10,left:10,right:10},children:jsxRuntime.jsx(Be,{size:20,color:r.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[Cr.headerTitle,{color:r.foreground,fontFamily:i.medium}],children:n}),jsxRuntime.jsx(reactNative.View,{style:Cr.headerSpacer})]}),o&&jsxRuntime.jsx(reactNative.View,{style:Cr.container,children:jsxRuntime.jsx(reactNativeWebview.WebView,{source:{uri:o},style:Cr.webView,startInLoadingState:true,renderLoading:()=>jsxRuntime.jsx(reactNative.View,{style:Cr.loading,children:jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:r.primary})})})})]})}var Cr=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},headerButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},headerSpacer:{width:28,height:28},container:{flex:1},webView:{flex:1},loading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"}}),L=reactNative.StyleSheet.create({amountViewContainer:{flex:1},scrollContainer:{flex:1},scrollContent:{padding:16,paddingBottom:16},currencySelector:{alignItems:"center",marginBottom:16},currencyButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8},currencyText:{fontSize:14,fontWeight:"500"},currencyIcon:{width:24,height:24,borderRadius:12},amountContainer:{alignItems:"center",marginBottom:24},amountInputRow:{flexDirection:"row",alignItems:"center",marginBottom:8},currencySymbol:{fontSize:48,fontWeight:"300"},amountInput:{fontSize:48,fontWeight:"300",minWidth:50},usdcPreview:{fontSize:14},quickAmounts:{flexDirection:"row",justifyContent:"center",gap:12,marginBottom:24},quickAmountButton:{paddingHorizontal:20,paddingVertical:10},quickAmountText:{fontSize:14,fontWeight:"500"},validationError:{fontSize:12,textAlign:"center",marginTop:12,paddingHorizontal:16},providerSection:{marginBottom:24},providerHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},providerLabel:{fontSize:12,fontWeight:"500"},refreshText:{fontSize:10},providerButton:{padding:16},disabled:{opacity:.5},providerLoading:{flexDirection:"row",alignItems:"center",gap:12},loadingText:{fontSize:14},providerContent:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},providerInfo:{flex:1},autoPickedText:{fontSize:12,marginBottom:6},providerRow:{flexDirection:"row",alignItems:"center",gap:12},providerIcon:{width:32,height:32,borderRadius:16},providerIconPlaceholder:{width:32,height:32,borderRadius:8},providerIconImage:{width:32,height:32,borderRadius:8},providerName:{fontSize:14,fontWeight:"500"},bestPriceText:{fontSize:11,marginTop:2},noProviderText:{fontSize:14,textAlign:"center"},errorText:{fontSize:12,marginTop:8},continueButtonContainer:{padding:16,paddingBottom:24},continueButton:{paddingVertical:16,alignItems:"center"},disabledButton:{opacity:.5},continueButtonText:{fontSize:16,fontWeight:"600"},webViewHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:8},webViewHeaderButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},webViewHeaderTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},webViewHeaderSpacer:{width:28,height:28},webViewContainer:{flex:1},webView:{flex:1},webViewLoading:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},providerModalList:{height:468,paddingHorizontal:12,marginTop:8},quotesList:{gap:8,paddingBottom:24,minHeight:468},quoteItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:12},quoteLeft:{flexDirection:"row",alignItems:"center",gap:12},quoteIcon:{width:40,height:40,borderRadius:20},quoteName:{fontSize:14,fontWeight:"500"},bestPriceLabel:{fontSize:11,marginTop:2},quoteRight:{alignItems:"flex-end"},quoteAmount:{fontSize:14,fontWeight:"500"},quoteSource:{fontSize:12},onrampContainer:{flex:1,padding:16,alignItems:"center",paddingTop:24},onrampProviderIcon:{width:64,height:64,borderRadius:16},onrampTitle:{fontSize:18,fontWeight:"600",textAlign:"center",marginTop:20,marginBottom:8,paddingHorizontal:16},onrampSubtitle:{fontSize:14,textAlign:"center",marginBottom:24},flowDiagram:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:20,paddingHorizontal:24,borderRadius:12,width:"100%"},flowIconWithBadge:{position:"relative",width:24,height:24,marginBottom:4},flowIconImageNoBadge:{width:24,height:24,borderRadius:12},flowNetworkBadge:{position:"absolute",bottom:-4,right:-6,width:14,height:14,borderWidth:2},onrampInfoBox:{marginTop:16,padding:16,width:"100%"},onrampInfoText:{fontSize:13,lineHeight:20},flowStep:{alignItems:"center"},flowIcon:{width:28,height:28,borderRadius:14,marginBottom:4},flowIconImage:{width:24,height:24,borderRadius:12,marginBottom:4},flowLabel:{fontSize:10},flowValue:{fontSize:14,fontWeight:"500"}});function qd(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function Kd(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}function mi({execution:e,onPress:t}){let {colors:o,fonts:n,components:r}=O(),i=r.depositTracker.executionRow.card,s=e.status==="pending"||e.status==="waiting"||e.status==="delayed";e.status==="succeeded";let d=se(Re(e.destination_token_metadata,"png")||_t("/icons/tokens/png/usdc.png")),u=s?"Deposit Processing":"Deposit Completed",a=qd(e.created_at||new Date().toISOString()),g=Kd(e.source_amount_usd);return jsxRuntime.jsxs(ct,{cardTokens:i,onPress:t,contentStyle:vo.container,children:[jsxRuntime.jsxs(reactNative.View,{style:vo.iconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:d},style:vo.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[vo.statusBadge,{backgroundColor:s?o.warning:o.success,borderColor:i.backgroundColor}],children:s?jsxRuntime.jsx(Os,{size:12,color:"#FFFFFF",strokeWidth:2.5}):jsxRuntime.jsx(Be,{size:12,color:"#FFFFFF",strokeWidth:3})})]}),jsxRuntime.jsxs(reactNative.View,{style:vo.textContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[vo.title,{color:i.titleColor,fontFamily:n.medium}],children:u}),jsxRuntime.jsx(reactNative.Text,{style:[vo.dateTime,{color:i.subtitleColor,fontFamily:n.regular}],children:a})]}),jsxRuntime.jsxs(reactNative.View,{style:vo.rightContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[vo.amount,{color:i.textRightColor,fontFamily:n.medium}],children:g}),jsxRuntime.jsx(Co,{size:20,color:i.actionColor,strokeWidth:2})]})]})}var vo=reactNative.StyleSheet.create({container:{flexDirection:"row",alignItems:"center",paddingHorizontal:16,paddingVertical:12},iconContainer:{position:"relative",marginRight:12},tokenIcon:{width:40,height:40,borderRadius:20},statusBadge:{position:"absolute",bottom:-4,right:-4,width:22,height:22,borderRadius:11,alignItems:"center",justifyContent:"center",borderWidth:2},textContainer:{flex:1,gap:2},title:{fontSize:16,fontWeight:"500"},dateTime:{fontSize:13},rightContainer:{flexDirection:"row",alignItems:"center",gap:8},amount:{fontSize:16,fontWeight:"500"}});function al(e,t){let o={solana:"Solana",ethereum:"Ethereum",bitcoin:"Bitcoin"};return e==="ethereum"?{1:"Ethereum",137:"Polygon",8453:"Base",42161:"Arbitrum",10:"Optimism"}[t]||o[e]||e:o[e]||e}function ll(e,t=6){if(!e)return "\u2014";try{let o=Number(e)/Math.pow(10,t);return o===0?"0.00":o>=1?o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}):o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:8,minimumSignificantDigits:2,maximumSignificantDigits:6})}catch{return "0.00"}}function Zd(e){return e?`$${parseFloat(e).toFixed(2)}`:"$0.00"}var cl=e=>!e||e.length<12?e:`${e.slice(0,12)}...${e.slice(-4)}`;function dl(e){if(!e)return "";let t=e.indexOf(".");return t===-1?e.toUpperCase():e.slice(0,t).toUpperCase()+e.slice(t)}function Xd(e){try{let t=new Date(e);return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})+" at "+t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}catch{return e}}function gi({visible:e,onClose:t,executions:o,externalUserId:n,publishableKey:r,borderTopLeftRadius:i,borderTopRightRadius:s}){let{height:c}=reactNative.useWindowDimensions(),{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(o),[C,h]=react.useState(false),[b,p]=react.useState(null),[y,m]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{if(!e||!n)return;let k=async()=>{h(true);try{let M=[...(await en(n,r)).data].sort((H,X)=>{let U=H.created_at?new Date(H.created_at).getTime():0;return (X.created_at?new Date(X.created_at).getTime():0)-U});T(M);}catch(q){console.error("Failed to fetch executions:",q),T(o);}finally{h(false);}};k();let J=setInterval(k,1e4);return ()=>clearInterval(J)},[e,n,r,o]),react.useEffect(()=>{o.length>0&&T(k=>{let J=new Set(k.map(M=>M.id)),q=o.filter(M=>!J.has(M.id));return q.length>0?[...q,...k]:k});},[o]),react.useEffect(()=>{e||p(null);},[e]);let f=k=>{p(k);},R=()=>{p(null),m(false);},S=()=>{p(null),t();};return jsxRuntime.jsxs(Pe,{visible:e,onClose:S,closeOnBackdropPress:true,showHandle:false,heightPercent:.6,borderTopLeftRadius:i,borderTopRightRadius:s,children:[jsxRuntime.jsx($t,{title:b?"Deposit Details":"Deposit Tracker",onClose:S,showClose:!b,showBack:!!b,onBack:R}),b?(()=>{if(!b)return null;let k=b,J=k.status==="pending"||k.status==="waiting"||k.status==="delayed",q=k.status==="succeeded",M=se(Re(k.destination_token_metadata,"png")||_t("/icons/tokens/png/usdc.png")),H=k.provider_metadata?.details,X=H?.currencyIn,U=H?.currencyOut;X?.currency?.symbol||"USDC";U?.currency?.symbol||"USDC";let Ge=ll(k.source_amount_base_unit,k.source_token_metadata?.decimals),ee=ll(k.destination_amount_base_unit,k.destination_token_metadata?.decimals),Te=Zd(k.source_amount_usd),Ae=al(k.source_chain_type,k.source_chain_id),xe=al(k.destination_chain_type,k.destination_chain_id),Oe=()=>{k.explorer_url&&reactNative.Linking.openURL(k.explorer_url);},te=()=>{k.destination_explorer_url&&reactNative.Linking.openURL(k.destination_explorer_url);};return jsxRuntime.jsxs(reactNative.ScrollView,{ref:l,style:[$.scrollContainer,{maxHeight:c*.7}],contentContainerStyle:$.detailsContent,showsVerticalScrollIndicator:false,children:[jsxRuntime.jsxs(reactNative.View,{style:$.iconSection,children:[jsxRuntime.jsxs(reactNative.View,{style:$.iconWrapper,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:M},style:$.tokenIcon}),jsxRuntime.jsx(reactNative.View,{style:[$.statusBadge,{backgroundColor:J?d.warning:d.success,borderColor:d.background}],children:J?jsxRuntime.jsx(wt,{size:14,color:"#FFFFFF",strokeWidth:2}):jsxRuntime.jsx(Be,{size:14,color:"#FFFFFF",strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:$.statusRow,children:[jsxRuntime.jsx(reactNative.View,{style:[$.statusDot,{backgroundColor:J?d.warning:d.success}]}),jsxRuntime.jsx(reactNative.Text,{style:[$.statusText,{color:a.container.titleColor,fontFamily:u.semibold}],children:J?"Processing":"Completed"})]}),jsxRuntime.jsx(reactNative.Text,{style:[$.dateText,{color:a.container.subtitleColor,fontFamily:u.regular}],children:Xd(k.created_at||new Date().toISOString())})]}),jsxRuntime.jsxs(reactNative.View,{style:[$.card,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Amount Sent"}),jsxRuntime.jsxs(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:[Ge," ",dl(k.source_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Amount Received"}),jsxRuntime.jsxs(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:[ee," ",dl(k.destination_currency)]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"USD Value"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:Te})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Source Network"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:Ae})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Destination Network"}),jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:xe})]})]}),jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:()=>{let Ee=!y;m(Ee),Ee?setTimeout(()=>{l.current?.scrollToEnd({animated:true});},100):l.current?.scrollTo({y:0,animated:true});},style:$.toggleButton,activeOpacity:.7,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.toggleText,{color:a.container.actionTitle,fontFamily:u.regular}],children:y?"See less":"See more details"}),y?jsxRuntime.jsx(Wo,{size:14,color:a.container.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:14,color:a.container.actionColor,strokeWidth:2})]}),y&&jsxRuntime.jsxs(reactNative.View,{style:[$.card,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[k.explorer_url&&jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:Oe,style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Deposit Tx"}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:cl(k.transaction_hash)}),jsxRuntime.jsx(er,{size:14,color:a.card.actionIcon,strokeWidth:2})]})]}),jsxRuntime.jsx(reactNative.View,{style:[$.cardDivider,{backgroundColor:d.border}]})]}),k.destination_explorer_url&&q&&jsxRuntime.jsxs(reactNative.TouchableOpacity,{onPress:te,style:$.cardRow,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardLabel,{color:a.card.rowLeftLabel,fontFamily:u.regular}],children:"Completion Tx"}),jsxRuntime.jsxs(reactNative.View,{style:$.cardRowRight,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.cardValue,{color:a.card.rowRightLabel,fontFamily:u.medium}],children:cl(k.destination_transaction_hashes[0])}),jsxRuntime.jsx(er,{size:14,color:a.card.actionIcon,strokeWidth:2})]})]})]})]})})():jsxRuntime.jsx(reactNative.ScrollView,{style:[$.scrollContainer,{maxHeight:c*.7}],contentContainerStyle:$.scrollContent,showsVerticalScrollIndicator:false,children:g.length===0?jsxRuntime.jsxs(reactNative.View,{style:$.emptyContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[$.emptyText,{color:a.container.titleColor,fontFamily:u.medium}],children:"No deposits yet"}),jsxRuntime.jsx(reactNative.Text,{style:[$.emptySubtext,{color:a.container.subtitleColor,fontFamily:u.regular}],children:"Your deposit history will appear here"})]}):jsxRuntime.jsx(reactNative.View,{style:$.executionsList,children:g.map(k=>jsxRuntime.jsx(mi,{execution:k,onPress:()=>f(k)},k.id))})})]})}var $=reactNative.StyleSheet.create({scrollContainer:{paddingTop:16},scrollContent:{paddingHorizontal:16,paddingBottom:16},emptyContainer:{paddingVertical:40,paddingHorizontal:16,alignItems:"center"},emptyText:{fontSize:14,marginBottom:4},emptySubtext:{fontSize:12},executionsList:{paddingTop:8,gap:12},detailsContent:{paddingHorizontal:16,paddingBottom:32},iconSection:{alignItems:"center",marginBottom:24},iconWrapper:{position:"relative",marginBottom:12},tokenIcon:{width:72,height:72,borderRadius:36},statusBadge:{position:"absolute",bottom:0,right:0,width:28,height:28,borderRadius:14,alignItems:"center",justifyContent:"center",borderWidth:3},statusRow:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:4},statusDot:{width:8,height:8,borderRadius:4},statusText:{fontSize:16,fontWeight:"600"},dateText:{fontSize:14},card:{borderRadius:12,marginBottom:12,overflow:"hidden"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:14,paddingHorizontal:16},cardRowRight:{flexDirection:"row",alignItems:"center",gap:8},cardDivider:{height:1,marginHorizontal:16},cardLabel:{fontSize:14},cardValue:{fontSize:14,fontWeight:"500"},toggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:4},toggleText:{fontSize:14},buttonSection:{marginTop:12,gap:10},actionButton:{flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:16,borderRadius:12},buttonIconLeft:{marginRight:12},buttonIconRight:{marginLeft:12},buttonText:{color:"#FFFFFF",fontSize:14,fontWeight:"600",flex:1,textAlign:"left"},hintText:{fontSize:12,textAlign:"center",marginTop:8}});function Tn(e,t=true){let[o,n]=react.useState(null),[r,i]=react.useState(null),[s,c]=react.useState(false),[d,u]=react.useState(false),[a,g]=react.useState(null),[T,C]=react.useState(null);react.useEffect(()=>{!t||o||(c(true),rn().then(y=>{n(y),g(null);}).catch(y=>{g(y instanceof Error?y:new Error(String(y)));}).finally(()=>{c(false);}));},[t,o]),react.useEffect(()=>{!t||!e||r||(u(true),on(e).then(y=>{i(y),C(null);}).catch(y=>{C(y instanceof Error?y:new Error(String(y)));}).finally(()=>{u(false);}));},[t,e,r]);let h=s||d,b=a||T||null,p=null;if(o&&r){let y=r.blocked_country_codes||[],m=o.alpha2.toUpperCase();p=!y.some(l=>l.toUpperCase()===m);}return {isAllowed:p,alpha2:o?.alpha2?.toLowerCase()??null,country:o?.country??null,isLoading:h,error:b}}var _s="unifold_recent_tokens",ou=5,gl=[{symbol:"ETH",chainType:"ethereum",chainId:"1"},{symbol:"SOL",chainType:"solana",chainId:"mainnet"},{symbol:"USDC",chainType:"solana",chainId:"mainnet"},{symbol:"POL",chainType:"ethereum",chainId:"137"},{symbol:"BNB",chainType:"ethereum",chainId:"56"},{symbol:"BTC",chainType:"bitcoin",chainId:"mainnet"}];async function Ci(){try{let e=await xs__default.default.getItem(_s);return e?JSON.parse(e):[]}catch{return []}}async function ru(e){try{let o=(await Ci()).filter(r=>!(r.symbol===e.symbol&&r.chainType===e.chainType&&r.chainId===e.chainId));o.unshift(e);let n=o.slice(0,ou);await xs__default.default.setItem(_s,JSON.stringify(n));}catch{}}async function nu(e){try{let o=(await Ci()).filter(n=>!(n.symbol===e.symbol&&n.chainType===e.chainType&&n.chainId===e.chainId));return await xs__default.default.setItem(_s,JSON.stringify(o)),o}catch{return []}}function Rs({visible:e,onClose:t,tokens:o,selectedToken:n,selectedChainKey:r,onSelect:i,borderTopLeftRadius:s,borderTopRightRadius:c}){let{colors:d,fonts:u,components:a}=O(),[g,T]=react.useState(""),[C,h]=react.useState([]);react.useEffect(()=>{e&&Ci().then(h);},[e]),react.useEffect(()=>{e||T("");},[e]);let b=react.useMemo(()=>{let R=[];return o.forEach(S=>{S.chains.forEach(A=>{R.push({token:S,chain:A});});}),R},[o]),p=react.useMemo(()=>{let R=[],S=new Set,A=(B,k,J,q)=>{let M=`${B}-${k}:${J}`;if(S.has(M))return;let H=o.find(U=>U.symbol===B);if(!H)return;let X=H.chains.find(U=>U.chain_type===k&&U.chain_id===J);X&&(S.add(M),R.push({token:H,chain:X,isRecent:q}));};return C.forEach(B=>{A(B.symbol,B.chainType,B.chainId,true);}),gl.forEach(B=>{A(B.symbol,B.chainType,B.chainId,false);}),R},[o,C]),y=react.useMemo(()=>{if(!g.trim())return b;let R=g.toLowerCase();return b.filter(({token:S,chain:A})=>S.symbol.toLowerCase().includes(R)||S.name.toLowerCase().includes(R)||A.chain_name.toLowerCase().includes(R))},[b,g]),m=(R,S,A)=>gl.some(B=>B.symbol===R&&B.chainType===S&&B.chainId===A),l=async(R,S)=>{let A=`${S.chain_type}:${S.chain_id}`;if(!m(R.symbol,S.chain_type,S.chain_id)){await ru({symbol:R.symbol,chainType:S.chain_type,chainId:S.chain_id});let B=await Ci();h(B);}T(""),i(R.symbol,A),t();},f=async(R,S)=>{let A=await nu({symbol:R.symbol,chainType:S.chain_type,chainId:S.chain_id});h(A);};return jsxRuntime.jsxs(Pe,{visible:e,onClose:t,closeOnBackdropPress:true,showHandle:false,heightPercent:.9,borderTopLeftRadius:s,borderTopRightRadius:c,children:[jsxRuntime.jsxs(reactNative.View,{style:fe.header,children:[jsxRuntime.jsx(reactNative.View,{style:fe.headerSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[fe.headerTitle,{color:a.header.titleColor,fontFamily:u.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:t,style:fe.closeButton,children:jsxRuntime.jsx(lt,{size:20,color:a.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsx(reactNative.View,{style:fe.searchContainer,children:jsxRuntime.jsx(reactNative.TextInput,{style:[fe.searchInput,{backgroundColor:a.search.backgroundColor,color:a.search.inputColor,fontFamily:u.regular,borderRadius:a.input.borderRadius,borderWidth:a.input.borderWidth,borderColor:a.input.borderColor}],placeholder:"Search",placeholderTextColor:a.search.placeholderColor,value:g,onChangeText:T,autoCapitalize:"none",autoCorrect:false})}),p.length>0&&!g&&jsxRuntime.jsxs(reactNative.View,{style:fe.quickSelectSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.sectionLabel,{color:a.list.titleSectionColor,fontFamily:u.regular}],children:"Quick select"}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:fe.quickSelectScroll,children:p.map(({token:R,chain:S,isRecent:A})=>{let B=`${S.chain_type}:${S.chain_id}`;R.symbol===n&&B===r;return jsxRuntime.jsxs(reactNative.View,{children:[A&&jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>f(R,S),style:fe.removeButton,children:jsxRuntime.jsx(lt,{size:12,color:d.foregroundMuted,strokeWidth:2})}),jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>l(R,S),activeOpacity:.7,style:[fe.quickSelectItem,{backgroundColor:a.card.backgroundColor,borderRadius:a.card.borderRadius,borderWidth:a.card.borderWidth,borderColor:a.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:fe.tokenIconContainer,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(R,"png"))},style:fe.quickSelectIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(S,"png"))},style:[fe.quickSelectChainBadge,{borderColor:a.card.backgroundColor,borderRadius:a.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:fe.quickSelectText,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.quickSelectSymbol,{color:a.card.titleColor,fontFamily:u.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[fe.quickSelectChain,{color:a.card.subtitleColor,fontFamily:u.regular}],children:S.chain_name})]})]})]},`quick-${R.symbol}-${B}`)})})]}),jsxRuntime.jsx(reactNative.Text,{style:[fe.sectionLabel,{color:a.list.titleSectionColor,fontFamily:u.regular}],children:"All supported tokens"}),jsxRuntime.jsx(reactNative.ScrollView,{style:fe.tokenList,showsVerticalScrollIndicator:false,keyboardShouldPersistTaps:"handled",contentContainerStyle:fe.tokenListContent,children:y.length===0?jsxRuntime.jsx(reactNative.View,{style:fe.emptyState,children:jsxRuntime.jsx(reactNative.Text,{style:[fe.emptyText,{color:d.foregroundMuted,fontFamily:u.regular}],children:"No tokens found"})}):y.map(({token:R,chain:S})=>{let A=`${S.chain_type}:${S.chain_id}`,B=R.symbol===n&&A===r;return jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>l(R,S),activeOpacity:.7,style:[fe.tokenItem,{backgroundColor:B?a.card.backgroundColor:"transparent"}],children:[jsxRuntime.jsxs(reactNative.View,{style:fe.tokenIconContainerLarge,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(R,"png"))},style:fe.tokenIcon}),jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(S,"png"))},style:[fe.tokenChainBadge,{borderColor:a.card.backgroundColor,borderRadius:a.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:fe.tokenInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[fe.tokenSymbol,{color:a.card.titleColor,fontFamily:u.medium}],children:R.symbol}),jsxRuntime.jsx(reactNative.Text,{style:[fe.tokenChainName,{color:a.card.subtitleColor,fontFamily:u.regular}],children:S.chain_name})]}),jsxRuntime.jsxs(reactNative.Text,{style:[fe.minDeposit,{color:a.card.labelColor,fontFamily:u.regular}],children:["Minimum:"," ",jsxRuntime.jsxs(reactNative.Text,{style:{color:a.card.labelHighlightRightColor,fontFamily:u.regular},children:["$",S.minimum_deposit_amount_usd]})]})]},`${R.symbol}-${A}`)})})]})}var fe=reactNative.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},closeButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},headerTitle:{fontSize:16,fontWeight:"500",textAlign:"center",flex:1},headerSpacer:{width:28},searchContainer:{paddingHorizontal:16,paddingBottom:12},searchInput:{height:40,paddingHorizontal:16,fontSize:14},quickSelectSection:{marginBottom:12},sectionLabel:{fontSize:12,paddingHorizontal:16,marginBottom:8},quickSelectScroll:{paddingHorizontal:16,gap:8},quickSelectItem:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12},removeButton:{position:"absolute",top:-2,right:-6,zIndex:1,padding:2},tokenIconContainer:{position:"relative"},quickSelectIcon:{width:28,height:28,borderRadius:14},quickSelectChainBadge:{position:"absolute",bottom:-2,right:-2,width:14,height:14,borderRadius:7,borderWidth:2},quickSelectText:{alignItems:"flex-start"},quickSelectSymbol:{fontSize:12,fontWeight:"500"},quickSelectChain:{fontSize:10},tokenList:{flex:1},tokenListContent:{paddingHorizontal:16,paddingBottom:24,gap:4},emptyState:{padding:32,alignItems:"center"},emptyText:{fontSize:14},tokenItem:{flexDirection:"row",alignItems:"center",gap:12,padding:12,borderRadius:12},tokenIconContainerLarge:{position:"relative"},tokenIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenInfo:{flex:1},tokenSymbol:{fontSize:14,fontWeight:"500"},tokenChainName:{fontSize:12},minDeposit:{fontSize:12}});var wi=(e,t)=>`${t}:${e}`,cu=e=>{let[t,o]=e.split(":");return {chainType:t,chainId:o}};function Is({externalUserId:e,publishableKey:t,recipientAddress:o,destinationChainType:n,destinationChainId:r,destinationTokenAddress:i,destinationTokenSymbol:s,defaultChainType:c,defaultChainId:d,defaultTokenAddress:u,depositConfirmationMode:a="auto_ui",onExecutionsChange:g,onDepositSuccess:T,onDepositError:C,wallets:h,borderTopLeftRadius:b,borderTopRightRadius:p,sheetBorderRadius:y}){let{colors:m,fonts:l,components:f}=O(),R=c&&d?`${c}:${d}`:"solana:mainnet",[S,A]=react.useState("USDC"),[B,k]=react.useState(R),[J,q]=react.useState([]),[M,H]=react.useState(!h?.length),X=h?.length?h:J,[U,Qe]=react.useState([]),[We,Ge]=react.useState(true),[ee,Te]=react.useState(false),[Ae,xe]=react.useState(false),[Oe,te]=react.useState(false),[Ee,it]=react.useState([]),[st,dt]=react.useState(new Map),[at]=react.useState(()=>new Date),[Ct,Je]=react.useState(null),[oo,ce]=react.useState(false),[j,_e]=react.useState(null),[Kt,Ce]=react.useState(false),bt=new Map;U.forEach(ne=>{ne.chains.forEach(be=>{let V=`${be.chain_type}:${be.chain_id}`;bt.has(V)||bt.set(V,be);});});let Xe=Array.from(bt.values()),ut=cu(B),de=Xe.find(ne=>ne.chain_type===ut.chainType&&ne.chain_id===ut.chainId),et=de?.chain_type||"ethereum",ro=ir(X,et),ze=ro?.address||"",ge=react.useRef(false);react.useEffect(()=>{async function ne(){try{Ge(!0),Je(null);let V=await tn(t,i&&r&&n?{destination_token_address:i,destination_chain_id:r,destination_chain_type:n}:void 0);if(Qe(V.data),V.data.length>0&&!ge.current){ge.current=!0;let N,re;if(c&&d)if(u)for(let Q of V.data){let Ve=Q.chains.find(we=>we.chain_type===c&&we.chain_id===d&&we.token_address.toLowerCase()===u.toLowerCase());if(Ve){N=Q,re=Ve;break}}else for(let Q of V.data){let Ve=Q.chains.find(we=>we.chain_type===c&&we.chain_id===d);if(Ve){N=Q,re=Ve;break}}if(!N&&i)for(let Q of V.data){let Ve=Q.chains.find(we=>we.token_address.toLowerCase()===i.toLowerCase());if(Ve){N=Q,re=Ve;break}}N||(N=V.data.find(Q=>Q.symbol==="USDC"),N&&N.chains.length>0&&(re=N.chains[0])),N||(N=V.data.find(Q=>Q.symbol==="USDT"),N&&N.chains.length>0&&(re=N.chains[0])),N||(N=V.data[0],N.chains.length>0&&(re=N.chains[0])),N&&A(N.symbol),re&&k(wi(re.chain_id,re.chain_type));}}catch(be){console.error("Error fetching supported tokens:",be),Je("Failed to load supported tokens"),C?.({message:"Failed to load supported tokens",error:be});}finally{Ge(false);}}ne();},[t,i,r,n,c,d,u,C]),react.useEffect(()=>{g&&g(Ee);},[Ee,g]),react.useEffect(()=>{if(h?.length){H(false);return}if(J.length>0){H(false);return}let ne=null,be=false,V=async()=>{if(!be){H(true);try{let N=await nr({external_user_id:e,recipient_address:o,destination_chain_type:n,destination_chain_id:r,destination_token_address:i},t);be||(q(N.data),Je(null),H(!1));}catch(N){console.error("Error fetching wallets, retrying in 5s:",N),be||(Je(N instanceof Error?N.message:"Failed to load wallets"),H(false),ne=setTimeout(V,5e3));}}};return V(),()=>{be=true,ne&&clearTimeout(ne);}},[e,o,n,r,i,t,h,J.length]);let Ht=ro?.id??"",{showWaitingUi:Dt,handleIveDeposited:ho}=bn({depositConfirmationMode:a,depositAddress:ze,chain:B,externalUserId:e,publishableKey:t,modalOpenedAt:at,depositWalletId:Ht,depositExecutions:Ee,trackedExecutions:st,setDepositExecutions:it,setTrackedExecutions:dt,setLatestExecution:_e,setShowStatusSheet:ce,onDepositSuccess:T,onExecutionsChange:g,onDepositError:C});react.useEffect(()=>{if(!U.length)return;let ne=U.find(V=>V.symbol===S);if(!ne||ne.chains.length===0)return;if(!ne.chains.some(V=>wi(V.chain_id,V.chain_type)===B)){let V=ne.chains[0];k(wi(V.chain_id,V.chain_type));}},[S,U,B]);let Ze=U.find(ne=>ne.symbol===S),je=(Ze?.chains||[]).find(ne=>wi(ne.chain_id,ne.chain_type)===B),no=async()=>{if(ze)try{reactNative.Clipboard.setString(ze),Te(!0),setTimeout(()=>Te(!1),2e3);}catch(ne){console.error("Failed to copy:",ne);}},F=je?.estimated_price_impact_percent??0,Bt=je?.max_slippage_percent??.25,he=je?.minimum_deposit_amount_usd??3;return We?jsxRuntime.jsxs(reactNative.View,{style:v.loadingContainer,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"large",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[v.loadingText,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Loading currencies..."})]}):Ct&&U.length===0?jsxRuntime.jsxs(reactNative.View,{style:v.errorContainer,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.errorText,{color:m.error,fontFamily:l.regular}],children:Ct}),jsxRuntime.jsx(reactNative.Text,{style:[v.errorHint,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Please check your network connection and try again."})]}):jsxRuntime.jsxs(reactNative.View,{style:v.container,children:[jsxRuntime.jsxs(reactNative.View,{style:v.selectorSection,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.selectorLabel,{color:f.card.labelColor,fontFamily:l.medium}],children:"Select token to deposit"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>te(true),disabled:We||U.length===0,style:[v.tokenSelectorButton,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],activeOpacity:.7,children:We?jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorLoading,children:[jsxRuntime.jsx(reactNative.View,{style:[v.loadingIcon,{backgroundColor:m.cardHover}]}),jsxRuntime.jsxs(reactNative.View,{style:v.loadingTextContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[v.loadingLine,{backgroundColor:m.cardHover,width:60}]}),jsxRuntime.jsx(reactNative.View,{style:[v.loadingLine,{backgroundColor:m.cardHover,width:100,marginTop:4}]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(reactNative.View,{style:v.tokenIconWrapper,children:[Ze&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(Ze,"png"))},style:v.tokenMainIcon}),(je||de)&&jsxRuntime.jsx(reactNative.Image,{source:{uri:se(Re(je||de,"png"))},style:[v.tokenChainBadge,{borderColor:f.card.backgroundColor,borderRadius:f.badge.borderRadius}]})]}),jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorInfo,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.tokenSelectorSymbol,{color:f.card.titleColor,fontFamily:l.semibold}],children:Ze?.symbol||S}),jsxRuntime.jsx(reactNative.Text,{style:[v.tokenSelectorNetwork,{color:f.card.subtitleColor,fontFamily:l.regular}],numberOfLines:1,children:je?.chain_name||de?.chain_name||"Select network"})]}),jsxRuntime.jsxs(reactNative.View,{style:v.tokenSelectorRight,children:[jsxRuntime.jsxs(reactNative.Text,{style:[v.minDepositText,{color:f.card.labelHighlightRightColor,fontFamily:l.medium}],children:["$",he," min"]}),jsxRuntime.jsx(Co,{size:16,color:f.card.actionColor,strokeWidth:2})]})]})})]}),jsxRuntime.jsx(Rs,{visible:Oe,onClose:()=>te(false),tokens:U,selectedToken:S,selectedChainKey:B,onSelect:(ne,be)=>{A(ne),k(be);},borderTopLeftRadius:y?.tokenSelector?.borderTopLeftRadius??b,borderTopRightRadius:y?.tokenSelector?.borderTopRightRadius??p}),jsxRuntime.jsx(reactNative.View,{style:v.qrContainer,children:jsxRuntime.jsx(reactNative.View,{style:[v.qrWrapper,{backgroundColor:m.background,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth>0?f.card.borderWidth:1,borderColor:f.card.borderColor}],children:M?jsxRuntime.jsxs(reactNative.View,{style:v.qrLoading,children:[jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:m.primary}),jsxRuntime.jsx(reactNative.Text,{style:[v.loadingText,{color:m.foregroundMuted,fontFamily:l.regular}],children:"Loading..."})]}):ze?jsxRuntime.jsx(Nr,{value:ze,size:180,logoUri:se(Re(je,"png")||_t("/icons/networks/png/ethereum.png")),logoSize:45}):jsxRuntime.jsx(reactNative.View,{style:v.qrLoading,children:jsxRuntime.jsx(reactNative.Text,{style:[v.errorText,{color:m.error,fontFamily:l.regular}],children:"No address available"})})})}),jsxRuntime.jsxs(reactNative.View,{style:v.addressSection,children:[jsxRuntime.jsxs(reactNative.View,{style:v.addressHeader,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.addressLabel,{color:f.card.labelColor,fontFamily:l.medium}],children:"Deposit Address"}),ee&&jsxRuntime.jsxs(reactNative.View,{style:v.copiedIndicator,children:[jsxRuntime.jsx(Be,{size:14,color:m.success,strokeWidth:2}),jsxRuntime.jsx(reactNative.Text,{style:[v.copiedText,{color:m.success,fontFamily:l.regular}],children:"Copied"})]})]}),jsxRuntime.jsxs(ct,{cardTokens:f.transferCrypto.depositAddress.card,onPress:!M&&ze?no:void 0,contentStyle:v.addressBox,children:[jsxRuntime.jsx(reactNative.Text,{style:[v.addressText,{color:f.card.titleColor,fontFamily:l.regular}],numberOfLines:2,children:M?"Loading...":ze||"No address available"}),jsxRuntime.jsx(reactNative.View,{style:v.addressCopyIcon,children:jsxRuntime.jsx(Xo,{size:16,color:f.card.actionColor,strokeWidth:1})})]})]}),jsxRuntime.jsxs(reactNative.View,{style:[v.detailsCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>xe(!Ae),style:v.detailsHeader,children:[jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Zo,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:"Processing time: < 1 min"})]}),jsxRuntime.jsx(reactNative.View,{style:v.chevronContainer,children:Ae?jsxRuntime.jsx(Wo,{size:16,color:f.card.actionColor,strokeWidth:2}):jsxRuntime.jsx(wt,{size:16,color:f.card.actionColor,strokeWidth:2})})]}),Ae&&jsxRuntime.jsxs(reactNative.View,{style:v.detailsContent,children:[jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Price impact: ",F.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:f.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Slippage: Auto \u2022 ",Bt.toFixed(2),"%"]}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(true),hitSlop:{top:10,bottom:10,left:10,right:10},style:{marginLeft:-4},children:jsxRuntime.jsx(Sr,{size:14,color:f.card.actionColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.detailsRow,children:[jsxRuntime.jsx(reactNative.View,{style:[v.detailIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(Rn,{size:12,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsxs(reactNative.Text,{style:[v.detailsLabel,{color:f.card.titleColor,fontFamily:l.regular}],children:["Need help?"," ",jsxRuntime.jsx(reactNative.Text,{style:{textDecorationLine:"underline"},children:"Contact support"})]})]})]})]}),jsxRuntime.jsx(oi,{depositConfirmationMode:a,depositAddress:ze,showWaitingUi:Dt,latestExecution:j,onIveDeposited:ho}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{style:v.termsContainer,onPress:()=>reactNative.Linking.openURL("https://unifold.io/terms"),children:jsxRuntime.jsx(reactNative.Text,{style:[v.termsText,{color:m.primary,fontFamily:l.regular}],children:"Terms apply"})}),jsxRuntime.jsxs(Pe,{visible:Kt,onClose:()=>Ce(false),closeOnBackdropPress:true,showHandle:true,borderTopLeftRadius:y?.infoSheet?.borderTopLeftRadius??b,borderTopRightRadius:y?.infoSheet?.borderTopRightRadius??p,children:[jsxRuntime.jsxs(reactNative.View,{style:[v.sheetHeader,{borderBottomColor:m.border}],children:[jsxRuntime.jsx(reactNative.View,{style:v.sheetHeaderSpacer}),jsxRuntime.jsx(reactNative.Text,{style:[v.sheetTitle,{color:f.header.titleColor,fontFamily:l.medium}],children:"Price Impact & Slippage"}),jsxRuntime.jsx(reactNativeGestureHandler.TouchableOpacity,{onPress:()=>Ce(false),style:v.sheetCloseButton,children:jsxRuntime.jsx(lt,{size:20,color:f.header.buttonColor,strokeWidth:2})})]}),jsxRuntime.jsxs(reactNative.View,{style:v.infoSheetContent,children:[jsxRuntime.jsxs(reactNative.View,{style:[v.infoCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:v.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[v.infoCardIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(wr,{size:16,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardTitle,{color:f.card.titleColor,fontFamily:l.medium}],children:"Price Impact"}),jsxRuntime.jsxs(reactNative.Text,{style:[v.infoCardValue,{color:f.card.titleColor,fontFamily:l.medium}],children:[F.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardDescription,{color:f.card.descriptionColor,fontFamily:l.regular}],children:"Price impact is the difference between the current market price and the price you'll receive for your swap. This occurs due to liquidity pool mechanics and trade size."})]}),jsxRuntime.jsxs(reactNative.View,{style:[v.infoCard,{backgroundColor:f.card.backgroundColor,borderRadius:f.card.borderRadius,borderWidth:f.card.borderWidth,borderColor:f.card.borderColor}],children:[jsxRuntime.jsxs(reactNative.View,{style:v.infoCardHeader,children:[jsxRuntime.jsx(reactNative.View,{style:[v.infoCardIcon,{backgroundColor:f.card.iconBackgroundColor,borderRadius:f.card.iconContainerBorderRadius}],children:jsxRuntime.jsx(kr,{size:16,color:f.card.iconColor,strokeWidth:2})}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardTitle,{color:f.card.titleColor,fontFamily:l.medium}],children:"Max Slippage"}),jsxRuntime.jsxs(reactNative.Text,{style:[v.infoCardValue,{color:f.card.titleColor,fontFamily:l.medium}],children:[Bt.toFixed(2),"%"]})]}),jsxRuntime.jsx(reactNative.Text,{style:[v.infoCardDescription,{color:f.card.descriptionColor,fontFamily:l.regular}],children:"Max slippage is the maximum price difference you're willing to accept between when you submit a transaction and when it executes. Your transaction will revert if the price moves beyond this threshold."})]})]})]}),j&&jsxRuntime.jsx(Ur,{visible:oo,status:j.status,tokenIconUrl:j.destination_token_metadata?.icon_urls?.find(ne=>ne.format==="png")?.url||j.destination_token_metadata?.icon_url||Re(Ze,"png"),explorerUrl:j.explorer_url,completionExplorerUrl:j.destination_explorer_url,date:j.created_at?new Date(j.created_at):void 0,amountUsd:j.source_amount_usd?parseFloat(j.source_amount_usd):void 0,onClose:()=>ce(false),borderTopLeftRadius:y?.depositStatus?.borderTopLeftRadius??b,borderTopRightRadius:y?.depositStatus?.borderTopRightRadius??p})]})}var v=reactNative.StyleSheet.create({container:{flex:1,paddingHorizontal:16},loadingContainer:{padding:40,alignItems:"center",gap:12},loadingText:{fontSize:14},errorContainer:{padding:40,alignItems:"center",gap:8},errorText:{fontSize:14,textAlign:"center"},errorHint:{fontSize:12,textAlign:"center"},selectorSection:{marginBottom:12},selectorLabel:{fontSize:12,marginBottom:8},tokenSelectorButton:{flexDirection:"row",alignItems:"center",gap:12,padding:12},tokenSelectorLoading:{flexDirection:"row",alignItems:"center",gap:12,flex:1},loadingIcon:{width:40,height:40,borderRadius:20},loadingTextContainer:{flex:1},loadingLine:{height:12,borderRadius:6},tokenIconWrapper:{position:"relative"},tokenMainIcon:{width:40,height:40,borderRadius:20},tokenChainBadge:{position:"absolute",bottom:-4,right:-4,width:20,height:20,borderRadius:10,borderWidth:2},tokenSelectorInfo:{flex:1},tokenSelectorSymbol:{fontSize:14,fontWeight:"500"},tokenSelectorNetwork:{fontSize:12,marginTop:2},tokenSelectorRight:{flexDirection:"row",alignItems:"center",gap:8},minDepositText:{fontSize:12,fontWeight:"500"},qrContainer:{alignItems:"center",marginVertical:8},qrWrapper:{padding:16},qrLoading:{width:160,height:160,alignItems:"center",justifyContent:"center"},addressSection:{marginBottom:16},addressHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:8},addressLabel:{fontSize:12},copiedIndicator:{flexDirection:"row",alignItems:"center",gap:4},copiedText:{fontSize:12,fontWeight:"500"},addressBox:{position:"relative",paddingHorizontal:12,paddingVertical:16},addressText:{fontSize:12,fontFamily:"monospace"},addressCopyIcon:{position:"absolute",right:12,top:0,bottom:0,justifyContent:"center"},detailsCard:{borderRadius:8,padding:4,marginBottom:16},detailsHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8,paddingLeft:8,paddingRight:8},detailsContent:{paddingRight:12,paddingLeft:8,paddingBottom:12,gap:10},detailsRow:{flexDirection:"row",alignItems:"center",gap:8},detailIcon:{width:24,height:24,borderRadius:12,alignItems:"center",justifyContent:"center"},detailsLabel:{fontSize:13},chevronContainer:{},termsContainer:{alignItems:"center",paddingVertical:8},termsText:{fontSize:12,textDecorationLine:"underline"},sheetHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:16},sheetHeaderSpacer:{width:28},sheetTitle:{fontSize:16,fontWeight:"500",flex:1,textAlign:"center"},sheetCloseButton:{width:28,height:28,alignItems:"center",justifyContent:"center"},infoSheetContent:{paddingHorizontal:16,paddingBottom:32,gap:16},infoCard:{borderRadius:12,padding:16,gap:12},infoCardHeader:{flexDirection:"row",alignItems:"center",gap:10},infoCardIcon:{width:32,height:32,borderRadius:16,alignItems:"center",justifyContent:"center"},infoCardTitle:{fontSize:15,fontWeight:"600",flex:1},infoCardValue:{fontSize:15,fontWeight:"600"},infoCardDescription:{fontSize:13,lineHeight:20}});var Lo={transferCrypto:{title:"Transfer Crypto",subtitle:"No limit \u2022 Instant"},depositWithCard:{title:"Deposit with Card",subtitle:"$50,000 limit \u2022 2 min"},stripeLinkPay:{title:"Pay with Stripe Link",subtitle:"Apple Pay or Card"},depositTracker:{title:"Deposit Tracker",subtitle:"Track your deposit progress"}};function mu(){let{colors:e,components:t}=O(),o=react.useRef(new reactNative.Animated.Value(.5)).current,n=t.depositMenu.card.backgroundColor,r=e.cardHover;react.useEffect(()=>{let s=reactNative.Animated.loop(reactNative.Animated.sequence([reactNative.Animated.timing(o,{toValue:1,duration:800,useNativeDriver:true}),reactNative.Animated.timing(o,{toValue:.5,duration:800,useNativeDriver:true})]));return s.start(),()=>s.stop()},[o]);let i=({rightIcons:s=2})=>jsxRuntime.jsxs(reactNative.View,{style:[Go.card,{backgroundColor:n,borderRadius:t.depositMenu.card.borderRadius}],children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.leftIcon,{backgroundColor:r,opacity:o,borderRadius:t.depositMenu.card.iconContainerBorderRadius}]}),jsxRuntime.jsxs(reactNative.View,{style:Go.textBlock,children:[jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.titleBar,{backgroundColor:r,opacity:o}]}),jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.subtitleBar,{backgroundColor:r,opacity:o}]})]}),jsxRuntime.jsx(reactNative.View,{style:Go.rightIcons,children:Array.from({length:s}).map((c,d)=>jsxRuntime.jsx(reactNative.Animated.View,{style:[Go.rightIcon,{backgroundColor:r,opacity:o}]},d))})]});return jsxRuntime.jsxs(reactNative.View,{style:Go.container,children:[jsxRuntime.jsx(i,{rightIcons:3}),jsxRuntime.jsx(i,{rightIcons:2}),jsxRuntime.jsx(i,{rightIcons:0})]})}var Go=reactNative.StyleSheet.create({container:{paddingTop:8,paddingBottom:24,gap:8},card:{marginHorizontal:16,flexDirection:"row",alignItems:"center",paddingVertical:16,paddingHorizontal:12,gap:12},leftIcon:{width:36,height:36},textBlock:{flex:1,gap:6},titleBar:{height:12,width:"70%",borderRadius:6},subtitleBar:{height:10,width:"50%",borderRadius:5},rightIcons:{flexDirection:"row",alignItems:"center",gap:4},rightIcon:{width:20,height:20,borderRadius:10}});function fu({visible:e,onClose:t,externalUserId:o,publishableKey:n,modalTitle:r="Deposit",destinationTokenSymbol:i,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,showBalance:C=false,hideDepositTracker:h=false,enableStripeLinkPay:b=false,StripeOnrampComponent:p,stripeOnrampEmail:y,stripeOnrampPhone:m,stripeMerchantIdentifier:l,stripeTheme:f,depositConfirmationMode:R="auto_ui",transferInputVariant:S="double_input",onDepositSuccess:A,onDepositError:B,sheetBorderRadius:k}){let J=k?.globalBorderTopLeftRadius,q=k?.globalBorderTopRightRadius,{colors:M,fonts:H}=O(),[X,U]=react.useState([]),[Qe,We]=react.useState(false),[Ge,ee]=react.useState(false),[Te,Ae]=react.useState(false),[xe,Oe]=react.useState(false),[te,Ee]=react.useState(null),[it,st]=react.useState("amount"),{isAllowed:dt,isLoading:at}=Tn(n,e);react.useEffect(()=>{if(!e||te)return;let Ce=false;return on(n).then(async bt=>{if(Ce)return;let Xe=[];for(let ut of bt?.transfer_crypto?.networks??[]){let de=ut.icon_urls.find(et=>et.format==="png")?.url||ut.icon_urls.find(et=>et.format==="svg")?.url;de&&Xe.push(se(de));}for(let ut of bt?.payment_networks?.networks??[]){let de=ut.icon_urls.find(et=>et.format==="png")?.url||ut.icon_urls.find(et=>et.format==="svg")?.url;de&&Xe.push(se(de));}Xe.length>0&&await Zi(Xe),Ce||Ee(bt);}).catch(console.error),()=>{Ce=true;}},[e,te,n]);let Ct=()=>{t();},Je=X.filter(Ce=>Ce.status==="pending"||Ce.status==="waiting").length,ce=!!(s&&c&&d&&u&&n)&&C!==false&&!!te,j=at||e&&!te,_e=dt===false,Kt=null;if(xe&&p){let Ce=jsxRuntime.jsx(p,{publishableKey:n,email:y,phone:m,externalUserId:o,recipientAddress:s??"",destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,merchantIdentifier:l,onClose:()=>Oe(false)});Kt=f?jsxRuntime.jsx(Wr,{...f,children:Ce}):Ce;}return jsxRuntime.jsxs(Pe,{visible:e,onClose:Ct,closeOnBackdropPress:false,showHandle:false,borderTopLeftRadius:k?.main?.borderTopLeftRadius??J,borderTopRightRadius:k?.main?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:r,showBack:false,onClose:Ct,showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),j&&jsxRuntime.jsx(mu,{}),!j&&_e&&jsxRuntime.jsxs(reactNative.View,{style:Oo.centeredContainer,children:[jsxRuntime.jsx(reactNative.View,{style:[Oo.iconContainer,{backgroundColor:M.cardHover}],children:jsxRuntime.jsx(vn,{size:32,color:M.foreground,strokeWidth:1.5})}),jsxRuntime.jsx(reactNative.Text,{style:[Oo.blockedTitle,{color:M.foreground,fontFamily:H.semibold}],children:"No Tokens Available"}),jsxRuntime.jsx(reactNative.Text,{style:[Oo.blockedDescription,{color:M.foreground,opacity:.7,fontFamily:H.regular}],children:"There are no supported tokens available from your current location."})]}),!j&&!_e&&jsxRuntime.jsxs(reactNative.View,{style:Oo.optionsContainer,children:[jsxRuntime.jsx(mn,{onPress:()=>ee(true),title:Lo.transferCrypto.title,subtitle:Lo.transferCrypto.subtitle,featuredTokens:te?.transfer_crypto?.networks}),jsxRuntime.jsx(gn,{onPress:()=>Ae(true),title:Lo.depositWithCard.title,subtitle:Lo.depositWithCard.subtitle,paymentNetworks:te?.payment_networks?.networks}),b&&p&&jsxRuntime.jsx(Cn,{onPress:()=>Oe(true),title:Lo.stripeLinkPay.title,subtitle:Lo.stripeLinkPay.subtitle}),!h&&jsxRuntime.jsx(hn,{onPress:()=>We(true),title:Lo.depositTracker.title,subtitle:Lo.depositTracker.subtitle,badge:Je>0?Je:void 0})]}),jsxRuntime.jsx(gi,{visible:Qe,onClose:()=>We(false),executions:X,externalUserId:o,publishableKey:n,borderTopLeftRadius:k?.depositsTracker?.borderTopLeftRadius??J,borderTopRightRadius:k?.depositsTracker?.borderTopRightRadius??q}),jsxRuntime.jsxs(Pe,{visible:Ge,onClose:()=>ee(false),closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:k?.transferCrypto?.borderTopLeftRadius??J,borderTopRightRadius:k?.transferCrypto?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:Lo.transferCrypto.title,showBack:false,onClose:()=>ee(false),showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),jsxRuntime.jsx(reactNative.ScrollView,{style:Oo.transferScrollContainer,contentContainerStyle:Oo.scrollContent,showsVerticalScrollIndicator:false,children:S==="single_input"?jsxRuntime.jsx(Is,{externalUserId:o,publishableKey:n,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,destinationTokenSymbol:i,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,depositConfirmationMode:R,onExecutionsChange:U,onDepositSuccess:A,onDepositError:B,borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{tokenSelector:k?.tokenSelector,infoSheet:k?.infoSheet,depositStatus:k?.depositStatus}}):jsxRuntime.jsx(ni,{externalUserId:o,publishableKey:n,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,destinationTokenSymbol:i,defaultChainType:a,defaultChainId:g,defaultTokenAddress:T,depositConfirmationMode:R,onExecutionsChange:U,onDepositSuccess:A,onDepositError:B,borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{tokenSelector:k?.tokenSelector,chainSelector:k?.chainSelector,infoSheet:k?.infoSheet,depositStatus:k?.depositStatus}})})]}),jsxRuntime.jsxs(Pe,{visible:Te,onClose:()=>{Ae(false),st("amount");},closeOnBackdropPress:false,showHandle:false,heightPercent:.9,borderTopLeftRadius:k?.buyWithCard?.borderTopLeftRadius??J,borderTopRightRadius:k?.buyWithCard?.borderTopRightRadius??q,children:[jsxRuntime.jsx($t,{title:`Deposit ${i||"USDC"}`,showBack:it==="onramp",onBack:()=>st("amount"),onClose:()=>{Ae(false),st("amount");},showBalance:ce,balanceAddress:s,balanceChainType:c,balanceChainId:d,balanceTokenAddress:u,publishableKey:n,projectName:te?.project_name}),jsxRuntime.jsx(reactNative.View,{style:Oo.buyWithCardContainer,children:jsxRuntime.jsx(di,{externalUserId:o,publishableKey:n,destinationTokenSymbol:i,recipientAddress:s,destinationChainType:c,destinationChainId:d,destinationTokenAddress:u,onDepositSuccess:A,onDepositError:B,view:it,onViewChange:Ce=>st(Ce),borderTopLeftRadius:J,borderTopRightRadius:q,sheetBorderRadius:{providerModal:k?.providerModal,webView:k?.webView,currencyModal:k?.currencyModal}})})]}),b&&p&&jsxRuntime.jsx(Pe,{visible:xe,onClose:()=>Oe(false),closeOnBackdropPress:false,showHandle:false,heightPercent:1,borderTopLeftRadius:0,borderTopRightRadius:0,children:jsxRuntime.jsx(reactNative.View,{style:Oo.stripeLinkPayContainer,children:Kt})})]})}function Si({theme:e="auto",...t}){return jsxRuntime.jsx(fu,{...t})}var Oo=reactNative.StyleSheet.create({optionsContainer:{paddingTop:8,paddingBottom:24,gap:8},transferScrollContainer:{flex:1},scrollContent:{paddingBottom:24},buyWithCardContainer:{flex:1},stripeLinkPayContainer:{flex:1},centeredContainer:{alignItems:"center",justifyContent:"center",paddingVertical:48,paddingHorizontal:16,minHeight:200},iconContainer:{width:64,height:64,borderRadius:32,alignItems:"center",justifyContent:"center",marginBottom:16},blockedTitle:{fontSize:18,fontWeight:"600",marginBottom:8,textAlign:"center"},blockedDescription:{fontSize:14,textAlign:"center",maxWidth:280,lineHeight:20}});reactNative.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8},text:{fontWeight:"600",textAlign:"center"},fullWidth:{width:"100%"},disabled:{opacity:.5}});reactNative.StyleSheet.create({icon:{backgroundColor:"transparent"}});var _l=react.createContext(null);function Su({children:e,publishableKey:t,config:o}){let[n,r]=react.useState(false),[i,s]=react.useState(null),c=reactNative.useColorScheme(),d=react.useRef(false);d.current||(En({publishableKey:t}),d.current=true);let u=react.useMemo(()=>{let y=o?.appearance||"dark";return y==="auto"?c==="dark"?"dark":"light":y},[o?.appearance,c]);react.useEffect(()=>{if(!t||t.trim()===""){console.error("Unifold: publishableKey is required. Please provide a valid publishable key.");return}!t.startsWith("pk_test_")&&!t.startsWith("pk_live_")&&console.warn('Unifold: publishableKey should start with "pk_test_" or "pk_live_". Please ensure you are using a valid publishable key.'),En({publishableKey:t});},[t]),react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]);let a=react.useRef(null),g=react.useRef(null),T=react.useCallback(y=>{g.current&&(clearTimeout(g.current),g.current=null),a.current&&(console.warn("[UnifoldProvider] A deposit is already in progress. Cancelling previous deposit."),a.current.reject({message:"Deposit cancelled - new deposit started",code:"DEPOSIT_SUPERSEDED"}),a.current=null);let m=new Promise((l,f)=>{a.current={resolve:l,reject:f};});return s(y),r(true),m},[]),C=react.useCallback(()=>{a.current&&(a.current.reject({message:"Deposit cancelled by user",code:"DEPOSIT_CANCELLED"}),a.current=null),r(false),g.current=setTimeout(()=>{s(null),g.current=null;},200);},[]),h=react.useCallback(y=>{i?.onSuccess&&i.onSuccess(y),a.current&&(a.current.resolve(y),a.current=null);},[i]),b=react.useCallback(y=>{console.error("[UnifoldProvider] Deposit error:",y),i?.onError&&i.onError(y),a.current&&(a.current.reject(y),a.current=null);},[i]),p=react.useMemo(()=>({publishableKey:t,beginDeposit:T,closeDeposit:C}),[t,T,C]);return jsxRuntime.jsx(_l.Provider,{value:p,children:jsxRuntime.jsxs(Wr,{mode:u,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components,children:[e,i&&jsxRuntime.jsx(Si,{visible:n,onClose:C,publishableKey:t,modalTitle:o?.modalTitle,externalUserId:i.externalUserId,destinationChainType:i.destinationChainType,destinationChainId:i.destinationChainId,destinationTokenSymbol:i.destinationTokenSymbol,recipientAddress:i.recipientAddress,destinationTokenAddress:i.destinationTokenAddress,defaultChainType:i.defaultChainType,defaultChainId:i.defaultChainId,defaultTokenAddress:i.defaultTokenAddress,showBalance:i.showBalance,stripeOnrampEmail:i.stripeOnrampEmail,stripeOnrampPhone:i.stripeOnrampPhone,stripeTheme:{mode:u,accentColor:o?.accentColor,theme:o?.theme,fontFamily:o?.fontFamily,fonts:o?.fonts,components:o?.components},depositConfirmationMode:i.depositConfirmationMode??"auto_ui",hideDepositTracker:o?.hideDepositTracker,transferInputVariant:o?.transferInputVariant,enableStripeLinkPay:o?.enableStripeLinkPay,stripeMerchantIdentifier:o?.stripeMerchantIdentifier,StripeOnrampComponent:o?.enableStripeLinkPay?Pa():void 0,onDepositSuccess:h,onDepositError:b,theme:u,sheetBorderRadius:o?.sheetBorderRadius})]})})}function ku(){let e=react.useContext(_l);if(!e)throw new Error("useUnifold must be used within UnifoldProvider");return e}
3
+ exports.AmountScreen=Bn;exports.KYCWizardScreen=Wn;exports.OnrampScreen=Kn;exports.StripeOnramp=Yn;exports.StripeOnrampPreconfigure=Ia;exports.UnifoldProvider=Su;exports.getStripePublishableKey=Un;exports.registerStripeOnramp=Qn;exports.setDevApiUrl=Gs;exports.setStripeOnrampApiUrl=Nn;exports.setStripeOnrampPublishableKey=Hn;exports.useAllowedCountry=Tn;exports.useStripeOnramp=jn;exports.useUnifold=ku;