@privy-io/react-auth 1.54.0 → 1.54.1-beta-20240122155643
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/esm/index.js +32 -32
- package/dist/index.js +72 -72
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -856,7 +856,7 @@ Resources:
|
|
|
856
856
|
color: var(--privy-color-error);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
859
|
-
`;import{XCircleIcon as
|
|
859
|
+
`;import{XCircleIcon as b1}from"@heroicons/react/24/outline";import{useEffect as Fp,useRef as E1,useState as Rn}from"react";import{useCallback as Up,useEffect as C1}from"react";import{ExclamationTriangleIcon as Mg}from"@heroicons/react/24/outline";import{useEffect as Lg,useState as Vs}from"react";import{ArrowPathIcon as Ag,EyeIcon as Rg,EyeSlashIcon as Ig}from"@heroicons/react/24/outline";import Me,{css as Gs}from"styled-components";var Wg=Gs`
|
|
860
860
|
font-size: 14px;
|
|
861
861
|
font-style: normal;
|
|
862
862
|
font-weight: 400;
|
|
@@ -1074,18 +1074,18 @@ Resources:
|
|
|
1074
1074
|
`;import{Fragment as Ep,jsx as ft,jsxs as kn}from"react/jsx-runtime";var Pp=({buttonHideAnimations:e,buttonLoading:t,onSubmit:o,onBack:r,config:n})=>{let[i,a]=Bg(!1);return kn(Ep,{children:[ft(x,{title:"Confirm Password",closeable:!1,backFn:r}),ft(q,{}),kn(Ao,{children:[kn(Wo,{children:[ft(Fg,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),ft("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),ft("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),ft(xn,{children:kn(Sn,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:s=>{s.preventDefault(),a(l=>!l)},children:[ft(wp,{color:"var(--privy-color-error)",checked:i}),ft(Ep,{children:"I understand losing my password means losing my account."})]})})]}),kn(Gg,{children:[n.initiatedBy==="user"&&ft(no,{onClick:n.onCancel,disabled:t,children:"Cancel"}),ft(Ro,{onClick:o,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),ft(K,{}),ft(F,{protectedByPrivy:!0})]})},Gg=Hg.div`
|
|
1075
1075
|
display: flex;
|
|
1076
1076
|
gap: 10px;
|
|
1077
|
-
`;import{KeyIcon as
|
|
1077
|
+
`;import{KeyIcon as n1}from"@heroicons/react/24/outline";import{CheckCircleIcon as Rp}from"@heroicons/react/24/solid";import{useState as Ip,useMemo as $s,useEffect as i1}from"react";import Wp from"styled-components";import zg from"fast-password-entropy";import*as Tp from"secure-password-utilities";import{DEFAULT_WORDLIST as Vg}from"secure-password-utilities/wordlists";var $g=95,jg=8,qg=3,Kg=.3,Yg=/[a-z]/,Jg=/[A-Z]/,Qg=/[0-9]/,Zg="a-zA-Z0-9",xp="!@#$%^&*()\\-_+.",Sp=`${Zg}${xp}`,Xg=new RegExp(`[${xp}]`),e1=new RegExp(`[${Sp}]`),_p=new RegExp(`^[${Sp}]{6,}$`),kp=(e="")=>{let t=e.split("").filter(o=>!e1.test(o)).map(o=>o.replace(" ","SPACE"));return[...new Set(t)]},Ji=()=>Tp.generatePassphrase(4,Vg);function t1(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function o1(e){if(e.length<jg)return 0;let t=0;Yg.test(e)&&(t+=1),Jg.test(e)&&(t+=1),Qg.test(e)&&(t+=1),Xg.test(e)&&(t+=1);let o=t/qg;return Math.max(0,Math.min(1,o))}function r1(e=""){let t=o1(e),o=zg(e)/$g;return(t*Kg+o)/2}function Ap(e=""){let t=r1(e);return{value:t,label:t1(t)}}import{Fragment as l1,jsx as Se,jsxs as lo}from"react/jsx-runtime";var Mp=({buttonHideAnimations:e,buttonLoading:t,password:o="",config:r,onSubmit:n,onClose:i,onPasswordChange:a,onPasswordGenerate:s})=>{let[l,c]=Ip(!1),[u,f]=Ip(!1);i1(()=>{o&&!u&&f(!0)},[o]);let w=$s(()=>u?(o?.length||0)<6?"Password must be at least 6 characters":_p.test(o||"")?null:`Invalid characters used ( ${kp(o).join(" ")} )`:null,[o,u]),v=$s(()=>w?{value:0,label:"Weak"}:Ap(o),[o,w]),T=$s(()=>!!(!o?.length||w),[w,o]);return lo(l1,{children:[Se(x,{onClose:i,title:"Secure your account",closeable:r.initiatedBy==="user"}),Se(q,{}),lo(Ao,{children:[lo(Wo,{children:[Se(n1,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Se("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),Se("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),lo(Io,{children:[Se(or,{value:o,onChange:y=>a(y.target.value),placeholder:"enter or generate a strong password",type:l?"password":"text"}),lo(zr,{style:{width:"3.5rem"},children:[l?Se(Vr,{onClick:()=>c(!1)}):Se($r,{onClick:()=>c(!0)}),Se(yp,{onClick:s})]})]}),Se(gp,{value:v.value===0?.01:v.value,label:v.label}),Se(qi,{error:!!w,children:w||`Password Strength: ${u?v.label:"--"}`}),lo(s1,{children:[Se(a1,{children:lo(xn,{children:[lo(Sn,{children:[Se(Rp,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),lo(Sn,{children:[Se(Rp,{width:24,height:24,fill:"var(--privy-color-accent)"}),"You will only be asked to enter it when signing on to a new device."]})]})}),Se(Ro,{onClick:n,loading:t,disabled:T,hideAnimations:e,children:"Continue"})]})]}),Se(K,{}),Se(F,{protectedByPrivy:!0})]})},a1=Wp(xn)`
|
|
1078
1078
|
flex: 1;
|
|
1079
1079
|
padding-top: 1rem;
|
|
1080
|
-
`,
|
|
1080
|
+
`,s1=Wp.div`
|
|
1081
1081
|
display: flex;
|
|
1082
1082
|
flex-direction: column;
|
|
1083
1083
|
height: 100%;
|
|
1084
|
-
`;import{ArrowDownTrayIcon as
|
|
1084
|
+
`;import{ArrowDownTrayIcon as c1,ClipboardDocumentCheckIcon as d1,DocumentDuplicateIcon as p1,ExclamationTriangleIcon as u1}from"@heroicons/react/24/outline";import{useState as m1,useCallback as Lp}from"react";import{Fragment as js,jsx as Je,jsxs as rr}from"react/jsx-runtime";var Np=({buttonHideAnimations:e,buttonLoading:t,appName:o,password:r,onSubmit:n,onBack:i})=>{let[a,s]=m1(!1),l=Lp(()=>{s(!0),r&&navigator.clipboard.writeText(r)},[r]),c=Lp(()=>{let u=document.createElement("a"),f=o.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),w=new Blob([f1(o,r)],{type:"text/plain"}),v=URL.createObjectURL(w);u.href=v,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[r]);return rr(js,{children:[Je(x,{backFn:i,title:"Save Password",closeable:!1}),Je(q,{}),rr(Ao,{children:[rr(Wo,{children:[Je(u1,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),Je("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),Je("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset if you lose your device. Make sure to secure it to keep your assets safe."})]}),Je(Io,{centered:!0,children:Je(hp,{children:r})}),rr("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[Je(zs,{onClick:l,children:a?rr(js,{children:[Je(d1,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):rr(js,{children:[Je(p1,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),rr(zs,{onClick:c,children:[Je(c1,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),Je(Ro,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),Je(K,{}),Je(F,{protectedByPrivy:!0})]})},f1=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1085
1085
|
|
|
1086
1086
|
${t}
|
|
1087
1087
|
|
|
1088
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import{CheckCircleIcon as
|
|
1088
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import{CheckCircleIcon as h1,XCircleIcon as y1}from"@heroicons/react/24/outline";import{Fragment as g1,jsx as co,jsxs as qs}from"react/jsx-runtime";var Op=({error:e,onClose:t})=>qs(g1,{children:[co(x,{closeable:!1}),co(q,{}),e?qs(xt,{children:[co(y1,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}),co(he,{title:"Something went wrong",description:e})]}):qs(xt,{children:[co(h1,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),co(he,{title:"Success"})]}),co(U,{onClick:t,children:"Close"}),co(K,{}),co(F,{protectedByPrivy:!0})]});import{useReducer as v1}from"react";var w1=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Dp=()=>{let[e,t]=v1(w1,"creating");return{send:t,state:e}};import{jsx as An}from"react/jsx-runtime";var Qi=({onSubmit:e,...t})=>{let{send:o,state:r}=Dp(),n=Up(async()=>{r==="finalizing"&&await e(),o("next")},[r,o,e]);C1(()=>{let a;return r==="done"&&t.config.initiatedBy==="automatic"&&(a=setTimeout(()=>t.onClose?.(),et)),()=>{a&&clearTimeout(a)}},[r,t.config.initiatedBy,t.onClose]);let i=Up(()=>{o("back")},[o]);return r==="creating"?An(Mp,{...t,onSubmit:n}):r==="saving"?An(Np,{...t,onSubmit:n,onBack:i}):r==="confirming"?An(vp,{...t,onSubmit:n,onBack:i}):r==="finalizing"?An(Pp,{...t,onSubmit:n,onBack:i}):r==="done"?An(Op,{...t,onSubmit:n}):null};import{Fragment as T1,jsx as jr,jsxs as Bp}from"react/jsx-runtime";var P1=250,Hp=()=>{let{app:e,navigate:t,data:o,onUserCloseViaDialogOrKeybindRef:r}=S(),[n,i]=Rn(""),[a,s]=Rn(!1),[l,c]=Rn(),[u,f]=Rn(null),[w,v]=Rn(null),T=E1(!1),{authenticated:y,getAccessToken:E}=H(),{refreshUser:b,closePrivyModal:W,createAnalyticsEvent:M,isNewUserThisSession:N,initializeWalletProxy:I}=A(),{onSuccess:k,onFailure:R,callAuthOnSuccessOnClose:D}=o.createWallet,$=e?.embeddedWallets.requireUserPasswordOnCreate===!0,B=!!(!n||T.current)&&!$,_=new dt(async()=>se());Fp(()=>{u||I(3e4).then(O=>f(O))},[u]),Fp(()=>{if(!y){t("LANDING"),R(new Error("User must be authenticated before creating a Privy wallet"));return}!$&&!a&&!T.current&&(s(!0),_.execute().finally(()=>s(!1)))},[$,y]);let J=()=>{$&&w&&w?.recoveryMethod!=="user-passcode"?R(new Ze("User created a wallet but failed to set a password for it")):w?k(w):R(new Ze("User wallet creation failed")),W({shouldCallAuthOnSuccess:D})};r.current=()=>null;let se=async function(){let O=await E();if(O)try{if(M("embedded_wallet_creation_started"),!await(await I(br))?.create({accessToken:O,recoveryPassword:l}))throw M("embedded_wallet_creation_failed",{error:"walletProxy did not send a response."}),new Error("Unable to create wallet");let le=await b(),vt=ne(le);if(!vt)throw M("embedded_wallet_creation_failed",{error:"Updated user is missing embedded wallet."}),new Error("Unable to create wallet");v(vt),M("embedded_wallet_creation_completed",{walletAddress:vt.address}),i(""),T.current=!0,$?t("EMBEDDED_WALLET_CREATED_SCREEN"):N?t("EMBEDDED_WALLET_CREATED_SCREEN"):vt&&(k(vt),W({shouldCallAuthOnSuccess:D}))}catch(De){if(T.current)return;i("An error has occurred, please try again."),console.warn(De)}else i("An error has occured, please login again."),M("embedded_wallet_creation_failed",{error:"Missing access token for user."})},ve=async()=>$?(s(!0),_.execute().then(()=>new Promise(O=>setTimeout(O,P1))).finally(()=>s(!1))):W({shouldCallAuthOnSuccess:D});return!$&&n?Bp(T1,{children:[jr(x,{closeable:!1}),Bp(xt,{children:[jr(b1,{fill:"var(--privy-color-error)",stroke:"white",strokeWidth:".25px",width:"64px",height:"64px"}),jr(he,{title:"Something went wrong",description:n})]}),jr(U,{onClick:J,children:"Close"})]}):B?jr(Ur,{}):jr(Qi,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:B||!u,buttonLoading:a,buttonHideAnimations:!w&&a,error:n,password:l||"",onClose:J,onPasswordChange:c,onPasswordGenerate:()=>c(Ji()),onSubmit:ve})};import{useEffect as x1,useState as Zi}from"react";import{jsx as S1}from"react/jsx-runtime";var Gp=()=>{let[e,t]=Zi(null),[o,r]=Zi(!1),[n,i]=Zi(null),[a,s]=Zi(""),{authenticated:l,getAccessToken:c,user:u}=H(),{walletProxy:f,refreshUser:w,closePrivyModal:v,createAnalyticsEvent:T}=A(),{app:y,navigate:E,data:b,onUserCloseViaDialogOrKeybindRef:W}=S(),{onSuccess:M,onFailure:N}=b.createWallet,I=ne(u),k=e?.recoveryMethod==="user-passcode";x1(()=>{l||(E("LANDING"),N(new li("User must be authenticated before setting a password on a Privy wallet")))},[l]);let R=()=>{if(n){N(n),v({shouldCallAuthOnSuccess:!1});return}if(!k){N(new Ze("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}M(e),v({shouldCallAuthOnSuccess:!1})};W.current=R;let D=async()=>{let B=await c();if(B&&I?.address&&a&&f)try{if(T("embedded_wallet_set_password_started",{walletAddress:I.address}),!(await f.setRecoveryPassword({accessToken:B,address:I.address,recoveryPassword:a})).address){i(new Ze("Error setting password on privy wallet")),T("embedded_wallet_set_password_failed",{walletAddress:I.address,reason:"error setting password"});return}let J=await w(),se=ne(J);if(!se){i(new Ze("Error setting password on privy wallet")),T("embedded_wallet_set_password_failed",{walletAddress:I.address,reason:"wallet disconnected"});return}t(se),T("embedded_wallet_set_password_completed",{walletAddress:I.address})}catch(_){console.warn(_),i(_ instanceof Error?_:new Error("Error setting password on privy wallet")),T("embedded_wallet_set_password_failed",{walletAddress:I.address,reason:_})}},$=async()=>{k?(M(e),v({shouldCallAuthOnSuccess:!1})):(r(!0),i(null),await D(),r(!1))};return S1(Qi,{appName:y?.name||"privy",config:{initiatedBy:"user",onCancel:R},error:n?"An error has occurred, please try again.":void 0,buttonLoading:o,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>s(Ji()),onPasswordChange:s,onSubmit:$,onClose:R})};import{UserCircleIcon as _1}from"@heroicons/react/24/outline";import{LockClosedIcon as k1}from"@heroicons/react/24/solid";import{Fragment as A1,jsx as po,jsxs as Xi}from"react/jsx-runtime";var zp=()=>{let{user:e}=H(),{closePrivyModal:t,createAnalyticsEvent:o}=A(),{data:r,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=S(),{onSuccess:s,onFailure:l}=r.setWalletPassword,c=()=>{l(new Ze("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,Xi(A1,{children:[po(x,{onClose:c}),po(q,{}),Xi(xt,{children:[Xi(Ad,{children:[po(_1,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),po(Rd,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:po(k1,{width:"12px",height:"12px",fill:"white"})})]}),Xi(he,{title:"Secure Your Account",children:["Please set a password to secure your account.",po("p",{children:"Losing this password will make your account inaccessible on new devices. You will only be asked for it when you log on to a new device."})]})]}),po(U,{onClick:()=>{let f=ne(e);o("embedded_wallet_set_password_started",{walletAddress:f?.address}),n({createWallet:{onFailure:l,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),po(K,{}),po(F,{protectedByPrivy:!0})]})};import{ShieldCheckIcon as R1}from"@heroicons/react/24/outline";import{useEffect as I1,useState as ea}from"react";import ta,{css as W1}from"styled-components";import{Fragment as D1,jsx as Be,jsxs as nr}from"react/jsx-runtime";var Vp=()=>{let[e,t]=ea(!0),{authenticated:o,getAccessToken:r}=H(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=A(),{navigate:s,data:l,onUserCloseViaDialogOrKeybindRef:c}=S(),[u,f]=ea(void 0),[w,v]=ea(""),[T,y]=ea(!1),{privyWallet:E,onCompleteNavigateTo:b,onSuccess:W,onFailure:M}=l.recoverWallet,N=(R="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),M(typeof R=="string"?new Ze(R):R)};c.current=N,I1(()=>{if(!o||!E)return N("User must be authenticated and have a Privy wallet before it can be recovered")},[o]);let I=R=>{R&&f(R)};return nr(D1,{children:[Be(x,{onClose:N}),Be(q,{}),nr(L1,{children:[nr(M1,{children:[Be(R1,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Be("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),Be("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),nr("div",{children:[nr(Io,{children:[Be(or,{type:e?"password":"text",onChange:R=>I(R.target.value),disabled:T}),Be(zr,{style:{right:"0.75rem"},children:e?Be(Vr,{onClick:()=>t(!1)}):Be($r,{onClick:()=>t(!0)})})]}),!!w&&Be(N1,{children:w})]}),nr("div",{children:[nr(kd,{children:[Be("h4",{children:"Why is this necessary?"}),Be("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Be(O1,{loading:T||!n,disabled:!u,onClick:async()=>{y(!0);let R=await r();if(R&&E&&u!==null)try{a("embedded_wallet_recovery_started",{walletAddress:E.address}),await n?.recover({address:E.address,accessToken:R,recoveryPin:u}),v(""),b?s(b):i({shouldCallAuthOnSuccess:!1}),W?.(E),a("embedded_wallet_recovery_completed",{walletAddress:E.address})}catch(D){rp(D)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{y(!1)}else return N("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!E&&T,children:"Recover your account"})]})]}),Be(K,{}),Be(F,{protectedByPrivy:!0})]})},M1=ta.div`
|
|
1089
1089
|
display: flex;
|
|
1090
1090
|
flex-direction: column;
|
|
1091
1091
|
align-items: center;
|
|
@@ -1107,26 +1107,26 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1107
1107
|
font-weight: 400;
|
|
1108
1108
|
line-height: 20px;
|
|
1109
1109
|
}
|
|
1110
|
-
`,
|
|
1110
|
+
`,L1=ta.div`
|
|
1111
1111
|
display: flex;
|
|
1112
1112
|
flex-direction: column;
|
|
1113
1113
|
justify-content: space-between;
|
|
1114
|
-
`,
|
|
1114
|
+
`,N1=ta.div`
|
|
1115
1115
|
line-height: 20px;
|
|
1116
1116
|
height: 20px;
|
|
1117
1117
|
font-size: 13px;
|
|
1118
1118
|
color: var(--privy-color-error);
|
|
1119
1119
|
text-align: left;
|
|
1120
1120
|
margin-top: 0.5rem;
|
|
1121
|
-
`,
|
|
1122
|
-
${e=>e.hideAnimations&&
|
|
1121
|
+
`,O1=ta(U)`
|
|
1122
|
+
${e=>e.hideAnimations&&W1`
|
|
1123
1123
|
&& {
|
|
1124
1124
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
1125
1125
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
1126
1126
|
transition: none;
|
|
1127
1127
|
}
|
|
1128
1128
|
`}
|
|
1129
|
-
`;import{EyeSlashIcon as
|
|
1129
|
+
`;import{EyeSlashIcon as F1,LinkIcon as B1,ClockIcon as H1}from"@heroicons/react/24/outline";import jt from"styled-components";import{jsx as Ks,jsxs as U1}from"react/jsx-runtime";var oa=({size:e=61,...t})=>Ks("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:U1("g",{id:"moonpay_symbol_wht 2",children:[Ks("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Ks("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as $p,jsx as He,jsxs as ir}from"react/jsx-runtime";var Ys=({title:e,desc:t,icon:o})=>ir(q1,{children:[He(Y1,{children:o}),ir(K1,{children:[He($1,{children:e}),He(j1,{children:t})]})]}),jp=({app:e,signedUrl:t,onContinue:o})=>ir($p,{children:[ir(z1,{children:[He(oa,{size:"3.75rem"}),ir(V1,{children:[e?.name," uses ",He("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),ir(J1,{children:[He(Ys,{icon:He(B1,{width:"1rem"}),title:"Purchase assets to fund your account",desc:ir($p,{children:["Connect a payment method (",He("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),He(Ys,{icon:He(H1,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),He(Ys,{icon:He(F1,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),He(Q1,{className:"mobile-only"})]}),He(G1,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),He(Oi,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:o,children:"Continue to Moonpay"})]}),G1=jt.span`
|
|
1130
1130
|
display: inline-block;
|
|
1131
1131
|
color: var(--privy-color-foreground-3);
|
|
1132
1132
|
text-align: center;
|
|
@@ -1135,13 +1135,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1135
1135
|
font-weight: 400;
|
|
1136
1136
|
line-height: 140%; /* 0.875rem */
|
|
1137
1137
|
margin-bottom: 0.25rem;
|
|
1138
|
-
`,
|
|
1138
|
+
`,z1=jt.div`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
flex-direction: column;
|
|
1141
1141
|
align-items: center;
|
|
1142
1142
|
justify-content: center;
|
|
1143
1143
|
padding: 1.5rem 0;
|
|
1144
|
-
`,
|
|
1144
|
+
`,V1=jt.span`
|
|
1145
1145
|
color: var(--privy-color-foreground);
|
|
1146
1146
|
text-align: center;
|
|
1147
1147
|
font-size: 1.125rem;
|
|
@@ -1150,46 +1150,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1150
1150
|
margin: 1.5rem 0;
|
|
1151
1151
|
text-align: center;
|
|
1152
1152
|
max-width: 19.5rem;
|
|
1153
|
-
`,$
|
|
1153
|
+
`,$1=jt.span`
|
|
1154
1154
|
color: var(--privy-color-foreground);
|
|
1155
1155
|
font-size: 0.875rem;
|
|
1156
1156
|
font-weight: 500;
|
|
1157
1157
|
line-height: 1.225rem;
|
|
1158
1158
|
width: 100%;
|
|
1159
|
-
`,
|
|
1159
|
+
`,j1=jt.span`
|
|
1160
1160
|
color: var(--privy-color-foreground-2);
|
|
1161
1161
|
font-size: 0.875rem;
|
|
1162
1162
|
font-weight: 400;
|
|
1163
1163
|
line-height: 1.225rem;
|
|
1164
|
-
`,
|
|
1164
|
+
`,q1=jt.div`
|
|
1165
1165
|
display: flex;
|
|
1166
1166
|
align-items: flex-start;
|
|
1167
1167
|
gap: 0.5rem;
|
|
1168
1168
|
align-self: stretch;
|
|
1169
|
-
`,
|
|
1169
|
+
`,K1=jt.div`
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
flex-direction: column;
|
|
1172
1172
|
gap: 0.25rem;
|
|
1173
1173
|
align-items: flex-start;
|
|
1174
1174
|
text-align: left;
|
|
1175
1175
|
flex: 1 0 0;
|
|
1176
|
-
`,
|
|
1176
|
+
`,Y1=jt.div`
|
|
1177
1177
|
padding-top: 2px;
|
|
1178
|
-
`,
|
|
1178
|
+
`,J1=jt.div`
|
|
1179
1179
|
display: flex;
|
|
1180
1180
|
flex-direction: column;
|
|
1181
1181
|
gap: 1.25rem;
|
|
1182
1182
|
margin: 0 0.5rem;
|
|
1183
|
-
`,
|
|
1183
|
+
`,Q1=jt.div`
|
|
1184
1184
|
margin: 30px 0;
|
|
1185
|
-
`;import{ofetch as
|
|
1185
|
+
`;import{ofetch as Z1}from"ofetch";import{useEffect as X1,useRef as ev,useState as tv}from"react";var ra="moonpay",qp="sdk_fiat_on_ramp_completed_with_status";async function Kp(e,t,o,r,n=!1){let i=o.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=o.uiConfig||{accentColor:r.accent,theme:r.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...o,...i,...a}})}async function ov(e,t){let o=t?Tc:Pc,r=t?Sc:xc;return Z1(`${o}/transactions/ext/${e}`,{query:{apiKey:r}})}function Yp(e,t=!1){let[o,r]=tv(null),{createAnalyticsEvent:n}=A(),i=ev(0);return X1(()=>{let a=setInterval(async()=>{if(e)try{let[s]=await ov(e,t),l=s.status==="waitingAuthorization"&&s.paymentMethod==="credit_debit_card"?"pending":s.status;r(l),["failed","completed","awaitingAuthorization"].includes(l)&&(n(qp,{status:l,provider:ra,paymentMethod:s.paymentMethod,cardPaymentType:s.cardPaymentType,currency:s.currency?.code,baseCurrencyAmount:s.baseCurrencyAmount,quoteCurrencyAmount:s.quoteCurrencyAmount,feeAmount:s.feeAmount,extraFeeAmount:s.extraFeeAmount,networkFeeAmount:s.networkFeeAmount}),clearInterval(a))}catch(s){s.response?.status!==404&&(i.current+=1),i.current>=3&&(r("serviceFailure"),n(qp,{status:"serviceFailure",provider:ra}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),o}import{Fragment as rv,jsx as Js,jsxs as nv}from"react/jsx-runtime";var Jp=()=>{let{app:e,data:t,navigate:o}=S(),{createAnalyticsEvent:r}=A(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:nv(rv,{children:[Js(x,{title:"Fund account"},"header"),Js(jp,{app:e,signedUrl:n,onContinue:()=>{r("sdk_fiat_on_ramp_started",{provider:ra}),o("FIAT_ON_RAMP_STATUS_SCREEN")}}),Js(F,{protectedByPrivy:!0})]})};import{ArrowsRightLeftIcon as iv,CheckCircleIcon as av,XCircleIcon as sv}from"@heroicons/react/24/solid";import{useMemo as lv}from"react";import Qp from"styled-components";import{Fragment as Qs,jsx as Ge,jsxs as ar}from"react/jsx-runtime";var Zp=()=>{let{app:e,data:t}=S(),{closePrivyModal:o}=A(),{externalTransactionId:r}=t?.fiatOnRampStatus,n=Yp(r||null,e.fiatOnRamp.useSandbox);return ar(Qs,{children:[Ge(x,{title:"Fund account"},"header"),Ge(dv,{status:n,onClickCta:o}),Ge(F,{protectedByPrivy:!0})]})},cv=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:ar(Qs,{children:[ar("p",{children:["It looks like there was an issue with your payment. Please contact"," ",Ge("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),Ge("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},dv=({status:e,onClickCta:t})=>{let{title:o,body:r,cta:n}=lv(()=>cv(e),[e]);return ar(Qs,{children:[ar(hv,{children:[Ge(mv,{status:e}),ar(To,{children:[Ge("h3",{children:o}),Ge(fv,{children:r})]})]}),n&&Ge(U,{onClick:t,children:n})]})},pv=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",uv=e=>{switch(e){case"serviceFailure":case"failed":return sv;case"completed":return av;case"waitingAuthorization":return()=>Ge(iv,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},mv=({status:e})=>{if(!e||e==="pending"){let r="var(--privy-color-foreground-4)";return ar("div",{style:{position:"relative"},children:[Ge(Bt,{color:r,style:{position:"absolute"}}),Ge(bs,{color:r}),Ge(oa,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=uv(e),o=pv(e);return Ge("div",{style:{borderColor:o,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Ge(t,{width:"4rem",height:"4rem",color:o})})},fv=Qp.p`
|
|
1186
1186
|
font-size: 1rem;
|
|
1187
1187
|
color: var(--privy-color-foreground-3);
|
|
1188
1188
|
margin-bottom: 1rem;
|
|
1189
1189
|
display: flex;
|
|
1190
1190
|
flex-direction: column;
|
|
1191
1191
|
gap: 1rem;
|
|
1192
|
-
`,
|
|
1192
|
+
`,hv=Qp.div`
|
|
1193
1193
|
display: flex;
|
|
1194
1194
|
flex-direction: column;
|
|
1195
1195
|
align-items: center;
|
|
@@ -1197,7 +1197,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1197
1197
|
margin-left: 1.75rem;
|
|
1198
1198
|
margin-right: 1.75rem;
|
|
1199
1199
|
padding: 2rem 0;
|
|
1200
|
-
`;import{ArrowTopRightOnSquareIcon as
|
|
1200
|
+
`;import{ArrowTopRightOnSquareIcon as yv}from"@heroicons/react/24/outline";import gv from"styled-components";import{Fragment as wv,jsx as Mo,jsxs as Cv}from"react/jsx-runtime";var Xp=()=>{let{closePrivyModal:e}=A();return Cv(wv,{children:[Mo(x,{},"header"),Mo(vv,{children:Mo(yv,{style:{width:32,height:32}})}),Mo(zt,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),Mo(Gt,{children:Mo(U,{onClick:()=>e(),children:"Close"})}),Mo(K,{}),Mo(F,{protectedByPrivy:!0})]})},vv=gv.div`
|
|
1201
1201
|
border-radius: 50%;
|
|
1202
1202
|
height: 68px;
|
|
1203
1203
|
width: 68px;
|
|
@@ -1207,7 +1207,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1207
1207
|
background-color: var(--privy-color-accent);
|
|
1208
1208
|
color: white;
|
|
1209
1209
|
margin: 0 auto 24px auto;
|
|
1210
|
-
`;import*as ru from"react-device-detect";import
|
|
1210
|
+
`;import*as ru from"react-device-detect";import Tv from"styled-components";import Zs from"styled-components";import{jsx as eu}from"react/jsx-runtime";var tu=({style:e,...t})=>eu("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:eu("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as Ev,jsxs as Pv}from"react/jsx-runtime";var ou=Zs.div`
|
|
1211
1211
|
display: flex;
|
|
1212
1212
|
flex-direction: column;
|
|
1213
1213
|
justify-content: flex-start;
|
|
@@ -1218,7 +1218,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1218
1218
|
border-left: 2px solid var(--privy-color-foreground-4);
|
|
1219
1219
|
height: 12px;
|
|
1220
1220
|
}
|
|
1221
|
-
`,na=({children:e})=>
|
|
1221
|
+
`,na=({children:e})=>Pv(bv,{children:[Ev(tu,{style:{width:"16px",height:"16px"}}),e]}),bv=Zs.div`
|
|
1222
1222
|
display: flex;
|
|
1223
1223
|
justify-content: flex-start;
|
|
1224
1224
|
justify-items: center;
|
|
@@ -1236,15 +1236,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1236
1236
|
margin-bottom: auto;
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
|
-
`;import{Fragment as
|
|
1239
|
+
`;import{Fragment as _v,jsx as _e,jsxs as In}from"react/jsx-runtime";var xv=()=>{let{navigate:e}=S(),t="https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return ru.isFirefox&&(t="https://addons.mozilla.org/en-US/firefox/addon/phantom-app/"),In(Sv,{children:[_e(gn,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),_e(io,{children:_e(Dt,{style:{width:"152px",height:"152px"}})}),In(ou,{children:[_e(na,{children:In("div",{children:[_e("span",{children:"Install the "}),_e("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),_e(Xs,{}),_e(na,{children:"Set up your first wallet"}),_e(Xs,{}),_e(na,{children:"Store your recovery phrase in a safe place!"})]}),_e(Di,{onClick:()=>e("LANDING"),children:"Done! I have my wallet"})]})},nu=()=>{let{navigateBack:e}=S();return In(_v,{children:[_e(x,{backFn:e},"header"),_e(q,{}),_e(xv,{}),_e(K,{}),In(Q,{children:[_e("span",{children:"Still not sure? "}),_e("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Sv=Tv(io)`
|
|
1240
1240
|
gap: 30px;
|
|
1241
1241
|
|
|
1242
1242
|
> :first-child > svg {
|
|
1243
1243
|
margin-top: 20px;
|
|
1244
1244
|
}
|
|
1245
|
-
`;import uw from"@heroicons/react/24/outline/EnvelopeIcon";import mw from"@heroicons/react/24/outline/PhoneIcon";import fw from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as hw,useState as Eu}from"react";import yw from"styled-components";import{jsx as Wn,jsxs as iu}from"react/jsx-runtime";var au=({...e})=>iu("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[iu("g",{clipPath:"url(#clip0_2856_1743)",children:[Wn("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Wn("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Wn("defs",{children:Wn("clipPath",{id:"clip0_2856_1743",children:Wn("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import
|
|
1245
|
+
`;import uw from"@heroicons/react/24/outline/EnvelopeIcon";import mw from"@heroicons/react/24/outline/PhoneIcon";import fw from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as hw,useState as Eu}from"react";import yw from"styled-components";import{jsx as Wn,jsxs as iu}from"react/jsx-runtime";var au=({...e})=>iu("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[iu("g",{clipPath:"url(#clip0_2856_1743)",children:[Wn("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),Wn("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Wn("defs",{children:Wn("clipPath",{id:"clip0_2856_1743",children:Wn("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import Lv from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as Nv}from"react";import{EnvelopeIcon as kv}from"@heroicons/react/24/outline";import{forwardRef as Av,useState as el}from"react";import ol from"styled-components";import{Fragment as Mv,jsx as Mn,jsxs as tl}from"react/jsx-runtime";var ia=Av((e,t)=>{let[o,r]=el(""),[n,i]=el(!1),[a,s]=el(null),{initLoginWithEmail:l}=A(),{navigate:c}=S(),u=ue(),f=Lc(o),w=n,v=n||!f||u.enabled&&u.status==="error",T=()=>{i(!0),l(o).then(()=>{c("AWAITING_PASSWORDLESS_CODE")}).catch(y=>{y?.status===422?s(y.message):y?.privyErrorCode==="allowlist_rejected"?c("ALLOWLIST_REJECTION_SCREEN"):(console.error(y),s("Issue submitting email")),i(!1)})};return tl(Mv,{children:[tl(Rv,{children:[tl(Iv,{children:[Mn(kv,{}),Mn("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:y=>r(y.target.value),onKeyUp:y=>{y.key==="Enter"&&T()},value:o,autoComplete:"email"}),e.stacked?null:Mn(Ui,{isSubmitting:w,onClick:T,disabled:v,children:"Submit"})]}),a&&Mn(Wv,{children:a})]}),e.stacked?Mn(U,{loadingText:null,loading:w,disabled:v,onClick:T,children:"Submit"}):null]})}),Rv=ol.div`
|
|
1246
1246
|
width: 100%;
|
|
1247
|
-
`,
|
|
1247
|
+
`,Iv=ol.label`
|
|
1248
1248
|
display: block;
|
|
1249
1249
|
position: relative;
|
|
1250
1250
|
width: 100%;
|
|
@@ -1302,7 +1302,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1302
1302
|
&& > input::placeholder {
|
|
1303
1303
|
color: var(--privy-color-foreground-3);
|
|
1304
1304
|
}
|
|
1305
|
-
`,
|
|
1305
|
+
`,Wv=ol.div`
|
|
1306
1306
|
font-size: 13px;
|
|
1307
1307
|
color: var(--privy-color-error);
|
|
1308
1308
|
text-align: left;
|
|
@@ -1312,9 +1312,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1312
1312
|
> a {
|
|
1313
1313
|
text-decoration: underline;
|
|
1314
1314
|
}
|
|
1315
|
-
`;import{Fragment as
|
|
1315
|
+
`;import{Fragment as Ov,jsx as aa,jsxs as su}from"react/jsx-runtime";var lu=({isEditable:e,setIsEditable:t})=>{let o=Nv(null);return su(Ov,{children:[aa(ao,{if:!e,children:aa(ia,{ref:o})}),aa(ao,{if:e,children:su(ye,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[aa(Lv,{})," Continue with Email"]})})]})};import Jv from"@heroicons/react/24/outline/PhoneIcon";import{useRef as Qv}from"react";import{forwardRef as $v,useState as ca}from"react";import nl from"styled-components";import Dv from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as Uv,AsYouType as Fv,getCountries as Bv,getCountryCallingCode as sa,getExampleNumber as Hv}from"libphonenumber-js/min";import{jsx as Vv,jsxs as zv}from"react/jsx-runtime";var Ln=(e,t)=>Uv(String(e),t),la=(e,t)=>`+${sa(t)} ${e}`,cu=e=>`*${e.replaceAll("-","").slice(-4)}`,du=e=>new Fv(e),Gv=Bv().map(e=>({code:e,callCode:sa(e)})),pu=e=>Hv(e,Dv)?.formatNational(),uu=({value:e,onChange:t})=>Vv("select",{value:e,onChange:t,children:Gv.map(o=>zv("option",{value:o.code,children:[o.code," +",o.callCode]},o.code))});import{Fragment as Yv,jsx as Nn,jsxs as rl}from"react/jsx-runtime";var qr=$v((e,t)=>{let{navigate:o,app:r}=S(),n=ue(),[i,a]=ca(""),[s,l]=ca(r?.intl.defaultCountry??"US"),[c,u]=ca(!1),[f,w]=ca(null),v=Ln(i,s),T=du(s),y=pu(s),E=sa(s),b=c,W=c||!v||n.enabled&&n.status==="error",M=E.length,N=R=>{let D=R.target.value;l(D),a(""),e.onChange&&e.onChange({rawPhoneNumber:i,qualifiedPhoneNumber:la(i,D),countryCode:D,isValid:Ln(i,s)})},I=R=>{try{let D=R.replace(/\D/g,""),$=i.replace(/\D/g,""),B=D===$?R:T.input(R);a(B),e.onChange&&e.onChange({rawPhoneNumber:B,qualifiedPhoneNumber:la(R,s),countryCode:s,isValid:Ln(R,s)})}catch(D){console.error("Error processing phone number:",D)}},k=async()=>{let R=n.status==="success"?n.token:void 0;u(!0);try{let D=la(i,s);await e.onSubmit({rawPhoneNumber:i,qualifiedPhoneNumber:D,countryCode:s,isValid:Ln(i,s),captchaToken:R})}catch(D){let $=D;$?.status===422||D.type==="twilio_verification_failed"?w($.message):$?.privyErrorCode==="allowlist_rejected"?o("ALLOWLIST_REJECTION_SCREEN"):(console.error(D),w("Issue submitting phone number"))}finally{u(!1)}};return rl(Yv,{children:[rl(jv,{children:[rl(qv,{callingCodeLength:M,children:[Nn(uu,{value:s,onChange:N}),Nn("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:y,onChange:R=>{I(R.target.value)},onKeyUp:R=>{R.key==="Enter"&&k()},value:i,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?Nn(Ui,{isSubmitting:b,onClick:k,disabled:W,children:"Submit"}):null]}),f&&Nn(Kv,{children:f})]}),e.stacked&&!e.noIncludeSubmitButton?Nn(U,{loading:b,loadingText:null,onClick:k,disabled:W,children:"Submit"}):null]})}),jv=nl.div`
|
|
1316
1316
|
width: 100%;
|
|
1317
|
-
`,
|
|
1317
|
+
`,qv=nl.label`
|
|
1318
1318
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
1319
1319
|
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
|
|
1320
1320
|
display: block;
|
|
@@ -1400,7 +1400,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1400
1400
|
&& > input::placeholder {
|
|
1401
1401
|
color: var(--privy-color-foreground-3);
|
|
1402
1402
|
}
|
|
1403
|
-
`,
|
|
1403
|
+
`,Kv=nl.div`
|
|
1404
1404
|
font-size: 13px;
|
|
1405
1405
|
color: var(--privy-color-error);
|
|
1406
1406
|
text-align: left;
|
|
@@ -1410,7 +1410,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1410
1410
|
> a {
|
|
1411
1411
|
text-decoration: underline;
|
|
1412
1412
|
}
|
|
1413
|
-
`;import{Fragment as
|
|
1413
|
+
`;import{Fragment as Zv,jsx as da,jsxs as mu}from"react/jsx-runtime";var fu=({isEditable:e,setIsEditable:t})=>{let o=Qv(null),{navigate:r}=S(),{initLoginWithSms:n}=A();async function i({qualifiedPhoneNumber:a}){await n(a),r("AWAITING_PASSWORDLESS_CODE")}return mu(Zv,{children:[da(ao,{if:!e,children:da(qr,{ref:o,onSubmit:i})}),da(ao,{if:e,children:mu(ye,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[da(Jv,{})," Continue with SMS"]})})]})};import{useState as vu}from"react";import rw from"styled-components";import{jsx as hu,jsxs as Xv}from"react/jsx-runtime";var pa=({style:e,...t})=>Xv("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[hu("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),hu("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as On,jsxs as ew}from"react/jsx-runtime";var ua=({style:e,...t})=>ew("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[On("g",{clipPath:"url(#clip0)",children:On("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),On("defs",{children:On("clipPath",{id:"clip0",children:On("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as yu}from"react/jsx-runtime";var ma=({style:e,...t})=>yu("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:yu("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});import{jsx as fa,jsxs as tw}from"react/jsx-runtime";var ha=({style:e,...t})=>tw("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[fa("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),fa("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),fa("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),fa("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as ya}from"react/jsx-runtime";function ga({style:e,...t}){return ya("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:ya("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:ya("g",{transform:"scale(5.12,5.12)",children:ya("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as il,jsxs as ow}from"react/jsx-runtime";function va(e){return ow("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[il("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),il("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),il("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"currentColor"})]})}import{jsx as gu}from"react/jsx-runtime";var wa=({style:e,...t})=>gu("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:gu("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156 ",fill:"currentColor"})});import{jsx as qt,jsxs as aw}from"react/jsx-runtime";var nw={apple:{logo:qt(pa,{}),displayName:"Apple"},discord:{logo:qt(ua,{}),displayName:"Discord"},github:{logo:qt(ma,{}),displayName:"GitHub"},google:{logo:qt(ha,{}),displayName:"Google"},linkedin:{logo:qt(ga,{}),displayName:"LinkedIn"},twitter:{logo:qt(wa,{}),displayName:"Twitter"},tiktok:{logo:qt(va,{}),displayName:"TikTok"}},Lo=({provider:e})=>{let[t,o]=vu(!1),[r,n]=vu(!1),{status:i}=ue(),{initLoginWithOAuth:a}=A(),{displayName:s,logo:l}=nw[e];return aw(iw,{onClick:async()=>{o(!0),n(!1);try{await a(e)}catch(f){console.error(f),n(!0),setTimeout(()=>{n(!1)},1e3)}finally{o(!1)}},disabled:t||i==="error"||r,children:[l,qt("span",{children:s}),t?qt(ro,{}):qt("span",{})]})},iw=rw(ye)`
|
|
1414
1414
|
span:last-child {
|
|
1415
1415
|
margin-left: auto;
|
|
1416
1416
|
}
|