@privy-io/react-auth 1.5.0-beta.5 → 1.5.0-beta.6

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/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Z3=Object.create;var D1=Object.defineProperty;var w3=Object.getOwnPropertyDescriptor;var L3=Object.getOwnPropertyNames;var v3=Object.getPrototypeOf,E3=Object.prototype.hasOwnProperty;var x3=(a,e)=>{for(var l in e)D1(a,l,{get:e[l],enumerable:!0})},Y2=(a,e,l,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of L3(e))!E3.call(a,o)&&o!==l&&D1(a,o,{get:()=>e[o],enumerable:!(i=w3(e,o))||i.enumerable});return a};var f=(a,e,l)=>(l=a!=null?Z3(v3(a)):{},Y2(e||!a||!a.__esModule?D1(l,"default",{value:a,enumerable:!0}):l,a)),A3=a=>Y2(D1({},"__esModule",{value:!0}),a);var S5={};x3(S5,{PrivyProvider:()=>g3,usePrivy:()=>x});module.exports=A3(S5);var t1=require("react");var F1=f(require("axios"));var J2=f(require("axios")),s1=class extends Error{constructor(l,i){super(l);i instanceof Error&&(this.cause=i)}toString(){return`${this.type}: ${this.message}`}},U1=class extends s1{constructor(l,i,o,n){super(o,n);this.type=l;this.status=i}},b=class extends s1{constructor(l,i){super(l,i);this.type="client_error"}};var G=class extends s1{constructor(l,i){super(l,i);this.type="connector_error"}},j=a=>{if(!J2.default.isAxiosError(a))return a1(a);if(!a.response)return new U1("api_error",null,a.message,a);let{type:e,message:l,error:i}=a.response.data;return new U1(e||"ApiError",a.response.status,l||i,a)},a1=a=>a instanceof s1?a:a instanceof Error?new b(a.message,a):new b(`Internal error: ${a}`);var V1=class{constructor(e,l,i){this.appId=e,this.session=l,this.defaults=i}async get(e,l){try{return await F1.default.get(e,this.buildConfig({headers:{"Cache-Control":"no-cache"},...l}))}catch(i){throw j(i)}}async post(e,l,i){try{return await F1.default.post(e,l,this.buildConfig(i))}catch(o){throw j(o)}}async delete(e,l){try{return await F1.default.delete(e,this.buildConfig(l))}catch(i){throw j(i)}}buildConfig(e){return e=e||{},e.headers=e.headers||{},e.headers["privy-app-id"]=this.appId,this.session.token!==null&&(e.headers.authorization=`Bearer ${this.session.token}`),{...this.defaults,...e}}};var X2="https://api.privy.io/v0",Q2=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",u2="70f97dc579834350a5baec117b3c5ae3",t4=1e4,d1=1200,e4=3e4;var a4=f(require("jwt-decode")),M1=class{static parse(e){try{return new M1(e)}catch{return null}}constructor(e){this.value=e,this._decoded=(0,a4.default)(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}isExpired(e=0){let l=Date.now(),i=(this.expiration-e)*1e3;return l>=i}};var g1=class{constructor(e){this.promise=null;this.fn=e}execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}};var m2=class{constructor(){this._cache={}}get(e){return this._cache[e]}put(e,l){l!==void 0?this._cache[e]=l:this.del(e)}del(e){delete this._cache[e]}},b2=class{get(e){let l=localStorage.getItem(e);return l===null?void 0:JSON.parse(l)}put(e,l){l!==void 0?localStorage.setItem(e,JSON.stringify(l)):this.del(e)}del(e){localStorage.removeItem(e)}};function _3(){return typeof window<"u"&&window.localStorage?new b2:new m2}var K=_3();var T3=a=>{var e;return(e=a.map(l=>{if(l.type==="wallet")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3),chainType:l.chain_type}}).filter(l=>l))==null?void 0:e[0]},P3=a=>{var e;return(e=a.map(l=>{if(l.type==="email")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},S3=a=>{var e;return(e=a.map(l=>{if(l.type==="google_oauth")return{subject:l.subject,email:l.subject,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},I3=a=>{var e;return(e=a.map(l=>{if(l.type==="twitter_oauth")return{subject:l.subject,username:l.username,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},R3=a=>{var e;return(e=a.map(l=>{if(l.type==="discord_oauth")return{subject:l.subject,username:l.username,email:l.email,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]};function y1(a){if(!a)return null;let e=P3(a.linked_accounts),l=T3(a.linked_accounts),i=S3(a.linked_accounts),o=I3(a.linked_accounts),n=R3(a.linked_accounts);return{id:a.id,createdAt:new Date(a.created_at*1e3),linkedAccounts:[...l?[l]:[],...e?[e]:[],...i?[i]:[],...o?[o]:[],...n?[n]:[]],email:e&&{address:e==null?void 0:e.address},wallet:l&&{address:l.address,chainType:l.chainType,chainId:l.chainId,walletType:l.walletType},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name},discord:n&&{subject:n.subject,username:n.username,email:n.email}}}var l4=()=>"/api/v1/sessions",i4=()=>"/api/v1/sessions/logout",o4=()=>"/api/v1/siwe/init",r4=()=>"/api/v1/siwe/authenticate",n4=()=>"/api/v1/passwordless/init",C4=()=>"/api/v1/passwordless/authenticate",s4=()=>"/api/v1/oauth/init",d4=()=>"/api/v1/oauth/authenticate",c4=()=>"/api/v1/siwe/unlink",p4=()=>"/api/v1/passwordless/unlink";var W3=30,k2="privy:token",M2="privy:refresh_token",H1=class{constructor(){this.authenticateOnce=new g1(async e=>this._authenticate(e)),this.refreshOnce=new g1(this._refresh.bind(this)),this.destroyOnce=new g1(this._destroy.bind(this))}get token(){let e=K.get(k2);return typeof e=="string"?e:null}get refreshToken(){let e=K.get(M2);return typeof e=="string"?e:null}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasActiveToken(){let e=M1.parse(this.token);return e!==null&&!e.isExpired(W3)}authenticate(e){return this.authenticateOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}async _authenticate(e){try{let{token:l,refresh_token:i,user:o}=await e.authenticate();return l&&this.storeToken(l),i&&this.storeRefreshToken(i),y1(o)}catch(l){throw console.warn("Error authenticating session"),a1(l)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");let e=this.token,l=this.refreshToken;if(!e||!l)return null;try{let i=await this.api.post(l4(),{refresh_token:l});return this.storeToken(i.data.token),this.storeRefreshToken(i.data.refresh_token),y1(i.data.user)}catch(i){throw a1(i)}}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(i4(),{})),this.destroyLocalState()}catch(l){throw console.warn("Error destroying session"),a1(l)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null)}storeToken(e){typeof e=="string"?K.put(k2,e):K.del(k2)}storeRefreshToken(e){typeof e=="string"?K.put(M2,e):K.del(M2)}};var u4=require("@ethersproject/address"),L2=f(require("@walletconnect/web3-provider"));var Z1=class{constructor(e){this.removeListener=(e,l)=>{if(this._provider)return this._provider.removeListener(e,l)};this.setProvider=e=>{this._provider=e,this._subscriptions.forEach(l=>{var i;(i=this._provider)==null||i.on(l.eventName,l.listener)})};this._provider=e,this._subscriptions=[]}on(e,l){if(this._provider)return this._provider.on(e,l);this._subscriptions.push({eventName:e,listener:l})}request(e){if(!this._provider)throw new G(`A wallet request of type ${e.method} was made to a disconnected wallet: `);return this._provider.request(e)}},w1=class extends Z1{constructor(l){super(l)}},B1=class extends Z1{constructor(e){super(e)}sendAsync(e,l){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var m4=require("ethers");var h4=["metamask","coinbase_wallet","wallet_connect"];var f4=require("ethers");var G1=class extends G{constructor(){super("Wallet timeout");this.type="wallet_error"}},y2=a=>{if(a instanceof G)return a;if((a==null?void 0:a.code)&&(a==null?void 0:a.reason)){let e=new L1(a);return a.code===f4.ethers.errors.ACTION_REJECTED&&(e.details=f1.E4001_USER_REJECTED_REQUEST),e}return a!=null&&a.code?new L1(a):new G("Unknown connector error",a)},g2=class extends s1{constructor(l,i,o){super(l);this.type="provider_error";this.code=i,this.data=o}},L1=class extends g2{constructor(l){var n,d,p;let i=l;super(i.message,i.code,i.data);let o=Object.values(f1).find(c=>c.eipCode===i.code);this.details=o||f1.UNKNOWN_ERROR,i.code===-32002&&((n=i.message)!=null&&n.includes("already pending for origin")?(d=i.message)!=null&&d.includes("wallet_requestPermissions")?this.details=f1.E32002_CONNECTION_ALREADY_PENDING:this.details=f1.E32002_REQUEST_ALREADY_PENDING:(p=i.message)!=null&&p.includes("Already processing")&&i.message.includes("eth_requestAccounts")&&(this.details=f1.E32002_WALLET_LOCKED))}},N3={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0}},O3={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},D3={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},f1={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...D3,...O3},Z2={...N3,...f1};var w2="privy:wallet_type",j1=(a=new G1,e=e4)=>new Promise((l,i)=>setTimeout(()=>{i(a)},e)),v2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isMetaMask)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isMetaMask)return!0}return!1},E2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isCoinbaseWallet)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isCoinbaseWallet)return!0}return!1},z1=class{constructor(){this.walletType=null;this.getEthereumProvider=()=>this.ethProvider;this.createSiweMessage=(e,l,i,o,n,d,p)=>`${i} wants you to sign in with your Ethereum account:
1
+ "use strict";var Z3=Object.create;var D1=Object.defineProperty;var w3=Object.getOwnPropertyDescriptor;var L3=Object.getOwnPropertyNames;var v3=Object.getPrototypeOf,E3=Object.prototype.hasOwnProperty;var x3=(a,e)=>{for(var l in e)D1(a,l,{get:e[l],enumerable:!0})},Y2=(a,e,l,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of L3(e))!E3.call(a,o)&&o!==l&&D1(a,o,{get:()=>e[o],enumerable:!(i=w3(e,o))||i.enumerable});return a};var f=(a,e,l)=>(l=a!=null?Z3(v3(a)):{},Y2(e||!a||!a.__esModule?D1(l,"default",{value:a,enumerable:!0}):l,a)),A3=a=>Y2(D1({},"__esModule",{value:!0}),a);var S5={};x3(S5,{PrivyProvider:()=>g3,usePrivy:()=>x});module.exports=A3(S5);var t1=require("react");var F1=f(require("axios"));var J2=f(require("axios")),s1=class extends Error{constructor(l,i){super(l);i instanceof Error&&(this.cause=i)}toString(){return`${this.type}: ${this.message}`}},U1=class extends s1{constructor(l,i,o,n){super(o,n);this.type=l;this.status=i}},b=class extends s1{constructor(l,i){super(l,i);this.type="client_error"}};var G=class extends s1{constructor(l,i){super(l,i);this.type="connector_error"}},z=a=>{if(!J2.default.isAxiosError(a))return a1(a);if(!a.response)return new U1("api_error",null,a.message,a);let{type:e,message:l,error:i}=a.response.data;return new U1(e||"ApiError",a.response.status,l||i,a)},a1=a=>a instanceof s1?a:a instanceof Error?new b(a.message,a):new b(`Internal error: ${a}`);var V1=class{constructor(e,l,i){this.appId=e,this.session=l,this.defaults=i}async get(e,l){try{return await F1.default.get(e,this.buildConfig({headers:{"Cache-Control":"no-cache"},...l}))}catch(i){throw z(i)}}async post(e,l,i){try{return await F1.default.post(e,l,this.buildConfig(i))}catch(o){throw z(o)}}async delete(e,l){try{return await F1.default.delete(e,this.buildConfig(l))}catch(i){throw z(i)}}buildConfig(e){return e=e||{},e.headers=e.headers||{},e.headers["privy-app-id"]=this.appId,this.session.token!==null&&(e.headers.authorization=`Bearer ${this.session.token}`),{...this.defaults,...e}}};var X2="https://api.privy.io/v0",Q2=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",u2="70f97dc579834350a5baec117b3c5ae3",t4=1e4,d1=1200,e4=3e4;var a4=f(require("jwt-decode")),M1=class{static parse(e){try{return new M1(e)}catch{return null}}constructor(e){this.value=e,this._decoded=(0,a4.default)(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}isExpired(e=0){let l=Date.now(),i=(this.expiration-e)*1e3;return l>=i}};var g1=class{constructor(e){this.promise=null;this.fn=e}execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}};var m2=class{constructor(){this._cache={}}get(e){return this._cache[e]}put(e,l){l!==void 0?this._cache[e]=l:this.del(e)}del(e){delete this._cache[e]}},b2=class{get(e){let l=localStorage.getItem(e);return l===null?void 0:JSON.parse(l)}put(e,l){l!==void 0?localStorage.setItem(e,JSON.stringify(l)):this.del(e)}del(e){localStorage.removeItem(e)}};function _3(){return typeof window<"u"&&window.localStorage?new b2:new m2}var K=_3();var T3=a=>{var e;return(e=a.map(l=>{if(l.type==="wallet")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3),chainType:l.chain_type}}).filter(l=>l))==null?void 0:e[0]},P3=a=>{var e;return(e=a.map(l=>{if(l.type==="email")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},S3=a=>{var e;return(e=a.map(l=>{if(l.type==="google_oauth")return{subject:l.subject,email:l.email,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},I3=a=>{var e;return(e=a.map(l=>{if(l.type==="twitter_oauth")return{subject:l.subject,username:l.username,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},R3=a=>{var e;return(e=a.map(l=>{if(l.type==="discord_oauth")return{subject:l.subject,username:l.username,email:l.email,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]};function y1(a){if(!a)return null;let e=P3(a.linked_accounts),l=T3(a.linked_accounts),i=S3(a.linked_accounts),o=I3(a.linked_accounts),n=R3(a.linked_accounts);return{id:a.id,createdAt:new Date(a.created_at*1e3),linkedAccounts:[...l?[l]:[],...e?[e]:[],...i?[i]:[],...o?[o]:[],...n?[n]:[]],email:e&&{address:e==null?void 0:e.address},wallet:l&&{address:l.address,chainType:l.chainType,chainId:l.chainId,walletType:l.walletType},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name},discord:n&&{subject:n.subject,username:n.username,email:n.email}}}var l4=()=>"/api/v1/sessions",i4=()=>"/api/v1/sessions/logout",o4=()=>"/api/v1/siwe/init",r4=()=>"/api/v1/siwe/authenticate",n4=()=>"/api/v1/passwordless/init",C4=()=>"/api/v1/passwordless/authenticate",s4=()=>"/api/v1/oauth/init",d4=()=>"/api/v1/oauth/authenticate",c4=()=>"/api/v1/siwe/unlink",p4=()=>"/api/v1/passwordless/unlink";var W3=30,k2="privy:token",M2="privy:refresh_token",H1=class{constructor(){this.authenticateOnce=new g1(async e=>this._authenticate(e)),this.refreshOnce=new g1(this._refresh.bind(this)),this.destroyOnce=new g1(this._destroy.bind(this))}get token(){let e=K.get(k2);return typeof e=="string"?e:null}get refreshToken(){let e=K.get(M2);return typeof e=="string"?e:null}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasActiveToken(){let e=M1.parse(this.token);return e!==null&&!e.isExpired(W3)}authenticate(e){return this.authenticateOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}async _authenticate(e){try{let{token:l,refresh_token:i,user:o}=await e.authenticate();return l&&this.storeToken(l),i&&this.storeRefreshToken(i),y1(o)}catch(l){throw console.warn("Error authenticating session"),a1(l)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");let e=this.token,l=this.refreshToken;if(!e||!l)return null;try{let i=await this.api.post(l4(),{refresh_token:l});return this.storeToken(i.data.token),this.storeRefreshToken(i.data.refresh_token),y1(i.data.user)}catch(i){throw a1(i)}}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(i4(),{})),this.destroyLocalState()}catch(l){throw console.warn("Error destroying session"),a1(l)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null)}storeToken(e){typeof e=="string"?K.put(k2,e):K.del(k2)}storeRefreshToken(e){typeof e=="string"?K.put(M2,e):K.del(M2)}};var u4=require("@ethersproject/address"),L2=f(require("@walletconnect/web3-provider"));var Z1=class{constructor(e){this.removeListener=(e,l)=>{if(this._provider)return this._provider.removeListener(e,l)};this.setProvider=e=>{this._provider=e,this._subscriptions.forEach(l=>{var i;(i=this._provider)==null||i.on(l.eventName,l.listener)})};this._provider=e,this._subscriptions=[]}on(e,l){if(this._provider)return this._provider.on(e,l);this._subscriptions.push({eventName:e,listener:l})}request(e){if(!this._provider)throw new G(`A wallet request of type ${e.method} was made to a disconnected wallet: `);return this._provider.request(e)}},w1=class extends Z1{constructor(l){super(l)}},B1=class extends Z1{constructor(e){super(e)}sendAsync(e,l){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var m4=require("ethers");var h4=["metamask","coinbase_wallet","wallet_connect"];var f4=require("ethers");var G1=class extends G{constructor(){super("Wallet timeout");this.type="wallet_error"}},y2=a=>{if(a instanceof G)return a;if((a==null?void 0:a.code)&&(a==null?void 0:a.reason)){let e=new L1(a);return a.code===f4.ethers.errors.ACTION_REJECTED&&(e.details=f1.E4001_USER_REJECTED_REQUEST),e}return a!=null&&a.code?new L1(a):new G("Unknown connector error",a)},g2=class extends s1{constructor(l,i,o){super(l);this.type="provider_error";this.code=i,this.data=o}},L1=class extends g2{constructor(l){var n,d,p;let i=l;super(i.message,i.code,i.data);let o=Object.values(f1).find(c=>c.eipCode===i.code);this.details=o||f1.UNKNOWN_ERROR,i.code===-32002&&((n=i.message)!=null&&n.includes("already pending for origin")?(d=i.message)!=null&&d.includes("wallet_requestPermissions")?this.details=f1.E32002_CONNECTION_ALREADY_PENDING:this.details=f1.E32002_REQUEST_ALREADY_PENDING:(p=i.message)!=null&&p.includes("Already processing")&&i.message.includes("eth_requestAccounts")&&(this.details=f1.E32002_WALLET_LOCKED))}},N3={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0}},O3={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},D3={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},f1={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...D3,...O3},Z2={...N3,...f1};var w2="privy:wallet_type",z1=(a=new G1,e=e4)=>new Promise((l,i)=>setTimeout(()=>{i(a)},e)),v2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isMetaMask)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isMetaMask)return!0}return!1},E2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isCoinbaseWallet)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isCoinbaseWallet)return!0}return!1},j1=class{constructor(){this.walletType=null;this.getEthereumProvider=()=>this.ethProvider;this.createSiweMessage=(e,l,i,o,n,d,p)=>`${i} wants you to sign in with your Ethereum account:
2
2
  ${l}
3
3
 
4
4
  ${p}
@@ -9,7 +9,7 @@ Chain ID: ${e}
9
9
  Nonce: ${d}
10
10
  Issued At: ${n}
11
11
  Resources:
12
- - https://privy.io`;this.ethProvider=new Z1}initialize(){let e=K.get(w2);h4.includes(e)&&(this.walletType=e,this.connect({showPrompt:!1}))}destroy(){this.walletType=null,K.del(w2)}async connect(e){var l,i;switch(this.walletType){case"metamask":this.ethProvider.setProvider(window.ethereum),(l=window.ethereum.providers)==null||l.forEach(async n=>{n.isMetaMask&&this.ethProvider.setProvider(n)});break;case"coinbase_wallet":this.ethProvider.setProvider(window.ethereum),(i=window.ethereum.providers)==null||i.forEach(async n=>{n.isCoinbaseWallet&&this.ethProvider.setProvider(n)});break;case"wallet_connect":let o=new L2.default({infuraId:u2});this.ethProvider.setProvider(o);break;default:throw new G(`Unsupported wallet: ${this.walletType}`)}return!await this.isConnected()&&e.showPrompt&&await this.promptConnection(this.walletType),this.address()}async isConnected(){switch(this.walletType){case"metamask":return await this.address()!==null;case"coinbase_wallet":return await this.address()!==null;case"wallet_connect":return this.ethProvider.connected;default:throw new G(`Unsupported wallet: ${this.walletType}`)}}async promptConnection(e){try{switch(e){case"metamask":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),j1()]);break;case"coinbase_wallet":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),j1()]);break;case"wallet_connect":let l=new L2.default({infuraId:u2});this.ethProvider.setProvider(l),await Promise.race([l.enable(),j1()]),K.put(w2,e);break;default:throw new G(`Unsupported wallet: ${this.walletType}`)}}catch(l){throw y2(l)}}async sign(e){let i=new m4.providers.Web3Provider(new w1(this.getEthereumProvider())).getSigner();return Promise.race([i.signMessage(e),j1()]).catch(o=>{throw y2(o)})}prepareMessage(e,l,i){let o=window.location.host,n=window.location.origin,d=`${o} requests that you authenticate with Privy.`,p=new Date().toISOString();return this.createSiweMessage(e,l,o,n,p,i,d)}async chainId(){let e=await this.getEthereumProvider().request({method:"eth_chainId"}),l=Number(e);return String(l)}async address(){let e=await this.getEthereumProvider().request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0?(0,u4.getAddress)(e[0]):null}};var x2,$1=class{constructor(e){let l=e.apiURL||X2,i=e.timeout||t4;this.appId=e.appId,this.connector=new z1,this.connector.initialize(),x2||(x2=new H1),this.session=x2,this.api=new V1(e.appId,this.session,{baseURL:l,timeout:i}),this.session.api=this.api}async authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return await this.session.authenticate(this.authFlow)}async logout(){await this.session.destroy(),this.connector.destroy(),this.authFlow=void 0}startAuthFlow(e){e.api=this.api,this.authFlow=e}async unlinkEmail(e){try{let l=await this.api.post(p4(),{address:e});return y1(l.data)}catch(l){throw a1(l)}}async unlinkWallet(e){try{let l=await this.api.post(c4(),{address:e});return y1(l.data)}catch(l){throw a1(l)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(){return this.session.hasActiveToken()?this.session.token:this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getAppSettings(){try{let e=await this.api.get(`/api/v1/apps/${this.appId}`);return{id:e.data.id,name:e.data.name,verificationKey:e.data.verification_key,logoUrl:e.data.logo_url||void 0,theme:e.data.theme,accentColor:e.data.accent_color||void 0,googleOAuth:e.data.google_oauth,twitterOAuth:e.data.twitter_oauth,discordOAuth:e.data.discord_oauth,createdAt:new Date(e.data.created_at*1e3),updatedAt:new Date(e.data.updated_at*1e3)}}catch(e){throw a1(e)}}};var M3=require("@ethersproject/providers");var q1=require("react");var M=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var A2=(0,q1.createContext)({ready:!1,authenticated:!1,user:null,login:M,linkEmail:M,linkWallet:M,logout:M,getAccessToken:M,getEthereumProvider:M,getEthersProvider:M,getWeb3jsProvider:M,unlinkEmail:M,unlinkWallet:M}),x=()=>(0,q1.useContext)(A2);var A1=class{constructor(e){this.connector=e,this.meta={wallet:this.connector.walletType}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.connector.walletType)throw new b("Wallet must be specified");try{let e=await this.connector.connect({showPrompt:!0}),l=await this.connector.chainId(),i=await this.api.post(o4(),{address:e}),o=this.connector.prepareMessage(l,e,i.data.nonce),n=await this.connector.sign(o),d=await this.api.post(r4(),{message:o,signature:n});return{user:d.data.user,token:d.data.token,refresh_token:d.data.refresh_token}}catch(e){throw j(e)}}getEthereumProvider(){return this.connector.getEthereumProvider()}};var _1=class{constructor(e){this.meta={email:e}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let e=C4(),l=await this.api.post(e,{email:this.meta.email,code:this.meta.emailCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw j(e)}}async sendCodeEmail(e){if(!this.api)throw new b("Auth flow has no API instance");if(e&&(this.meta.email=e),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{let l=n4();return(await this.api.post(l,{email:this.meta.email})).data}catch(l){throw j(l)}}};var T1=class{constructor(e,l,i){this.meta={provider:e},this.meta.authorizationCode=l,this.meta.stateCode=i}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");try{let e=d4(),l=await this.api.post(e,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw j(e)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initialzing OAuth authentication.");try{let e=s4();return(await this.api.post(e,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(e){throw j(e)}}};var _8=require("wicg-inert"),m3=f(require("react-dom")),$2=f(require("styled-components"));var z=require("react");var K1=require("react");var _2=(0,K1.createContext)({showPrivyModal:!1,getAuthMeta:M,closePrivyModal:M,initLoginWithWallet:M,loginWithWallet:M,loginWithCode:M,loginWithEmail:M,resendEmailCode:M,initLoginWithOAuth:M}),y=()=>(0,K1.useContext)(_2);var k4=require("react/jsx-runtime");function b4(a){return(0,k4.jsx)("link",{rel:"prefetch",href:a.src})}var Y1=require("react/jsx-runtime"),M4=(0,z.createContext)({app:null,currentScreen:"LANDING",lastScreen:"LANDING",navigate:M,navigateBack:M}),g4=a=>{let e=a.client,{authenticated:l}=x(),{showPrivyModal:i}=y(),[o,n]=(0,z.useState)(null),[d,p]=(0,z.useState)(null),[c,k]=(0,z.useState)({accentColor:"#696ffd",theme:"System"});(0,z.useEffect)(()=>{async function g(){let A=await e.getAppSettings();k(A)}g()},[]),(0,z.useEffect)(()=>{l||n(null)},[l]),(0,z.useEffect)(()=>{i||(p("LANDING"),n("LANDING"))},[i]);let m={app:c,currentScreen:o||"LANDING",lastScreen:d||"LANDING",navigate:g=>{p(o),n(g)},navigateBack:()=>{n(d)}};return(0,Y1.jsxs)(M4.Provider,{value:m,children:[c&&c.logoUrl&&(0,Y1.jsx)(b4,{src:c.logoUrl}),a.children]})},u=()=>(0,z.useContext)(M4);var l2=require("react"),H2=f(require("styled-components"));var w4=f(require("styled-components"));var T2=require("react/jsx-runtime"),y4=({style:a,...e})=>(0,T2.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:(0,T2.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});var P2=require("react/jsx-runtime"),Z4=({style:a,...e})=>(0,P2.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:(0,P2.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})});var E=require("react/jsx-runtime"),S2=()=>(0,E.jsx)("div",{}),L4=({backFn:a})=>(0,E.jsx)("div",{children:(0,E.jsx)(Z4,{onClick:a})}),v4=()=>{let{closePrivyModal:a}=y();return(0,E.jsx)("div",{children:(0,E.jsx)("div",{children:(0,E.jsx)(y4,{onClick:a})})})},U3=()=>{let{app:a}=u();return a!=null&&a.logoUrl?(0,E.jsx)("div",{children:(0,E.jsx)("img",{src:a.logoUrl,alt:`${a==null?void 0:a.name} logo`,style:{objectFit:"contain",width:"120px",height:"30px"}})}):null};var P=({backFn:a})=>(0,E.jsxs)(x4,{children:[a?(0,E.jsx)(L4,{backFn:a}):(0,E.jsx)(S2,{}),(0,E.jsx)(U3,{},"app-name"),(0,E.jsx)(v4,{})]}),E4=({backFn:a})=>(0,E.jsxs)(x4,{children:[a?(0,E.jsx)(L4,{backFn:a}):(0,E.jsx)(S2,{}),(0,E.jsx)(S2,{}),(0,E.jsx)(v4,{})]}),x4=w4.default.div`
12
+ - https://privy.io`;this.ethProvider=new Z1}initialize(){let e=K.get(w2);h4.includes(e)&&(this.walletType=e,this.connect({showPrompt:!1}))}destroy(){this.walletType=null,K.del(w2)}async connect(e){var l,i;switch(this.walletType){case"metamask":this.ethProvider.setProvider(window.ethereum),(l=window.ethereum.providers)==null||l.forEach(async n=>{n.isMetaMask&&this.ethProvider.setProvider(n)});break;case"coinbase_wallet":this.ethProvider.setProvider(window.ethereum),(i=window.ethereum.providers)==null||i.forEach(async n=>{n.isCoinbaseWallet&&this.ethProvider.setProvider(n)});break;case"wallet_connect":let o=new L2.default({infuraId:u2});this.ethProvider.setProvider(o);break;default:throw new G(`Unsupported wallet: ${this.walletType}`)}return!await this.isConnected()&&e.showPrompt&&await this.promptConnection(this.walletType),this.address()}async isConnected(){switch(this.walletType){case"metamask":return await this.address()!==null;case"coinbase_wallet":return await this.address()!==null;case"wallet_connect":return this.ethProvider.connected;default:throw new G(`Unsupported wallet: ${this.walletType}`)}}async promptConnection(e){try{switch(e){case"metamask":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),z1()]);break;case"coinbase_wallet":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),z1()]);break;case"wallet_connect":let l=new L2.default({infuraId:u2});this.ethProvider.setProvider(l),await Promise.race([l.enable(),z1()]),K.put(w2,e);break;default:throw new G(`Unsupported wallet: ${this.walletType}`)}}catch(l){throw y2(l)}}async sign(e){let i=new m4.providers.Web3Provider(new w1(this.getEthereumProvider())).getSigner();return Promise.race([i.signMessage(e),z1()]).catch(o=>{throw y2(o)})}prepareMessage(e,l,i){let o=window.location.host,n=window.location.origin,d=`${o} requests that you authenticate with Privy.`,p=new Date().toISOString();return this.createSiweMessage(e,l,o,n,p,i,d)}async chainId(){let e=await this.getEthereumProvider().request({method:"eth_chainId"}),l=Number(e);return String(l)}async address(){let e=await this.getEthereumProvider().request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0?(0,u4.getAddress)(e[0]):null}};var x2,$1=class{constructor(e){let l=e.apiURL||X2,i=e.timeout||t4;this.appId=e.appId,this.connector=new j1,this.connector.initialize(),x2||(x2=new H1),this.session=x2,this.api=new V1(e.appId,this.session,{baseURL:l,timeout:i}),this.session.api=this.api}async authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return await this.session.authenticate(this.authFlow)}async logout(){await this.session.destroy(),this.connector.destroy(),this.authFlow=void 0}startAuthFlow(e){e.api=this.api,this.authFlow=e}async unlinkEmail(e){try{let l=await this.api.post(p4(),{address:e});return y1(l.data)}catch(l){throw a1(l)}}async unlinkWallet(e){try{let l=await this.api.post(c4(),{address:e});return y1(l.data)}catch(l){throw a1(l)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(){return this.session.hasActiveToken()?this.session.token:this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getAppSettings(){try{let e=await this.api.get(`/api/v1/apps/${this.appId}`);return{id:e.data.id,name:e.data.name,verificationKey:e.data.verification_key,logoUrl:e.data.logo_url||void 0,theme:e.data.theme,accentColor:e.data.accent_color||void 0,googleOAuth:e.data.google_oauth,twitterOAuth:e.data.twitter_oauth,discordOAuth:e.data.discord_oauth,createdAt:new Date(e.data.created_at*1e3),updatedAt:new Date(e.data.updated_at*1e3)}}catch(e){throw a1(e)}}};var M3=require("@ethersproject/providers");var q1=require("react");var M=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var A2=(0,q1.createContext)({ready:!1,authenticated:!1,user:null,login:M,linkEmail:M,linkWallet:M,logout:M,getAccessToken:M,getEthereumProvider:M,getEthersProvider:M,getWeb3jsProvider:M,unlinkEmail:M,unlinkWallet:M}),x=()=>(0,q1.useContext)(A2);var A1=class{constructor(e){this.connector=e,this.meta={wallet:this.connector.walletType}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.connector.walletType)throw new b("Wallet must be specified");try{let e=await this.connector.connect({showPrompt:!0}),l=await this.connector.chainId(),i=await this.api.post(o4(),{address:e}),o=this.connector.prepareMessage(l,e,i.data.nonce),n=await this.connector.sign(o),d=await this.api.post(r4(),{message:o,signature:n});return{user:d.data.user,token:d.data.token,refresh_token:d.data.refresh_token}}catch(e){throw z(e)}}getEthereumProvider(){return this.connector.getEthereumProvider()}};var _1=class{constructor(e){this.meta={email:e}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let e=C4(),l=await this.api.post(e,{email:this.meta.email,code:this.meta.emailCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw z(e)}}async sendCodeEmail(e){if(!this.api)throw new b("Auth flow has no API instance");if(e&&(this.meta.email=e),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{let l=n4();return(await this.api.post(l,{email:this.meta.email})).data}catch(l){throw z(l)}}};var T1=class{constructor(e,l,i){this.meta={provider:e},this.meta.authorizationCode=l,this.meta.stateCode=i}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");try{let e=d4(),l=await this.api.post(e,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw z(e)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initialzing OAuth authentication.");try{let e=s4();return(await this.api.post(e,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(e){throw z(e)}}};var _8=require("wicg-inert"),m3=f(require("react-dom")),$2=f(require("styled-components"));var j=require("react");var K1=require("react");var _2=(0,K1.createContext)({showPrivyModal:!1,getAuthMeta:M,closePrivyModal:M,initLoginWithWallet:M,loginWithWallet:M,loginWithCode:M,loginWithEmail:M,resendEmailCode:M,initLoginWithOAuth:M}),y=()=>(0,K1.useContext)(_2);var k4=require("react/jsx-runtime");function b4(a){return(0,k4.jsx)("link",{rel:"prefetch",href:a.src})}var Y1=require("react/jsx-runtime"),M4=(0,j.createContext)({app:null,currentScreen:"LANDING",lastScreen:"LANDING",navigate:M,navigateBack:M}),g4=a=>{let e=a.client,{authenticated:l}=x(),{showPrivyModal:i}=y(),[o,n]=(0,j.useState)(null),[d,p]=(0,j.useState)(null),[c,k]=(0,j.useState)({accentColor:"#696ffd",theme:"System"});(0,j.useEffect)(()=>{async function g(){let A=await e.getAppSettings();k(A)}g()},[]),(0,j.useEffect)(()=>{l||n(null)},[l]),(0,j.useEffect)(()=>{i||(p("LANDING"),n("LANDING"))},[i]);let m={app:c,currentScreen:o||"LANDING",lastScreen:d||"LANDING",navigate:g=>{p(o),n(g)},navigateBack:()=>{n(d)}};return(0,Y1.jsxs)(M4.Provider,{value:m,children:[c&&c.logoUrl&&(0,Y1.jsx)(b4,{src:c.logoUrl}),a.children]})},u=()=>(0,j.useContext)(M4);var l2=require("react"),H2=f(require("styled-components"));var w4=f(require("styled-components"));var T2=require("react/jsx-runtime"),y4=({style:a,...e})=>(0,T2.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:(0,T2.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});var P2=require("react/jsx-runtime"),Z4=({style:a,...e})=>(0,P2.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:(0,P2.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})});var E=require("react/jsx-runtime"),S2=()=>(0,E.jsx)("div",{}),L4=({backFn:a})=>(0,E.jsx)("div",{children:(0,E.jsx)(Z4,{onClick:a})}),v4=()=>{let{closePrivyModal:a}=y();return(0,E.jsx)("div",{children:(0,E.jsx)("div",{children:(0,E.jsx)(y4,{onClick:a})})})},U3=()=>{let{app:a}=u();return a!=null&&a.logoUrl?(0,E.jsx)("div",{children:(0,E.jsx)("img",{src:a.logoUrl,alt:`${a==null?void 0:a.name} logo`,style:{objectFit:"contain",width:"120px",height:"30px"}})}):null};var P=({backFn:a})=>(0,E.jsxs)(x4,{children:[a?(0,E.jsx)(L4,{backFn:a}):(0,E.jsx)(S2,{}),(0,E.jsx)(U3,{},"app-name"),(0,E.jsx)(v4,{})]}),E4=({backFn:a})=>(0,E.jsxs)(x4,{children:[a?(0,E.jsx)(L4,{backFn:a}):(0,E.jsx)(S2,{}),(0,E.jsx)(S2,{}),(0,E.jsx)(v4,{})]}),x4=w4.default.div`
13
13
  height: 30px;
14
14
  display: flex;
15
15
  align-items: center;
@@ -160,7 +160,7 @@ Resources:
160
160
  border-color: var(--fail-light);
161
161
  border-bottom-color: var(--fail-light);
162
162
  }
163
- `;var I4=a=>!!String(a).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),e2=a=>{var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;a=a.replace(e,function(i,o,n,d){return o+o+n+n+d+d});var l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return{r:parseInt((l==null?void 0:l[1])||"00",16),g:parseInt((l==null?void 0:l[2])||"00",16),b:parseInt((l==null?void 0:l[3])||"00",16)}};var O=require("react/jsx-runtime"),a2=()=>{let[a,e]=(0,E1.useState)(""),[l,i]=(0,E1.useState)(!1),[o,n]=(0,E1.useState)(null),{authenticated:d}=x(),{loginWithEmail:p}=y(),{navigate:c}=u();(0,E1.useEffect)(()=>{let m=document.querySelector("#email-input");m==null||m.focus()},[]);let k=I4(a);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(H3,{children:[(0,O.jsxs)(G3,{children:[(0,O.jsx)(_4,{}),(0,O.jsx)("input",{id:"email-input",type:"email",placeholder:"your@email.com",onChange:m=>e(m.target.value),onKeyUp:m=>{m.key==="Enter"&&(i(!0),p(a).then(()=>{c("AWAITING_EMAIL_CODE")}).catch(g=>{(g==null?void 0:g.status)===422?n(g.message):n("Issue submitting email"),i(!1)}))},value:a,autoComplete:"email"})]}),(0,O.jsx)(B3,{disabled:l||!k,onClick:()=>{i(!0),p(a).then(()=>{c("AWAITING_EMAIL_CODE")}).catch(m=>{(m==null?void 0:m.status)===422?n(m.message):n("Issue submitting email"),i(!1)})},children:l?(0,O.jsx)(O2,{color:"var(--disabled-fg)",style:{height:"1rem",width:"1rem",borderWidth:"2px"}}):"Submit"})]}),o?(0,O.jsx)(z3,{fail:!!o,children:o||""}):null,!d&&!o?(0,O.jsx)(j3,{children:(0,O.jsx)("span",{children:"You\u2019ll be able to connect a wallet later."})}):null]})},H3=x1.default.div`
163
+ `;var I4=a=>!!String(a).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),e2=a=>{var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;a=a.replace(e,function(i,o,n,d){return o+o+n+n+d+d});var l=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return{r:parseInt((l==null?void 0:l[1])||"00",16),g:parseInt((l==null?void 0:l[2])||"00",16),b:parseInt((l==null?void 0:l[3])||"00",16)}};var O=require("react/jsx-runtime"),a2=()=>{let[a,e]=(0,E1.useState)(""),[l,i]=(0,E1.useState)(!1),[o,n]=(0,E1.useState)(null),{authenticated:d}=x(),{loginWithEmail:p}=y(),{navigate:c}=u();(0,E1.useEffect)(()=>{let m=document.querySelector("#email-input");m==null||m.focus()},[]);let k=I4(a);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(H3,{children:[(0,O.jsxs)(G3,{children:[(0,O.jsx)(_4,{}),(0,O.jsx)("input",{id:"email-input",type:"email",placeholder:"your@email.com",onChange:m=>e(m.target.value),onKeyUp:m=>{m.key==="Enter"&&(i(!0),p(a).then(()=>{c("AWAITING_EMAIL_CODE")}).catch(g=>{(g==null?void 0:g.status)===422?n(g.message):n("Issue submitting email"),i(!1)}))},value:a,autoComplete:"email"})]}),(0,O.jsx)(B3,{disabled:l||!k,onClick:()=>{i(!0),p(a).then(()=>{c("AWAITING_EMAIL_CODE")}).catch(m=>{(m==null?void 0:m.status)===422?n(m.message):n("Issue submitting email"),i(!1)})},children:l?(0,O.jsx)(O2,{color:"var(--disabled-fg)",style:{height:"1rem",width:"1rem",borderWidth:"2px"}}):"Submit"})]}),o?(0,O.jsx)(j3,{fail:!!o,children:o||""}):null,!d&&!o?(0,O.jsx)(z3,{children:(0,O.jsx)("span",{children:"You\u2019ll be able to connect a wallet later."})}):null]})},H3=x1.default.div`
164
164
  display: flex;
165
165
  border: 1px solid #d1d5db;
166
166
  width: 100%;
@@ -225,14 +225,14 @@ Resources:
225
225
  line-height: 24px;
226
226
  }
227
227
  }
228
- `,j3=x1.default.div`
228
+ `,z3=x1.default.div`
229
229
  font-size: 13px;
230
230
  color: #6b7280;
231
231
 
232
232
  > button {
233
233
  text-decoration: underline;
234
234
  }
235
- `,z3=x1.default.div`
235
+ `,j3=x1.default.div`
236
236
  line-height: 20px;
237
237
  height: 20px;
238
238
  font-size: 13px;
@@ -356,7 +356,7 @@ Resources:
356
356
  }
357
357
 
358
358
  cursor: ${a=>a.active?"inherit":"pointer"};
359
- `;var p1=require("react");var W1=f(require("styled-components"));var _=require("react/jsx-runtime"),X3=1400;var j4=()=>{var U;let{navigate:a,app:e}=u(),{closePrivyModal:l,resendEmailCode:i,getAuthMeta:o,loginWithCode:n}=y(),{authenticated:d,user:p}=x(),[c,k]=(0,p1.useState)(["","","","",""]),[m,g]=(0,p1.useState)(!1),[A,C]=(0,p1.useState)(null),[h,B]=(0,p1.useState)(null);(0,p1.useEffect)(()=>{if(d&&m){let T=setTimeout(()=>{var w;(w=p==null?void 0:p.wallet)!=null&&w.address?l():a("CONNECT_WALLET_OPTIONAL")},d1);return()=>clearTimeout(T)}},[d,m,p]),(0,p1.useEffect)(()=>{if(A&&h===0){let T=setTimeout(()=>{k(["","","","",""]),C(null);let w=document.querySelector("input[name=code-0]");w==null||w.focus()},X3);return()=>clearTimeout(T)}},[A]);let N=T=>{var K2;let w=T.currentTarget.value.replace(" ","");if(w==="")return;if(isNaN(Number(w))){C("Code should be numeric"),B(1);return}C(null),B(null);let J=Number((K2=T.currentTarget.name)==null?void 0:K2.charAt(5)),p2=[...w||[""]].slice(0,5-J),h2=[...c.slice(0,J),...p2,...c.slice(J+p2.length)];k(h2);let y3=p2.length,q2=Math.min(Math.max(J+y3,0),4);if(!isNaN(Number(T.currentTarget.value))){let X=document.querySelector(`input[name=code-${q2}]`);X==null||X.focus()}if(h2.every(X=>X&&!isNaN(+X))){let X=document.querySelector(`input[name=code-${q2}]`);X==null||X.blur(),n(h2.join("")).then(()=>g(!0)).catch(f2=>{(f2==null?void 0:f2.status)===422?C("Invalid or expired verification code"):C("Issue verifying code"),B(0)})}T.preventDefault()},O1=T=>{h===1&&(C(null),B(null));let w=[...c.slice(0,T),"",...c.slice(T+1)];if(k(w),T>0){let J=document.querySelector(`input[name=code-${T-1}]`);J==null||J.focus()}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(P,{},"header"),(0,_.jsxs)(Q3,{children:[(0,_.jsxs)("p",{children:["Please check ",(U=o())==null?void 0:U.email," for an email from ",(e==null?void 0:e.name)||"privy.io"," and enter your code below."]}),(0,_.jsxs)(t5,{children:[(0,_.jsx)("div",{children:c.map((T,w)=>(0,_.jsx)("input",{name:`code-${w}`,type:"text",value:c[w],onChange:N,onKeyUp:J=>{J.key==="Backspace"&&O1(w)},inputMode:"numeric",autoFocus:w===0,pattern:"[0-9]",className:`${m?"success":""} ${A?"fail":""}`,autoComplete:"one-time-code"},w))}),(0,_.jsx)(e5,{fail:!!A,success:m,children:(0,_.jsx)("span",{children:A||(m?"Success!":"")})})]}),(0,_.jsxs)(a5,{children:[(0,_.jsx)("span",{children:"Didn\u2019t get an email?"}),(0,_.jsx)("button",{onClick:i,children:"Resend Code"})]})]}),(0,_.jsx)(Q,{protectedByPrivy:!0})]})},Q3=W1.default.div`
359
+ `;var p1=require("react");var W1=f(require("styled-components"));var _=require("react/jsx-runtime"),X3=1400;var z4=()=>{var U;let{navigate:a,app:e}=u(),{closePrivyModal:l,resendEmailCode:i,getAuthMeta:o,loginWithCode:n}=y(),{authenticated:d,user:p}=x(),[c,k]=(0,p1.useState)(["","","","",""]),[m,g]=(0,p1.useState)(!1),[A,C]=(0,p1.useState)(null),[h,B]=(0,p1.useState)(null);(0,p1.useEffect)(()=>{if(d&&m){let T=setTimeout(()=>{var w;(w=p==null?void 0:p.wallet)!=null&&w.address?l():a("CONNECT_WALLET_OPTIONAL")},d1);return()=>clearTimeout(T)}},[d,m,p]),(0,p1.useEffect)(()=>{if(A&&h===0){let T=setTimeout(()=>{k(["","","","",""]),C(null);let w=document.querySelector("input[name=code-0]");w==null||w.focus()},X3);return()=>clearTimeout(T)}},[A]);let N=T=>{var K2;let w=T.currentTarget.value.replace(" ","");if(w==="")return;if(isNaN(Number(w))){C("Code should be numeric"),B(1);return}C(null),B(null);let J=Number((K2=T.currentTarget.name)==null?void 0:K2.charAt(5)),p2=[...w||[""]].slice(0,5-J),h2=[...c.slice(0,J),...p2,...c.slice(J+p2.length)];k(h2);let y3=p2.length,q2=Math.min(Math.max(J+y3,0),4);if(!isNaN(Number(T.currentTarget.value))){let X=document.querySelector(`input[name=code-${q2}]`);X==null||X.focus()}if(h2.every(X=>X&&!isNaN(+X))){let X=document.querySelector(`input[name=code-${q2}]`);X==null||X.blur(),n(h2.join("")).then(()=>g(!0)).catch(f2=>{(f2==null?void 0:f2.status)===422?C("Invalid or expired verification code"):C("Issue verifying code"),B(0)})}T.preventDefault()},O1=T=>{h===1&&(C(null),B(null));let w=[...c.slice(0,T),"",...c.slice(T+1)];if(k(w),T>0){let J=document.querySelector(`input[name=code-${T-1}]`);J==null||J.focus()}};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(P,{},"header"),(0,_.jsxs)(Q3,{children:[(0,_.jsxs)("p",{children:["Please check ",(U=o())==null?void 0:U.email," for an email from ",(e==null?void 0:e.name)||"privy.io"," and enter your code below."]}),(0,_.jsxs)(t5,{children:[(0,_.jsx)("div",{children:c.map((T,w)=>(0,_.jsx)("input",{name:`code-${w}`,type:"text",value:c[w],onChange:N,onKeyUp:J=>{J.key==="Backspace"&&O1(w)},inputMode:"numeric",autoFocus:w===0,pattern:"[0-9]",className:`${m?"success":""} ${A?"fail":""}`,autoComplete:"one-time-code"},w))}),(0,_.jsx)(e5,{fail:!!A,success:m,children:(0,_.jsx)("span",{children:A||(m?"Success!":"")})})]}),(0,_.jsxs)(a5,{children:[(0,_.jsx)("span",{children:"Didn\u2019t get an email?"}),(0,_.jsx)("button",{onClick:i,children:"Resend Code"})]})]}),(0,_.jsx)(Q,{protectedByPrivy:!0})]})},Q3=W1.default.div`
360
360
  display: flex;
361
361
  flex-direction: column;
362
362
  align-items: flex-start;
@@ -441,7 +441,7 @@ Resources:
441
441
  > button {
442
442
  text-decoration: underline;
443
443
  }
444
- `;var $4=require("react");var B2=f(require("styled-components"));var i2=f(require("styled-components")),z4=i2.default.button`
444
+ `;var $4=require("react");var B2=f(require("styled-components"));var i2=f(require("styled-components")),j4=i2.default.button`
445
445
  display: flex;
446
446
  flex-direction: row;
447
447
  align-items: center;
@@ -462,12 +462,12 @@ Resources:
462
462
  color: var(--disabled-fg);
463
463
  cursor: not-allowed;
464
464
  }
465
- `,o2=(0,i2.default)(z4)`
465
+ `,o2=(0,i2.default)(j4)`
466
466
  && {
467
467
  background-color: var(--primary-color);
468
468
  color: #ffffff;
469
469
  }
470
- `,r2=(0,i2.default)(z4)`
470
+ `,r2=(0,i2.default)(j4)`
471
471
  && {
472
472
  border: 1px solid #e5e7eb;
473
473
  color: var(--text-dark-blue);
@@ -607,14 +607,14 @@ Resources:
607
607
  color: var(--primary-color);
608
608
  background-color: #696efd1a;
609
609
  border-radius: var(--border-radius-sm);
610
- `;var i3=require("react");var j2=f(require("styled-components"));var q=require("react/jsx-runtime"),o3=()=>{let{user:a}=x(),{closePrivyModal:e}=y();return(0,i3.useEffect)(()=>{var l;if((l=a==null?void 0:a.email)!=null&&l.address){let i=setTimeout(()=>{e()},d1);return()=>clearTimeout(i)}},[a]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(P,{},"header"),(0,q.jsxs)(p5,{children:[(0,q.jsx)(h5,{children:(0,q.jsx)("h3",{children:"Connect your Email"})}),(0,q.jsx)(a2,{}),(0,q.jsx)(r2,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),(0,q.jsx)(Q,{protectedByPrivy:!0})]})},p5=(0,j2.default)(D)`
610
+ `;var i3=require("react");var z2=f(require("styled-components"));var q=require("react/jsx-runtime"),o3=()=>{let{user:a}=x(),{closePrivyModal:e}=y();return(0,i3.useEffect)(()=>{var l;if((l=a==null?void 0:a.email)!=null&&l.address){let i=setTimeout(()=>{e()},d1);return()=>clearTimeout(i)}},[a]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(P,{},"header"),(0,q.jsxs)(p5,{children:[(0,q.jsx)(h5,{children:(0,q.jsx)("h3",{children:"Connect your Email"})}),(0,q.jsx)(a2,{}),(0,q.jsx)(r2,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),(0,q.jsx)(Q,{protectedByPrivy:!0})]})},p5=(0,z2.default)(D)`
611
611
  gap: 12px;
612
- `,h5=j2.default.div`
612
+ `,h5=z2.default.div`
613
613
  font-weight: 500;
614
614
  font-size: 14px;
615
615
  line-height: 20px;
616
616
  color: 'var(--text-dark-gray)';
617
- `;var k1=require("react");var N1=f(require("styled-components"));var I=require("react/jsx-runtime"),z2=2,r3={metamask:{name:"MetaMask",component:l1},coinbase_wallet:{name:"Coinbase Wallet",component:v1},wallet_connect:{name:"WalletConnect",component:J1}},n3=()=>{var O1;let[a,e]=(0,k1.useState)(!1),[l,i]=(0,k1.useState)(void 0),{navigate:o,navigateBack:n}=u(),{getAuthMeta:d,closePrivyModal:p,loginWithWallet:c}=y(),[k,m]=(0,k1.useState)(0),{user:g}=x();(0,k1.useEffect)(()=>{i(void 0),c().then(()=>e(!0)).catch(U=>{console.error(U),(U==null?void 0:U.status)===422?i(Z2.ERROR_USER_EXISTS):U instanceof L1&&!U.details.default?i(U.details):i(Z2.ERROR_WALLET_CONNECTION)})},[k]),(0,k1.useEffect)(()=>{var U;if((U=g==null?void 0:g.wallet)!=null&&U.address){e(!0);let T=setTimeout(()=>{var w;(w=g==null?void 0:g.email)!=null&&w.address?p():o("CONNECT_EMAIL_OPTIONAL")},d1);return()=>clearTimeout(T)}},[g]);let A=((O1=d())==null?void 0:O1.wallet)||"metamask",C=r3[A].name,h=r3[A].component,B=a?`Successfully connected with ${C}`:l?l.message:`Waiting for ${C}`,N="";if(a)N="You\u2019re good to go!";else if(k>=z2&&l)N="Unable to connect wallet";else if(l)N=l.detail;else switch(A){case"wallet_connect":N="Open your mobile wallet app to continue";break;default:N="Don\u2019t see your wallet modal? Check your other browser windows."}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(E4,{backFn:n}),(0,I.jsxs)(f5,{children:[(0,I.jsx)(m5,{children:(0,I.jsxs)("div",{children:[(0,I.jsx)(P4,{success:a,fail:!!l}),(0,I.jsx)(h,{style:{width:"38px",height:"38px"}})]})}),(0,I.jsxs)(u5,{children:[(0,I.jsx)("h3",{children:B}),(0,I.jsx)("p",{children:N})]}),a?null:(0,I.jsx)(b5,{onClick:()=>{m(k+1),i(void 0)},visible:(l==null?void 0:l.retryable)&&k<z2,disabled:!((l==null?void 0:l.retryable)&&k<z2),children:"Retry"})]}),(0,I.jsx)(Q,{})]})},f5=N1.default.div`
617
+ `;var k1=require("react");var N1=f(require("styled-components"));var I=require("react/jsx-runtime"),j2=2,r3={metamask:{name:"MetaMask",component:l1},coinbase_wallet:{name:"Coinbase Wallet",component:v1},wallet_connect:{name:"WalletConnect",component:J1}},n3=()=>{var O1;let[a,e]=(0,k1.useState)(!1),[l,i]=(0,k1.useState)(void 0),{navigate:o,navigateBack:n}=u(),{getAuthMeta:d,closePrivyModal:p,loginWithWallet:c}=y(),[k,m]=(0,k1.useState)(0),{user:g}=x();(0,k1.useEffect)(()=>{i(void 0),c().then(()=>e(!0)).catch(U=>{console.error(U),(U==null?void 0:U.status)===422?i(Z2.ERROR_USER_EXISTS):U instanceof L1&&!U.details.default?i(U.details):i(Z2.ERROR_WALLET_CONNECTION)})},[k]),(0,k1.useEffect)(()=>{var U;if((U=g==null?void 0:g.wallet)!=null&&U.address){e(!0);let T=setTimeout(()=>{var w;(w=g==null?void 0:g.email)!=null&&w.address?p():o("CONNECT_EMAIL_OPTIONAL")},d1);return()=>clearTimeout(T)}},[g]);let A=((O1=d())==null?void 0:O1.wallet)||"metamask",C=r3[A].name,h=r3[A].component,B=a?`Successfully connected with ${C}`:l?l.message:`Waiting for ${C}`,N="";if(a)N="You\u2019re good to go!";else if(k>=j2&&l)N="Unable to connect wallet";else if(l)N=l.detail;else switch(A){case"wallet_connect":N="Open your mobile wallet app to continue";break;default:N="Don\u2019t see your wallet modal? Check your other browser windows."}return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(E4,{backFn:n}),(0,I.jsxs)(f5,{children:[(0,I.jsx)(m5,{children:(0,I.jsxs)("div",{children:[(0,I.jsx)(P4,{success:a,fail:!!l}),(0,I.jsx)(h,{style:{width:"38px",height:"38px"}})]})}),(0,I.jsxs)(u5,{children:[(0,I.jsx)("h3",{children:B}),(0,I.jsx)("p",{children:N})]}),a?null:(0,I.jsx)(b5,{onClick:()=>{m(k+1),i(void 0)},visible:(l==null?void 0:l.retryable)&&k<j2,disabled:!((l==null?void 0:l.retryable)&&k<j2),children:"Retry"})]}),(0,I.jsx)(Q,{})]})},f5=N1.default.div`
618
618
  display: flex;
619
619
  flex-direction: column;
620
620
  align-items: center;
@@ -995,7 +995,7 @@ Resources:
995
995
  border-color: var(--primary-color);
996
996
  box-shadow: 0 0 0 1px var(--primary-color);
997
997
  }
998
- `;var b3=require("react"),R=require("react/jsx-runtime"),E5=()=>{let{currentScreen:a}=u(),e=a==="AWAITING_CONNECTION";return(0,R.jsxs)(_5,{compact:e,children:[a==="LANDING"&&(0,R.jsx)(G4,{}),a==="AWAITING_EMAIL_CODE"&&(0,R.jsx)(j4,{}),a==="CONNECT_WALLET_OPTIONAL"&&(0,R.jsx)(q4,{}),a==="CONNECT_EMAIL_OPTIONAL"&&(0,R.jsx)(o3,{}),a==="WALLET_EDUCATION"&&(0,R.jsx)(l3,{}),a==="AWAITING_CONNECTION"&&(0,R.jsx)(n3,{}),a==="FULLY_LINKED_SCREEN"&&(0,R.jsx)(p3,{}),a==="INSTALL_METAMASK_SCREEN"&&(0,R.jsx)(C3,{}),a==="INSTALL_COINBASE_WALLET_SCREEN"&&(0,R.jsx)(s3,{})]})},k3=()=>{let{showPrivyModal:a}=y(),{app:e}=u();return a?m3.default.createPortal((0,R.jsx)(A5,{children:(0,R.jsx)(f3,{accentColor:e==null?void 0:e.accentColor,children:(0,R.jsx)(E5,{})})}),document.body):null},x5=({children:a,...e})=>((0,b3.useEffect)(()=>{var l;if(e.open){(l=document==null?void 0:document.activeElement)==null||l.blur();let i=(document==null?void 0:document.querySelector("#root"))||(document==null?void 0:document.querySelector("#__next"));i==null||i.setAttribute("inert","true")}return()=>{let i=(document==null?void 0:document.querySelector("#root"))||(document==null?void 0:document.querySelector("#__next"));i==null||i.removeAttribute("inert")}},[e.open,e.onClose]),(0,R.jsx)("dialog",{open:!0,role:"dialog",...e,children:a})),A5=(0,$2.default)(x5)`
998
+ `;var b3=require("react"),R=require("react/jsx-runtime"),E5=()=>{let{currentScreen:a}=u(),e=a==="AWAITING_CONNECTION";return(0,R.jsxs)(_5,{compact:e,children:[a==="LANDING"&&(0,R.jsx)(G4,{}),a==="AWAITING_EMAIL_CODE"&&(0,R.jsx)(z4,{}),a==="CONNECT_WALLET_OPTIONAL"&&(0,R.jsx)(q4,{}),a==="CONNECT_EMAIL_OPTIONAL"&&(0,R.jsx)(o3,{}),a==="WALLET_EDUCATION"&&(0,R.jsx)(l3,{}),a==="AWAITING_CONNECTION"&&(0,R.jsx)(n3,{}),a==="FULLY_LINKED_SCREEN"&&(0,R.jsx)(p3,{}),a==="INSTALL_METAMASK_SCREEN"&&(0,R.jsx)(C3,{}),a==="INSTALL_COINBASE_WALLET_SCREEN"&&(0,R.jsx)(s3,{})]})},k3=()=>{let{showPrivyModal:a}=y(),{app:e}=u();return a?m3.default.createPortal((0,R.jsx)(A5,{children:(0,R.jsx)(f3,{accentColor:e==null?void 0:e.accentColor,children:(0,R.jsx)(E5,{})})}),document.body):null},x5=({children:a,...e})=>((0,b3.useEffect)(()=>{var l;if(e.open){(l=document==null?void 0:document.activeElement)==null||l.blur();let i=(document==null?void 0:document.querySelector("#root"))||(document==null?void 0:document.querySelector("#__next"));i==null||i.setAttribute("inert","true")}return()=>{let i=(document==null?void 0:document.querySelector("#root"))||(document==null?void 0:document.querySelector("#__next"));i==null||i.removeAttribute("inert")}},[e.open,e.onClose]),(0,R.jsx)("dialog",{open:!0,role:"dialog",...e,children:a})),A5=(0,$2.default)(x5)`
999
999
  position: fixed;
1000
1000
  top: 0;
1001
1001
  left: 0;
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{useEffect as D2,useState as E1}from"react";import o2 from"axios";import p3 from"axios";var Y=class extends Error{constructor(l,i){super(l);i instanceof Error&&(this.cause=i)}toString(){return`${this.type}: ${this.message}`}},_1=class extends Y{constructor(l,i,o,r){super(o,r);this.type=l;this.status=i}},m=class extends Y{constructor(l,i){super(l,i);this.type="client_error"}};var W=class extends Y{constructor(l,i){super(l,i);this.type="connector_error"}},N=a=>{if(!p3.isAxiosError(a))return z(a);if(!a.response)return new _1("api_error",null,a.message,a);let{type:e,message:l,error:i}=a.response.data;return new _1(e||"ApiError",a.response.status,l||i,a)},z=a=>a instanceof Y?a:a instanceof Error?new m(a.message,a):new m(`Internal error: ${a}`);var T1=class{constructor(e,l,i){this.appId=e,this.session=l,this.defaults=i}async get(e,l){try{return await o2.get(e,this.buildConfig({headers:{"Cache-Control":"no-cache"},...l}))}catch(i){throw N(i)}}async post(e,l,i){try{return await o2.post(e,l,this.buildConfig(i))}catch(o){throw N(o)}}async delete(e,l){try{return await o2.delete(e,this.buildConfig(l))}catch(i){throw N(i)}}buildConfig(e){return e=e||{},e.headers=e.headers||{},e.headers["privy-app-id"]=this.appId,this.session.token!==null&&(e.headers.authorization=`Bearer ${this.session.token}`),{...this.defaults,...e}}};var V2="https://api.privy.io/v0",H2=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",r2="70f97dc579834350a5baec117b3c5ae3",B2=1e4,J=1200,G2=3e4;import h3 from"jwt-decode";var r1=class{static parse(e){try{return new r1(e)}catch{return null}}constructor(e){this.value=e,this._decoded=h3(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}isExpired(e=0){let l=Date.now(),i=(this.expiration-e)*1e3;return l>=i}};var n1=class{constructor(e){this.promise=null;this.fn=e}execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}};var n2=class{constructor(){this._cache={}}get(e){return this._cache[e]}put(e,l){l!==void 0?this._cache[e]=l:this.del(e)}del(e){delete this._cache[e]}},C2=class{get(e){let l=localStorage.getItem(e);return l===null?void 0:JSON.parse(l)}put(e,l){l!==void 0?localStorage.setItem(e,JSON.stringify(l)):this.del(e)}del(e){localStorage.removeItem(e)}};function f3(){return typeof window<"u"&&window.localStorage?new C2:new n2}var U=f3();var u3=a=>{var e;return(e=a.map(l=>{if(l.type==="wallet")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3),chainType:l.chain_type}}).filter(l=>l))==null?void 0:e[0]},m3=a=>{var e;return(e=a.map(l=>{if(l.type==="email")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},b3=a=>{var e;return(e=a.map(l=>{if(l.type==="google_oauth")return{subject:l.subject,email:l.subject,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},k3=a=>{var e;return(e=a.map(l=>{if(l.type==="twitter_oauth")return{subject:l.subject,username:l.username,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},M3=a=>{var e;return(e=a.map(l=>{if(l.type==="discord_oauth")return{subject:l.subject,username:l.username,email:l.email,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]};function C1(a){if(!a)return null;let e=m3(a.linked_accounts),l=u3(a.linked_accounts),i=b3(a.linked_accounts),o=k3(a.linked_accounts),r=M3(a.linked_accounts);return{id:a.id,createdAt:new Date(a.created_at*1e3),linkedAccounts:[...l?[l]:[],...e?[e]:[],...i?[i]:[],...o?[o]:[],...r?[r]:[]],email:e&&{address:e==null?void 0:e.address},wallet:l&&{address:l.address,chainType:l.chainType,chainId:l.chainId,walletType:l.walletType},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name},discord:r&&{subject:r.subject,username:r.username,email:r.email}}}var j2=()=>"/api/v1/sessions",z2=()=>"/api/v1/sessions/logout",$2=()=>"/api/v1/siwe/init",q2=()=>"/api/v1/siwe/authenticate",K2=()=>"/api/v1/passwordless/init",Y2=()=>"/api/v1/passwordless/authenticate",J2=()=>"/api/v1/oauth/init",X2=()=>"/api/v1/oauth/authenticate",Q2=()=>"/api/v1/siwe/unlink",t4=()=>"/api/v1/passwordless/unlink";var g3=30,s2="privy:token",d2="privy:refresh_token",P1=class{constructor(){this.authenticateOnce=new n1(async e=>this._authenticate(e)),this.refreshOnce=new n1(this._refresh.bind(this)),this.destroyOnce=new n1(this._destroy.bind(this))}get token(){let e=U.get(s2);return typeof e=="string"?e:null}get refreshToken(){let e=U.get(d2);return typeof e=="string"?e:null}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasActiveToken(){let e=r1.parse(this.token);return e!==null&&!e.isExpired(g3)}authenticate(e){return this.authenticateOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}async _authenticate(e){try{let{token:l,refresh_token:i,user:o}=await e.authenticate();return l&&this.storeToken(l),i&&this.storeRefreshToken(i),C1(o)}catch(l){throw console.warn("Error authenticating session"),z(l)}}async _refresh(){if(!this.api)throw new m("Session has no API instance");let e=this.token,l=this.refreshToken;if(!e||!l)return null;try{let i=await this.api.post(j2(),{refresh_token:l});return this.storeToken(i.data.token),this.storeRefreshToken(i.data.refresh_token),C1(i.data.user)}catch(i){throw z(i)}}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(z2(),{})),this.destroyLocalState()}catch(l){throw console.warn("Error destroying session"),z(l)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null)}storeToken(e){typeof e=="string"?U.put(s2,e):U.del(s2)}storeRefreshToken(e){typeof e=="string"?U.put(d2,e):U.del(d2)}};import{getAddress as v3}from"@ethersproject/address";import a4 from"@walletconnect/web3-provider";var s1=class{constructor(e){this.removeListener=(e,l)=>{if(this._provider)return this._provider.removeListener(e,l)};this.setProvider=e=>{this._provider=e,this._subscriptions.forEach(l=>{var i;(i=this._provider)==null||i.on(l.eventName,l.listener)})};this._provider=e,this._subscriptions=[]}on(e,l){if(this._provider)return this._provider.on(e,l);this._subscriptions.push({eventName:e,listener:l})}request(e){if(!this._provider)throw new W(`A wallet request of type ${e.method} was made to a disconnected wallet: `);return this._provider.request(e)}},d1=class extends s1{constructor(l){super(l)}},S1=class extends s1{constructor(e){super(e)}sendAsync(e,l){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};import{providers as E3}from"ethers";var e4=["metamask","coinbase_wallet","wallet_connect"];import{ethers as y3}from"ethers";var I1=class extends W{constructor(){super("Wallet timeout");this.type="wallet_error"}},p2=a=>{if(a instanceof W)return a;if((a==null?void 0:a.code)&&(a==null?void 0:a.reason)){let e=new c1(a);return a.code===y3.errors.ACTION_REJECTED&&(e.details=e1.E4001_USER_REJECTED_REQUEST),e}return a!=null&&a.code?new c1(a):new W("Unknown connector error",a)},c2=class extends Y{constructor(l,i,o){super(l);this.type="provider_error";this.code=i,this.data=o}},c1=class extends c2{constructor(l){var r,C,p;let i=l;super(i.message,i.code,i.data);let o=Object.values(e1).find(c=>c.eipCode===i.code);this.details=o||e1.UNKNOWN_ERROR,i.code===-32002&&((r=i.message)!=null&&r.includes("already pending for origin")?(C=i.message)!=null&&C.includes("wallet_requestPermissions")?this.details=e1.E32002_CONNECTION_ALREADY_PENDING:this.details=e1.E32002_REQUEST_ALREADY_PENDING:(p=i.message)!=null&&p.includes("Already processing")&&i.message.includes("eth_requestAccounts")&&(this.details=e1.E32002_WALLET_LOCKED))}},Z3={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0}},w3={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},L3={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},e1={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...L3,...w3},h2={...Z3,...e1};var f2="privy:wallet_type",R1=(a=new I1,e=G2)=>new Promise((l,i)=>setTimeout(()=>{i(a)},e)),u2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isMetaMask)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isMetaMask)return!0}return!1},m2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isCoinbaseWallet)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isCoinbaseWallet)return!0}return!1},W1=class{constructor(){this.walletType=null;this.getEthereumProvider=()=>this.ethProvider;this.createSiweMessage=(e,l,i,o,r,C,p)=>`${i} wants you to sign in with your Ethereum account:
1
+ import{useEffect as D2,useState as E1}from"react";import o2 from"axios";import p3 from"axios";var Y=class extends Error{constructor(l,i){super(l);i instanceof Error&&(this.cause=i)}toString(){return`${this.type}: ${this.message}`}},_1=class extends Y{constructor(l,i,o,r){super(o,r);this.type=l;this.status=i}},m=class extends Y{constructor(l,i){super(l,i);this.type="client_error"}};var W=class extends Y{constructor(l,i){super(l,i);this.type="connector_error"}},N=a=>{if(!p3.isAxiosError(a))return j(a);if(!a.response)return new _1("api_error",null,a.message,a);let{type:e,message:l,error:i}=a.response.data;return new _1(e||"ApiError",a.response.status,l||i,a)},j=a=>a instanceof Y?a:a instanceof Error?new m(a.message,a):new m(`Internal error: ${a}`);var T1=class{constructor(e,l,i){this.appId=e,this.session=l,this.defaults=i}async get(e,l){try{return await o2.get(e,this.buildConfig({headers:{"Cache-Control":"no-cache"},...l}))}catch(i){throw N(i)}}async post(e,l,i){try{return await o2.post(e,l,this.buildConfig(i))}catch(o){throw N(o)}}async delete(e,l){try{return await o2.delete(e,this.buildConfig(l))}catch(i){throw N(i)}}buildConfig(e){return e=e||{},e.headers=e.headers||{},e.headers["privy-app-id"]=this.appId,this.session.token!==null&&(e.headers.authorization=`Bearer ${this.session.token}`),{...this.defaults,...e}}};var V2="https://api.privy.io/v0",H2=process.env.NEXT_PUBLIC_PRIVY_AUTH_URL||"https://auth.privy.io",r2="70f97dc579834350a5baec117b3c5ae3",B2=1e4,J=1200,G2=3e4;import h3 from"jwt-decode";var r1=class{static parse(e){try{return new r1(e)}catch{return null}}constructor(e){this.value=e,this._decoded=h3(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}isExpired(e=0){let l=Date.now(),i=(this.expiration-e)*1e3;return l>=i}};var n1=class{constructor(e){this.promise=null;this.fn=e}execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}};var n2=class{constructor(){this._cache={}}get(e){return this._cache[e]}put(e,l){l!==void 0?this._cache[e]=l:this.del(e)}del(e){delete this._cache[e]}},C2=class{get(e){let l=localStorage.getItem(e);return l===null?void 0:JSON.parse(l)}put(e,l){l!==void 0?localStorage.setItem(e,JSON.stringify(l)):this.del(e)}del(e){localStorage.removeItem(e)}};function f3(){return typeof window<"u"&&window.localStorage?new C2:new n2}var U=f3();var u3=a=>{var e;return(e=a.map(l=>{if(l.type==="wallet")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3),chainType:l.chain_type}}).filter(l=>l))==null?void 0:e[0]},m3=a=>{var e;return(e=a.map(l=>{if(l.type==="email")return{address:l.address,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},b3=a=>{var e;return(e=a.map(l=>{if(l.type==="google_oauth")return{subject:l.subject,email:l.email,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},k3=a=>{var e;return(e=a.map(l=>{if(l.type==="twitter_oauth")return{subject:l.subject,username:l.username,name:l.name,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]},M3=a=>{var e;return(e=a.map(l=>{if(l.type==="discord_oauth")return{subject:l.subject,username:l.username,email:l.email,type:l.type,verifiedAt:new Date(l.verified_at*1e3)}}).filter(l=>l))==null?void 0:e[0]};function C1(a){if(!a)return null;let e=m3(a.linked_accounts),l=u3(a.linked_accounts),i=b3(a.linked_accounts),o=k3(a.linked_accounts),r=M3(a.linked_accounts);return{id:a.id,createdAt:new Date(a.created_at*1e3),linkedAccounts:[...l?[l]:[],...e?[e]:[],...i?[i]:[],...o?[o]:[],...r?[r]:[]],email:e&&{address:e==null?void 0:e.address},wallet:l&&{address:l.address,chainType:l.chainType,chainId:l.chainId,walletType:l.walletType},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name},discord:r&&{subject:r.subject,username:r.username,email:r.email}}}var z2=()=>"/api/v1/sessions",j2=()=>"/api/v1/sessions/logout",$2=()=>"/api/v1/siwe/init",q2=()=>"/api/v1/siwe/authenticate",K2=()=>"/api/v1/passwordless/init",Y2=()=>"/api/v1/passwordless/authenticate",J2=()=>"/api/v1/oauth/init",X2=()=>"/api/v1/oauth/authenticate",Q2=()=>"/api/v1/siwe/unlink",t4=()=>"/api/v1/passwordless/unlink";var g3=30,s2="privy:token",d2="privy:refresh_token",P1=class{constructor(){this.authenticateOnce=new n1(async e=>this._authenticate(e)),this.refreshOnce=new n1(this._refresh.bind(this)),this.destroyOnce=new n1(this._destroy.bind(this))}get token(){let e=U.get(s2);return typeof e=="string"?e:null}get refreshToken(){let e=U.get(d2);return typeof e=="string"?e:null}hasRefreshCredentials(){return typeof this.token=="string"&&typeof this.refreshToken=="string"}hasActiveToken(){let e=r1.parse(this.token);return e!==null&&!e.isExpired(g3)}authenticate(e){return this.authenticateOnce.execute(e)}refresh(){return this.refreshOnce.execute()}destroy(){return this.destroyOnce.execute()}async _authenticate(e){try{let{token:l,refresh_token:i,user:o}=await e.authenticate();return l&&this.storeToken(l),i&&this.storeRefreshToken(i),C1(o)}catch(l){throw console.warn("Error authenticating session"),j(l)}}async _refresh(){if(!this.api)throw new m("Session has no API instance");let e=this.token,l=this.refreshToken;if(!e||!l)return null;try{let i=await this.api.post(z2(),{refresh_token:l});return this.storeToken(i.data.token),this.storeRefreshToken(i.data.refresh_token),C1(i.data.user)}catch(i){throw j(i)}}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(j2(),{})),this.destroyLocalState()}catch(l){throw console.warn("Error destroying session"),j(l)}}destroyLocalState(){this.storeToken(null),this.storeRefreshToken(null)}storeToken(e){typeof e=="string"?U.put(s2,e):U.del(s2)}storeRefreshToken(e){typeof e=="string"?U.put(d2,e):U.del(d2)}};import{getAddress as v3}from"@ethersproject/address";import a4 from"@walletconnect/web3-provider";var s1=class{constructor(e){this.removeListener=(e,l)=>{if(this._provider)return this._provider.removeListener(e,l)};this.setProvider=e=>{this._provider=e,this._subscriptions.forEach(l=>{var i;(i=this._provider)==null||i.on(l.eventName,l.listener)})};this._provider=e,this._subscriptions=[]}on(e,l){if(this._provider)return this._provider.on(e,l);this._subscriptions.push({eventName:e,listener:l})}request(e){if(!this._provider)throw new W(`A wallet request of type ${e.method} was made to a disconnected wallet: `);return this._provider.request(e)}},d1=class extends s1{constructor(l){super(l)}},S1=class extends s1{constructor(e){super(e)}sendAsync(e,l){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};import{providers as E3}from"ethers";var e4=["metamask","coinbase_wallet","wallet_connect"];import{ethers as y3}from"ethers";var I1=class extends W{constructor(){super("Wallet timeout");this.type="wallet_error"}},p2=a=>{if(a instanceof W)return a;if((a==null?void 0:a.code)&&(a==null?void 0:a.reason)){let e=new c1(a);return a.code===y3.errors.ACTION_REJECTED&&(e.details=e1.E4001_USER_REJECTED_REQUEST),e}return a!=null&&a.code?new c1(a):new W("Unknown connector error",a)},c2=class extends Y{constructor(l,i,o){super(l);this.type="provider_error";this.code=i,this.data=o}},c1=class extends c2{constructor(l){var r,C,p;let i=l;super(i.message,i.code,i.data);let o=Object.values(e1).find(c=>c.eipCode===i.code);this.details=o||e1.UNKNOWN_ERROR,i.code===-32002&&((r=i.message)!=null&&r.includes("already pending for origin")?(C=i.message)!=null&&C.includes("wallet_requestPermissions")?this.details=e1.E32002_CONNECTION_ALREADY_PENDING:this.details=e1.E32002_REQUEST_ALREADY_PENDING:(p=i.message)!=null&&p.includes("Already processing")&&i.message.includes("eth_requestAccounts")&&(this.details=e1.E32002_WALLET_LOCKED))}},Z3={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0}},w3={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet modal? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},L3={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},e1={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...L3,...w3},h2={...Z3,...e1};var f2="privy:wallet_type",R1=(a=new I1,e=G2)=>new Promise((l,i)=>setTimeout(()=>{i(a)},e)),u2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isMetaMask)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isMetaMask)return!0}return!1},m2=()=>{if(!window.ethereum)return!1;if(window.ethereum.isCoinbaseWallet)return!0;if(window.ethereum.providers){for(let a of window.ethereum.providers)if(a.isCoinbaseWallet)return!0}return!1},W1=class{constructor(){this.walletType=null;this.getEthereumProvider=()=>this.ethProvider;this.createSiweMessage=(e,l,i,o,r,C,p)=>`${i} wants you to sign in with your Ethereum account:
2
2
  ${l}
3
3
 
4
4
  ${p}
@@ -9,7 +9,7 @@ Chain ID: ${e}
9
9
  Nonce: ${C}
10
10
  Issued At: ${r}
11
11
  Resources:
12
- - https://privy.io`;this.ethProvider=new s1}initialize(){let e=U.get(f2);e4.includes(e)&&(this.walletType=e,this.connect({showPrompt:!1}))}destroy(){this.walletType=null,U.del(f2)}async connect(e){var l,i;switch(this.walletType){case"metamask":this.ethProvider.setProvider(window.ethereum),(l=window.ethereum.providers)==null||l.forEach(async r=>{r.isMetaMask&&this.ethProvider.setProvider(r)});break;case"coinbase_wallet":this.ethProvider.setProvider(window.ethereum),(i=window.ethereum.providers)==null||i.forEach(async r=>{r.isCoinbaseWallet&&this.ethProvider.setProvider(r)});break;case"wallet_connect":let o=new a4({infuraId:r2});this.ethProvider.setProvider(o);break;default:throw new W(`Unsupported wallet: ${this.walletType}`)}return!await this.isConnected()&&e.showPrompt&&await this.promptConnection(this.walletType),this.address()}async isConnected(){switch(this.walletType){case"metamask":return await this.address()!==null;case"coinbase_wallet":return await this.address()!==null;case"wallet_connect":return this.ethProvider.connected;default:throw new W(`Unsupported wallet: ${this.walletType}`)}}async promptConnection(e){try{switch(e){case"metamask":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),R1()]);break;case"coinbase_wallet":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),R1()]);break;case"wallet_connect":let l=new a4({infuraId:r2});this.ethProvider.setProvider(l),await Promise.race([l.enable(),R1()]),U.put(f2,e);break;default:throw new W(`Unsupported wallet: ${this.walletType}`)}}catch(l){throw p2(l)}}async sign(e){let i=new E3.Web3Provider(new d1(this.getEthereumProvider())).getSigner();return Promise.race([i.signMessage(e),R1()]).catch(o=>{throw p2(o)})}prepareMessage(e,l,i){let o=window.location.host,r=window.location.origin,C=`${o} requests that you authenticate with Privy.`,p=new Date().toISOString();return this.createSiweMessage(e,l,o,r,p,i,C)}async chainId(){let e=await this.getEthereumProvider().request({method:"eth_chainId"}),l=Number(e);return String(l)}async address(){let e=await this.getEthereumProvider().request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0?v3(e[0]):null}};var b2,N1=class{constructor(e){let l=e.apiURL||V2,i=e.timeout||B2;this.appId=e.appId,this.connector=new W1,this.connector.initialize(),b2||(b2=new P1),this.session=b2,this.api=new T1(e.appId,this.session,{baseURL:l,timeout:i}),this.session.api=this.api}async authenticate(){if(!this.authFlow)throw new m("No auth flow in progress.");return await this.session.authenticate(this.authFlow)}async logout(){await this.session.destroy(),this.connector.destroy(),this.authFlow=void 0}startAuthFlow(e){e.api=this.api,this.authFlow=e}async unlinkEmail(e){try{let l=await this.api.post(t4(),{address:e});return C1(l.data)}catch(l){throw z(l)}}async unlinkWallet(e){try{let l=await this.api.post(Q2(),{address:e});return C1(l.data)}catch(l){throw z(l)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(){return this.session.hasActiveToken()?this.session.token:this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getAppSettings(){try{let e=await this.api.get(`/api/v1/apps/${this.appId}`);return{id:e.data.id,name:e.data.name,verificationKey:e.data.verification_key,logoUrl:e.data.logo_url||void 0,theme:e.data.theme,accentColor:e.data.accent_color||void 0,googleOAuth:e.data.google_oauth,twitterOAuth:e.data.twitter_oauth,discordOAuth:e.data.discord_oauth,createdAt:new Date(e.data.created_at*1e3),updatedAt:new Date(e.data.updated_at*1e3)}}catch(e){throw z(e)}}};import{Web3Provider as h6}from"@ethersproject/providers";import{createContext as x3,useContext as A3}from"react";var k=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var k2=x3({ready:!1,authenticated:!1,user:null,login:k,linkEmail:k,linkWallet:k,logout:k,getAccessToken:k,getEthereumProvider:k,getEthersProvider:k,getWeb3jsProvider:k,unlinkEmail:k,unlinkWallet:k}),w=()=>A3(k2);var b1=class{constructor(e){this.connector=e,this.meta={wallet:this.connector.walletType}}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.connector.walletType)throw new m("Wallet must be specified");try{let e=await this.connector.connect({showPrompt:!0}),l=await this.connector.chainId(),i=await this.api.post($2(),{address:e}),o=this.connector.prepareMessage(l,e,i.data.nonce),r=await this.connector.sign(o),C=await this.api.post(q2(),{message:o,signature:r});return{user:C.data.user,token:C.data.token,refresh_token:C.data.refresh_token}}catch(e){throw N(e)}}getEthereumProvider(){return this.connector.getEthereumProvider()}};var k1=class{constructor(e){this.meta={email:e}}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new m("Email and email code must be set prior to calling authenticate.");try{let e=Y2(),l=await this.api.post(e,{email:this.meta.email,code:this.meta.emailCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw N(e)}}async sendCodeEmail(e){if(!this.api)throw new m("Auth flow has no API instance");if(e&&(this.meta.email=e),!this.meta.email)throw new m("Email must be set when initialzing authentication.");try{let l=K2();return(await this.api.post(l,{email:this.meta.email})).data}catch(l){throw N(l)}}};var M1=class{constructor(e,l,i){this.meta={provider:e},this.meta.authorizationCode=l,this.meta.stateCode=i}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new m("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");try{let e=X2(),l=await this.api.post(e,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw N(e)}}async getAuthorizationUrl(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.provider)throw new m("Provider must be set when initialzing OAuth authentication.");try{let e=J2();return(await this.api.post(e,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(e){throw N(e)}}};import"wicg-inert";import r6 from"react-dom";import s3 from"styled-components";import{createContext as S3,useContext as I3,useEffect as g2,useState as y2}from"react";import{createContext as _3,useContext as T3}from"react";var M2=_3({showPrivyModal:!1,getAuthMeta:k,closePrivyModal:k,initLoginWithWallet:k,loginWithWallet:k,loginWithCode:k,loginWithEmail:k,resendEmailCode:k,initLoginWithOAuth:k}),g=()=>T3(M2);import{jsx as P3}from"react/jsx-runtime";function l4(a){return P3("link",{rel:"prefetch",href:a.src})}import{jsx as R3,jsxs as W3}from"react/jsx-runtime";var i4=S3({app:null,currentScreen:"LANDING",lastScreen:"LANDING",navigate:k,navigateBack:k}),o4=a=>{let e=a.client,{authenticated:l}=w(),{showPrivyModal:i}=g(),[o,r]=y2(null),[C,p]=y2(null),[c,b]=y2({accentColor:"#696ffd",theme:"System"});g2(()=>{async function M(){let Z=await e.getAppSettings();b(Z)}M()},[]),g2(()=>{l||r(null)},[l]),g2(()=>{i||(p("LANDING"),r("LANDING"))},[i]);let u={app:c,currentScreen:o||"LANDING",lastScreen:C||"LANDING",navigate:M=>{p(o),r(M)},navigateBack:()=>{r(C)}};return W3(i4.Provider,{value:u,children:[c&&c.logoUrl&&R3(l4,{src:c.logoUrl}),a.children]})},f=()=>I3(i4);import{useEffect as f5,useState as u5}from"react";import W4 from"styled-components";import N3 from"styled-components";import{jsx as r4}from"react/jsx-runtime";var n4=({style:a,...e})=>r4("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:r4("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});import{jsx as C4}from"react/jsx-runtime";var s4=({style:a,...e})=>C4("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:C4("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})});import{jsx as E,jsxs as f4}from"react/jsx-runtime";var Z2=()=>E("div",{}),d4=({backFn:a})=>E("div",{children:E(s4,{onClick:a})}),c4=()=>{let{closePrivyModal:a}=g();return E("div",{children:E("div",{children:E(n4,{onClick:a})})})},O3=()=>{let{app:a}=f();return a!=null&&a.logoUrl?E("div",{children:E("img",{src:a.logoUrl,alt:`${a==null?void 0:a.name} logo`,style:{objectFit:"contain",width:"120px",height:"30px"}})}):null};var x=({backFn:a})=>f4(h4,{children:[a?E(d4,{backFn:a}):E(Z2,{}),E(O3,{},"app-name"),E(c4,{})]}),p4=({backFn:a})=>f4(h4,{children:[a?E(d4,{backFn:a}):E(Z2,{}),E(Z2,{}),E(c4,{})]}),h4=N3.div`
12
+ - https://privy.io`;this.ethProvider=new s1}initialize(){let e=U.get(f2);e4.includes(e)&&(this.walletType=e,this.connect({showPrompt:!1}))}destroy(){this.walletType=null,U.del(f2)}async connect(e){var l,i;switch(this.walletType){case"metamask":this.ethProvider.setProvider(window.ethereum),(l=window.ethereum.providers)==null||l.forEach(async r=>{r.isMetaMask&&this.ethProvider.setProvider(r)});break;case"coinbase_wallet":this.ethProvider.setProvider(window.ethereum),(i=window.ethereum.providers)==null||i.forEach(async r=>{r.isCoinbaseWallet&&this.ethProvider.setProvider(r)});break;case"wallet_connect":let o=new a4({infuraId:r2});this.ethProvider.setProvider(o);break;default:throw new W(`Unsupported wallet: ${this.walletType}`)}return!await this.isConnected()&&e.showPrompt&&await this.promptConnection(this.walletType),this.address()}async isConnected(){switch(this.walletType){case"metamask":return await this.address()!==null;case"coinbase_wallet":return await this.address()!==null;case"wallet_connect":return this.ethProvider.connected;default:throw new W(`Unsupported wallet: ${this.walletType}`)}}async promptConnection(e){try{switch(e){case"metamask":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),R1()]);break;case"coinbase_wallet":await Promise.race([this.ethProvider.request({method:"eth_requestAccounts"}),R1()]);break;case"wallet_connect":let l=new a4({infuraId:r2});this.ethProvider.setProvider(l),await Promise.race([l.enable(),R1()]),U.put(f2,e);break;default:throw new W(`Unsupported wallet: ${this.walletType}`)}}catch(l){throw p2(l)}}async sign(e){let i=new E3.Web3Provider(new d1(this.getEthereumProvider())).getSigner();return Promise.race([i.signMessage(e),R1()]).catch(o=>{throw p2(o)})}prepareMessage(e,l,i){let o=window.location.host,r=window.location.origin,C=`${o} requests that you authenticate with Privy.`,p=new Date().toISOString();return this.createSiweMessage(e,l,o,r,p,i,C)}async chainId(){let e=await this.getEthereumProvider().request({method:"eth_chainId"}),l=Number(e);return String(l)}async address(){let e=await this.getEthereumProvider().request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0?v3(e[0]):null}};var b2,N1=class{constructor(e){let l=e.apiURL||V2,i=e.timeout||B2;this.appId=e.appId,this.connector=new W1,this.connector.initialize(),b2||(b2=new P1),this.session=b2,this.api=new T1(e.appId,this.session,{baseURL:l,timeout:i}),this.session.api=this.api}async authenticate(){if(!this.authFlow)throw new m("No auth flow in progress.");return await this.session.authenticate(this.authFlow)}async logout(){await this.session.destroy(),this.connector.destroy(),this.authFlow=void 0}startAuthFlow(e){e.api=this.api,this.authFlow=e}async unlinkEmail(e){try{let l=await this.api.post(t4(),{address:e});return C1(l.data)}catch(l){throw j(l)}}async unlinkWallet(e){try{let l=await this.api.post(Q2(),{address:e});return C1(l.data)}catch(l){throw j(l)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()?this.session.refresh():null}async getAccessToken(){return this.session.hasActiveToken()?this.session.token:this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getAppSettings(){try{let e=await this.api.get(`/api/v1/apps/${this.appId}`);return{id:e.data.id,name:e.data.name,verificationKey:e.data.verification_key,logoUrl:e.data.logo_url||void 0,theme:e.data.theme,accentColor:e.data.accent_color||void 0,googleOAuth:e.data.google_oauth,twitterOAuth:e.data.twitter_oauth,discordOAuth:e.data.discord_oauth,createdAt:new Date(e.data.created_at*1e3),updatedAt:new Date(e.data.updated_at*1e3)}}catch(e){throw j(e)}}};import{Web3Provider as h6}from"@ethersproject/providers";import{createContext as x3,useContext as A3}from"react";var k=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var k2=x3({ready:!1,authenticated:!1,user:null,login:k,linkEmail:k,linkWallet:k,logout:k,getAccessToken:k,getEthereumProvider:k,getEthersProvider:k,getWeb3jsProvider:k,unlinkEmail:k,unlinkWallet:k}),w=()=>A3(k2);var b1=class{constructor(e){this.connector=e,this.meta={wallet:this.connector.walletType}}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.connector.walletType)throw new m("Wallet must be specified");try{let e=await this.connector.connect({showPrompt:!0}),l=await this.connector.chainId(),i=await this.api.post($2(),{address:e}),o=this.connector.prepareMessage(l,e,i.data.nonce),r=await this.connector.sign(o),C=await this.api.post(q2(),{message:o,signature:r});return{user:C.data.user,token:C.data.token,refresh_token:C.data.refresh_token}}catch(e){throw N(e)}}getEthereumProvider(){return this.connector.getEthereumProvider()}};var k1=class{constructor(e){this.meta={email:e}}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new m("Email and email code must be set prior to calling authenticate.");try{let e=Y2(),l=await this.api.post(e,{email:this.meta.email,code:this.meta.emailCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw N(e)}}async sendCodeEmail(e){if(!this.api)throw new m("Auth flow has no API instance");if(e&&(this.meta.email=e),!this.meta.email)throw new m("Email must be set when initialzing authentication.");try{let l=K2();return(await this.api.post(l,{email:this.meta.email})).data}catch(l){throw N(l)}}};var M1=class{constructor(e,l,i){this.meta={provider:e},this.meta.authorizationCode=l,this.meta.stateCode=i}async authenticate(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new m("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");try{let e=X2(),l=await this.api.post(e,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode});return{user:l.data.user,token:l.data.token,refresh_token:l.data.refresh_token}}catch(e){throw N(e)}}async getAuthorizationUrl(){if(!this.api)throw new m("Auth flow has no API instance");if(!this.meta.provider)throw new m("Provider must be set when initialzing OAuth authentication.");try{let e=J2();return(await this.api.post(e,{provider:this.meta.provider,redirect_to:window.location.href})).data}catch(e){throw N(e)}}};import"wicg-inert";import r6 from"react-dom";import s3 from"styled-components";import{createContext as S3,useContext as I3,useEffect as g2,useState as y2}from"react";import{createContext as _3,useContext as T3}from"react";var M2=_3({showPrivyModal:!1,getAuthMeta:k,closePrivyModal:k,initLoginWithWallet:k,loginWithWallet:k,loginWithCode:k,loginWithEmail:k,resendEmailCode:k,initLoginWithOAuth:k}),g=()=>T3(M2);import{jsx as P3}from"react/jsx-runtime";function l4(a){return P3("link",{rel:"prefetch",href:a.src})}import{jsx as R3,jsxs as W3}from"react/jsx-runtime";var i4=S3({app:null,currentScreen:"LANDING",lastScreen:"LANDING",navigate:k,navigateBack:k}),o4=a=>{let e=a.client,{authenticated:l}=w(),{showPrivyModal:i}=g(),[o,r]=y2(null),[C,p]=y2(null),[c,b]=y2({accentColor:"#696ffd",theme:"System"});g2(()=>{async function M(){let Z=await e.getAppSettings();b(Z)}M()},[]),g2(()=>{l||r(null)},[l]),g2(()=>{i||(p("LANDING"),r("LANDING"))},[i]);let u={app:c,currentScreen:o||"LANDING",lastScreen:C||"LANDING",navigate:M=>{p(o),r(M)},navigateBack:()=>{r(C)}};return W3(i4.Provider,{value:u,children:[c&&c.logoUrl&&R3(l4,{src:c.logoUrl}),a.children]})},f=()=>I3(i4);import{useEffect as f5,useState as u5}from"react";import W4 from"styled-components";import N3 from"styled-components";import{jsx as r4}from"react/jsx-runtime";var n4=({style:a,...e})=>r4("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:r4("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});import{jsx as C4}from"react/jsx-runtime";var s4=({style:a,...e})=>C4("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...a},...e,children:C4("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18"})});import{jsx as E,jsxs as f4}from"react/jsx-runtime";var Z2=()=>E("div",{}),d4=({backFn:a})=>E("div",{children:E(s4,{onClick:a})}),c4=()=>{let{closePrivyModal:a}=g();return E("div",{children:E("div",{children:E(n4,{onClick:a})})})},O3=()=>{let{app:a}=f();return a!=null&&a.logoUrl?E("div",{children:E("img",{src:a.logoUrl,alt:`${a==null?void 0:a.name} logo`,style:{objectFit:"contain",width:"120px",height:"30px"}})}):null};var x=({backFn:a})=>f4(h4,{children:[a?E(d4,{backFn:a}):E(Z2,{}),E(O3,{},"app-name"),E(c4,{})]}),p4=({backFn:a})=>f4(h4,{children:[a?E(d4,{backFn:a}):E(Z2,{}),E(Z2,{}),E(c4,{})]}),h4=N3.div`
13
13
  height: 30px;
14
14
  display: flex;
15
15
  align-items: center;
@@ -116,7 +116,7 @@ Resources:
116
116
  :hover > :last-child {
117
117
  visibility: visible;
118
118
  }
119
- `;import G3 from"styled-components";import{jsx as b4,jsxs as z3}from"react/jsx-runtime";var V1=()=>{let{navigate:a}=f();return z3(j3,{children:[b4("span",{children:"Don\u2019t have a wallet? "}),b4("button",{onClick:()=>{a("WALLET_EDUCATION")},children:"Create one now."})]})},j3=G3.div`
119
+ `;import G3 from"styled-components";import{jsx as b4,jsxs as j3}from"react/jsx-runtime";var V1=()=>{let{navigate:a}=f();return j3(z3,{children:[b4("span",{children:"Don\u2019t have a wallet? "}),b4("button",{onClick:()=>{a("WALLET_EDUCATION")},children:"Create one now."})]})},z3=G3.div`
120
120
  font-size: 13px;
121
121
  color: #6b7280;
122
122
 
@@ -244,13 +244,13 @@ Resources:
244
244
  opacity: ${a=>a.success||a.fail?"1":"0"};
245
245
 
246
246
  transition: ${a=>a.fail?"":"all 150ms ease-in-out"};
247
- `;import j1 from"styled-components";import{jsx as Z4}from"react/jsx-runtime";var w4=({style:a,...e})=>Z4("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...a},...e,children:Z4("path",{d:"M7.54311 19.7551C16.5973 19.7551 21.5516 12.2467 21.5516 5.74656C21.5516 5.53533 21.5516 5.32409 21.542 5.11286C22.5021 4.42156 23.3375 3.54783 24 2.55888C23.1166 2.95254 22.1661 3.21178 21.1675 3.3366C22.1853 2.73171 22.963 1.76196 23.3375 0.609788C22.3869 1.17627 21.3308 1.57953 20.2074 1.80037C19.3049 0.840223 18.0279 0.244934 16.6165 0.244934C13.8993 0.244934 11.6909 2.45326 11.6909 5.17047C11.6909 5.55453 11.7389 5.92898 11.8157 6.29384C7.72554 6.09221 4.09619 4.12391 1.66703 1.14747C1.24457 1.87718 1.00453 2.72211 1.00453 3.62464C1.00453 5.3337 1.87826 6.84112 3.19366 7.72445C2.38714 7.69565 1.62862 7.47481 0.966125 7.10996C0.966125 7.12916 0.966125 7.14837 0.966125 7.17717C0.966125 9.55833 2.66558 11.5554 4.91232 12.0067C4.49945 12.1219 4.06739 12.1795 3.61612 12.1795C3.29927 12.1795 2.99203 12.1507 2.69438 12.0931C3.31848 14.0518 5.14275 15.4728 7.29347 15.5112C5.60362 16.8362 3.4817 17.6235 1.17736 17.6235C0.783698 17.6235 0.390039 17.6043 0.00598145 17.5563C2.17591 18.9389 4.76829 19.7551 7.54311 19.7551Z",fill:"white"})});import{jsx as y1,jsxs as a5}from"react/jsx-runtime";var L4=({style:a,...e})=>a5("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...a},...e,children:[y1("g",{clipPath:"url(#clip0)",children:y1("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:"#ffffff"})}),y1("defs",{children:y1("clipPath",{id:"clip0",children:y1("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as G1,jsxs as l5}from"react/jsx-runtime";var v4=({style:a,...e})=>l5("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...a},...e,children:[G1("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"}),G1("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"}),G1("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"}),G1("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 f1,jsxs as C5}from"react/jsx-runtime";var E4=({showGoogle:a,showTwitter:e,showDiscord:l})=>{let{initLoginWithOAuth:i}=g();return C5(i5,{children:[a&&f1(n5,{onClick:()=>{i("google")},children:f1(v4,{})}),e&&f1(o5,{onClick:()=>{i("twitter")},children:f1(w4,{})}),l&&f1(r5,{onClick:()=>{i("discord")},children:f1(L4,{})})]})},i5=j1.div`
247
+ `;import z1 from"styled-components";import{jsx as Z4}from"react/jsx-runtime";var w4=({style:a,...e})=>Z4("svg",{width:"24",height:"20",viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...a},...e,children:Z4("path",{d:"M7.54311 19.7551C16.5973 19.7551 21.5516 12.2467 21.5516 5.74656C21.5516 5.53533 21.5516 5.32409 21.542 5.11286C22.5021 4.42156 23.3375 3.54783 24 2.55888C23.1166 2.95254 22.1661 3.21178 21.1675 3.3366C22.1853 2.73171 22.963 1.76196 23.3375 0.609788C22.3869 1.17627 21.3308 1.57953 20.2074 1.80037C19.3049 0.840223 18.0279 0.244934 16.6165 0.244934C13.8993 0.244934 11.6909 2.45326 11.6909 5.17047C11.6909 5.55453 11.7389 5.92898 11.8157 6.29384C7.72554 6.09221 4.09619 4.12391 1.66703 1.14747C1.24457 1.87718 1.00453 2.72211 1.00453 3.62464C1.00453 5.3337 1.87826 6.84112 3.19366 7.72445C2.38714 7.69565 1.62862 7.47481 0.966125 7.10996C0.966125 7.12916 0.966125 7.14837 0.966125 7.17717C0.966125 9.55833 2.66558 11.5554 4.91232 12.0067C4.49945 12.1219 4.06739 12.1795 3.61612 12.1795C3.29927 12.1795 2.99203 12.1507 2.69438 12.0931C3.31848 14.0518 5.14275 15.4728 7.29347 15.5112C5.60362 16.8362 3.4817 17.6235 1.17736 17.6235C0.783698 17.6235 0.390039 17.6043 0.00598145 17.5563C2.17591 18.9389 4.76829 19.7551 7.54311 19.7551Z",fill:"white"})});import{jsx as y1,jsxs as a5}from"react/jsx-runtime";var L4=({style:a,...e})=>a5("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...a},...e,children:[y1("g",{clipPath:"url(#clip0)",children:y1("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:"#ffffff"})}),y1("defs",{children:y1("clipPath",{id:"clip0",children:y1("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as G1,jsxs as l5}from"react/jsx-runtime";var v4=({style:a,...e})=>l5("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...a},...e,children:[G1("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"}),G1("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"}),G1("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"}),G1("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 f1,jsxs as C5}from"react/jsx-runtime";var E4=({showGoogle:a,showTwitter:e,showDiscord:l})=>{let{initLoginWithOAuth:i}=g();return C5(i5,{children:[a&&f1(n5,{onClick:()=>{i("google")},children:f1(v4,{})}),e&&f1(o5,{onClick:()=>{i("twitter")},children:f1(w4,{})}),l&&f1(r5,{onClick:()=>{i("discord")},children:f1(L4,{})})]})},i5=z1.div`
248
248
  display: flex;
249
249
  flex-direction: row;
250
250
  justify-content: space-between;
251
251
  width: 100%;
252
252
  gap: 4px;
253
- `,o5=j1.button`
253
+ `,o5=z1.button`
254
254
  && {
255
255
  border-radius: var(--border-radius-sm);
256
256
  cursor: pointer;
@@ -262,7 +262,7 @@ Resources:
262
262
  justify-content: center;
263
263
  align-items: center;
264
264
  }
265
- `,r5=j1.button`
265
+ `,r5=z1.button`
266
266
  && {
267
267
  border-radius: var(--border-radius-sm);
268
268
  cursor: pointer;
@@ -274,7 +274,7 @@ Resources:
274
274
  justify-content: center;
275
275
  align-items: center;
276
276
  }
277
- `,n5=j1.button`
277
+ `,n5=z1.button`
278
278
  && {
279
279
  border-radius: var(--border-radius-sm);
280
280
  cursor: pointer;
@@ -298,7 +298,7 @@ Resources:
298
298
  border-top: 1px solid #d1d5db;
299
299
  margin: 0px 8px;
300
300
  }
301
- `;import d5 from"styled-components";import{jsx as P4}from"react/jsx-runtime";var S4=({style:a,...e})=>P4("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...a},...e,children:P4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99555 0.929932C-1.12055 1.31799 -0.499722 9.15734 2.17445 8.76915C0.0807959 10.5544 -0.960455 16.6416 6.01654 16.0265C10.6356 15.9489 15.5635 12.2232 15.5635 8.1095C15.5635 2.63748 10.7516 0.929932 7.99555 0.929932ZM9.47052 7.53055C9.47052 8.49933 8.81856 9.28468 8.01433 9.28468C7.2101 9.28468 6.55814 8.49933 6.55814 7.53055C6.55814 6.56176 7.2101 5.77641 8.01433 5.77641C8.81856 5.77641 9.47052 6.56176 9.47052 7.53055ZM12.3171 9.28468C13.1213 9.28468 13.7733 8.49933 13.7733 7.53055C13.7733 6.56176 13.1213 5.77641 12.3171 5.77641C11.5129 5.77641 10.8609 6.56176 10.8609 7.53055C10.8609 8.49933 11.5129 9.28468 12.3171 9.28468Z",fill:"var(--primary-color)"})});import{Fragment as c5,jsx as z1,jsxs as p5}from"react/jsx-runtime";var j=({protectedByPrivy:a})=>z1(l1,{children:a?p5(c5,{children:[z1(S4,{}),z1("span",{children:z1("a",{href:"https://www.privy.io/how-it-works",target:"_blank",children:"Protected by Privy"})})]}):null}),l1=d5.div`
301
+ `;import d5 from"styled-components";import{jsx as P4}from"react/jsx-runtime";var S4=({style:a,...e})=>P4("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...a},...e,children:P4("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99555 0.929932C-1.12055 1.31799 -0.499722 9.15734 2.17445 8.76915C0.0807959 10.5544 -0.960455 16.6416 6.01654 16.0265C10.6356 15.9489 15.5635 12.2232 15.5635 8.1095C15.5635 2.63748 10.7516 0.929932 7.99555 0.929932ZM9.47052 7.53055C9.47052 8.49933 8.81856 9.28468 8.01433 9.28468C7.2101 9.28468 6.55814 8.49933 6.55814 7.53055C6.55814 6.56176 7.2101 5.77641 8.01433 5.77641C8.81856 5.77641 9.47052 6.56176 9.47052 7.53055ZM12.3171 9.28468C13.1213 9.28468 13.7733 8.49933 13.7733 7.53055C13.7733 6.56176 13.1213 5.77641 12.3171 5.77641C11.5129 5.77641 10.8609 6.56176 10.8609 7.53055C10.8609 8.49933 11.5129 9.28468 12.3171 9.28468Z",fill:"var(--primary-color)"})});import{Fragment as c5,jsx as j1,jsxs as p5}from"react/jsx-runtime";var z=({protectedByPrivy:a})=>j1(l1,{children:a?p5(c5,{children:[j1(S4,{}),j1("span",{children:j1("a",{href:"https://www.privy.io/how-it-works",target:"_blank",children:"Protected by Privy"})})]}):null}),l1=d5.div`
302
302
  height: 20px;
303
303
  font-size: 12px;
304
304
  display: flex;
@@ -328,7 +328,7 @@ Resources:
328
328
  margin-top: auto;
329
329
  gap: 16px;
330
330
  flex-grow: 100;
331
- `;import{Fragment as R4,jsx as V,jsxs as w1}from"react/jsx-runtime";var N4=()=>{let[a,e]=u5(0),{ready:l,authenticated:i,user:o}=w(),{navigate:r,app:C}=f();f5(()=>{var Z,n,h,R,A;let u=(o==null?void 0:o.google)||(o==null?void 0:o.twitter)||(o==null?void 0:o.discord),M=(o==null?void 0:o.google)&&(o==null?void 0:o.twitter)&&(o==null?void 0:o.discord);l&&i&&(u?(Z=o.wallet)!=null&&Z.address||r("LANDING"):((n=o==null?void 0:o.email)==null?void 0:n.address)&&!((h=o.wallet)!=null&&h.address)?r("CONNECT_WALLET_OPTIONAL"):((R=o==null?void 0:o.wallet)==null?void 0:R.address)&&!((A=o.email)!=null&&A.address)?r("CONNECT_EMAIL_OPTIONAL"):M&&(console.error("Launched modal, but nothing left to connect."),r("FULLY_LINKED_SCREEN")))},[]);let p=a==0,c=a==1,b=!((C==null?void 0:C.discordOAuth)||(C==null?void 0:C.googleOAuth)||(C==null?void 0:C.twitterOAuth));return w1(R4,{children:[V(x,{},"header"),w1(_,{children:[V(_2,{children:V("h2",{children:"Connect with"})}),w1(I4,{active:p,onClick:()=>{p||e(0)},children:[V(_2,{active:p,children:V("h3",{children:"Wallet"})}),p?w1(R4,{children:[V(F1,{}),V(V1,{})]}):null]}),w1(I4,{active:c,onClick:()=>{c||e(1)},children:[V(_2,{active:c,children:V("h3",{children:b?"Email":"Email & Social"})}),c?V(T4,{}):null]})]}),V(j,{protectedByPrivy:!0})]})},_2=W4.div`
331
+ `;import{Fragment as R4,jsx as V,jsxs as w1}from"react/jsx-runtime";var N4=()=>{let[a,e]=u5(0),{ready:l,authenticated:i,user:o}=w(),{navigate:r,app:C}=f();f5(()=>{var Z,n,h,R,A;let u=(o==null?void 0:o.google)||(o==null?void 0:o.twitter)||(o==null?void 0:o.discord),M=(o==null?void 0:o.google)&&(o==null?void 0:o.twitter)&&(o==null?void 0:o.discord);l&&i&&(u?(Z=o.wallet)!=null&&Z.address||r("LANDING"):((n=o==null?void 0:o.email)==null?void 0:n.address)&&!((h=o.wallet)!=null&&h.address)?r("CONNECT_WALLET_OPTIONAL"):((R=o==null?void 0:o.wallet)==null?void 0:R.address)&&!((A=o.email)!=null&&A.address)?r("CONNECT_EMAIL_OPTIONAL"):M&&(console.error("Launched modal, but nothing left to connect."),r("FULLY_LINKED_SCREEN")))},[]);let p=a==0,c=a==1,b=!((C==null?void 0:C.discordOAuth)||(C==null?void 0:C.googleOAuth)||(C==null?void 0:C.twitterOAuth));return w1(R4,{children:[V(x,{},"header"),w1(_,{children:[V(_2,{children:V("h2",{children:"Connect with"})}),w1(I4,{active:p,onClick:()=>{p||e(0)},children:[V(_2,{active:p,children:V("h3",{children:"Wallet"})}),p?w1(R4,{children:[V(F1,{}),V(V1,{})]}):null]}),w1(I4,{active:c,onClick:()=>{c||e(1)},children:[V(_2,{active:c,children:V("h3",{children:b?"Email":"Email & Social"})}),c?V(T4,{}):null]})]}),V(z,{protectedByPrivy:!0})]})},_2=W4.div`
332
332
  font-weight: ${a=>a.active?600:500};
333
333
  color: ${a=>a.active?"inherit":"#6b7280"};
334
334
  display: flex;
@@ -356,7 +356,7 @@ Resources:
356
356
  }
357
357
 
358
358
  cursor: ${a=>a.active?"inherit":"pointer"};
359
- `;import{useEffect as O4,useState as $1}from"react";import q1 from"styled-components";import{Fragment as y5,jsx as X,jsxs as L1}from"react/jsx-runtime";var m5=1400;var D4=()=>{var T;let{navigate:a,app:e}=f(),{closePrivyModal:l,resendEmailCode:i,getAuthMeta:o,loginWithCode:r}=g(),{authenticated:C,user:p}=w(),[c,b]=$1(["","","","",""]),[u,M]=$1(!1),[Z,n]=$1(null),[h,R]=$1(null);O4(()=>{if(C&&u){let v=setTimeout(()=>{var y;(y=p==null?void 0:p.wallet)!=null&&y.address?l():a("CONNECT_WALLET_OPTIONAL")},J);return()=>clearTimeout(v)}},[C,u,p]),O4(()=>{if(Z&&h===0){let v=setTimeout(()=>{b(["","","","",""]),n(null);let y=document.querySelector("input[name=code-0]");y==null||y.focus()},m5);return()=>clearTimeout(v)}},[Z]);let A=v=>{var F2;let y=v.currentTarget.value.replace(" ","");if(y==="")return;if(isNaN(Number(y))){n("Code should be numeric"),R(1);return}n(null),R(null);let B=Number((F2=v.currentTarget.name)==null?void 0:F2.charAt(5)),a2=[...y||[""]].slice(0,5-B),l2=[...c.slice(0,B),...a2,...c.slice(B+a2.length)];b(l2);let c3=a2.length,U2=Math.min(Math.max(B+c3,0),4);if(!isNaN(Number(v.currentTarget.value))){let G=document.querySelector(`input[name=code-${U2}]`);G==null||G.focus()}if(l2.every(G=>G&&!isNaN(+G))){let G=document.querySelector(`input[name=code-${U2}]`);G==null||G.blur(),r(l2.join("")).then(()=>M(!0)).catch(i2=>{(i2==null?void 0:i2.status)===422?n("Invalid or expired verification code"):n("Issue verifying code"),R(0)})}v.preventDefault()},A1=v=>{h===1&&(n(null),R(null));let y=[...c.slice(0,v),"",...c.slice(v+1)];if(b(y),v>0){let B=document.querySelector(`input[name=code-${v-1}]`);B==null||B.focus()}};return L1(y5,{children:[X(x,{},"header"),L1(b5,{children:[L1("p",{children:["Please check ",(T=o())==null?void 0:T.email," for an email from ",(e==null?void 0:e.name)||"privy.io"," and enter your code below."]}),L1(k5,{children:[X("div",{children:c.map((v,y)=>X("input",{name:`code-${y}`,type:"text",value:c[y],onChange:A,onKeyUp:B=>{B.key==="Backspace"&&A1(y)},inputMode:"numeric",autoFocus:y===0,pattern:"[0-9]",className:`${u?"success":""} ${Z?"fail":""}`,autoComplete:"one-time-code"},y))}),X(M5,{fail:!!Z,success:u,children:X("span",{children:Z||(u?"Success!":"")})})]}),L1(g5,{children:[X("span",{children:"Didn\u2019t get an email?"}),X("button",{onClick:i,children:"Resend Code"})]})]}),X(j,{protectedByPrivy:!0})]})},b5=q1.div`
359
+ `;import{useEffect as O4,useState as $1}from"react";import q1 from"styled-components";import{Fragment as y5,jsx as X,jsxs as L1}from"react/jsx-runtime";var m5=1400;var D4=()=>{var T;let{navigate:a,app:e}=f(),{closePrivyModal:l,resendEmailCode:i,getAuthMeta:o,loginWithCode:r}=g(),{authenticated:C,user:p}=w(),[c,b]=$1(["","","","",""]),[u,M]=$1(!1),[Z,n]=$1(null),[h,R]=$1(null);O4(()=>{if(C&&u){let v=setTimeout(()=>{var y;(y=p==null?void 0:p.wallet)!=null&&y.address?l():a("CONNECT_WALLET_OPTIONAL")},J);return()=>clearTimeout(v)}},[C,u,p]),O4(()=>{if(Z&&h===0){let v=setTimeout(()=>{b(["","","","",""]),n(null);let y=document.querySelector("input[name=code-0]");y==null||y.focus()},m5);return()=>clearTimeout(v)}},[Z]);let A=v=>{var F2;let y=v.currentTarget.value.replace(" ","");if(y==="")return;if(isNaN(Number(y))){n("Code should be numeric"),R(1);return}n(null),R(null);let B=Number((F2=v.currentTarget.name)==null?void 0:F2.charAt(5)),a2=[...y||[""]].slice(0,5-B),l2=[...c.slice(0,B),...a2,...c.slice(B+a2.length)];b(l2);let c3=a2.length,U2=Math.min(Math.max(B+c3,0),4);if(!isNaN(Number(v.currentTarget.value))){let G=document.querySelector(`input[name=code-${U2}]`);G==null||G.focus()}if(l2.every(G=>G&&!isNaN(+G))){let G=document.querySelector(`input[name=code-${U2}]`);G==null||G.blur(),r(l2.join("")).then(()=>M(!0)).catch(i2=>{(i2==null?void 0:i2.status)===422?n("Invalid or expired verification code"):n("Issue verifying code"),R(0)})}v.preventDefault()},A1=v=>{h===1&&(n(null),R(null));let y=[...c.slice(0,v),"",...c.slice(v+1)];if(b(y),v>0){let B=document.querySelector(`input[name=code-${v-1}]`);B==null||B.focus()}};return L1(y5,{children:[X(x,{},"header"),L1(b5,{children:[L1("p",{children:["Please check ",(T=o())==null?void 0:T.email," for an email from ",(e==null?void 0:e.name)||"privy.io"," and enter your code below."]}),L1(k5,{children:[X("div",{children:c.map((v,y)=>X("input",{name:`code-${y}`,type:"text",value:c[y],onChange:A,onKeyUp:B=>{B.key==="Backspace"&&A1(y)},inputMode:"numeric",autoFocus:y===0,pattern:"[0-9]",className:`${u?"success":""} ${Z?"fail":""}`,autoComplete:"one-time-code"},y))}),X(M5,{fail:!!Z,success:u,children:X("span",{children:Z||(u?"Success!":"")})})]}),L1(g5,{children:[X("span",{children:"Didn\u2019t get an email?"}),X("button",{onClick:i,children:"Resend Code"})]})]}),X(z,{protectedByPrivy:!0})]})},b5=q1.div`
360
360
  display: flex;
361
361
  flex-direction: column;
362
362
  align-items: flex-start;
@@ -472,7 +472,7 @@ Resources:
472
472
  border: 1px solid #e5e7eb;
473
473
  color: var(--text-dark-blue);
474
474
  }
475
- `;import{Fragment as v5,jsx as i1,jsxs as F4}from"react/jsx-runtime";var H4=()=>{let{user:a}=w(),{closePrivyModal:e}=g();return Z5(()=>{var l;if((l=a==null?void 0:a.wallet)!=null&&l.address){let i=setTimeout(()=>{e()},J);return()=>clearTimeout(i)}},[a]),F4(v5,{children:[i1(x,{},"header"),F4(w5,{children:[i1(L5,{children:i1("h3",{children:"Connect Wallet"})}),i1(F1,{}),i1(V1,{}),i1(Y1,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),i1(j,{protectedByPrivy:!0})]})},w5=V4(_)`
475
+ `;import{Fragment as v5,jsx as i1,jsxs as F4}from"react/jsx-runtime";var H4=()=>{let{user:a}=w(),{closePrivyModal:e}=g();return Z5(()=>{var l;if((l=a==null?void 0:a.wallet)!=null&&l.address){let i=setTimeout(()=>{e()},J);return()=>clearTimeout(i)}},[a]),F4(v5,{children:[i1(x,{},"header"),F4(w5,{children:[i1(L5,{children:i1("h3",{children:"Connect Wallet"})}),i1(F1,{}),i1(V1,{}),i1(Y1,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),i1(z,{protectedByPrivy:!0})]})},w5=V4(_)`
476
476
  gap: 12px;
477
477
  `,L5=V4.div`
478
478
  font-weight: 500;
@@ -503,7 +503,7 @@ Resources:
503
503
  margin-top: auto;
504
504
  margin-bottom: auto;
505
505
  }
506
- `;import{jsx as d,jsxs as Q1}from"react/jsx-runtime";var j4=({style:a,...e})=>Q1("svg",{width:"286",height:"183",viewBox:"0 0 286 183",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...a},...e,children:[d("rect",{x:"198.5",y:"133",width:"50",height:"50",rx:"25",fill:"#E1E7EF"}),d("path",{d:"M236.373 144.791L225.206 153.052L227.289 148.181L236.373 144.791Z",fill:"#E17726",stroke:"#E17726",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M210.627 144.791L221.692 153.116L219.711 148.187L210.627 144.785V144.791ZM232.353 163.933L229.377 168.47L235.738 170.219L237.557 164.036L232.347 163.933H232.353ZM209.448 164.036L211.257 170.219L217.602 168.47L214.647 163.933L209.448 164.036Z",fill:"#E27625",stroke:"#E27625",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M217.262 156.27L215.497 158.939L221.783 159.23L221.579 152.46L217.262 156.281V156.27V156.27ZM229.737 156.281L225.351 152.374L225.206 159.23L231.492 158.939L229.732 156.281H229.737ZM217.602 168.475L221.417 166.64L218.14 164.089L217.607 168.475H217.602ZM225.588 166.63L229.377 168.475L228.865 164.084L225.588 166.635V166.63Z",fill:"#E27625",stroke:"#E27625",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M229.377 168.47L225.588 166.635L225.895 169.1L225.862 170.144L229.382 168.47H229.377ZM217.602 168.47L221.137 170.144L221.11 169.1L221.417 166.635L217.602 168.47V168.47Z",fill:"#D5BFB2",stroke:"#D5BFB2",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M221.197 162.448L218.054 161.533L220.282 160.516L221.207 162.453H221.197V162.448ZM225.793 162.448L226.729 160.505L228.962 161.522L225.793 162.459V162.448Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M217.602 168.47L218.156 163.933L214.647 164.035L217.602 168.47V168.47ZM228.844 163.933L229.377 168.47L232.353 164.035L228.844 163.933V163.933ZM231.503 158.939L225.217 159.23L225.793 162.459L226.729 160.505L228.962 161.522L231.503 158.939V158.939ZM218.054 161.533L220.282 160.516L221.207 162.453L221.794 159.224L215.508 158.944L218.059 161.538L218.054 161.533Z",fill:"#CC6228",stroke:"#CC6228",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M215.503 158.939L218.134 164.078L218.048 161.528L215.497 158.934L215.503 158.939ZM228.962 161.533L228.86 164.084L231.492 158.944L228.957 161.538L228.962 161.533ZM221.794 159.23L221.196 162.459L221.945 166.263L222.117 161.242L221.794 159.23ZM225.211 159.23L224.904 161.237L225.055 166.269L225.792 162.453L225.206 159.224V159.235L225.211 159.23Z",fill:"#E27525",stroke:"#E27525",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.793 162.448L225.055 166.263L225.588 166.635L228.86 164.084L228.962 161.528L225.793 162.448V162.448ZM218.054 161.528L218.14 164.078L221.417 166.629L221.945 166.263L221.207 162.448L218.048 161.528H218.059H218.054Z",fill:"#F5841F",stroke:"#F5841F",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.868 170.144L225.895 169.1L225.604 168.863H221.39L221.11 169.1L221.137 170.144L217.602 168.47L218.845 169.487L221.353 171.215H225.642L228.155 169.482L229.377 168.47L225.857 170.144H225.868V170.144Z",fill:"#C0AC9D",stroke:"#C0AC9D",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.588 166.63L225.055 166.264H221.945L221.417 166.635L221.11 169.1L221.39 168.863H225.604L225.895 169.1L225.588 166.635V166.624V166.63Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M236.846 153.585L237.783 149.037L236.373 144.791L225.583 152.777L229.737 156.27L235.598 157.976L236.889 156.475L236.33 156.066L237.223 155.248L236.545 154.72L237.438 154.042L236.846 153.585H236.857H236.846ZM209.217 149.032L210.17 153.585L209.556 154.037L210.466 154.715L209.787 155.248L210.67 156.066L210.11 156.475L211.402 157.976L217.263 156.275L221.417 152.767L210.627 144.791L209.217 149.032V149.032Z",fill:"#763E1A",stroke:"#763E1A",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M235.598 157.976L229.737 156.275L231.502 158.934L228.871 164.073L232.353 164.03H237.562L235.598 157.97V157.976ZM217.263 156.27L211.402 157.976L209.448 164.035H214.658L218.14 164.079L215.508 158.939L217.273 156.27H217.263V156.27ZM225.206 159.224L225.588 152.766L227.289 148.176H219.711L221.412 152.766L221.794 159.224L221.939 161.248V166.263H225.055L225.071 161.248L225.206 159.224V159.224Z",fill:"#F5841F",stroke:"#F5841F",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("rect",{x:"192",y:"30",width:"50",height:"50",rx:"25",fill:"#0C5BFF"}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M205 55C205 61.6274 210.373 67 217 67C223.627 67 229 61.6274 229 55C229 48.3726 223.627 43 217 43C210.373 43 205 48.3726 205 55ZM213.933 51.1333C213.491 51.1333 213.133 51.4915 213.133 51.9333V58.0667C213.133 58.5085 213.491 58.8667 213.933 58.8667H220.067C220.508 58.8667 220.867 58.5085 220.867 58.0667V51.9333C220.867 51.4915 220.508 51.1333 220.067 51.1333H213.933Z",fill:"white"}),d("rect",{x:"39.5",y:"18",width:"50",height:"50",rx:"25",fill:"url(#paint0_linear_428_81)"}),d("path",{d:"M77.3677 42.8335H74.102C74.102 36.2519 68.6881 30.9167 62.0091 30.9167C55.4129 30.9167 50.0501 36.1213 49.9189 42.5901C49.7831 49.2769 56.1492 55.0834 62.9357 55.0834H63.7893C69.7724 55.0834 77.7916 50.468 79.0445 44.8444C79.2758 43.8079 78.445 42.8335 77.3677 42.8335ZM57.1562 43.1267C57.1562 44.0068 56.4257 44.7267 55.5325 44.7267C54.6394 44.7267 53.9089 44.0065 53.9089 43.1267V40.5383C53.9089 39.6582 54.6394 38.9383 55.5325 38.9383C56.4257 38.9383 57.1562 39.6582 57.1562 40.5383V43.1267ZM62.794 43.1267C62.794 44.0068 62.0636 44.7267 61.1705 44.7267C60.2773 44.7267 59.5468 44.0065 59.5468 43.1267V40.5383C59.5468 39.6582 60.2776 38.9383 61.1705 38.9383C62.0636 38.9383 62.794 39.6582 62.794 40.5383V43.1267Z",fill:"url(#paint1_linear_428_81)"}),d("rect",{x:"46.5",y:"124",width:"50",height:"50",rx:"25",fill:"#141414"}),d("g",{clipPath:"url(#clip0_428_81)",children:d("path",{d:"M62.1497 143.578C67.3134 138.585 75.6867 138.585 80.8505 143.578L81.4722 144.179C81.5335 144.238 81.5822 144.308 81.6155 144.386C81.6488 144.463 81.666 144.547 81.666 144.631C81.666 144.715 81.6488 144.799 81.6155 144.876C81.5822 144.954 81.5335 145.024 81.4722 145.083L79.3462 147.139C79.2835 147.199 79.1996 147.232 79.1123 147.232C79.025 147.232 78.9411 147.199 78.8784 147.139L78.0232 146.311C74.421 142.829 68.58 142.829 64.977 146.311L64.0611 147.197C63.9984 147.257 63.9145 147.29 63.8272 147.29C63.7399 147.29 63.656 147.257 63.5933 147.197L61.4672 145.141C61.4059 145.083 61.3572 145.012 61.3239 144.935C61.2906 144.857 61.2735 144.774 61.2735 144.689C61.2735 144.605 61.2906 144.521 61.3239 144.444C61.3572 144.366 61.4059 144.296 61.4672 144.237L62.1497 143.578ZM85.248 147.829L87.1397 149.659C87.201 149.718 87.2497 149.788 87.283 149.865C87.3163 149.943 87.3334 150.027 87.3334 150.111C87.3334 150.195 87.3163 150.279 87.283 150.356C87.2497 150.434 87.201 150.504 87.1397 150.563L78.6081 158.812C78.4828 158.933 78.315 159 78.1403 159C77.9656 159 77.7978 158.933 77.6725 158.812L71.6177 152.957C71.5864 152.927 71.5443 152.91 71.5005 152.91C71.4567 152.91 71.4147 152.927 71.3833 152.957L65.3285 158.812C65.2032 158.933 65.0354 159 64.8607 159C64.686 159 64.5182 158.933 64.3929 158.812L55.8605 150.563C55.7992 150.504 55.7505 150.434 55.7172 150.356C55.6839 150.279 55.6667 150.195 55.6667 150.111C55.6667 150.027 55.6839 149.943 55.7172 149.865C55.7505 149.788 55.7992 149.718 55.8605 149.659L57.7531 147.829C57.8783 147.709 58.0459 147.642 58.2204 147.642C58.3949 147.642 58.5625 147.709 58.6878 147.829L64.7427 153.684C64.774 153.714 64.816 153.731 64.8598 153.731C64.9036 153.731 64.9457 153.714 64.977 153.684L71.0319 147.829C71.1572 147.709 71.325 147.641 71.4997 147.641C71.6743 147.641 71.8422 147.709 71.9675 147.829L78.0232 153.684C78.0545 153.714 78.0965 153.731 78.1403 153.731C78.1841 153.731 78.2262 153.714 78.2575 153.684L84.3124 147.829C84.4377 147.709 84.6055 147.641 84.7802 147.641C84.9549 147.641 85.1227 147.709 85.248 147.829Z",fill:"white"})}),d("rect",{x:"103.5",y:"58",width:"78",height:"78",rx:"39",fill:"white"}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M131.626 83.0058C128.674 83.3405 126.5 85.8652 126.5 88.8363V92.0779V103.277V105.099C126.5 108.098 128.713 110.636 131.695 110.952C134.982 111.301 139.216 111.667 142.5 111.667C147.147 111.667 153.695 110.934 156.773 110.555C157.765 110.433 158.5 109.588 158.5 108.589V92.0779C158.5 91.0782 157.765 90.2337 156.773 90.1115C153.705 89.7336 147.189 89.0046 142.545 88.9999L142.5 88.9999L142.46 88.9999C139.655 89.0025 136.165 89.2695 133.166 89.564C132.488 89.5642 131.907 89.0495 131.84 88.3608C131.768 87.6279 132.304 86.9755 133.037 86.9036C136.061 86.6067 139.621 86.3333 142.5 86.3333C145.707 86.3333 149.764 86.6728 152.989 87.007C154.039 87.1159 155.006 87.2247 155.833 87.3221V85.3898C155.833 84.3995 155.112 83.56 154.131 83.4288C151.262 83.0454 145.367 82.3333 141.167 82.3333C138.276 82.3333 134.583 82.6705 131.626 83.0058ZM153.833 102.333C154.938 102.333 155.833 101.438 155.833 100.333C155.833 99.2287 154.938 98.3333 153.833 98.3333C152.729 98.3333 151.833 99.2287 151.833 100.333C151.833 101.438 152.729 102.333 153.833 102.333Z",fill:"#696FFD"}),d("rect",{x:"103.5",y:"58",width:"78",height:"78",rx:"39",stroke:"#E1E7EF",strokeWidth:"2"}),d("path",{d:"M269.405 111C278.27 111 285.457 103.837 285.457 95C285.457 86.1634 278.27 79 269.405 79C260.54 79 253.354 86.1634 253.354 95C253.354 103.837 260.54 111 269.405 111Z",fill:"#B9BBFE"}),d("path",{d:"M133.971 24C140.62 24 146.01 18.6274 146.01 12C146.01 5.37258 140.62 0 133.971 0C127.322 0 121.932 5.37258 121.932 12C121.932 18.6274 127.322 24 133.971 24Z",fill:"#B9BBFE"}),d("path",{d:"M15.5917 112C20.5782 112 24.6206 107.971 24.6206 103C24.6206 98.0294 20.5782 94 15.5917 94C10.6051 94 6.56274 98.0294 6.56274 103C6.56274 107.971 10.6051 112 15.5917 112Z",fill:"#B9BBFE"}),d("path",{d:"M152.029 177C157.57 177 162.061 172.523 162.061 167C162.061 161.477 157.57 157 152.029 157C146.488 157 141.997 161.477 141.997 167C141.997 172.523 146.488 177 152.029 177Z",fill:"#E9E9FF"}),d("path",{d:"M263.386 21C267.818 21 271.412 17.4183 271.412 13C271.412 8.58172 267.818 5 263.386 5C258.953 5 255.36 8.58172 255.36 13C255.36 17.4183 258.953 21 263.386 21Z",fill:"#E9E9FF"}),d("path",{d:"M7.06436 36C10.6658 36 13.5853 33.0899 13.5853 29.5C13.5853 25.9101 10.6658 23 7.06436 23C3.46296 23 0.543457 25.9101 0.543457 29.5C0.543457 33.0899 3.46296 36 7.06436 36Z",fill:"#E9E9FF"}),Q1("defs",{children:[Q1("linearGradient",{id:"paint0_linear_428_81",x1:"64.5",y1:"18",x2:"64.5",y2:"68",gradientUnits:"userSpaceOnUse",children:[d("stop",{stopColor:"#534BB1"}),d("stop",{offset:"1",stopColor:"#551BF9"})]}),Q1("linearGradient",{id:"paint1_linear_428_81",x1:"64.5",y1:"30.9167",x2:"64.5",y2:"55.0834",gradientUnits:"userSpaceOnUse",children:[d("stop",{stopColor:"white"}),d("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"})]}),d("clipPath",{id:"clip0_428_81",children:d("rect",{width:"31.6667",height:"19.1667",fill:"white",transform:"translate(55.6667 139.833)"})})]})]});import*as Q from"react-device-detect";import{Fragment as S2,jsx as s,jsxs as L}from"react/jsx-runtime";var J4=()=>{let[a,e]=_5("WHAT_IS_A_WALLET"),{navigateBack:l,navigate:i}=f(),o=a==="WHAT_IS_A_WALLET"?l:a==="PICK_A_NEW_WALLET"?()=>e("WHAT_IS_A_WALLET"):()=>e("PICK_A_NEW_WALLET"),r;return Q.isFirefox?r="https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/":r="https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en",L(S2,{children:[s(x,{backFn:o},"header"),L(T5,{children:[a==="WHAT_IS_A_WALLET"&&L(S2,{children:[s(j4,{style:{width:"100%",height:"auto",borderRadius:"var(--border-radius-sm)"}}),L(P5,{children:[s("h3",{children:"What is a wallet?"}),s("p",{children:"Wallets are how you can store, send, and receive cryptocurrencies and NFTs. They are also a new way to log in."}),s("p",{children:"Instead of creating new accounts and passwords every time you explore crypto apps, you can just connect your wallet."})]}),s(R5,{children:s(W5,{onClick:()=>e("PICK_A_NEW_WALLET"),children:"Get a Wallet"})})]}),a==="PICK_A_NEW_WALLET"&&s(S2,{children:L(S5,{children:[L("div",{children:[s("h3",{children:"Create a new wallet"}),s("p",{children:"Select one the wallet providers below to get started on your web3 adventure."})]}),L(I5,{children:[L(z4,{onClick:()=>{Q.isIOS?window.location.href="https://apps.apple.com/us/app/metamask-blockchain-wallet/id1438144202":Q.isAndroid?window.location.href="https://play.google.com/store/apps/details?id=io.metamask":e("CREATE_METAMASK_WALLET")},children:[s($,{}),s($4,{children:s("h4",{children:"MetaMask"})}),s("div",{children:s("span",{children:"Set up"})})]}),L(z4,{onClick:()=>{Q.isIOS?window.location.href="https://apps.apple.com/us/app/coinbase-wallet-nfts-crypto/id1278383455":Q.isAndroid?window.location.href="https://play.google.com/store/apps/details?id=org.toshi":e("CREATE_COINBASE_WALLET")},children:[s(p1,{}),s($4,{children:s("h4",{children:"Coinbase Wallet"})}),s("div",{children:s("span",{children:"Set up"})})]})]})]})}),a==="CREATE_COINBASE_WALLET"&&L(q4,{children:[L(K4,{children:[s("h3",{children:"Create a wallet with Coinbase"}),s(X1,{style:{width:"152px",height:"152px"}})]}),L(o1,{children:[s(S,{children:"Open the camera on your phone"}),s(K,{}),s(S,{children:"Scan the QR code with your camera"}),s(K,{}),s(S,{children:"Click the link and download the app"})]}),s(Y4,{onClick:()=>i("LANDING"),children:"Done! I have my wallet"})]}),a==="CREATE_METAMASK_WALLET"&&L(q4,{children:[L(K4,{children:[s("h3",{children:"Create a wallet with Metamask"}),s($,{style:{width:"152px",height:"152px"}})]}),L(o1,{children:[s(S,{children:L("div",{children:[s("span",{children:"Install the "}),s("a",{href:r,target:"_blank",children:"MetaMask browser extension"})]})}),s(K,{}),s(S,{children:"Set up your first wallet"})]}),s(Y4,{onClick:()=>i("LANDING"),children:"Done! I have my wallet"})]})]}),L(l1,{children:[s("span",{children:"Still not sure? "}),s("a",{target:"_blank",href:"https://join.tell.ie/blog/explaining-web3-wallets",children:"Learn more"})]})]})},T5=H(_)`
506
+ `;import{jsx as d,jsxs as Q1}from"react/jsx-runtime";var z4=({style:a,...e})=>Q1("svg",{width:"286",height:"183",viewBox:"0 0 286 183",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"1.25rem",width:"1.25rem",...a},...e,children:[d("rect",{x:"198.5",y:"133",width:"50",height:"50",rx:"25",fill:"#E1E7EF"}),d("path",{d:"M236.373 144.791L225.206 153.052L227.289 148.181L236.373 144.791Z",fill:"#E17726",stroke:"#E17726",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M210.627 144.791L221.692 153.116L219.711 148.187L210.627 144.785V144.791ZM232.353 163.933L229.377 168.47L235.738 170.219L237.557 164.036L232.347 163.933H232.353ZM209.448 164.036L211.257 170.219L217.602 168.47L214.647 163.933L209.448 164.036Z",fill:"#E27625",stroke:"#E27625",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M217.262 156.27L215.497 158.939L221.783 159.23L221.579 152.46L217.262 156.281V156.27V156.27ZM229.737 156.281L225.351 152.374L225.206 159.23L231.492 158.939L229.732 156.281H229.737ZM217.602 168.475L221.417 166.64L218.14 164.089L217.607 168.475H217.602ZM225.588 166.63L229.377 168.475L228.865 164.084L225.588 166.635V166.63Z",fill:"#E27625",stroke:"#E27625",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M229.377 168.47L225.588 166.635L225.895 169.1L225.862 170.144L229.382 168.47H229.377ZM217.602 168.47L221.137 170.144L221.11 169.1L221.417 166.635L217.602 168.47V168.47Z",fill:"#D5BFB2",stroke:"#D5BFB2",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M221.197 162.448L218.054 161.533L220.282 160.516L221.207 162.453H221.197V162.448ZM225.793 162.448L226.729 160.505L228.962 161.522L225.793 162.459V162.448Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M217.602 168.47L218.156 163.933L214.647 164.035L217.602 168.47V168.47ZM228.844 163.933L229.377 168.47L232.353 164.035L228.844 163.933V163.933ZM231.503 158.939L225.217 159.23L225.793 162.459L226.729 160.505L228.962 161.522L231.503 158.939V158.939ZM218.054 161.533L220.282 160.516L221.207 162.453L221.794 159.224L215.508 158.944L218.059 161.538L218.054 161.533Z",fill:"#CC6228",stroke:"#CC6228",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M215.503 158.939L218.134 164.078L218.048 161.528L215.497 158.934L215.503 158.939ZM228.962 161.533L228.86 164.084L231.492 158.944L228.957 161.538L228.962 161.533ZM221.794 159.23L221.196 162.459L221.945 166.263L222.117 161.242L221.794 159.23ZM225.211 159.23L224.904 161.237L225.055 166.269L225.792 162.453L225.206 159.224V159.235L225.211 159.23Z",fill:"#E27525",stroke:"#E27525",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.793 162.448L225.055 166.263L225.588 166.635L228.86 164.084L228.962 161.528L225.793 162.448V162.448ZM218.054 161.528L218.14 164.078L221.417 166.629L221.945 166.263L221.207 162.448L218.048 161.528H218.059H218.054Z",fill:"#F5841F",stroke:"#F5841F",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.868 170.144L225.895 169.1L225.604 168.863H221.39L221.11 169.1L221.137 170.144L217.602 168.47L218.845 169.487L221.353 171.215H225.642L228.155 169.482L229.377 168.47L225.857 170.144H225.868V170.144Z",fill:"#C0AC9D",stroke:"#C0AC9D",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M225.588 166.63L225.055 166.264H221.945L221.417 166.635L221.11 169.1L221.39 168.863H225.604L225.895 169.1L225.588 166.635V166.624V166.63Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M236.846 153.585L237.783 149.037L236.373 144.791L225.583 152.777L229.737 156.27L235.598 157.976L236.889 156.475L236.33 156.066L237.223 155.248L236.545 154.72L237.438 154.042L236.846 153.585H236.857H236.846ZM209.217 149.032L210.17 153.585L209.556 154.037L210.466 154.715L209.787 155.248L210.67 156.066L210.11 156.475L211.402 157.976L217.263 156.275L221.417 152.767L210.627 144.791L209.217 149.032V149.032Z",fill:"#763E1A",stroke:"#763E1A",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("path",{d:"M235.598 157.976L229.737 156.275L231.502 158.934L228.871 164.073L232.353 164.03H237.562L235.598 157.97V157.976ZM217.263 156.27L211.402 157.976L209.448 164.035H214.658L218.14 164.079L215.508 158.939L217.273 156.27H217.263V156.27ZM225.206 159.224L225.588 152.766L227.289 148.176H219.711L221.412 152.766L221.794 159.224L221.939 161.248V166.263H225.055L225.071 161.248L225.206 159.224V159.224Z",fill:"#F5841F",stroke:"#F5841F",strokeWidth:"0.47",strokeLinecap:"round",strokeLinejoin:"round"}),d("rect",{x:"192",y:"30",width:"50",height:"50",rx:"25",fill:"#0C5BFF"}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M205 55C205 61.6274 210.373 67 217 67C223.627 67 229 61.6274 229 55C229 48.3726 223.627 43 217 43C210.373 43 205 48.3726 205 55ZM213.933 51.1333C213.491 51.1333 213.133 51.4915 213.133 51.9333V58.0667C213.133 58.5085 213.491 58.8667 213.933 58.8667H220.067C220.508 58.8667 220.867 58.5085 220.867 58.0667V51.9333C220.867 51.4915 220.508 51.1333 220.067 51.1333H213.933Z",fill:"white"}),d("rect",{x:"39.5",y:"18",width:"50",height:"50",rx:"25",fill:"url(#paint0_linear_428_81)"}),d("path",{d:"M77.3677 42.8335H74.102C74.102 36.2519 68.6881 30.9167 62.0091 30.9167C55.4129 30.9167 50.0501 36.1213 49.9189 42.5901C49.7831 49.2769 56.1492 55.0834 62.9357 55.0834H63.7893C69.7724 55.0834 77.7916 50.468 79.0445 44.8444C79.2758 43.8079 78.445 42.8335 77.3677 42.8335ZM57.1562 43.1267C57.1562 44.0068 56.4257 44.7267 55.5325 44.7267C54.6394 44.7267 53.9089 44.0065 53.9089 43.1267V40.5383C53.9089 39.6582 54.6394 38.9383 55.5325 38.9383C56.4257 38.9383 57.1562 39.6582 57.1562 40.5383V43.1267ZM62.794 43.1267C62.794 44.0068 62.0636 44.7267 61.1705 44.7267C60.2773 44.7267 59.5468 44.0065 59.5468 43.1267V40.5383C59.5468 39.6582 60.2776 38.9383 61.1705 38.9383C62.0636 38.9383 62.794 39.6582 62.794 40.5383V43.1267Z",fill:"url(#paint1_linear_428_81)"}),d("rect",{x:"46.5",y:"124",width:"50",height:"50",rx:"25",fill:"#141414"}),d("g",{clipPath:"url(#clip0_428_81)",children:d("path",{d:"M62.1497 143.578C67.3134 138.585 75.6867 138.585 80.8505 143.578L81.4722 144.179C81.5335 144.238 81.5822 144.308 81.6155 144.386C81.6488 144.463 81.666 144.547 81.666 144.631C81.666 144.715 81.6488 144.799 81.6155 144.876C81.5822 144.954 81.5335 145.024 81.4722 145.083L79.3462 147.139C79.2835 147.199 79.1996 147.232 79.1123 147.232C79.025 147.232 78.9411 147.199 78.8784 147.139L78.0232 146.311C74.421 142.829 68.58 142.829 64.977 146.311L64.0611 147.197C63.9984 147.257 63.9145 147.29 63.8272 147.29C63.7399 147.29 63.656 147.257 63.5933 147.197L61.4672 145.141C61.4059 145.083 61.3572 145.012 61.3239 144.935C61.2906 144.857 61.2735 144.774 61.2735 144.689C61.2735 144.605 61.2906 144.521 61.3239 144.444C61.3572 144.366 61.4059 144.296 61.4672 144.237L62.1497 143.578ZM85.248 147.829L87.1397 149.659C87.201 149.718 87.2497 149.788 87.283 149.865C87.3163 149.943 87.3334 150.027 87.3334 150.111C87.3334 150.195 87.3163 150.279 87.283 150.356C87.2497 150.434 87.201 150.504 87.1397 150.563L78.6081 158.812C78.4828 158.933 78.315 159 78.1403 159C77.9656 159 77.7978 158.933 77.6725 158.812L71.6177 152.957C71.5864 152.927 71.5443 152.91 71.5005 152.91C71.4567 152.91 71.4147 152.927 71.3833 152.957L65.3285 158.812C65.2032 158.933 65.0354 159 64.8607 159C64.686 159 64.5182 158.933 64.3929 158.812L55.8605 150.563C55.7992 150.504 55.7505 150.434 55.7172 150.356C55.6839 150.279 55.6667 150.195 55.6667 150.111C55.6667 150.027 55.6839 149.943 55.7172 149.865C55.7505 149.788 55.7992 149.718 55.8605 149.659L57.7531 147.829C57.8783 147.709 58.0459 147.642 58.2204 147.642C58.3949 147.642 58.5625 147.709 58.6878 147.829L64.7427 153.684C64.774 153.714 64.816 153.731 64.8598 153.731C64.9036 153.731 64.9457 153.714 64.977 153.684L71.0319 147.829C71.1572 147.709 71.325 147.641 71.4997 147.641C71.6743 147.641 71.8422 147.709 71.9675 147.829L78.0232 153.684C78.0545 153.714 78.0965 153.731 78.1403 153.731C78.1841 153.731 78.2262 153.714 78.2575 153.684L84.3124 147.829C84.4377 147.709 84.6055 147.641 84.7802 147.641C84.9549 147.641 85.1227 147.709 85.248 147.829Z",fill:"white"})}),d("rect",{x:"103.5",y:"58",width:"78",height:"78",rx:"39",fill:"white"}),d("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M131.626 83.0058C128.674 83.3405 126.5 85.8652 126.5 88.8363V92.0779V103.277V105.099C126.5 108.098 128.713 110.636 131.695 110.952C134.982 111.301 139.216 111.667 142.5 111.667C147.147 111.667 153.695 110.934 156.773 110.555C157.765 110.433 158.5 109.588 158.5 108.589V92.0779C158.5 91.0782 157.765 90.2337 156.773 90.1115C153.705 89.7336 147.189 89.0046 142.545 88.9999L142.5 88.9999L142.46 88.9999C139.655 89.0025 136.165 89.2695 133.166 89.564C132.488 89.5642 131.907 89.0495 131.84 88.3608C131.768 87.6279 132.304 86.9755 133.037 86.9036C136.061 86.6067 139.621 86.3333 142.5 86.3333C145.707 86.3333 149.764 86.6728 152.989 87.007C154.039 87.1159 155.006 87.2247 155.833 87.3221V85.3898C155.833 84.3995 155.112 83.56 154.131 83.4288C151.262 83.0454 145.367 82.3333 141.167 82.3333C138.276 82.3333 134.583 82.6705 131.626 83.0058ZM153.833 102.333C154.938 102.333 155.833 101.438 155.833 100.333C155.833 99.2287 154.938 98.3333 153.833 98.3333C152.729 98.3333 151.833 99.2287 151.833 100.333C151.833 101.438 152.729 102.333 153.833 102.333Z",fill:"#696FFD"}),d("rect",{x:"103.5",y:"58",width:"78",height:"78",rx:"39",stroke:"#E1E7EF",strokeWidth:"2"}),d("path",{d:"M269.405 111C278.27 111 285.457 103.837 285.457 95C285.457 86.1634 278.27 79 269.405 79C260.54 79 253.354 86.1634 253.354 95C253.354 103.837 260.54 111 269.405 111Z",fill:"#B9BBFE"}),d("path",{d:"M133.971 24C140.62 24 146.01 18.6274 146.01 12C146.01 5.37258 140.62 0 133.971 0C127.322 0 121.932 5.37258 121.932 12C121.932 18.6274 127.322 24 133.971 24Z",fill:"#B9BBFE"}),d("path",{d:"M15.5917 112C20.5782 112 24.6206 107.971 24.6206 103C24.6206 98.0294 20.5782 94 15.5917 94C10.6051 94 6.56274 98.0294 6.56274 103C6.56274 107.971 10.6051 112 15.5917 112Z",fill:"#B9BBFE"}),d("path",{d:"M152.029 177C157.57 177 162.061 172.523 162.061 167C162.061 161.477 157.57 157 152.029 157C146.488 157 141.997 161.477 141.997 167C141.997 172.523 146.488 177 152.029 177Z",fill:"#E9E9FF"}),d("path",{d:"M263.386 21C267.818 21 271.412 17.4183 271.412 13C271.412 8.58172 267.818 5 263.386 5C258.953 5 255.36 8.58172 255.36 13C255.36 17.4183 258.953 21 263.386 21Z",fill:"#E9E9FF"}),d("path",{d:"M7.06436 36C10.6658 36 13.5853 33.0899 13.5853 29.5C13.5853 25.9101 10.6658 23 7.06436 23C3.46296 23 0.543457 25.9101 0.543457 29.5C0.543457 33.0899 3.46296 36 7.06436 36Z",fill:"#E9E9FF"}),Q1("defs",{children:[Q1("linearGradient",{id:"paint0_linear_428_81",x1:"64.5",y1:"18",x2:"64.5",y2:"68",gradientUnits:"userSpaceOnUse",children:[d("stop",{stopColor:"#534BB1"}),d("stop",{offset:"1",stopColor:"#551BF9"})]}),Q1("linearGradient",{id:"paint1_linear_428_81",x1:"64.5",y1:"30.9167",x2:"64.5",y2:"55.0834",gradientUnits:"userSpaceOnUse",children:[d("stop",{stopColor:"white"}),d("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"})]}),d("clipPath",{id:"clip0_428_81",children:d("rect",{width:"31.6667",height:"19.1667",fill:"white",transform:"translate(55.6667 139.833)"})})]})]});import*as Q from"react-device-detect";import{Fragment as S2,jsx as s,jsxs as L}from"react/jsx-runtime";var J4=()=>{let[a,e]=_5("WHAT_IS_A_WALLET"),{navigateBack:l,navigate:i}=f(),o=a==="WHAT_IS_A_WALLET"?l:a==="PICK_A_NEW_WALLET"?()=>e("WHAT_IS_A_WALLET"):()=>e("PICK_A_NEW_WALLET"),r;return Q.isFirefox?r="https://addons.mozilla.org/en-US/firefox/addon/ether-metamask/":r="https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en",L(S2,{children:[s(x,{backFn:o},"header"),L(T5,{children:[a==="WHAT_IS_A_WALLET"&&L(S2,{children:[s(z4,{style:{width:"100%",height:"auto",borderRadius:"var(--border-radius-sm)"}}),L(P5,{children:[s("h3",{children:"What is a wallet?"}),s("p",{children:"Wallets are how you can store, send, and receive cryptocurrencies and NFTs. They are also a new way to log in."}),s("p",{children:"Instead of creating new accounts and passwords every time you explore crypto apps, you can just connect your wallet."})]}),s(R5,{children:s(W5,{onClick:()=>e("PICK_A_NEW_WALLET"),children:"Get a Wallet"})})]}),a==="PICK_A_NEW_WALLET"&&s(S2,{children:L(S5,{children:[L("div",{children:[s("h3",{children:"Create a new wallet"}),s("p",{children:"Select one the wallet providers below to get started on your web3 adventure."})]}),L(I5,{children:[L(j4,{onClick:()=>{Q.isIOS?window.location.href="https://apps.apple.com/us/app/metamask-blockchain-wallet/id1438144202":Q.isAndroid?window.location.href="https://play.google.com/store/apps/details?id=io.metamask":e("CREATE_METAMASK_WALLET")},children:[s($,{}),s($4,{children:s("h4",{children:"MetaMask"})}),s("div",{children:s("span",{children:"Set up"})})]}),L(j4,{onClick:()=>{Q.isIOS?window.location.href="https://apps.apple.com/us/app/coinbase-wallet-nfts-crypto/id1278383455":Q.isAndroid?window.location.href="https://play.google.com/store/apps/details?id=org.toshi":e("CREATE_COINBASE_WALLET")},children:[s(p1,{}),s($4,{children:s("h4",{children:"Coinbase Wallet"})}),s("div",{children:s("span",{children:"Set up"})})]})]})]})}),a==="CREATE_COINBASE_WALLET"&&L(q4,{children:[L(K4,{children:[s("h3",{children:"Create a wallet with Coinbase"}),s(X1,{style:{width:"152px",height:"152px"}})]}),L(o1,{children:[s(S,{children:"Open the camera on your phone"}),s(K,{}),s(S,{children:"Scan the QR code with your camera"}),s(K,{}),s(S,{children:"Click the link and download the app"})]}),s(Y4,{onClick:()=>i("LANDING"),children:"Done! I have my wallet"})]}),a==="CREATE_METAMASK_WALLET"&&L(q4,{children:[L(K4,{children:[s("h3",{children:"Create a wallet with Metamask"}),s($,{style:{width:"152px",height:"152px"}})]}),L(o1,{children:[s(S,{children:L("div",{children:[s("span",{children:"Install the "}),s("a",{href:r,target:"_blank",children:"MetaMask browser extension"})]})}),s(K,{}),s(S,{children:"Set up your first wallet"})]}),s(Y4,{onClick:()=>i("LANDING"),children:"Done! I have my wallet"})]})]}),L(l1,{children:[s("span",{children:"Still not sure? "}),s("a",{target:"_blank",href:"https://join.tell.ie/blog/explaining-web3-wallets",children:"Learn more"})]})]})},T5=H(_)`
507
507
  > svg {
508
508
  @media (max-width: 440px) {
509
509
  display: none;
@@ -528,7 +528,7 @@ Resources:
528
528
  flex-direction: column;
529
529
  width: 100%;
530
530
  gap: 8px;
531
- `,z4=H.button`
531
+ `,j4=H.button`
532
532
  display: flex;
533
533
  flex-direction: row;
534
534
  align-items: center;
@@ -607,14 +607,14 @@ Resources:
607
607
  color: var(--primary-color);
608
608
  background-color: #696efd1a;
609
609
  border-radius: var(--border-radius-sm);
610
- `;import{useEffect as N5}from"react";import Q4 from"styled-components";import{Fragment as U5,jsx as u1,jsxs as X4}from"react/jsx-runtime";var t3=()=>{let{user:a}=w(),{closePrivyModal:e}=g();return N5(()=>{var l;if((l=a==null?void 0:a.email)!=null&&l.address){let i=setTimeout(()=>{e()},J);return()=>clearTimeout(i)}},[a]),X4(U5,{children:[u1(x,{},"header"),X4(O5,{children:[u1(D5,{children:u1("h3",{children:"Connect your Email"})}),u1(B1,{}),u1(Y1,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),u1(j,{protectedByPrivy:!0})]})},O5=Q4(_)`
610
+ `;import{useEffect as N5}from"react";import Q4 from"styled-components";import{Fragment as U5,jsx as u1,jsxs as X4}from"react/jsx-runtime";var t3=()=>{let{user:a}=w(),{closePrivyModal:e}=g();return N5(()=>{var l;if((l=a==null?void 0:a.email)!=null&&l.address){let i=setTimeout(()=>{e()},J);return()=>clearTimeout(i)}},[a]),X4(U5,{children:[u1(x,{},"header"),X4(O5,{children:[u1(D5,{children:u1("h3",{children:"Connect your Email"})}),u1(B1,{}),u1(Y1,{onClick:()=>{e()},children:"I\u2019ll do this later"})]}),u1(z,{protectedByPrivy:!0})]})},O5=Q4(_)`
611
611
  gap: 12px;
612
612
  `,D5=Q4.div`
613
613
  font-weight: 500;
614
614
  font-size: 14px;
615
615
  line-height: 20px;
616
616
  color: 'var(--text-dark-gray)';
617
- `;import{useEffect as e3,useState as I2}from"react";import e2 from"styled-components";import{Fragment as G5,jsx as t1,jsxs as t2}from"react/jsx-runtime";var R2=2,a3={metamask:{name:"MetaMask",component:$},coinbase_wallet:{name:"Coinbase Wallet",component:p1},wallet_connect:{name:"WalletConnect",component:O1}},l3=()=>{var A1;let[a,e]=I2(!1),[l,i]=I2(void 0),{navigate:o,navigateBack:r}=f(),{getAuthMeta:C,closePrivyModal:p,loginWithWallet:c}=g(),[b,u]=I2(0),{user:M}=w();e3(()=>{i(void 0),c().then(()=>e(!0)).catch(T=>{console.error(T),(T==null?void 0:T.status)===422?i(h2.ERROR_USER_EXISTS):T instanceof c1&&!T.details.default?i(T.details):i(h2.ERROR_WALLET_CONNECTION)})},[b]),e3(()=>{var T;if((T=M==null?void 0:M.wallet)!=null&&T.address){e(!0);let v=setTimeout(()=>{var y;(y=M==null?void 0:M.email)!=null&&y.address?p():o("CONNECT_EMAIL_OPTIONAL")},J);return()=>clearTimeout(v)}},[M]);let Z=((A1=C())==null?void 0:A1.wallet)||"metamask",n=a3[Z].name,h=a3[Z].component,R=a?`Successfully connected with ${n}`:l?l.message:`Waiting for ${n}`,A="";if(a)A="You\u2019re good to go!";else if(b>=R2&&l)A="Unable to connect wallet";else if(l)A=l.detail;else switch(Z){case"wallet_connect":A="Open your mobile wallet app to continue";break;default:A="Don\u2019t see your wallet modal? Check your other browser windows."}return t2(G5,{children:[t1(p4,{backFn:r}),t2(F5,{children:[t1(H5,{children:t2("div",{children:[t1(g4,{success:a,fail:!!l}),t1(h,{style:{width:"38px",height:"38px"}})]})}),t2(V5,{children:[t1("h3",{children:R}),t1("p",{children:A})]}),a?null:t1(B5,{onClick:()=>{u(b+1),i(void 0)},visible:(l==null?void 0:l.retryable)&&b<R2,disabled:!((l==null?void 0:l.retryable)&&b<R2),children:"Retry"})]}),t1(j,{})]})},F5=e2.div`
617
+ `;import{useEffect as e3,useState as I2}from"react";import e2 from"styled-components";import{Fragment as G5,jsx as t1,jsxs as t2}from"react/jsx-runtime";var R2=2,a3={metamask:{name:"MetaMask",component:$},coinbase_wallet:{name:"Coinbase Wallet",component:p1},wallet_connect:{name:"WalletConnect",component:O1}},l3=()=>{var A1;let[a,e]=I2(!1),[l,i]=I2(void 0),{navigate:o,navigateBack:r}=f(),{getAuthMeta:C,closePrivyModal:p,loginWithWallet:c}=g(),[b,u]=I2(0),{user:M}=w();e3(()=>{i(void 0),c().then(()=>e(!0)).catch(T=>{console.error(T),(T==null?void 0:T.status)===422?i(h2.ERROR_USER_EXISTS):T instanceof c1&&!T.details.default?i(T.details):i(h2.ERROR_WALLET_CONNECTION)})},[b]),e3(()=>{var T;if((T=M==null?void 0:M.wallet)!=null&&T.address){e(!0);let v=setTimeout(()=>{var y;(y=M==null?void 0:M.email)!=null&&y.address?p():o("CONNECT_EMAIL_OPTIONAL")},J);return()=>clearTimeout(v)}},[M]);let Z=((A1=C())==null?void 0:A1.wallet)||"metamask",n=a3[Z].name,h=a3[Z].component,R=a?`Successfully connected with ${n}`:l?l.message:`Waiting for ${n}`,A="";if(a)A="You\u2019re good to go!";else if(b>=R2&&l)A="Unable to connect wallet";else if(l)A=l.detail;else switch(Z){case"wallet_connect":A="Open your mobile wallet app to continue";break;default:A="Don\u2019t see your wallet modal? Check your other browser windows."}return t2(G5,{children:[t1(p4,{backFn:r}),t2(F5,{children:[t1(H5,{children:t2("div",{children:[t1(g4,{success:a,fail:!!l}),t1(h,{style:{width:"38px",height:"38px"}})]})}),t2(V5,{children:[t1("h3",{children:R}),t1("p",{children:A})]}),a?null:t1(B5,{onClick:()=>{u(b+1),i(void 0)},visible:(l==null?void 0:l.retryable)&&b<R2,disabled:!((l==null?void 0:l.retryable)&&b<R2),children:"Retry"})]}),t1(z,{})]})},F5=e2.div`
618
618
  display: flex;
619
619
  flex-direction: column;
620
620
  align-items: center;
@@ -661,7 +661,7 @@ Resources:
661
661
  opacity: ${a=>a.visible?"1":"0"};
662
662
  transition: opacity 200ms;
663
663
  }
664
- `;import W2 from"styled-components";import{Fragment as q5,jsx as O,jsxs as m1}from"react/jsx-runtime";var i3=()=>{let{navigate:a}=f();return m1(q5,{children:[O(x,{},"header"),O(_,{children:m1(j5,{children:[m1(z5,{children:[O("h3",{children:"Create a wallet with Metamask"}),O($,{style:{width:"152px",height:"152px"}})]}),m1(o1,{children:[O(S,{children:m1("div",{children:[O("span",{children:"Install the "}),O("a",{href:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en",target:"_blank",children:"MetaMask browser extension"})]})}),O(K,{}),O(S,{children:"Set up your first wallet"})]}),O($5,{onClick:()=>a("LANDING"),children:"Done! I have my wallet"})]})}),m1(l1,{children:[O("span",{children:"Still not sure? "}),O("a",{target:"_blank",href:"https://join.tell.ie/blog/explaining-web3-wallets",children:"Learn more"})]})]})},j5=W2.div`
664
+ `;import W2 from"styled-components";import{Fragment as q5,jsx as O,jsxs as m1}from"react/jsx-runtime";var i3=()=>{let{navigate:a}=f();return m1(q5,{children:[O(x,{},"header"),O(_,{children:m1(z5,{children:[m1(j5,{children:[O("h3",{children:"Create a wallet with Metamask"}),O($,{style:{width:"152px",height:"152px"}})]}),m1(o1,{children:[O(S,{children:m1("div",{children:[O("span",{children:"Install the "}),O("a",{href:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en",target:"_blank",children:"MetaMask browser extension"})]})}),O(K,{}),O(S,{children:"Set up your first wallet"})]}),O($5,{onClick:()=>a("LANDING"),children:"Done! I have my wallet"})]})}),m1(l1,{children:[O("span",{children:"Still not sure? "}),O("a",{target:"_blank",href:"https://join.tell.ie/blog/explaining-web3-wallets",children:"Learn more"})]})]})},z5=W2.div`
665
665
  display: flex;
666
666
  flex-direction: column;
667
667
  align-items: center;
@@ -672,7 +672,7 @@ Resources:
672
672
  > :first-child > svg {
673
673
  margin-top: 20px;
674
674
  }
675
- `,z5=W2.div`
675
+ `,j5=W2.div`
676
676
  display: flex;
677
677
  flex-direction: column;
678
678
  align-items: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.5.0-beta.5",
3
+ "version": "1.5.0-beta.6",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",