1import{j as i}from"./index-C-44qb6b.js";import{da as u,db as m,dG as f,dr as h,dj as t,fm as p,di as g,e9 as y,d7 as w}from"./PrivyWalletBridge-DDAsZ1xc.js";import{m as E}from"./reservoir-x-nGuZkT-DAavOEOM.js";import{n as C}from"./safe-url-D7SRPu33-A8zMgOTd.js";import{n as x}from"./ScreenLayout-CN3EM1pv-QAUjgPIf.js";import{T as a}from"./triangle-alert-DSsGHqK2.js";import{c as S}from"./createLucideIcon-BcEcB7lN.js";import{L as A}from"./lock-BzwlR6z_.js";import"./solana-DLf93gq9.js";import"./ModalFooter-CZAG7cZB-HH6UHqHL.js";import"./Screen-B-Xa5qdH-DSppTye5.js";import"./index-CWARkn2w-CsIvc8bS.js";/** 2 * @license lucide-react v0.554.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const _=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],L=S("phone",_),I=({error:n,allowlistConfig:r,onRetry:o,onCaptchaReset:s,onBack:T})=>{let c=((e,l)=>{if(e instanceof E)return{title:"Transaction failed",detail:i.jsxs(i.Fragment,{children:[i.jsx("span",{children:e.message}),i.jsxs("span",{children:[" ","Check the"," ",i.jsx(v,{href:e.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:a};if(e instanceof h)switch(e.privyErrorCode){case t.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:a};case t.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:a};case t.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:e.message,ctaText:"Try again",icon:a};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:a}}else{if(e instanceof p&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:L};if(!(e instanceof g))return e instanceof y&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:a}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:a};switch(e.privyErrorCode){case t.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:a};case t.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:a};case t.ALLOWLIST_REJECTED:return{title:l.errorTitle||"You don't have access to this app",detail:l.errorDetail||"Have you been invited?",ctaText:l.errorCtaText||"Try another account",icon:A};case t.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case t.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case t.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:a};case t.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:a};case t.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:a};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:a}}}})(n,r);return i.jsx(x,{title:c.title,subtitle:c.detail,icon:c.icon,onBack:T,iconVariant:"error",primaryCta:{label:c.ctaText,onClick:()=>{if(n instanceof g&&(n.privyErrorCode===t.INVALID_CAPTCHA&&(s==null||s()),n.privyErrorCode===t.ALLOWLIST_REJECTED)){let e=C(r.errorCtaLink);if(e)return void window.open(e,"_blank","noopener,noreferrer")}o==null||o()},variant:"error"},watermark:!0})},V={component:()=>{var l,d;let{navigate:n,data:r,lastScreen:o,currentScreen:s}=u(),T=m(),{reset:c}=f(),e=((l=r==null?void 0:r.errorModalData)==null?void 0:l.previousScreen)||(o===s?void 0:o);
6return i.jsx(I,{error:((d=r==null?void 0:r.errorModalData)==null?void 0:d.error)||Error(),allowlistConfig:T.allowlistConfig,onRetry:()=>{n(e||"LandingScreen",!1)},onCaptchaReset:c})}};let v=w.a` 7 color: var(--privy-color-accent) !important; 8 font-weight: 600; 9`;export{V as ErrorScreen,I as ErrorScreenView,V 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.