1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="9ba848b3-c5a7-4fbf-9d00-952579fcc77c",e._sentryDebugIdIdentifier="sentry-dbid-9ba848b3-c5a7-4fbf-9d00-952579fcc77c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2353],{72353:(e,s,t)=>{t.r(s),t.d(s,{EmbeddedWalletPasswordUpdateScreen:()=>c,default:()=>c});var r=t(95155),a=t(12115),d=t(12042),o=t(7955),n=t(55151),l=t(6017),i=t(42214);t(15822),t(65884),t(55702),t(9330),t(98481);let c={component:()=>{let[e,s]=(0,a.useState)(null),[t,c]=(0,a.useState)(!1),[y,u]=(0,a.useState)(null),[w,p]=(0,a.useState)(""),{authenticated:v,user:f}=(0,d.u)(),{client:g,walletProxy:b,refreshSessionAndUser:h,closePrivyModal:_,createAnalyticsEvent:m}=(0,n.u)(),{navigate:M,data:R,onUserCloseViaDialogOrKeybindRef:P}=(0,d.a)(),A=(0,o.u)(),{onSuccess:E,onFailure:S}=R.setWalletPassword,I=(0,d.g)(f),C="user-passcode"===e?.recoveryMethod,N="user-passcode"===I?.recoveryMethod;(0,a.useEffect)(()=>{v||(M("LandingScreen"),S(new n.o("User must be authenticated before setting a password on a Privy wallet")))},[v]);let k=()=>(y?S(y):C?E(e):S(new n.m("Exited before password was added to wallet")),void _({shouldCallAuthOnSuccess:!1}));return P.current=k,(0,r.jsx)(i.S,{appName:A?.name||"privy",config:{initiatedBy:"user",onCancel:k},error:y?"An error has occurred, please try again.":void 0,buttonLoading:t,buttonHideAnimations:!1,password:w,isResettingPassword:N,onPasswordGenerate:()=>p((0,i.g)()),onPasswordChange:p,onSubmit:async()=>{C?(E(e),_({shouldCallAuthOnSuccess:!1})):(c(!0),u(null),await (async()=>{let e=await g.getAccessToken();if(e&&f&&I?.address&&w&&b)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:I.address,existingRecoveryMethod:I.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}});let{entropyId:t,entropyIdVerifier:r}=(0,l.b)(f);if(!(await b.setRecovery({accessToken:e,entropyId:t,entropyIdVerifier:r,recoveryPassword:w,recoveryMethod:"user-passcode"})).entropyId)return u(new n.m("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,existingRecoveryMethod:I.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"error setting password"}});let a=await h(),o=(0,d.g)(a);if(!o)return u(new n.m("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:I.address,existingRecoveryMethod:I.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"wallet disconnected"}});s(o),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:I.address,existingRecoveryMethod:I.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}})}catch(e){console.warn(e),u(e instanceof Error?e:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:I.address,reason:e}})}})(),c(!1))},onClose:k})}}}}]);
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.