1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[30],{71:(e,r,t)=>{t.r(r),t.d(r,{OAuthStatusScreen:()=>x,OAuthStatusScreenView:()=>b,default:()=>x});var i=t(95155),o=t(12115),n=t(87008),a=t(21209),l=t(56329),s=t(4636),c=t(56130),d=t(16189),p=t(54172),u=t(93456),g=t(19497),h=t(35883);t(50205),t(92253),t(68463),t(72378),t(86411);let v=({style:e})=>(0,i.jsx)(l.A,{style:{color:"var(--privy-color-error)",...e}}),m={google:{name:"Google",component:a.G},discord:{name:"Discord",component:a.D},github:{name:"Github",component:a.b},linkedin:{name:"LinkedIn",component:a.L},twitter:{name:"Twitter",component:a.a},spotify:{name:"Spotify",component:a.S},instagram:{name:"Instagram",component:a.I},tiktok:{name:"Tiktok",component:a.T},line:{name:"LINE",component:s.L},twitch:{name:"Twitch",component:s.T},apple:{name:"Apple",component:a.A}},f=({iconUrl:e,...r})=>o.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},o.createElement("foreignObject",{x:"2",y:"2",width:"29",height:"28"},o.createElement("img",{src:e,width:"29",height:"28",style:{display:"block",objectFit:"contain",borderRadius:"4px"},alt:"Provider icon"}))),y=(e,r)=>{if(e in m)return m[e];if((0,n.i)(e)&&r){let t=r.find(r=>r.provider===e);if(t)return{name:t.provider_display_name,component:e=>o.createElement(f,{...e,iconUrl:t.provider_icon_url})}}return{name:"Unknown",component:v}},b=({providerName:e,ProviderLogo:r,success:t,errorMessage:o,onRetry:n})=>{let a=t?`Successfully connected with ${e}`:o?o.message:`Verifying connection to ${e}`;return(0,i.jsx)(u.S,{title:a,subtitle:t?"You're good to go!":o?o.detail:"Just a few moments more",icon:r,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!o},secondaryCta:o?.retryable&&n?{label:"Retry",onClick:n}:void 0,watermark:!0})},x={component:()=>{let{authenticated:e,logout:r,ready:t,user:a}=(0,n.u)(),{setModalData:l,navigate:s,resetNavigation:u}=(0,n.a)(),v=(0,c.u)(),{getAuthMeta:m,initLoginWithOAuth:f,loginWithOAuth:x,updateWallets:w,setReadyToTrue:E,closePrivyModal:k,createAnalyticsEvent:S}=(0,d.u)(),[j,A]=(0,o.useState)(!1),[I,T]=(0,o.useState)(void 0),C=m()?.provider||"google",{name:_,component:O}=y(C,v.customOAuthProviders);return(0,o.useEffect)(()=>{x(C).then(()=>{A(!0),E(!0)}).catch(e=>{if(E(!1),e?.privyErrorCode===d.b.ALLOWLIST_REJECTED)return T(void 0),u(),void s("AllowlistRejectionScreen");if(e?.privyErrorCode===d.b.USER_LIMIT_REACHED)return console.error(new d.k(e).toString()),T(void 0),u(),void s("UserLimitReachedScreen");if(e?.privyErrorCode===d.b.USER_DOES_NOT_EXIST)return T(void 0),u(),void s("AccountNotFoundScreen");if(e?.privyErrorCode===d.b.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return T(void 0),u(),l({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:m()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void s("LinkConflictScreen");let{retryable:r,detail:t}=function(e,r,t){let i={detail:"",retryable:!1},o=(0,g.e)(r);if(e?.privyErrorCode===d.b.LINKED_TO_ANOTHER_USER&&(i.detail="This account has already been linked to another user."),e?.privyErrorCode===d.b.INVALID_CREDENTIALS&&(i.retryable=!0,i.detail="Something went wrong. Try again."),e.privyErrorCode===d.b.OAUTH_USER_DENIED&&(i.detail=`Retry and check ${o} to finish connecting your account.`,i.retryable=!0),e?.privyErrorCode===d.b.TOO_MANY_REQUESTS&&(i.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===d.b.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=y(r,t).name;i.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===d.b.OAUTH_ACCOUNT_SUSPENDED){let e=y(r,t).name;i.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===d.b.CANNOT_LINK_MORE_OF_TYPE&&(i.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===d.b.OAUTH_UNEXPECTED&&r.startsWith("privy:")&&(i.detail="Something went wrong. Please try again."),i}(e,C,v.customOAuthProviders);
1T({retryable:r,detail:t,message:"Authentication failed"})}).finally(()=>{(0,h.l)()})},[_,C]),(0,o.useEffect)(()=>{if(t&&e&&j&&a){if(v?.legal.requireUsersAcceptTerms&&!a.hasAcceptedTerms){let e=setTimeout(()=>{s("AffirmativeConsentScreen")},c.q);return()=>clearTimeout(e)}if((0,p.s)(a,v.embeddedWallets)){let e=setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:C,screen:"OAuthStatusScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),s("EmbeddedWalletOnAccountCreateScreen")},c.q);return()=>clearTimeout(e)}{let e=setTimeout(()=>k({shouldCallAuthOnSuccess:!0,isSuccess:!0}),c.q);return w(),()=>clearTimeout(e)}}},[t,e,j,a]),(0,i.jsx)(b,{providerName:_,ProviderLogo:O,success:j,errorMessage:I,onRetry:I?.retryable?()=>{(0,h.l)(),f(C),T(void 0)}:void 0})},isShownBeforeReady:!0}},19497:(e,r,t)=>{t.d(r,{e:()=>i});function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}},34048:(e,r,t)=>{t.d(r,{S:()=>E});var i=t(95155),o=t(12115),n=t(47561),a=t(48075),l=t(35595),s=t(95204);let c=n.I4.div` 2 /* spacing tokens */ 3 --screen-space: 16px; /* base 1x = 16 */ 4 --screen-space-lg: calc(var(--screen-space) * 1.5); /* 24px */ 5 6 position: relative; 7 overflow: hidden; 8 margin: 0 calc(-1 * var(--screen-space)); /* extends over modal padding */ 9 height: 100%; 10 border-radius: var(--privy-border-radius-lg); 11`,d=n.I4.div` 12 display: flex; 13 flex-direction: column; 14 gap: calc(var(--screen-space) * 1.5); 15 width: 100%; 16 background: var(--privy-color-background); 17 padding: 0 var(--screen-space-lg) var(--screen-space); 18 height: 100%; 19 border-radius: var(--privy-border-radius-lg); 20`,p=n.I4.div` 21 position: relative; 22 display: flex; 23 flex-direction: column; 24`,u=(0,n.I4)(l.M)` 25 margin: 0 -8px; 26`,g=n.I4.div` 27 flex: 1 1 auto; 28 display: flex; 29 flex-direction: column; 30 31 /* Enable scrolling */ 32 overflow-y: auto; 33 34 /* Hide scrollbar but keep functionality when scrollable */ 35 /* Add padding for focus outline space, offset with negative margin */ 36 padding: 3px; 37 margin: -3px; 38 39 &::-webkit-scrollbar {
40 display: none; 41 } 42 scrollbar-gutter: stable both-edges; 43 scrollbar-width: none; 44 -ms-overflow-style: none; 45 46 /* Gradient effect for scroll indication */ 47 ${({$colorScheme:e})=>"light"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0} 48 49 background-repeat: no-repeat; 50 background-size: 51 100% 32px, 52 100% 16px; 53 background-attachment: local, scroll; 54`,h=n.I4.div` 55 display: flex; 56 flex-direction: column; 57 gap: var(--screen-space-lg); 58 margin-top: 1.5rem; 59`,v=n.I4.div` 60 text-align: center; 61 display: flex; 62 flex-direction: column; 63 align-items: center; 64 gap: var(--screen-space); 65`,m=n.I4.div` 66 display: flex; 67 flex-direction: column; 68 gap: 4px; 69`,f=n.I4.h3` 70 && { 71 font-size: 20px; 72 line-height: 32px; 73 font-weight: 500; 74 color: var(--privy-color-foreground); 75 margin: 0; 76 } 77`,y=n.I4.p` 78 && { 79 margin: 0; 80 font-size: 16px; 81 font-weight: 300; 82 line-height: 24px; 83 color: var(--privy-color-foreground); 84 } 85`,b=n.I4.div` 86 background: ${({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"warning":return"var(--privy-color-warn, #FEF3C7)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";case"loading":case"logo":return"transparent";default:return"var(--privy-color-background-2)"}}}; 87 88 border-radius: 50%; 89 width: 64px; 90 height: 64px; 91 display: flex; 92 align-items: center; 93 justify-content: center; 94`,x=n.I4.div` 95 display: flex; 96 align-items: center; 97 justify-content: center; 98 99 img, 100 svg { 101 max-height: 90px; 102 max-width: 180px; 103 } 104`,w=n.I4.div` 105 display: flex; 106 flex-direction: column; 107 justify-content: center; 108 align-items: center; 109 width: 100%; 110 height: 82px; 111 112 > div { 113 position: relative; 114 } 115 116 > div > :first-child { 117 position: relative; 118 } 119 120 > div > :last-child { 121 position: absolute; 122 left: 50%; 123 top: 50%; 124 transform: translate(-50%, -50%); 125 } 126`,E=({children:e,...r})=>(0,i.jsx)(c,{children:(0,i.jsx)(d,{...r,children:e})}),k=n.I4.div` 127 position: absolute; 128 top: 0; 129 left: calc(-1 * var(--screen-space-lg)); 130 width: calc(100% + calc(var(--screen-space-lg) * 2)); 131 height: 4px; 132 background: var(--privy-color-background-2); 133 border-top-left-radius: inherit; 134 border-top-right-radius: inherit; 135 overflow: hidden; 136`,S=(0,n.I4)(l.B)` 137 padding: 0; 138 && a { 139 padding: 0; 140 color: var(--privy-color-foreground-3); 141 } 142`,j=n.I4.div` 143 height: 100%; 144 width: ${({pct:e})=>e}%; 145 background: var(--privy-color-foreground-3); 146 border-radius: 2px; 147 transition: width 300ms ease-in-out; 148`,A=({step:e})=>e?(0,i.jsx)(k,{children:(0,i.jsx)(j,{pct:Math.min(100,e.current/e.total*100)})}):null;E.Header=({title:e,subtitle:r,icon:t,iconVariant:o,iconLoadingStatus:n,showBack:a,onBack:l,showInfo:s,onInfo:c,showClose:d,onClose:g,step:h,headerTitle:b,...x})=>(0,i.jsxs)(p,{...x,children:[(0,i.jsx)(u,{backFn:a?l:void 0,infoFn:s?c:void 0,onClose:d?g:void 0,title:b,closeable:d}),(t||o||e||r)&&(0,i.jsxs)(v,{children:[t||o?(0,i.jsx)(E.Icon,{icon:t,variant:o,loadingStatus:n}):null,!(!e&&!r)&&(0,i.jsxs)(m,{children:[e&&(0,i.jsx)(f,{children:e}),r&&(0,i.jsx)(y,{children:r})]})]}),h&&(0,i.jsx)(A,{step:h})]}),(E.Body=o.forwardRef(({children:e,...r},t)=>(0,i.jsx)(g,{ref:t,...r,children:e}))).displayName="Screen.Body",E.Footer=({children:e,...r})=>(0,i.jsx)(h,{id:"privy-content-footer-container",...r,children:e}),E.Actions=({children:e,...r})=>(0,i.jsx)(I,{...r,children:e}),E.HelpText=({children:e,...r})=>(0,i.jsx)(T,{...r,children:e}),E.FooterText=({children:e,...r})=>(0,i.jsx)(C,{...r,children:e}),E.Watermark=()=>(0,i.jsx)(S,{}),E.Icon=({icon:e,variant:r="subtle",loadingStatus:t})=>"logo"===r&&e?(0,i.jsx)(x,"string"==typeof e?{children:(0,i.jsx)("img",{src:e,alt:""})}:o.isValidElement(e)?{children:e}:{children:o.createElement(e)}):"loading"===r?e?(0,i.jsx)(w,{children:(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,i.jsx)(a.a4,{success:t?.success,fail:t?.fail}),"string"==typeof e?(0,i.jsx)("span",{style:{background:`url('${e}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):o.isValidElement(e)?o.cloneElement(e,{style:{width:"38px",height:"38px"}}):o.createElement(e,{style:{width:"38px",height:"38px"}})]})}):(0,i.jsx)(b,{$variant:r,children:(0,i.jsx)(s.N,{size:"64px"})}):(0,i.jsx)(b,{$variant:r,children:e&&("string"==typeof e?(0,i.jsx)("img",{src:e,alt:"",style:{width:"32px",height:"32px",borderRadius:"6px"}}):o.isValidElement(e)?e:o.createElement(e,{width:32,height:32,stroke:(()=>{switch(r){case"success":return"var(--privy-color-icon-success)";case"warning":return"var(--privy-color-icon-warning)";case"error":return"var(--privy-color-icon-error)";default:return"var(--privy-color-icon-muted)"}})(),strokeWidth:2}))});let I=n.I4.div` 149 width: 100%; 150 display: flex; 151 flex-direction: column; 152 gap: calc(var(--screen-space) / 2); 153`,T=n.I4.div` 154 && { 155 margin: 0; 156 width: 100%; 157 text-align: center; 158 color: var(--privy-color-foreground-2); 159 font-size: 13px; 160 line-height: 20px; 161 162 & a { 163 text-decoration: underline; 164 } 165 } 166`,C=n.I4.div` 167 && { 168 margin-top: -1rem; 169 width: 100%; 170 text-align: center; 171 color: var(--privy-color-foreground-2); 172 font-size: 0.6875rem; // 11px 173 line-height: 1rem; // 16px 174 } 175`},54172:(e,r,t)=>{t.d(r,{s:()=>o});var i=t(35883);let o=(e,r)=>(0,i.s)(e,r.ethereum.createOnLogin)||(0,i.k)(e,r.solana.createOnLogin)},56329:(e,r,t)=>{t.d(r,{A:()=>
175o});var i=t(12115);let o=i.forwardRef(function(e,r){let{title:t,titleId:o,...n}=e;return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":o},n),t?i.createElement("title",{id:o},t):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))})},95204:(e,r,t)=>{t.d(r,{N:()=>n});var i=t(95155),o=t(47561);let n=({size:e,centerIcon:r})=>(0,i.jsx)(a,{$size:e,children:(0,i.jsxs)(l,{children:[(0,i.jsx)(c,{}),(0,i.jsx)(d,{}),r?(0,i.jsx)(s,{children:r}):null]})}),a=o.I4.div` 176 --spinner-size: ${e=>e.$size?e.$size:"96px"}; 177 178 display: inline-flex; 179 justify-content: center; 180 align-items: center; 181 182 @media all and (display-mode: standalone) { 183 margin-bottom: 30px; 184 } 185`,l=o.I4.div` 186 position: relative; 187 height: var(--spinner-size); 188 width: var(--spinner-size); 189 190 opacity: 1; 191 animation: fadein 200ms ease; 192`,s=o.I4.div` 193 position: absolute; 194 top: 0; 195 right: 0; 196 bottom: 0; 197 left: 0; 198 display: flex; 199 align-items: center; 200 justify-content: center; 201 svg, 202 img { 203 width: calc(var(--spinner-size) * 0.4); 204 height: calc(var(--spinner-size) * 0.4); 205 border-radius: var(--privy-border-radius-full); 206 } 207`,c=o.I4.div` 208 position: absolute; 209 top: 0; 210 right: 0; 211 bottom: 0; 212 left: 0; 213 width: var(--spinner-size); 214 height: var(--spinner-size); 215 216 && { 217 border: 4px solid var(--privy-color-border-default); 218 border-radius: 50%; 219 } 220`,d=o.I4.div` 221 position: absolute; 222 top: 0; 223 right: 0; 224 bottom: 0; 225 left: 0; 226 width: var(--spinner-size); 227 height: var(--spinner-size); 228 animation: spin 1200ms linear infinite; 229 230 && { 231 border: 4px solid; 232 border-color: var(--privy-color-icon-subtle) transparent transparent transparent; 233 border-radius: 50%; 234 } 235 236 @keyframes spin { 237 from { 238 transform: rotate(0deg); 239 } 240 to { 241 transform: rotate(360deg); 242 } 243 } 244`}}]);
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.