PageSourceSearch

https://wayfinder.ai/assets/FarcasterConnectStatusScreen-B992ZAEj-DCifBZrg.js

js wayfinder.ai collected 2026-09-25 20:16:27 UTC 7,651 bytes, 75 lines download raw bytes

1import{dr as K,cW as Z,cX as G,cZ as ee,c$ as l,d1 as u,dA as re,dm as $,cY as t,dp as F,dj as te,di as s}from"./index-TETqsn_E.js";import{n as ae}from"./OpenLink-DZHy38vr-C_Vie6GA.js";import{C as ie}from"./QrCode-BV7KfzAf-CfjsauZl.js";import{$ as oe}from"./ModalHeader-CAqKnddp-BZ3qGNJd.js";import{r as se}from"./LabelXs-oqZNqbm_-Bf_iGCqk.js";import{a as ne}from"./shouldProceedtoEmbeddedWalletCreationFlow-BMHEqcS9-Cp3J8Gp9.js";import{n as le}from"./ScreenLayout-Yoa2TSpi-byc_YvQv.js";import{l as O}from"./farcaster-DPlSjvF5-2X2FJMfD.js";import{C as ce}from"./check-DW1juctP.js";import{C as de}from"./copy-BDm245L4.js";import"./dijkstra-COg3n3zL.js";import"./Screen-CLdp3cO6-Cqh3ZNn0.js";import"./index-Dq_xe9dz-BxvdT4MJ.js";import"./createLucideIcon-BV3EjXwQ.js";let ue=s.div`
2  width: 100%;
3`,pe=s.div`
4  display: flex;
5  align-items: center;
6  justify-content: space-between;
7  gap: 0.75rem;
8  padding: 0.75rem;
9  height: 56px;
10  background: ${r=>r.$disabled?"var(--privy-color-background-2)":"var(--privy-color-background)"};
11  border: 1px solid var(--privy-color-foreground-4);
12  border-radius: var(--privy-border-radius-md);
13
14  &:hover {
15    border-color: ${r=>r.$disabled?"var(--privy-color-foreground-4)":"var(--privy-color-foreground-3)"};
16  }
17`,me=s.div`
18  flex: 1;
19  min-width: 0;
20  display: flex;
21  align-items: center;
22`,Q=s.span`
23  display: block;
24  font-size: 16px;
25  line-height: 24px;
26  color: ${r=>r.$disabled?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"};
27  overflow: hidden;
28  text-overflow: ellipsis;
29  /* Use single-line truncation without nowrap to respect container width */
30  display: -webkit-box;
31  -webkit-line-clamp: 1;
32  -webkit-box-orient: vertical;
33  word-break: break-all;
34
35  @media (min-width: 441px) {
36    font-size: 14px;
37    line-height: 20px;
38  }
39`,he=s(Q)`
40  color: var(--privy-color-foreground-3);
41  font-style: italic;
42`,fe=s(se)`
43  margin-bottom: 0.5rem;
44`,ge=s(oe)`
45  && {
46    gap: 0.375rem;
47    font-size: 14px;
48    flex-shrink: 0;
49  }
50`;const ve=({value:r,title:p,placeholder:c,className:a,showCopyButton:d=!0,truncate:o,maxLength:m=40,disabled:h=!1})=>{let[n,x]=l.useState(!1),E=o&&r?((i,S,f)=>{if((i=i.startsWith("https://")?i.slice(8):i).length<=f)return i;if(S==="middle"){let y=Math.ceil(f/2)-2,C=Math.floor(f/2)-1;return`${i.slice(0,y)}...${i.slice(-C)}`}return`${i.slice(0,f-3)}...`})(r,o,m):r;return l.useEffect((()=>{if(n){let i=setTimeout((()=>x(!1)),3e3);return()=>clearTimeout(i)}}),[n]),t.jsxs(ue,{className:a,children:[p&&t.jsx(fe,{children:p}),t.jsxs(pe,{$disabled:h,children:[t.jsx(me,{children:r?t.jsx(Q,{$disabled:h,title:r,children:E}):t.jsx(he,{$disabled:h,children:c||"No value"})}),d&&r&&t.jsx(ge,{onClick:function(i){i.stopPropagation(),navigator.clipboard.writeText(r).then((()=>x(!0))).catch(console.error)},size:"sm",children:t.jsxs(t.Fragment,n?{children:["Copied",t.jsx(ce,{size:14})]}:{children:["Copy",t.jsx(de,{size:14})]})})]})]})},xe=({connectUri:r,loading:p,success:c,errorMessage:a,onBack:d,onClose:o,onOpenFarcaster:m})=>t.jsx(le,F.isMobile||p?F.isIOS?{title:a?a.message:"Sign in with Farcaster",subtitle:a?a.detail:"To sign in with Farcaster, please open the Farcaster app.",icon:O,iconVariant:"loading",iconLoadingStatus:{success:c,fail:!!a},primaryCta:r&&m?{label:"Open Farcaster app",onClick:m}:void 0,onBack:d,onClose:o,watermark:!0}:{title:a?a.message:"Signing in with Farcaster",subtitle:a?a.detail:"This should only take a moment",icon:O,iconVariant:"loading",iconLoadingStatus:{success:c,fail:!!a},onBack:d,onClose:o,watermark:!0,children:r&&F.isMobile&&t.jsx(ye,{children:t.jsx(ae,{text:"Take me to Farcaster",url:r,color:"#8a63d2"})})}:{title:"Sign in with Farcaster",subtitle:"Scan with your phone's camera to continue.",onBack:d,onClose:o,watermark:!0,children:t.jsxs(be,{children:[t.jsx(we,{children:r?t.jsx(ie,{url:r,size:275,squareLogoElement:O}):t.jsx(Ce,{children:t.jsx(te,{})})}),t.jsxs(Ee,{children:[t.jsx(Se,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),r&&t.jsx(ve,{value:r,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),De={component:()=>{let{authenticated:r,logout:p,ready:c,user:a}=K(),{lastScreen:d,navigate:o,navigateBack:m,setModalData:h}=Z(),n=G(),{getAuthFlow:x,loginWithFarcaster:E,closePrivyModal:i,createAnalyticsEvent:S}=ee(),[f,y]=l.useState(void 0),[C,X]=l.useState(!1),[b,Y]=l.useState(!1),T=l.useRef([]),w=x(),k=w==null?void 0:w.meta.connectUri;return l.useEffect((()=>{let g=Date.now(),j=setInterval((async()=>{var _,R,I,L,N,U,M,D,W,z,B,q,V,P,H;let A=await w.pollForReady.execute(),J=Date.now()-g;if(A){clearInterval(j),X(!0);try{await E(),Y(!0)}catch(e){let v={retryable:!1,message:"Authentication failed"};
50if((e==null?void 0:e.privyErrorCode)===u.ALLOWLIST_REJECTED)return void o("AllowlistRejectionScreen");if((e==null?void 0:e.privyErrorCode)===u.USER_LIMIT_REACHED)return console.error(new re(e).toString()),void o("UserLimitReachedScreen");if((e==null?void 0:e.privyErrorCode)===u.USER_DOES_NOT_EXIST)return void o("AccountNotFoundScreen");if((e==null?void 0:e.privyErrorCode)===u.LINKED_TO_ANOTHER_USER)v.detail=e.message??"This account has already been linked to another user.";else{if((e==null?void 0:e.privyErrorCode)===u.ACCOUNT_TRANSFER_REQUIRED&&((R=(_=e.data)==null?void 0:_.data)!=null&&R.nonce))return h({accountTransfer:{nonce:(L=(I=e.data)==null?void 0:I.data)==null?void 0:L.nonce,account:(U=(N=e.data)==null?void 0:N.data)==null?void 0:U.subject,displayName:(W=(D=(M=e.data)==null?void 0:M.data)==null?void 0:D.account)==null?void 0:W.displayName,linkMethod:"farcaster",embeddedWalletAddress:(q=(B=(z=e.data)==null?void 0:z.data)==null?void 0:B.otherUser)==null?void 0:q.embeddedWalletAddress,farcasterEmbeddedAddress:(H=(P=(V=e.data)==null?void 0:V.data)==null?void 0:P.otherUser)==null?void 0:H.farcasterEmbeddedAddress}}),void o("LinkConflictScreen");(e==null?void 0:e.privyErrorCode)===u.INVALID_CREDENTIALS?(v.retryable=!0,v.detail="Something went wrong. Try again."):(e==null?void 0:e.privyErrorCode)===u.TOO_MANY_REQUESTS&&(v.detail="Too many requests. Please wait before trying again.")}y(v)}}else J>12e4&&(clearInterval(j),y({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(j),T.current.forEach((A=>clearTimeout(A)))}}),[]),l.useEffect((()=>{if(c&&r&&b&&a){if(n!=null&&n.legal.requireUsersAcceptTerms&&!a.hasAcceptedTerms){let g=setTimeout((()=>{o("AffirmativeConsentScreen")}),$);return()=>clearTimeout(g)}b&&(ne(a,n.embeddedWallets)?T.current.push(setTimeout((()=>{h({createWallet:{onSuccess:()=>{},onFailure:g=>{console.error(g),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:g,screen:"FarcasterConnectStatusScreen"}}),p()},callAuthOnSuccessOnClose:!0}}),o("EmbeddedWalletOnAccountCreateScreen")}),$)):T.current.push(setTimeout((()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0})),$)))}}),[b,c,r,a]),t.jsx(xe,{connectUri:k,loading:C,success:b,errorMessage:f,onBack:d?m:void 0,onClose:i,onOpenFarcaster:()=>{k&&(window.location.href=k)}})}};let ye=s.div`
51  margin-top: 24px;
52`,be=s.div`
53  display: flex;
54  flex-direction: column;
55  align-items: center;
56  gap: 24px;
57`,we=s.div`
58  display: flex;
59  align-items: center;
60  justify-content: center;
61  min-height: 275px;
62`,Ee=s.div`
63  display: flex;
64  flex-direction: column;
65  align-items: center;
66  gap: 16px;
67`,Se=s.div`
68  font-size: 0.875rem;
69  text-align: center;
70  color: var(--privy-color-foreground-2);
71`,Ce=s.div`
72  position: relative;
73  width: 82px;
74  height: 82px;
75`;export{De as FarcasterConnectStatusScreen,xe as FarcasterConnectStatusView,De 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.