PageSourceSearch

https://sana.bot/assets/RecoveryPasswordCreateScreen-pPFdLx0q-BJz5BxKi.js

js sana.bot collected 2026-10-04 06:55:18 UTC 2,351 bytes, 1 lines download raw bytes

1import{dw as I,dx as M,d0 as a,es as T,e6 as W,dy as R,d3 as j,et as S,ek as L}from"./index-Ct4kjZPJ.js";import{p as $,o as k}from"./SetWalletPasswordForm-BTbCZcGP-Dr57_KnW.js";import"./ExclamationTriangleIcon-DWh1fm65.js";import"./Layouts-BlFm53ED-CHQusfoi.js";import"./ModalHeader-D7u2VQIH-DaIkc-g5.js";import"./shared-CaZpHIpv-CrwdBBLu.js";import"./Checkbox-BhNoOKjX-By-61psA.js";import"./CheckCircleIcon-DyBSQ3LD.js";import"./ScreenHeader-CHmc4-Lu-CfnjDOhY.js";const q={component:()=>{let{navigate:c,data:v,onUserCloseViaDialogOrKeybindRef:x}=I(),C=M(),[P,g]=a.useState(""),[d,u]=a.useState(!1),[s,h]=a.useState(),[n,b]=a.useState(null),{create:r}=T(),{authenticated:w,user:o}=W(),{closePrivyModal:l,isNewUserThisSession:E,initializeWalletProxy:U}=R(),{onSuccess:p,onFailure:i,callAuthOnSuccessOnClose:m,shouldCreateEth:y,shouldCreateSol:f}=v.createWallet,[t,O]=a.useState(null),A=new L(async()=>{try{let e;if(y&&f)e=await r({recoveryMethod:"user-passcode",recoveryPassword:s,chainType:"ethereum",walletIndex:0,latestUser:o}),e=await r({chainType:"solana",walletIndex:0,latestUser:e.user});else if(f)e=await r({recoveryMethod:"user-passcode",recoveryPassword:s,chainType:"solana",walletIndex:0,latestUser:o});else{if(!y)throw Error("Invalid args to create wallet");e=await r({recoveryMethod:"user-passcode",recoveryPassword:s,chainType:"ethereum",walletIndex:0,latestUser:o})}O(e),E?c("EmbeddedWalletCreatedScreen"):(p(e),l({shouldCallAuthOnSuccess:m}))}catch(e){g(e.message)}});return a.useEffect(()=>{n||U(3e4).then(e=>b(e))},[n]),a.useEffect(()=>{if(!w||!o)return c("LandingScreen"),void i(Error("User must be authenticated before creating a Privy wallet"))},[w]),x.current=()=>null,j.jsx($,{config:{initiatedBy:"automatic"},appName:C?.name||"privy",loading:!n,buttonLoading:d,buttonHideAnimations:!t&&d,isResettingPassword:!1,error:P,password:s||"",onClose:()=>{t&&t.account.recoveryMethod!=="user-passcode"?(i(new S("User created a wallet but failed to set a password for it")),l({shouldCallAuthOnSuccess:!1})):t?(p(t),l({shouldCallAuthOnSuccess:m})):(i(new S("User wallet creation failed")),l({shouldCallAuthOnSuccess:!1}))},onPasswordChange:h,onPasswordGenerate:()=>h(k()),onSubmit:async()=>(u(!0),A.execute().then(()=>new Promise(e=>setTimeout(e,250))).finally(()=>u(!1)))})}};export{q as EmbeddedWalletPasswordCreateScreen,q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.