@zerodev/wallet-react-ui 0.0.12 → 0.0.13

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.
Files changed (42) hide show
  1. package/dist/_types/auth/authStoreSlice.d.ts +31 -0
  2. package/dist/_types/auth/authStoreSlice.d.ts.map +1 -1
  3. package/dist/_types/auth/components/WalletSheet/index.d.ts.map +1 -1
  4. package/dist/_types/auth/hooks/useAuth.d.ts +5 -0
  5. package/dist/_types/auth/hooks/useAuth.d.ts.map +1 -1
  6. package/dist/_types/auth/index.d.ts.map +1 -1
  7. package/dist/_types/auth/pages/SignUp/InstalledWallets.d.ts.map +1 -1
  8. package/dist/_types/auth/pages/SignUp/MoreWallets.d.ts.map +1 -1
  9. package/dist/_types/auth/pages/SignUp/Wallet.d.ts.map +1 -1
  10. package/dist/_types/auth/pages/Verifying.d.ts.map +1 -1
  11. package/dist/_types/auth/pages/WalletConnecting.d.ts +11 -0
  12. package/dist/_types/auth/pages/WalletConnecting.d.ts.map +1 -0
  13. package/dist/_types/auth/types.d.ts +1 -1
  14. package/dist/_types/auth/types.d.ts.map +1 -1
  15. package/dist/_types/auth/utils/isCancellationError.d.ts +4 -0
  16. package/dist/_types/auth/utils/isCancellationError.d.ts.map +1 -1
  17. package/dist/_types/auth/utils/isResourceUnavailableError.d.ts +12 -0
  18. package/dist/_types/auth/utils/isResourceUnavailableError.d.ts.map +1 -0
  19. package/dist/_types/connector.d.ts.map +1 -1
  20. package/dist/index.cjs +2 -2
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.mjs +872 -723
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/styles.css +1 -1
  25. package/package.json +4 -4
  26. package/src/auth/authStoreSlice.ts +72 -3
  27. package/src/auth/components/WalletSheet/index.tsx +9 -18
  28. package/src/auth/hooks/useAuth.ts +7 -0
  29. package/src/auth/index.tsx +3 -0
  30. package/src/auth/pages/SignUp/InstalledWallets.tsx +18 -28
  31. package/src/auth/pages/SignUp/MoreWallets.tsx +14 -26
  32. package/src/auth/pages/SignUp/Wallet.tsx +11 -27
  33. package/src/auth/pages/Verifying.tsx +28 -8
  34. package/src/auth/pages/WalletConnecting.tsx +237 -0
  35. package/src/auth/types.ts +1 -0
  36. package/src/auth/utils/isCancellationError.ts +20 -1
  37. package/src/auth/utils/isResourceUnavailableError.ts +29 -0
  38. package/src/connector.ts +13 -4
  39. package/src/shared/components/StatusScreen/index.tsx +1 -1
  40. package/dist/_types/shared/components/TokenSummary/index.d.ts +0 -18
  41. package/dist/_types/shared/components/TokenSummary/index.d.ts.map +0 -1
  42. package/src/shared/components/TokenSummary/index.tsx +0 -50
@@ -1,5 +1,21 @@
1
1
  import type { StateCreator } from 'zustand';
2
2
  import type { AuthStep } from './types';
3
+ /**
4
+ * Why the connecting page stopped waiting. Not always a failure: a request the
5
+ * wallet still holds (EIP-1193 `-32002`) renders as waiting.
6
+ */
7
+ export type ConnectFailure = {
8
+ title: string;
9
+ message: string;
10
+ /** The wallet still has the request open; render as waiting. */
11
+ pending: boolean;
12
+ };
13
+ export type PendingWallet = {
14
+ /** wagmi connector uid, resolved via useConnectors. */
15
+ connectorUid: string;
16
+ name: string;
17
+ icon?: string | undefined;
18
+ };
3
19
  export interface AuthStoreSlice {
4
20
  auth: {
5
21
  step: AuthStep | null;
@@ -19,6 +35,21 @@ export interface AuthStoreSlice {
19
35
  }) => void;
20
36
  /** Clear the persisted OTP session after a successful verify. */
21
37
  clearOtpSession: () => void;
38
+ /**
39
+ * External wallet the `wallet-connecting` step is driving. That page owns
40
+ * the wagmi connect() call; the wallet button only records intent.
41
+ */
42
+ pendingWallet: PendingWallet | null;
43
+ /** Null while the page is still waiting on the wallet. */
44
+ connectError: ConnectFailure | null;
45
+ /** Record the wallet and move to `wallet-connecting`. */
46
+ startWalletConnection: (wallet: PendingWallet) => void;
47
+ setConnectError: (failure: ConnectFailure | null) => void;
48
+ /**
49
+ * Forget the pending wallet. Called on success and by reset(), not when
50
+ * the user leaves: the open request may still be approved later.
51
+ */
52
+ clearPendingWallet: () => void;
22
53
  /** Restore a persisted OTP session (survives reloads mid-email-flow). */
23
54
  initialize: () => void;
24
55
  goToStep: (step: AuthStep | null) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"authStoreSlice.d.ts","sourceRoot":"","sources":["../../../src/auth/authStoreSlice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AA2CvC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAEJ,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAA;QACrB,WAAW,EAAE,QAAQ,EAAE,CAAA;QACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;QACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;QACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;QACpB;;;WAGG;QACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAA;QACxC,sDAAsD;QACtD,aAAa,EAAE,CAAC,KAAK,EAAE;YACrB,KAAK,EAAE,MAAM,CAAA;YACb,yBAAyB,EAAE,MAAM,CAAA;SAClC,KAAK,IAAI,CAAA;QACV,iEAAiE;QACjE,eAAe,EAAE,MAAM,IAAI,CAAA;QAG3B,yEAAyE;QACzE,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAA;QACzC,MAAM,EAAE,MAAM,IAAI,CAAA;QAClB,KAAK,EAAE,MAAM,IAAI,CAAA;KAClB,CAAA;CACF;AAED,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAC7C,cAAc,EACd;CAAE,EACF;CAAE,EACF,cAAc,CA+Fd,CAAA"}
1
+ {"version":3,"file":"authStoreSlice.d.ts","sourceRoot":"","sources":["../../../src/auth/authStoreSlice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AA2CvC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QAEJ,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAA;QACrB,WAAW,EAAE,QAAQ,EAAE,CAAA;QACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;QACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;QACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;QACpB;;;WAGG;QACH,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAA;QACxC,sDAAsD;QACtD,aAAa,EAAE,CAAC,KAAK,EAAE;YACrB,KAAK,EAAE,MAAM,CAAA;YACb,yBAAyB,EAAE,MAAM,CAAA;SAClC,KAAK,IAAI,CAAA;QACV,iEAAiE;QACjE,eAAe,EAAE,MAAM,IAAI,CAAA;QAE3B;;;WAGG;QACH,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;QACnC,0DAA0D;QAC1D,YAAY,EAAE,cAAc,GAAG,IAAI,CAAA;QACnC,yDAAyD;QACzD,qBAAqB,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAA;QACtD,eAAe,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAA;QACzD;;;WAGG;QACH,kBAAkB,EAAE,MAAM,IAAI,CAAA;QAG9B,yEAAyE;QACzE,UAAU,EAAE,MAAM,IAAI,CAAA;QACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAA;QACzC,MAAM,EAAE,MAAM,IAAI,CAAA;QAClB,KAAK,EAAE,MAAM,IAAI,CAAA;KAClB,CAAA;CACF;AAED,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAC7C,cAAc,EACd;CAAE,EACF;CAAE,EACF,cAAc,CAkId,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/auth/components/WalletSheet/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAE/E,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAExE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,iEAAiE;IACjE,MAAM,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACrC;kBACc;IACd,OAAO,EAAE,oBAAoB,CAAA;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE,gBAAgB,+BAWlB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/auth/components/WalletSheet/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAiB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAExE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,iEAAiE;IACjE,MAAM,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACrC;kBACc;IACd,OAAO,EAAE,oBAAoB,CAAA;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE,gBAAgB,+BAWlB"}
@@ -3,6 +3,11 @@ export declare function useAuth(): {
3
3
  email: string | null;
4
4
  otpId: string | null;
5
5
  otpEncryptionTargetBundle: string | null;
6
+ pendingWallet: import("../authStoreSlice").PendingWallet | null;
7
+ connectError: import("../authStoreSlice").ConnectFailure | null;
8
+ startWalletConnection: (wallet: import("../authStoreSlice").PendingWallet) => void;
9
+ setConnectError: (failure: import("../authStoreSlice").ConnectFailure | null) => void;
10
+ clearPendingWallet: () => void;
6
11
  goToStep: (step: import("../types").AuthStep | null) => void;
7
12
  goBack: (() => void) | null;
8
13
  reset: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../../src/auth/hooks/useAuth.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO;;;;;;;;;;;;;;EAuBtB"}
1
+ {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../../src/auth/hooks/useAuth.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO;;;;;;;;;;;;;;;;;;;EA8BtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAA;AAuDjD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EAAE,WAAW,EACpB,IAAI,EACJ,YAAY,EACZ,IAAI,GACL,GAAE;IACD,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;IACrC;2EACuE;IACvE,YAAY,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,SAAS,CAAA;IAC5C;;wBAEoB;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CACxB,sCAqCL"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAA;AA0DjD,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EAAE,WAAW,EACpB,IAAI,EACJ,YAAY,EACZ,IAAI,GACL,GAAE;IACD,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAA;IACrC;2EACuE;IACvE,YAAY,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,SAAS,CAAA;IAC5C;;wBAEoB;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CACxB,sCAqCL"}
@@ -1 +1 @@
1
- {"version":3,"file":"InstalledWallets.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/InstalledWallets.tsx"],"names":[],"mappings":"AAOA;qEACqE;AACrE,wBAAgB,sBAAsB,CAAC,EACrC,gBAAqB,EACrB,UAAc,GACf,EAAE;IACD;iEAC6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B;;uBAEmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,+BA0EA"}
1
+ {"version":3,"file":"InstalledWallets.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/InstalledWallets.tsx"],"names":[],"mappings":"AAMA;qEACqE;AACrE,wBAAgB,sBAAsB,CAAC,EACrC,gBAAqB,EACrB,UAAc,GACf,EAAE;IACD;iEAC6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B;;uBAEmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,+BAiEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"MoreWallets.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/MoreWallets.tsx"],"names":[],"mappings":"AAcA,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,EAChC,KAAsB,GACvB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,+BAwHA"}
1
+ {"version":3,"file":"MoreWallets.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/MoreWallets.tsx"],"names":[],"mappings":"AAaA,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,EAChC,KAAsB,GACvB,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,+BA6GA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Wallet.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/Wallet.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAA;AAG1B;gFACgF;AAChF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,+BA8FhE"}
1
+ {"version":3,"file":"Wallet.d.ts","sourceRoot":"","sources":["../../../../../src/auth/pages/SignUp/Wallet.tsx"],"names":[],"mappings":"AAKA,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAA;AAG1B;gFACgF;AAChF,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,+BA+EhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"Verifying.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/Verifying.tsx"],"names":[],"mappings":"AAYA,wBAAgB,SAAS,gCAuFxB"}
1
+ {"version":3,"file":"Verifying.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/Verifying.tsx"],"names":[],"mappings":"AAYA,wBAAgB,SAAS,gCA2GxB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The `wallet-connecting` step: shown from picking an external wallet until it
3
+ * answers, which a locked or dismissed wallet never does — so leaving must
4
+ * always be possible.
5
+ *
6
+ * This page owns the connect() call, since React Query drops per-call
7
+ * callbacks when the sign-up page unmounts on the step change. The wallet
8
+ * button only records intent (`startWalletConnection`).
9
+ */
10
+ export declare function WalletConnecting(): import("react").JSX.Element;
11
+ //# sourceMappingURL=WalletConnecting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletConnecting.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/WalletConnecting.tsx"],"names":[],"mappings":"AAgFA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,gCAmJ/B"}
@@ -1,4 +1,4 @@
1
1
  export type AuthMethod = 'email' | 'google' | 'passkey' | 'external-wallet';
2
- export type AuthStep = 'sign-up' | 'email-verification' | 'otp-input' | 'verifying-otp' | 'passkey-prompt' | 'oauth-in-progress' | 'authenticated' | 'error';
2
+ export type AuthStep = 'sign-up' | 'email-verification' | 'otp-input' | 'verifying-otp' | 'passkey-prompt' | 'wallet-connecting' | 'oauth-in-progress' | 'authenticated' | 'error';
3
3
  export type EmailAuthMethod = 'magicLink' | 'otp';
4
4
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auth/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,iBAAiB,CAAA;AAE3E,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,oBAAoB,GACpB,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,OAAO,CAAA;AAEX,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,KAAK,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auth/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,iBAAiB,CAAA;AAE3E,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,oBAAoB,GACpB,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,GACf,OAAO,CAAA;AAEX,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,KAAK,CAAA"}
@@ -1,2 +1,6 @@
1
+ /**
2
+ * The user cancelled, rather than something failed: passkey prompt dismissed,
3
+ * OAuth popup closed, or a wallet connection request rejected.
4
+ */
1
5
  export declare function isCancellationError(err: unknown): boolean;
2
6
  //# sourceMappingURL=isCancellationError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isCancellationError.d.ts","sourceRoot":"","sources":["../../../../src/auth/utils/isCancellationError.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CASzD"}
1
+ {"version":3,"file":"isCancellationError.d.ts","sourceRoot":"","sources":["../../../../src/auth/utils/isCancellationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAkBzD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * EIP-1474 `-32002` "Resource unavailable". Injected wallets send it when a
3
+ * request for this origin is already open (popup closed without answering,
4
+ * then clicked again) and they will not prompt again until it is answered —
5
+ * wagmi's injected connector reads the code the same way ("prompt is already
6
+ * open").
7
+ *
8
+ * viem wraps it as `ResourceUnavailableRpcError`; wagmi's injected connector
9
+ * rethrows the raw JSON-RPC object. Accept both and walk `.cause`.
10
+ */
11
+ export declare function isResourceUnavailableError(err: unknown): boolean;
12
+ //# sourceMappingURL=isResourceUnavailableError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isResourceUnavailableError.d.ts","sourceRoot":"","sources":["../../../../src/auth/utils/isResourceUnavailableError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAYhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAgB9B;2CAC2C;AAC3C,MAAM,MAAM,yBAAyB,GAAG,4BAA4B,CAAA;AAuCpE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,yBAAyB,GAChC,iBAAiB,CAsGnB"}
1
+ {"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAgB9B;2CAC2C;AAC3C,MAAM,MAAM,yBAAyB,GAAG,4BAA4B,CAAA;AAuCpE,wBAAgB,aAAa,CAC3B,MAAM,EAAE,yBAAyB,GAChC,iBAAiB,CA+GnB"}
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("@zerodev/react-ui"),m=require("react"),L=require("zustand"),y=require("wagmi"),j=require("@zerodev/wallet-react"),l2=require("zustand/middleware"),c2=require("wagmi/connectors"),d2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/error.webp").href:new URL("error.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),u2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/loading.webp").href:new URL("loading.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),f2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/send.webp").href:new URL("send.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),p2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/success.webp").href:new URL("success.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),m2={error:d2,loading:u2,send:f2,success:p2};function k({imageName:e,title:n,children:i,className:s}){return t.jsxs("div",{className:a.cn("zd:flex zd:flex-col zd:gap-8 zd:items-center",s),children:[t.jsx("img",{src:m2[e],alt:e,className:"zd:w-[118px] zd:h-[118px] zd:bg-transparent"}),t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center zd:whitespace-pre-wrap",children:n}),t.jsx(a.Text,{className:"zd:text-center zd:whitespace-pre-wrap",children:i})]})]})}function h2(){const n=y.useConfig().connectors.find(i=>i.id==="zerodev-wallet");if(!n||!("getKitStore"in n))throw new Error("useKitStore must be used with the zeroDevWallet connector");return n.getKitStore()}function v(){const e=h2(),n=L.useStore(e,l=>l.auth.step),i=L.useStore(e,l=>l.auth.stepHistory),s=L.useStore(e,l=>l.auth.email),r=L.useStore(e,l=>l.auth.otpId),o=L.useStore(e,l=>l.auth.otpEncryptionTargetBundle);return{step:n,email:s,otpId:r,otpEncryptionTargetBundle:o,goToStep:e.getState().auth.goToStep,goBack:i.length>0?e.getState().auth.goBack:null,reset:e.getState().auth.reset,setEmail:e.getState().auth.setEmail,setOtpSession:e.getState().auth.setOtpSession,clearOtpSession:e.getState().auth.clearOtpSession}}function g2(){const{email:e,setOtpSession:n}=v(),{mutateAsync:i,isPending:s}=j.useSendMagicLink(),[r,o]=m.useState(60),l=r<=0&&!s;m.useEffect(()=>{if(r<=0)return;const u=setInterval(()=>{o(g=>Math.max(0,g-1))},1e3);return()=>{clearInterval(u)}},[r]);const c=async()=>{if(!(!e||!l))try{const{otpId:u,otpEncryptionTargetBundle:g}=await i({email:e});n({otpId:u,otpEncryptionTargetBundle:g}),o(60)}catch{}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center",children:[t.jsxs(k,{imageName:"send",title:`Check your email!
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("@zerodev/react-ui"),h=require("react"),k=require("zustand"),j=require("wagmi"),v=require("@zerodev/wallet-react"),ue=require("@wagmi/core"),fe=require("zustand/middleware"),pe=require("wagmi/connectors"),me=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/error.webp").href:new URL("error.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),he=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/loading.webp").href:new URL("loading.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),ge=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/send.webp").href:new URL("send.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),xe=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/success.webp").href:new URL("success.webp",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),ze={error:me,loading:he,send:ge,success:xe};function b({imageName:e,title:n,children:r,className:s}){return t.jsxs("div",{className:a.cn("zd:flex zd:flex-col zd:gap-8 zd:items-center",s),children:[t.jsx("img",{src:ze[e],alt:e,className:"zd:w-[118px] zd:h-[118px] zd:object-contain zd:bg-transparent"}),t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center zd:whitespace-pre-wrap",children:n}),t.jsx(a.Text,{className:"zd:text-center zd:whitespace-pre-wrap",children:r})]})]})}function ee(){const n=j.useConfig().connectors.find(r=>r.id==="zerodev-wallet");if(!n||!("getKitStore"in n))throw new Error("useKitStore must be used with the zeroDevWallet connector");return n.getKitStore()}function F(){const e=ee(),n=k.useStore(e,c=>c.auth.step),r=k.useStore(e,c=>c.auth.stepHistory),s=k.useStore(e,c=>c.auth.email),i=k.useStore(e,c=>c.auth.otpId),o=k.useStore(e,c=>c.auth.otpEncryptionTargetBundle),d=k.useStore(e,c=>c.auth.pendingWallet),l=k.useStore(e,c=>c.auth.connectError);return{step:n,email:s,otpId:i,otpEncryptionTargetBundle:o,pendingWallet:d,connectError:l,startWalletConnection:e.getState().auth.startWalletConnection,setConnectError:e.getState().auth.setConnectError,clearPendingWallet:e.getState().auth.clearPendingWallet,goToStep:e.getState().auth.goToStep,goBack:r.length>0?e.getState().auth.goBack:null,reset:e.getState().auth.reset,setEmail:e.getState().auth.setEmail,setOtpSession:e.getState().auth.setOtpSession,clearOtpSession:e.getState().auth.clearOtpSession}}function Ce(){const{email:e,setOtpSession:n}=F(),{mutateAsync:r,isPending:s}=v.useSendMagicLink(),[i,o]=h.useState(60),d=i<=0&&!s;h.useEffect(()=>{if(i<=0)return;const c=setInterval(()=>{o(u=>Math.max(0,u-1))},1e3);return()=>{clearInterval(c)}},[i]);const l=async()=>{if(!(!e||!d))try{const{otpId:c,otpEncryptionTargetBundle:u}=await r({email:e});n({otpId:c,otpEncryptionTargetBundle:u}),o(60)}catch{}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center",children:[t.jsxs(b,{imageName:"send",title:`Check your email!
2
2
  An Email is On Its Way`,children:["We've sent a magic link to"," ",t.jsx(a.Text,{as:"span",className:"zd:text-solarOrange",children:e}),`
3
- `,"Please open the email and click the link to log in."]}),t.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:t.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",t.jsx("button",{type:"button",disabled:!l,onClick:c,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:l?"Resend":`Resend in ${r} ${r===1?"second":"seconds"}`})]})})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function x2(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("code")}function R(){if(typeof window>"u")return;const e=new URL(window.location.href);e.searchParams.has("code")&&(e.searchParams.delete("code"),window.history.replaceState(null,"",e.toString()))}function z2({title:e="Oops, something went wrong",message:n="We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",showRetry:i=!1,showChooseAnother:s=!0}){const{goToStep:r,goBack:o,reset:l}=v(),c=o??(()=>r("sign-up"));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[t.jsx(k,{imageName:"error",title:e,children:n}),t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-1",children:[i&&t.jsx(a.Button,{action:"primary",text:"Try again",onClick:c}),s&&t.jsx(a.Button,{action:i?"secondary":"primary",onClick:()=>{R(),r("sign-up")},text:"Choose another sign-in method"}),!i&&!s&&t.jsx(a.Button,{action:"primary",text:"Start over",onClick:l})]})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}const C2=4,D2=8,w2=6;function E2(e){return Math.max(C2,Math.min(D2,e))}function F2({char:e,isFocused:n}){return t.jsx(a.Wrapper,{"data-testid":"code-input-box","data-active":n||void 0,className:a.cn("zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",n&&"zd:border-[1.5px] zd:border-greyScale"),children:t.jsx(a.Text,{className:"zd:text-h2",children:e})})}function S2({onChange:e,onComplete:n,disabled:i=!1,error:s=!1,autoFocus:r=!1,length:o=w2,"data-testid":l}){const c=E2(o),u=m.useMemo(()=>Array.from({length:c},(f,D)=>({id:`char-${D}`,index:D})),[c]),[g,z]=m.useState(""),[E,p]=m.useState(!1),d=m.useRef(null);m.useEffect(()=>{var f;r&&!i&&((f=d.current)==null||f.focus())},[r,i]),m.useEffect(()=>{z(f=>f.slice(0,c))},[c]);const C=f=>{const D=f.slice(0,c).toUpperCase();z(D),e==null||e(D),D.length===c&&setTimeout(()=>{var w;n==null||n(D),(w=d.current)==null||w.blur()},0)};return t.jsxs("button",{type:"button",className:"zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",onClick:()=>{var f;return(f=d.current)==null?void 0:f.focus()},disabled:i,"data-testid":l,children:[t.jsx("input",{ref:d,value:g,onChange:f=>C(f.target.value),onFocus:()=>p(!0),onBlur:()=>p(!1),maxLength:c,disabled:i,className:"zd:absolute zd:opacity-0 zd:pointer-events-none",style:{position:"absolute",opacity:0},"aria-label":"Verification code"}),u.map(f=>t.jsx(F2,{char:g[f.index]??"",isFocused:!s&&E&&f.index===g.length},f.id))]})}function y2(){const{email:e,otpId:n,otpEncryptionTargetBundle:i,setOtpSession:s,clearOtpSession:r,goToStep:o}=v(),{mutateAsync:l,isPending:c}=j.useSendOTP(),{mutateAsync:u,isPending:g}=j.useVerifyOTP(),[z,E]=m.useState(""),[p,d]=m.useState(!1),[C,f]=m.useState(60);m.useEffect(()=>{if(C<=0)return;const S=setInterval(()=>{f(F=>Math.max(0,F-1))},1e3);return()=>clearInterval(S)},[C]);const D=async()=>{if(!(!z.trim()||!n||!i)){d(!1);try{await u({otpId:n,code:z.trim(),otpEncryptionTargetBundle:i}),r(),o("authenticated")}catch{d(!0)}}},w=S=>{E(S)},h=async()=>{if(!(!e||C>0||c))try{const{otpId:S,otpEncryptionTargetBundle:F}=await l({email:e});s({otpId:S,otpEncryptionTargetBundle:F}),f(60),d(!1)}catch{d(!0)}},x=C<=0&&!c;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center",children:[t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Enter verification code"}),t.jsxs(a.Text,{className:"zd:text-center",children:["Enter the code from the email we sent to"," ",t.jsx(a.Text,{className:"zd:text-solarOrange",children:e})]})]}),t.jsx(S2,{onComplete:w,onChange:()=>d(!1),disabled:g,error:p,autoFocus:!0}),t.jsx(a.Button,{text:"Confirm code",onClick:D,disabled:!z.trim()||g}),t.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:t.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",t.jsx("button",{type:"button",disabled:!x,onClick:h,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:x?"Resend":`Resend in ${C} ${C===1?"second":"seconds"}`})]})})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function v2({termsAndConditionsUrl:e,privacyPolicyUrl:n,agreedToTerms:i,setAgreedToTerms:s,highlight:r=!1}){const o=!!(e||n);return t.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-5",children:[o&&t.jsxs("div",{className:`zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${r?"zd:border zd:border-negative":"zd:border zd:border-transparent"}`,children:[t.jsx("input",{type:"checkbox",checked:i,onChange:l=>s(l.target.checked),className:"zd:cursor-pointer zd:[color-scheme:light]"}),t.jsxs(a.Text,{className:"zd:flex-1",children:["I agree to the"," ",e&&t.jsx(a.Text,{as:"a",href:e,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Terms & Conditions"}),e&&n&&" and ",n&&t.jsx(a.Text,{as:"a",href:n,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Privacy Policy"})]})]}),t.jsx(a.PoweredBy,{})]})}const j2=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/blob.webm").href:new URL("blob.webm",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href);function b2({className:e}){return t.jsx("video",{className:e,style:{aspectRatio:"1 / 1"},src:j2,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1})}const A2="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='24'%20height='24'%20fill='url(%23pattern0_19361_9946)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_19361_9946'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_19361_9946'%20transform='scale(0.0136986)'/%3e%3c/pattern%3e%3cimage%20id='image0_19361_9946'%20width='73'%20height='73'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,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'/%3e%3c/defs%3e%3c/svg%3e",W=A2;function B(e){return e instanceof Error?e.name==="AbortError"||e.name==="NotAllowedError"||e.name==="UserRejectedRequestError"?!0:e.message.toLowerCase().includes("oauth popup was closed"):!1}function Z(e,n){return n.rdns&&e.id===n.rdns?!0:!!n.rdns&&e.type==="injected"&&e.id!=="injected"&&e.id!=="zerodev-wallet"&&e.name===n.name}function T(e,n){return Z(e,n)?!0:!!n.rdns&&(Array.isArray(e.rdns)?e.rdns.includes(n.rdns):e.rdns===n.rdns)}const N2=[{id:"metamask",name:"MetaMask",rdns:"io.metamask",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m24.024%2023.824-4.846-1.434-3.655%202.172-2.55-.001-3.656-2.171-4.844%201.434L3%2018.88l1.473-5.488L3%208.751%204.473%203l7.569%204.496h4.413L24.024%203l1.473%205.751-1.473%204.64%201.473%205.488z%22%2F%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m4.474%203%207.57%204.499-.302%203.087zm4.844%2015.881%203.33%202.522-3.33.987zm3.064-4.17-.64-4.123-4.097%202.804h-.002v.001l.013%202.886%201.661-1.567zM24.024%203l-7.57%204.499.3%203.087zM19.18%2018.881l-3.33%202.522%203.33.987zm1.674-5.488v-.002zl-4.097-2.804-.64%204.124h3.064l1.662%201.567z%22%2F%3E%3Cpath%20fill%3D%22%23e34807%22%20d%3D%22m9.317%2022.39-4.844%201.434L3%2018.881h6.317zm3.064-7.68.925%205.962-1.282-3.315-4.37-1.078%201.662-1.568zm6.799%207.68%204.844%201.434%201.473-4.943H19.18zm-3.064-7.68-.925%205.962%201.282-3.315%204.37-1.078-1.663-1.568z%22%2F%3E%3Cpath%20fill%3D%22%23ff8d5d%22%20d%3D%22m3%2018.88%201.473-5.489h3.169l.012%202.887%204.37%201.078%201.282%203.314-.659.73-3.33-2.522H3zm22.497%200-1.473-5.489h-3.17l-.01%202.887-4.371%201.078-1.282%203.314.659.73%203.33-2.522h6.317zM16.455%207.495h-4.413l-.3%203.087%201.565%2010.084h1.884l1.565-10.084z%22%2F%3E%3Cpath%20fill%3D%22%23661800%22%20d%3D%22M4.473%203%203%208.751l1.473%204.64h3.169l4.1-2.805zm6.992%2012.908H10.03l-.781.761%202.776.685-.56-1.447M24.024%203l1.473%205.751-1.473%204.64h-3.17l-4.098-2.805zm-6.99%2012.908h1.437l.782.762-2.78.686.56-1.45zm-1.512%206.687.328-1.193-.66-.73h-1.885l-.659.73.327%201.192%22%2F%3E%3Cpath%20fill%3D%22%23c0c4cd%22%20d%3D%22M15.522%2022.594v1.969h-2.548v-1.969z%22%2F%3E%3Cpath%20fill%3D%22%23e7ebf6%22%20d%3D%22m9.318%2022.388%203.658%202.174v-1.969l-.328-1.192zm9.862%200-3.658%202.174v-1.969l.328-1.192z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M3%203h22.5v21.563H3z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"https://metamask.app.link/wc?uri=",downloadUrl:"https://metamask.io/download"},{id:"trust",name:"Trust Wallet",rdns:"com.trustwallet.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%230500FF%22%20d%3D%22M6%207.583%2013.53%205v17.882C8.15%2020.498%206%2015.928%206%2013.345V7.583Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M22%207.583%2013.53%205v17.882c6.05-2.384%208.47-6.954%208.47-9.537V7.583Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2219.768%22%20x2%3D%2214.072%22%20y1%3D%223.753%22%20y2%3D%2222.853%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.02%22%20stop-color%3D%22%2300F%22%2F%3E%3Cstop%20offset%3D%22.08%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.16%22%20stop-color%3D%22%2348FF91%22%2F%3E%3Cstop%20offset%3D%22.42%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.68%22%20stop-color%3D%22%230038FF%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%230500FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"trust://wc?uri=",downloadUrl:"https://trustwallet.com/download"},{id:"coinbase",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",icon:"data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22%232C5FF6%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%2023.8C19.4124%2023.8%2023.8%2019.4124%2023.8%2014C23.8%208.58761%2019.4124%204.2%2014%204.2C8.58761%204.2%204.2%208.58761%204.2%2014C4.2%2019.4124%208.58761%2023.8%2014%2023.8ZM11.55%2010.8C11.1358%2010.8%2010.8%2011.1358%2010.8%2011.55V16.45C10.8%2016.8642%2011.1358%2017.2%2011.55%2017.2H16.45C16.8642%2017.2%2017.2%2016.8642%2017.2%2016.45V11.55C17.2%2011.1358%2016.8642%2010.8%2016.45%2010.8H11.55Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E",downloadUrl:"https://coinbase.com/wallet/downloads"},{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",icon:"data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%22120%22%20height%3D%22120%22%20fill%3D%22url(%23paint0_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2038H26C56.9279%2038%2082%2063.0721%2082%2094V100H94C97.3137%20100%20100%2097.3137%20100%2094C100%2053.1309%2066.8691%2020%2026%2020C22.6863%2020%2020%2022.6863%2020%2026V38Z%22%20fill%3D%22url(%23paint1_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M84%2094H100C100%2097.3137%2097.3137%20100%2094%20100H84V94Z%22%20fill%3D%22url(%23paint2_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2020L26%2036H20L20%2026C20%2022.6863%2022.6863%2020%2026%2020Z%22%20fill%3D%22url(%23paint3_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2036H26C58.0325%2036%2084%2061.9675%2084%2094V100H66V94C66%2071.9086%2048.0914%2054%2026%2054H20V36Z%22%20fill%3D%22url(%23paint4_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M68%2094H84V100H68V94Z%22%20fill%3D%22url(%23paint5_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2052L20%2036L26%2036L26%2052H20Z%22%20fill%3D%22url(%23paint6_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2062C20%2065.3137%2022.6863%2068%2026%2068C40.3594%2068%2052%2079.6406%2052%2094C52%2097.3137%2054.6863%20100%2058%20100H68V94C68%2070.804%2049.196%2052%2026%2052H20V62Z%22%20fill%3D%22url(%23paint7_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M52%2094H68V100H58C54.6863%20100%2052%2097.3137%2052%2094Z%22%20fill%3D%22url(%23paint8_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2068C22.6863%2068%2020%2065.3137%2020%2062L20%2052L26%2052L26%2068Z%22%20fill%3D%22url(%23paint9_radial_62_329)%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_62_329%22%20x1%3D%2260%22%20y1%3D%220%22%20x2%3D%2260%22%20y2%3D%22120%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint1_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(74)%22%3E%0A%3Cstop%20offset%3D%220.770277%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_62_329%22%20x1%3D%2283%22%20y1%3D%2297%22%20x2%3D%22100%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2220%22%20x2%3D%2223%22%20y2%3D%2237%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint4_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(58)%22%3E%0A%3Cstop%20offset%3D%220.723929%22%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_62_329%22%20x1%3D%2268%22%20y1%3D%2297%22%20x2%3D%2284%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2252%22%20x2%3D%2223%22%20y2%3D%2236%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint7_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(42)%22%3E%0A%3Cstop%20offset%3D%220.59513%22%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint8_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(51%2097)%20scale(17%2045.3333)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint9_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(23%2069)%20rotate(-90)%20scale(17%20322.37)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E",mobileLink:"rainbow://wc?uri=",downloadUrl:"https://rainbow.download"},{id:"rabby",name:"Rabby Wallet",rdns:"io.rabby",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%238697FF%22%20d%3D%22M28%200H0v28h28V0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M22.54%2015.078c.677-1.514-2.673-5.744-5.874-7.506-2.017-1.365-4.12-1.178-4.545-.579-.935%201.316%203.094%202.43%205.788%203.731-.58.252-1.125.703-1.446%201.28-1.004-1.096-3.209-2.04-5.796-1.28-1.743.513-3.191%201.721-3.751%203.546a1.097%201.097%200%201%200-.445%202.1c.112%200%20.463-.075.463-.075l5.612.041c-2.244%203.56-4.018%204.081-4.018%204.698s1.697.45%202.335.22c3.05-1.1%206.327-4.531%206.89-5.519%202.36.295%204.345.33%204.786-.657Z%22%2F%3E%3Cpath%20fill%3D%22url(%23c)%22%20fill-rule%3D%22evenodd%22%20d%3D%22m17.885%2010.713.025.01c.125-.049.105-.233.07-.378-.078-.333-1.438-1.676-2.715-2.277-1.743-.82-3.025-.777-3.212-.398.356.726%201.998%201.408%203.714%202.12.723.3%201.46.606%202.118.923Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-rule%3D%22evenodd%22%20d%3D%22M15.701%2018.036a10.296%2010.296%200%200%200-1.2-.37c.482-.862.583-2.138.128-2.945-.639-1.133-1.44-1.736-3.304-1.736-1.024%200-3.783.346-3.832%202.648-.005.242%200%20.464.017.667l5.036.037a17.264%2017.264%200%200%201-1.871%202.483c.669.172%201.221.316%201.728.448.48.125.92.24%201.38.357a21.003%2021.003%200%200%200%201.918-1.59Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23e)%22%20d%3D%22M6.848%2016.063c.206%201.75%201.2%202.435%203.232%202.638%202.032.203%203.197.067%204.749.208%201.296.118%202.453.778%202.882.55.386-.205.17-.947-.347-1.423-.67-.617-1.597-1.046-3.229-1.199.325-.89.234-2.138-.27-2.817-.731-.982-2.079-1.426-3.785-1.232-1.782.202-3.49%201.08-3.232%203.275Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2210.464%22%20x2%3D%2222.394%22%20y1%3D%2213.737%22%20y2%3D%2217.12%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22c%22%20x1%3D%2220.386%22%20x2%3D%2211.779%22%20y1%3D%2213.509%22%20y2%3D%224.879%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237258DC%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23797DEA%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%2215.94%22%20x2%3D%227.673%22%20y1%3D%2218.337%22%20y2%3D%2213.584%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237461EA%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23BFC2FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22e%22%20x1%3D%2211.177%22%20x2%3D%2216.765%22%20y1%3D%2213.648%22%20y2%3D%2220.749%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.984%22%20stop-color%3D%22%23D5CEFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"rabby://wc?uri=",downloadUrl:"https://rabby.io"},{id:"okx",name:"OKX Wallet",rdns:"com.okex.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10.819%205.556H5.93a.376.376%200%200%200-.375.375v4.888c0%20.207.168.375.375.375h4.888a.376.376%200%200%200%20.375-.376V5.932a.376.376%200%200%200-.376-.375Zm5.64%205.638h-4.886a.376.376%200%200%200-.376.376v4.887c0%20.208.168.376.376.376h4.887a.376.376%200%200%200%20.376-.375V11.57a.376.376%200%200%200-.376-.377Zm.75-5.638h4.887c.208%200%20.376.168.376.375v4.888a.376.376%200%200%201-.376.375H17.21a.376.376%200%200%201-.376-.376V5.933c0-.208.169-.376.376-.376Zm-6.39%2011.277H5.93a.376.376%200%200%200-.375.376v4.887c0%20.208.168.376.375.376h4.888a.376.376%200%200%200%20.375-.376V17.21a.376.376%200%200%200-.376-.376Zm6.39%200h4.887c.208%200%20.376.169.376.376v4.887a.376.376%200%200%201-.376.376H17.21a.376.376%200%200%201-.376-.376V17.21c0-.207.169-.376.376-.376Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"okex://main/wc?uri=",downloadUrl:"https://okx.com/download"},{id:"zerion",name:"Zerion",rdns:"io.zerion.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%232962EF%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6.073%207c-.48%200-.665.593-.262.841l10.073%206.074a.577.577%200%200%200%20.758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904%2021c.48%200%20.67-.596.267-.844l-10.075-6.073a.569.569%200%200%200-.751.146l-4.437%205.813c-.301.404.012.958.534.958h14.462Z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"zerion://wc?uri=",downloadUrl:"https://zerion.io"},{id:"uniswap",name:"Uniswap",rdns:"org.uniswap.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23FFD8EA%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20fill%3D%22%23FF007A%22%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20d%3D%22M9.635%206.068c-.255-.039-.266-.043-.145-.06.23-.035.773.012%201.148.099.874.202%201.67.722%202.519%201.646l.225.246.323-.051c1.36-.213%202.741-.044%203.899.477.319.144.821.43.882.503.022.024.058.173.082.335.086.557.044.982-.13%201.301-.096.173-.101.228-.037.377a.367.367%200%200%200%20.334.206c.287%200%20.597-.454.74-1.086l.056-.252.113.126c.62.685%201.106%201.618%201.189%202.282l.021.174-.103-.158a1.966%201.966%200%200%200-.59-.604c-.415-.268-.855-.36-2.017-.42-1.05-.053-1.645-.141-2.234-.329-1.003-.32-1.508-.744-2.699-2.27-.53-.678-.855-1.053-1.18-1.354-.74-.687-1.466-1.047-2.396-1.187v-.001Z%22%2F%3E%3Cpath%20d%3D%22M18.725%207.581c.026-.453.088-.753.216-1.026.028-.07.063-.136.104-.198a.69.69%200%200%201-.049.178c-.092.266-.108.629-.043%201.052.081.536.126.613.706%201.192.273.272.589.613.704.761l.21.267-.21-.191c-.255-.233-.841-.69-.972-.755-.086-.042-.1-.042-.153.01-.05.048-.06.12-.068.461-.01.532-.084.873-.263%201.213-.096.187-.111.147-.025-.062.066-.155.072-.224.072-.739%200-1.033-.127-1.283-.864-1.707a8.169%208.169%200%200%200-.684-.346%202.614%202.614%200%200%201-.334-.16c.02-.02.74.185%201.029.293.431.163.502.183.555.164.034-.013.051-.113.068-.407h.001Zm-8.595%201.77c-.517-.696-.838-1.764-.768-2.563l.02-.247.119.02c.222.04.603.179.783.286.49.29.703.673.918%201.657.064.288.147.613.185.725.061.178.294.592.483.862.136.194.046.286-.255.26-.46-.04-1.083-.46-1.485-1Zm7.965%205.182c-2.42-.95-3.273-1.777-3.273-3.17%200-.206.007-.374.016-.374.008%200%20.102.067.208.151.491.384%201.04.548%202.563.765.896.128%201.398.231%201.864.382%201.48.478%202.392%201.449%202.61%202.773.063.384.028%201.104-.076%201.484-.082.3-.329.84-.394.861-.019.007-.037-.061-.04-.154-.025-.496-.283-.98-.715-1.343-.49-.412-1.15-.741-2.763-1.375Zm-1.699.396a4.13%204.13%200%200%200-.117-.5l-.062-.18.115.127c.16.173.285.396.391.693.082.227.09.294.09.662%200%20.361-.011.437-.087.64-.104.3-.28.572-.51.794-.443.44-1.011.683-1.833.784-.142.018-.557.047-.922.066-.922.046-1.529.144-2.073.33a.446.446%200%200%201-.156.036c-.021-.021.35-.237.656-.381.431-.204.861-.315%201.825-.47.475-.078.968-.173%201.093-.21%201.178-.352%201.784-1.263%201.59-2.39Z%22%2F%3E%3Cpath%20d%3D%22M17.506%2016.855c-.321-.675-.396-1.327-.22-1.935.02-.067.05-.119.068-.119a.64.64%200%200%201%20.169.09c.149.097.445.261%201.237.682.988.527%201.553.934%201.936%201.4.335.407.542.872.643%201.438.057.32.023%201.093-.061%201.416-.266%201.018-.882%201.818-1.764%202.285a2.129%202.129%200%200%201-.258.124c-.013%200%20.035-.116.104-.259.297-.605.331-1.193.107-1.848-.138-.401-.418-.89-.982-1.718-.657-.96-.817-1.218-.979-1.556Zm-9.095%203.644c.9-.742%202.016-1.267%203.036-1.43a4.85%204.85%200%200%201%201.575.06c.652.163%201.235.528%201.538.962.296.425.423.794.556%201.618.052.324.109.651.125.724.1.427.293.768.532.939.38.272%201.037.29%201.682.044a.853.853%200%200%201%20.21-.064c.023.023-.301.235-.53.347-.27.141-.572.213-.879.208-.59%200-1.08-.294-1.49-.891a7.027%207.027%200%200%201-.402-.784c-.431-.961-.644-1.253-1.145-1.575-.437-.28-1-.329-1.424-.126-.556.266-.71.96-.312%201.4.187.189.43.313.695.354a.75.75%200%200%200%20.589-.174.728.728%200%200%200%20.251-.551c0-.29-.114-.453-.4-.581-.392-.172-.812.029-.81.388%200%20.153.069.249.226.32.1.044.103.046.02.03-.358-.073-.442-.496-.154-.776.347-.336%201.064-.188%201.31.272.103.194.115.578.025.81-.203.52-.79.793-1.387.644-.407-.102-.571-.211-1.06-.703-.852-.856-1.182-1.023-2.408-1.21l-.237-.035.268-.22Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M4.418%205.179c2.842%203.368%204.8%204.757%205.017%205.05.18.243.112.462-.195.632a1.899%201.899%200%200%201-.699.191c-.2%200-.269-.075-.269-.075-.115-.106-.18-.088-.773-1.116A176.911%20176.911%200%200%200%205.968%207.56c-.044-.04-.042-.04%201.448%202.564.24.543.047.741.047.819%200%20.157-.044.24-.242.457-.332.36-.48.765-.587%201.604-.12.94-.456%201.604-1.39%202.741-.545.666-.635.787-.773%201.056-.174.338-.221.527-.24.952a2.9%202.9%200%200%200%20.16%201.174c.122.378.252.626.582%201.125.285.43.448.75.448.876%200%20.099.019.099.461.001%201.054-.232%201.91-.64%202.392-1.142.298-.311.367-.482.37-.907.002-.277-.008-.336-.085-.496-.125-.26-.353-.477-.855-.813-.66-.44-.942-.794-1.018-1.28-.065-.4.01-.682.373-1.427.377-.773.47-1.103.535-1.88.04-.503.096-.701.244-.861.155-.166.293-.222.676-.272.623-.084%201.018-.24%201.343-.534a1.14%201.14%200%200%200%20.421-.869l.014-.28-.16-.179C9.563%209.34%204.036%204.667%204%204.667c-.007%200%20.18.23.418.512Zm1.325%2013.086a.486.486%200%200%200-.157-.652c-.203-.133-.522-.069-.522.103%200%20.053.03.092.098.125.114.058.122.122.032.254s-.082.248.02.328c.168.126.404.057.529-.158ZM10.683%2012c-.29.086-.575.389-.664.706-.053.194-.022.534.058.638.13.169.255.213.596.212.665-.004%201.243-.283%201.311-.632.054-.286-.2-.68-.55-.855a1.33%201.33%200%200%200-.75-.07Zm.78.593c.102-.143.057-.296-.118-.4-.331-.199-.835-.035-.835.272%200%20.153.262.32.502.32.16%200%20.38-.093.45-.192Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M4%204h19v20H4z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"uniswap://wc?uri=",downloadUrl:"https://wallet.uniswap.org"},{id:"ledger",name:"Ledger",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M11.65%204.4H4.4V9h1.1V5.5l6.15-.04V4.4Zm.05%205.95v7.25h4.6v-1.1h-3.5l-.04-6.15H11.7ZM4.4%2023.6h7.25v-1.06L5.5%2022.5V19H4.4v4.6ZM16.35%204.4h7.25V9h-1.1V5.5l-6.15-.04V4.4Zm7.25%2019.2h-7.25v-1.06l6.15-.04V19h1.1v4.6Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"ledgerlive://wc?uri=",downloadUrl:"https://www.ledger.com/ledger-live"},{id:"binance",name:"Binance Wallet",rdns:"com.binance.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22130%22%20height%3D%22130%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h130v130H0z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22M45.587%2057.02%2065.01%2037.606l19.43%2019.43%2011.295-11.303L65.01%2015%2034.284%2045.725zM15%2065.004l11.299-11.299%2011.298%2011.299L26.3%2076.302zM45.587%2072.983%2065.01%2092.406l19.43-19.43%2011.303%2011.287-.008.007-30.725%2030.734-30.725-30.718-.016-.016zM92.403%2065.006%20103.7%2053.708%20115%2065.006l-11.299%2011.299z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22m76.471%2064.998-11.46-11.469-8.476%208.475-.98.972-2.005%202.006-.016.016.016.024%2011.46%2011.453%2011.461-11.47.008-.007z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"bnc://app.binance.com/cedefi/wc?uri=",downloadUrl:"https://www.binance.com/en/download"}],b=N2;function k2({open:e,onOpenChange:n,wallet:i,pairing:s}){return t.jsx(a.BottomSheet,{open:e,onOpenChange:n,children:t.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[t.jsx(a.BottomSheetTitle,{children:i?`Connect ${i.name}`:"WalletConnect"}),t.jsx(T2,{wallet:i,pairing:s})]})})}function T2({wallet:e,pairing:n}){const{goToStep:i}=v(),{uri:s,error:r,retry:o}=n,l=y.useConnectors(),{connect:c}=y.useConnect(),u=e?l.find(x=>T(x,e)):void 0,[g,z]=m.useState(u?"browser":"mobile"),[E,p]=m.useState(null),[d,C]=m.useState(!1),f=s&&(e!=null&&e.mobileLink)?`${e.mobileLink}${encodeURIComponent(s)}`:s,D=async()=>{if(s)try{await navigator.clipboard.writeText(s),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},w=()=>{u&&(p(null),c({connector:u},{onSuccess:()=>i(null),onError:x=>{B(x)||p(x instanceof Error?x.message:String(x))}}))},h=r??E;return t.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-3",children:[t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:gap-2",children:[t.jsx("img",{src:e?e.icon:W,alt:"",className:"zd:w-8 zd:h-8 zd:rounded-xl"}),t.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:e?e.name:"WalletConnect"}),t.jsx(a.BottomSheetClose,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),e&&t.jsx("div",{className:"zd:flex zd:w-full zd:gap-2",children:["mobile","browser"].map(x=>t.jsx("button",{type:"button",onClick:()=>z(x),className:`zd:flex-1 zd:rounded-2xl zd:py-1.5 zd:text-body3 zd:cursor-pointer ${g===x?"zd:bg-greyScale/10 zd:font-semibold":"zd:text-greyScale/60"}`,children:x==="mobile"?"Mobile":"Browser"},x))}),!e||g==="mobile"?h?t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-2 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:h}),t.jsx(a.Button,{action:"secondary",text:"Try again",onClick:o})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"zd:bg-white zd:rounded-2xl zd:p-2 zd:border zd:border-greyScale/10",children:f?t.jsx(a.QrCode,{value:f,size:176}):t.jsx("div",{className:"zd:w-[176px] zd:h-[176px] zd:flex zd:items-center zd:justify-center",children:t.jsx("div",{className:"zd:w-8 zd:h-8 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})})}),f&&(e==null?void 0:e.mobileLink)&&t.jsxs("a",{href:f,className:"zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Open in ",e.name]}),t.jsx(a.Button,{action:"secondary",text:d?"Copied":"Copy link",onClick:D,disabled:!f})]}):h?t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-2 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:h}),t.jsx(a.Button,{action:"secondary",text:"Try again",onClick:u?w:o})]}):u&&e?t.jsxs("button",{type:"button",onClick:w,className:"zd:w-full zd:cursor-pointer zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Open in ",e.name]}):e&&t.jsxs("a",{href:e.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Get ",e.name]})]})}function X(){var e,n;return typeof window>"u"?!1:((n=(e=window.matchMedia)==null?void 0:e.call(window,"(pointer: coarse)"))==null?void 0:n.matches)||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)}function P(e){return e.type==="walletConnect"&&"zdWalletConnect"in e}function I2(e){const{wallet:n,connectors:i,uri:s,mobile:r}=e;return!n.mobileLink||!r||!s||i.some(o=>T(o,n))?null:`${n.mobileLink}${encodeURIComponent(s)}`}function U2(){const{goToStep:e}=v(),n=y.useConnectors(),i=n.find(P),{connect:s}=y.useConnect(),o=y.useConnections().some(d=>d.connector.uid===(i==null?void 0:i.uid)),{isReconnecting:l}=y.useAccount(),[c,u]=m.useState(null),[g,z]=m.useState(null),E=m.useRef(!1),p=d=>{z(null),u(null),s({connector:d},{onError:C=>z(C.message)})};return m.useEffect(()=>{if(!i||o)return;const d=({type:h,data:x})=>{h==="display_uri"&&typeof x=="string"&&u(x)};i.emitter.on("message",d);const C=()=>z("Proposal expired"),f=()=>e(null);let D,w=!1;return i.getProvider().then(h=>{var x,S,F;w||(D=h,(F=(S=(x=D.signer)==null?void 0:x.client)==null?void 0:S.events)==null||F.on("proposal_expire",C),D.on("connect",f))}).catch(h=>{w||z(h instanceof Error?h.message:String(h))}),!E.current&&!l&&(E.current=!0,p(i)),()=>{var h,x,S;w=!0,(S=(x=(h=D==null?void 0:D.signer)==null?void 0:h.client)==null?void 0:x.events)==null||S.off("proposal_expire",C),D==null||D.off("connect",f),i.emitter.off("message",d)}},[i,o,l]),{uri:c,error:g,retry:()=>{i&&p(i)},deepLinkFor:d=>I2({wallet:d,connectors:n,uri:g?null:c,mobile:X()})}}const $=m.createContext(null);function A(){const e=m.useContext($);if(!e)throw new Error("SignUp.* components must be rendered inside <SignUp>");return e}function O(e){const{setAuthPending:n}=A();m.useEffect(()=>(n(e),()=>n(!1)),[e,n])}const L2=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function _(e){return L2.test(e.trim())}function e2(){const{goToStep:e,setEmail:n,setOtpSession:i}=v(),{authPending:s,emailAuthMethod:r,needsAgreement:o,guardAgreement:l,setError:c}=A(),[u,g]=m.useState(""),z=r==="otp",{mutateAsync:E,isPending:p}=j.useSendOTP(),{mutateAsync:d,isPending:C}=j.useSendMagicLink(),f=p||C;O(f);const D=async()=>{if(!(!u||s)&&_(u)&&l()){c(null);try{const w=z?E:d,{otpId:h,otpEncryptionTargetBundle:x}=await w({email:u});n(u),i({otpId:h,otpEncryptionTargetBundle:x}),e(z?"otp-input":"email-verification")}catch(w){c(w instanceof Error?w.message:"Failed to send verification code")}}};return t.jsx(a.Input,{iconName:"email",placeholder:"Enter your email",value:u,onChange:w=>g(w.target.value),type:"email",autoCapitalize:"none",autoComplete:"email",disabled:s,variant:"listItemStyle",onKeyDown:w=>{w.key==="Enter"&&u&&!s&&D()},children:f?t.jsx("div",{className:"zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center",children:t.jsx("div",{className:"zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})}):t.jsx("button",{type:"button",disabled:!_(u)||o,className:`zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${_(u)&&!o?"zd:cursor-pointer":"zd:cursor-not-allowed zd:opacity-50"}`,onClick:()=>D(),children:t.jsx(a.Icon,{name:"chevronRight",className:"zd:text-greyScale"})})})}function t2(){const{goToStep:e}=v(),{authPending:n,guardAgreement:i,setError:s}=A(),{mutateAsync:r,isPending:o}=j.useAuthenticateOAuth({mutation:{onSuccess:()=>{e("authenticated")}}});O(o);const l=async()=>{if(!n&&i()){s(null);try{await r({provider:"google"})}catch(c){B(c)||s(c instanceof Error?c.message:String(c))}}};return t.jsx(a.ListItem,{icon:t.jsx(a.ListItemIcon,{name:"google"}),title:"Google",trailing:t.jsx(a.ListItemChevron,{}),disabled:n,onClick:l})}function B2({excludeWalletIds:e=[],maxWallets:n=4}){const{goToStep:i}=v(),{authPending:s,guardAgreement:r,setError:o,registeredWallets:l}=A(),c=y.useConnectors(),{connect:u,isPending:g}=y.useConnect();O(g);const z=c.filter(p=>p.type==="injected"&&p.id!=="injected"&&p.id!=="zerodev-wallet").map(p=>{const d=b.find(C=>T(p,C));return{connector:p,walletId:d==null?void 0:d.id,name:(d==null?void 0:d.name)??p.name,icon:(d==null?void 0:d.icon)??p.icon,ids:d?[d.id,p.id]:[p.id],rank:d?b.indexOf(d):b.length}}).filter(p=>!(p.walletId&&l.includes(p.walletId))).filter(p=>!p.ids.some(d=>e.includes(d))).sort((p,d)=>p.rank-d.rank).slice(0,n),E=p=>{s||r()&&(o(null),u({connector:p},{onSuccess:()=>i(null),onError:d=>{B(d)||o(d instanceof Error?d.message:String(d))}}))};return t.jsx(t.Fragment,{children:z.map(({connector:p,name:d,icon:C})=>t.jsx(a.ListItem,{title:d,icon:C?t.jsx("img",{src:C,alt:"",className:"zd:w-6 zd:h-6"}):null,subtitle:t.jsx(a.Badge,{text:"INSTALLED"}),trailing:t.jsx(a.ListItemChevron,{}),disabled:s,onClick:()=>E(p)},p.uid))})}function O2({tile:e}){return t.jsxs("button",{type:"button",onClick:e.onSelect,className:"zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",children:[t.jsx("div",{className:"zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center",children:e.icon?t.jsx("img",{src:e.icon,alt:"",className:"zd:w-8 zd:h-8"}):t.jsx(a.Icon,{name:"walletOutline",className:"zd:w-8 zd:h-8 zd:text-greyScale"})}),t.jsx(a.Text,{className:"zd:text-body3 zd:max-w-full zd:truncate",children:e.name})]})}function R2({open:e,onOpenChange:n,tiles:i}){return t.jsx(a.BottomSheet,{open:e,onOpenChange:n,children:t.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[t.jsx(a.BottomSheetTitle,{children:"All wallets"}),t.jsxs("div",{className:"zd:mb-3 zd:flex zd:items-center zd:gap-2",children:[t.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:"All wallets"}),t.jsx(a.BottomSheetClose,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),t.jsx("div",{className:"zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto",children:i.map(s=>t.jsx(O2,{tile:s},s.key))})]})})}function M2({title:e="More wallets"}){const{goToStep:n}=v(),{authPending:i,guardAgreement:s,setError:r,openWalletSheet:o}=A(),[l,c]=m.useState(!1),u=y.useConnectors(),{connect:g,isPending:z}=y.useConnect();O(z);const E=u.filter(h=>h.id!=="zerodev-wallet"&&h.type!=="walletConnect"),p=h=>{i||s()&&(c(!1),r(null),g({connector:h},{onSuccess:()=>n(null),onError:x=>{B(x)||r(x instanceof Error?x.message:String(x))}}))},d=u.some(P),C=b.map(h=>{const x=E.find(S=>Z(S,h));return{key:h.id,name:h.name,icon:h.icon,onSelect:()=>{if(x){p(x);return}if(d){if(i||!s())return;c(!1),o(h);return}const S=E.find(F=>T(F,h));if(S){p(S);return}c(!1),window.open(h.downloadUrl,"_blank","noopener,noreferrer")}}}),f=E.filter(h=>!b.some(x=>T(h,x))).map(h=>({key:h.uid,name:h.name,icon:h.icon,onSelect:()=>p(h)})),D=d?[{key:"walletconnect",name:"WalletConnect",icon:W,onSelect:()=>{i||s()&&(c(!1),o())}}]:[],w=()=>{i||s()&&c(!0)};return t.jsxs(t.Fragment,{children:[t.jsx(a.ListItem,{icon:t.jsx(a.ListItemIcon,{name:"walletOutline",className:"zd:w-5 zd:h-5"}),title:e,trailing:t.jsx(a.ListItemChevron,{}),disabled:i,onClick:w}),t.jsx(R2,{open:l,onOpenChange:c,tiles:[...D,...C,...f]})]})}function n2(){const{goToStep:e}=v(),{authPending:n,guardAgreement:i,setError:s}=A(),r={onSuccess:()=>{e("authenticated")},onError:z=>{B(z)||s(z instanceof Error?z.message:String(z))}},{mutate:o,isPending:l}=j.useRegisterPasskey({mutation:r}),{mutate:c,isPending:u}=j.useLoginPasskey({mutation:r});O(l||u);const g=z=>()=>{n||i()&&(s(null),z())};return t.jsxs(t.Fragment,{children:[t.jsx(a.Button,{action:"secondary",text:"Create a passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:g(()=>o())}),t.jsx(a.Button,{action:"secondary",text:"Log in with passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:g(()=>c())})]})}function P2({walletId:e}){const n=b.find(f=>f.id===e);if(!n)throw new Error(`Unknown walletId "${e}". Valid ids: ${b.map(f=>f.id).join(", ")}`);const{goToStep:i}=v(),{authPending:s,guardAgreement:r,setError:o,registerWallet:l,openWalletSheet:c}=A(),u=y.useConnectors(),{connect:g,isPending:z}=y.useConnect();O(z),m.useLayoutEffect(()=>l(n.id),[l,n.id]);const E=u.find(f=>Z(f,n)),p={title:n.name,icon:t.jsx("img",{src:n.icon,alt:"",className:"zd:w-6 zd:h-6"}),trailing:t.jsx(a.ListItemChevron,{})};if(!E&&u.some(P))return t.jsx(a.ListItem,{...p,disabled:s,onClick:()=>{s||r()&&c(n)}});const d=E??u.find(f=>T(f,n));if(!d)return t.jsx(a.ListItem,{...p,asChild:!0,children:t.jsx("a",{href:n.downloadUrl,target:"_blank",rel:"noopener noreferrer"})});const C=()=>{s||r()&&(o(null),g({connector:d},{onSuccess:()=>i(null),onError:f=>{B(f)||o(f instanceof Error?f.message:String(f))}}))};return t.jsx(a.ListItem,{...p,...!!E&&{subtitle:t.jsx(a.Badge,{text:"INSTALLED"})},disabled:s,onClick:C})}function H2(){const{authPending:e,guardAgreement:n,openWalletSheet:i}=A();if(!y.useConnectors().some(P))return null;const r=()=>{e||n()&&i()};return t.jsx(a.ListItem,{title:"WalletConnect",icon:t.jsx("img",{src:W,alt:"",className:"zd:w-6 zd:h-6"}),subtitle:t.jsx(a.Badge,{text:"QR CODE"}),trailing:t.jsx(a.ListItemChevron,{}),disabled:e,onClick:r})}function s2({children:e,termsAndConditionsUrl:n,privacyPolicyUrl:i,emailAuthMethod:s="magicLink"}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),[u,g]=m.useState(null),[z,E]=m.useState(!1),[p,d]=m.useState([]),C=m.useCallback(F=>(d(I=>[...I,F]),()=>{d(I=>{const H=[...I];return H.splice(H.indexOf(F),1),H})}),[]),[f,D]=m.useState(null),w=U2(),x=!!(n||i)&&!r,S=()=>x?(c(!0),!1):!0;return t.jsxs($.Provider,{value:{authPending:z,emailAuthMethod:s,setAuthPending:E,needsAgreement:x,guardAgreement:S,setError:g,registeredWallets:p,registerWallet:C,openWalletSheet:F=>{const I=F&&w.deepLinkFor(F);I&&(window.location.href=I),D({wallet:F})}},children:[u!==null&&t.jsx("div",{className:"zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100",children:t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:max-w-md",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Error occurred"}),t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:u}),t.jsx(a.Button,{action:"primary",text:"Try again",onClick:()=>g(null)})]})}),t.jsxs("div",{className:`zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${u!==null?" zd:hidden":""}`,children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:justify-center",children:[t.jsxs("div",{className:"zd:px-4 zd:flex zd:flex-col zd:items-center",children:[t.jsx("div",{className:"zd:w-full zd:px-16 zd:py-4",children:t.jsx(b2,{className:"zd:w-full zd:pointer-events-none zd:select-none"})}),t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Continue to your wallet"}),t.jsx(a.Text,{className:"zd:mt-2 zd:text-center zd:text-greyScale/50",children:"Choose a sign-in method to proceed"})]}),t.jsx("div",{className:"zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2",children:e})]}),t.jsx("div",{className:"zd:px-4",children:t.jsx(v2,{termsAndConditionsUrl:n,privacyPolicyUrl:i,agreedToTerms:r,setAgreedToTerms:F=>{o(F),F&&c(!1)},highlight:l})})]}),t.jsx(k2,{pairing:w,open:f!==null,onOpenChange:F=>{F||D(null)},wallet:f==null?void 0:f.wallet})]})}function i2({label:e="or"}){return t.jsxs("div",{className:"zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3",children:[t.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"}),t.jsx(a.Text,{className:"zd:text-body3",children:e}),t.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"})]})}function _2(e){return t.jsxs(s2,{...e,children:[t.jsx(n2,{}),t.jsx(i2,{}),t.jsx(t2,{}),t.jsx(e2,{})]})}const r2=Object.assign(s2,{Default:_2,Passkey:n2,Google:t2,Email:e2,Wallet:P2,WalletConnect:H2,InstalledWallets:B2,MoreWallets:M2,Divider:i2});function W2(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("code")}function Z2(){const{otpId:e,otpEncryptionTargetBundle:n,goToStep:i,clearOtpSession:s}=v(),[r]=m.useState(W2),[o,l]=m.useState(null),c=m.useRef(!1),{mutate:u,isPending:g}=j.useVerifyMagicLink({mutation:{onSuccess:()=>{s(),i("authenticated")},onError:z=>{l(z)}}});return m.useEffect(()=>{if(!(c.current||!r)){if(c.current=!0,!e||!n){R(),i(null);return}u({otpId:e,code:r,otpEncryptionTargetBundle:n})}},[e,n,r,u,i]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[!o&&g&&t.jsx(k,{imageName:"loading",title:"Verifying Your Email",children:"Please wait while we securely connect your wallet."}),!o&&!r&&!g&&t.jsxs(t.Fragment,{children:[t.jsxs(k,{imageName:"error",title:"Invalid Link",children:["This verification link is invalid or incomplete.",t.jsx("br",{}),"Please check your email and try again with the correct link."]}),t.jsx(a.Button,{action:"primary",onClick:()=>{R(),i("sign-up")},text:"Choose another sign-in method"})]}),o!=null&&t.jsxs(t.Fragment,{children:[t.jsx(k,{imageName:"error",title:"Oops, something went wrong",children:"We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request."}),t.jsx(a.Button,{action:"primary",onClick:()=>{R(),i("sign-up")},text:"Choose another sign-in method"})]})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function G2(){return t.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:t.jsx(k,{imageName:"loading",title:"Authenticating...",children:"Please wait while we complete the OAuth authentication."})})}function V2(){return t.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:t.jsx(k,{imageName:"loading",title:"Passkey authentication",children:"Please authenticate with your passkey."})})}function q2(e,n){switch(e){case"sign-up":return n?n():t.jsx(r2.Default,{});case"email-verification":return t.jsx(g2,{});case"otp-input":return t.jsx(y2,{});case"verifying-otp":return t.jsx(Z2,{});case"oauth-in-progress":return t.jsx(G2,{});case"passkey-prompt":return t.jsx(V2,{});case"error":return t.jsx(z2,{});default:return null}}function K2({onClose:e,size:n,renderSignUp:i,logo:s}={}){const{step:r,goToStep:o,goBack:l,reset:c}=v();m.useEffect(()=>{r===null&&x2()&&o("verifying-otp")},[r,o]);const u=q2(r,i);if(!u)return null;const g=()=>{R(),c(),e==null||e()};return t.jsx(a.Screen,{...n&&{size:n},className:r==="sign-up"?"zd:h-auto zd:max-h-202.5":void 0,topNav:t.jsx(a.TopNav,{...l!==null&&{onLeftButtonClick:l},onRightButtonClick:g,...r==="sign-up"&&{...s&&{logo:s},className:"zd:px-4"}}),children:u})}function J2(e){const n=e.toLowerCase();return b.find(i=>{const s=i.name.toLowerCase();return n.includes(s)||s.includes(n)})}function Q2(e){return b.find(n=>T(e,n))}function Y2(){const{connector:e,isConnected:n}=y.useAccount(),[i,s]=m.useState(void 0),r=!!e&&e.type==="walletConnect";return m.useEffect(()=>{if(!e||!r){s(void 0);return}let o=!1;return e.getProvider().then(l=>{var u,g;if(o)return;const c=(g=(u=l.session)==null?void 0:u.peer)==null?void 0:g.metadata;s(c)}).catch(()=>{}),()=>{o=!0}},[e,r]),m.useMemo(()=>{var l;if(!n||!e)return;if(e.id==="zerodev-wallet")return{name:e.name,icon:e.icon,source:"embedded"};if(r){const c=i!=null&&i.name?J2(i.name):void 0;return{name:(i==null?void 0:i.name)??void 0,icon:((l=i==null?void 0:i.icons)==null?void 0:l[0])??(c==null?void 0:c.icon),walletId:c==null?void 0:c.id,source:"walletconnect"}}const o=Q2(e);return{name:e.name,icon:e.icon??(o==null?void 0:o.icon),walletId:o==null?void 0:o.id,source:e.type==="injected"?"injected":"other"}},[e,n,r,i])}function X2(e){const n=Y2();return m.useMemo(()=>({walletInfo:n}),[n])}const G="zerodev:auth:otpSession";function $2(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(G);if(!e)return null;const n=JSON.parse(e);return!(n!=null&&n.otpId)||!(n!=null&&n.otpEncryptionTargetBundle)?null:n}catch{return null}}function ee(e){if(!(typeof window>"u"))try{window.localStorage.setItem(G,JSON.stringify(e))}catch{}}function V(){if(!(typeof window>"u"))try{window.localStorage.removeItem(G)}catch{}}const te=(e,n,i)=>({auth:{step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null,initialize:()=>{const s=$2();s&&e(r=>({auth:{...r.auth,otpId:s.otpId,otpEncryptionTargetBundle:s.otpEncryptionTargetBundle}}))},goToStep:s=>{e(r=>({auth:{...r.auth,step:s,stepHistory:r.auth.step===null?r.auth.stepHistory:[...r.auth.stepHistory,r.auth.step]}}))},goBack:()=>{const{auth:s}=n();if(s.stepHistory.length===0)return;const r=[...s.stepHistory],o=r.pop();e(l=>({auth:{...l.auth,step:o,stepHistory:r}}))},reset:()=>{V(),e(s=>({auth:{...s.auth,step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null}}))},setEmail:s=>{e(r=>({auth:{...r.auth,email:s}}))},setOtpSession:({otpId:s,otpEncryptionTargetBundle:r})=>{ee({otpId:s,otpEncryptionTargetBundle:r}),e(o=>({auth:{...o.auth,otpId:s,otpEncryptionTargetBundle:r}}))},clearOtpSession:()=>{V(),e(s=>({auth:{...s.auth,otpId:null,otpEncryptionTargetBundle:null}}))}}}),ne=()=>L.create()(l2.subscribeWithSelector((e,n,i)=>({pendingRequests:[],userConfirmationListenerActive:!1,addPendingRequest:s=>e(r=>({pendingRequests:[...r.pendingRequests,s]})),removePendingRequest:s=>e(r=>({pendingRequests:r.pendingRequests.filter(o=>o.id!==s)})),clearPendingRequests:()=>e({pendingRequests:[]}),setUserConfirmationListenerActive:s=>e({userConfirmationListenerActive:s}),...te(e,n)})));function se(e){return new Promise((n,i)=>{const s=e.subscribe(r=>r.auth.step,r=>{r==="authenticated"?(s(),n()):r===null&&(s(),i(new Error("Auth flow dismissed")))})})}function ie(e){const n=j.zeroDevWallet(e),i=ne();return s=>{const r=n(s);return{...r,async connect(o){try{return await r.connect(o)}catch(l){if(o!=null&&o.isReconnecting||!(l instanceof j.NotAuthenticatedError))throw l;if(i.getState().auth.step!==null)throw new Error("Auth flow already in progress");return i.getState().auth.goToStep("sign-up"),await se(i),r.connect(o)}},async disconnect(){var o;await((o=r.disconnect)==null?void 0:o.call(r)),i.getState().auth.reset()},async setup(){var o;await((o=r.setup)==null?void 0:o.call(r)),!(typeof window>"u")&&i.getState().auth.initialize()},getKitStore(){return i}}}}const re={Pending:"zd:text-solarOrange",Success:"zd:text-positive",Failed:"zd:text-negative"};function oe({icon:e,title:n,value:i,chainName:s,chainIconUrl:r,destChainName:o,destChainIconUrl:l,status:c,className:u}){return t.jsxs("div",{className:a.cn("zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",u),children:[t.jsx("div",{className:"zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white",children:t.jsx(a.Icon,{name:e,className:"zd:size-5"})}),t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2",children:[t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[t.jsx(a.Text,{className:"zd:shrink-0 zd:whitespace-nowrap zd:text-body1",children:n}),t.jsx(a.Text,{className:"zd:min-w-0 zd:truncate zd:text-right zd:text-body1",children:i})]}),t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-2",children:[t.jsx(q,{name:s,...r&&{iconUrl:r}}),o&&t.jsxs(t.Fragment,{children:[t.jsx(a.Icon,{name:"arrowRightFill","aria-hidden":!0,className:"zd:size-3 zd:shrink-0 zd:opacity-30"}),t.jsx(q,{name:o,...l&&{iconUrl:l}})]})]}),t.jsx(a.Text,{className:a.cn("zd:shrink-0 zd:text-body3",re[c]),children:c})]})]})]})}function q({name:e,iconUrl:n}){return t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-[5px]",children:[n&&t.jsx("span",{className:"zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white",children:t.jsx("img",{src:n,alt:"","aria-hidden":!0,className:"zd:size-full zd:object-cover"})}),t.jsx(a.Text,{className:"zd:truncate zd:text-body3",children:e})]})}const U="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png",K="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png",N=3600*1e3,ae=[{id:"mock-1",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:U,destChainName:"Base",destChainIconUrl:K,status:"Pending",timestamp:Date.now()-1*N},{id:"mock-2",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:U,destChainName:"Base",destChainIconUrl:K,status:"Pending",timestamp:Date.now()-2*N},{id:"mock-3",icon:"lighting",title:"Fixed Yield",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:U,status:"Success",timestamp:Date.now()-3*N},{id:"mock-4",icon:"imageFill",title:"Received NFT",value:"Bored Ape Yacht Club",chainName:"Arbitrum One",chainIconUrl:U,status:"Success",timestamp:Date.now()-4*N},{id:"mock-5",icon:"lighting",title:"Collateral Used",value:"Collateralization enabled for USD₮0",chainName:"Arbitrum One",chainIconUrl:U,status:"Success",timestamp:Date.now()-336*N},{id:"mock-6",icon:"lighting",title:"Liquid Staked ETH",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:U,status:"Success",timestamp:Date.now()-336*N-1*N}];function M(e){const n=new Date(e);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function le(e,n){const i=M(e);return i===M(n)?"Today":i===M(n-1440*60*1e3)?"Yesterday":new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(new Date(e))}function ce(e,n=Date.now()){var o;const i=[...e].sort((l,c)=>c.timestamp-l.timestamp),s=[];let r=null;for(const l of i){const c=M(l.timestamp);c!==r&&(r=c,s.push({label:le(l.timestamp,n),entries:[]})),(o=s[s.length-1])==null||o.entries.push(l)}return s}function de({entries:e=ae,onSelectEntry:n}){const i=ce(e);return t.jsx("div",{className:"zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4",children:t.jsx(a.Wrapper,{variant:"ghost",className:"zd:flex zd:w-full zd:flex-1 zd:flex-col zd:gap-1 zd:overflow-y-auto zd:rounded-2xl zd:p-2",children:i.map(s=>t.jsxs(m.Fragment,{children:[t.jsx("div",{className:"zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2",children:t.jsx(a.Text,{className:"zd:text-body3",children:s.label})}),s.entries.map(r=>n?t.jsx("button",{type:"button",onClick:()=>n(r),className:"zd:w-full zd:cursor-pointer zd:text-left",children:t.jsx(J,{entry:r})},r.id):t.jsx(J,{entry:r},r.id))]},s.label))})})}function J({entry:e}){return t.jsx(oe,{icon:e.icon,title:e.title,value:e.value,chainName:e.chainName,...e.chainIconUrl&&{chainIconUrl:e.chainIconUrl},...e.destChainName&&{destChainName:e.destChainName},...e.destChainIconUrl&&{destChainIconUrl:e.destChainIconUrl},status:e.status})}const ue={history:"History"};function fe({onClose:e,entries:n,onSelectEntry:i,className:s,size:r}){const[o]=m.useState("history"),l=()=>{switch(o){case"history":return t.jsx(de,{...n&&{entries:n},...i&&{onSelectEntry:i}})}};return t.jsx(a.Screen,{...s&&{className:s},...r&&{size:r},topNav:t.jsx(a.TopNav,{title:ue[o],onRightButtonClick:e}),children:l()})}const o2="WALLETCONNECT_DEEPLINK_CHOICE",Q=new WeakSet;function Y(e){var s,r,o;const n=(r=(s=e.session)==null?void 0:s.peer)==null?void 0:r.metadata,i=(o=n==null?void 0:n.redirect)==null?void 0:o.native;if(!i||!X()){a2();return}try{localStorage.setItem(o2,JSON.stringify({href:i,name:(n==null?void 0:n.name)??""}))}catch{}}function a2(){try{localStorage.removeItem(o2)}catch{}}function pe(e){Q.has(e)||(Q.add(e),e.on("connect",()=>Y(e)),e.on("disconnect",a2),e.session&&Y(e))}function me(e){if(!e.projectId)throw new Error("zeroDevWalletConnect requires a WalletConnect projectId");const n=c2.walletConnect({...e,showQrModal:!1});return i=>{const s=Object.assign(n(i),{zdWalletConnect:!0}),r=s.getProvider.bind(s);return s.getProvider=async(...o)=>{const l=await r(...o);return pe(l),l},s}}exports.ConnectWallet=K2;exports.SignUp=r2;exports.TxHistory=fe;exports.useAuth=v;exports.useWalletInfo=X2;exports.zeroDevWallet=ie;exports.zeroDevWalletConnect=me;
3
+ `,"Please open the email and click the link to log in."]}),t.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:t.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",t.jsx("button",{type:"button",disabled:!d,onClick:l,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:d?"Resend":`Resend in ${i} ${i===1?"second":"seconds"}`})]})})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function De(){return typeof window>"u"?!1:new URLSearchParams(window.location.search).has("code")}function B(){if(typeof window>"u")return;const e=new URL(window.location.href);e.searchParams.has("code")&&(e.searchParams.delete("code"),window.history.replaceState(null,"",e.toString()))}function we({title:e="Oops, something went wrong",message:n="We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",showRetry:r=!1,showChooseAnother:s=!0}){const{goToStep:i,goBack:o,reset:d}=F(),l=o??(()=>i("sign-up"));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[t.jsx(b,{imageName:"error",title:e,children:n}),t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-1",children:[r&&t.jsx(a.Button,{action:"primary",text:"Try again",onClick:l}),s&&t.jsx(a.Button,{action:r?"secondary":"primary",onClick:()=>{B(),i("sign-up")},text:"Choose another sign-in method"}),!r&&!s&&t.jsx(a.Button,{action:"primary",text:"Start over",onClick:d})]})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}const Ee=4,ye=8,Fe=6;function Se(e){return Math.max(Ee,Math.min(ye,e))}function je({char:e,isFocused:n}){return t.jsx(a.Wrapper,{"data-testid":"code-input-box","data-active":n||void 0,className:a.cn("zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",n&&"zd:border-[1.5px] zd:border-greyScale"),children:t.jsx(a.Text,{className:"zd:text-h2",children:e})})}function ve({onChange:e,onComplete:n,disabled:r=!1,error:s=!1,autoFocus:i=!1,length:o=Fe,"data-testid":d}){const l=Se(o),c=h.useMemo(()=>Array.from({length:l},(f,m)=>({id:`char-${m}`,index:m})),[l]),[u,p]=h.useState(""),[D,z]=h.useState(!1),C=h.useRef(null);h.useEffect(()=>{var f;i&&!r&&((f=C.current)==null||f.focus())},[i,r]),h.useEffect(()=>{p(f=>f.slice(0,l))},[l]);const g=f=>{const m=f.slice(0,l).toUpperCase();p(m),e==null||e(m),m.length===l&&setTimeout(()=>{var x;n==null||n(m),(x=C.current)==null||x.blur()},0)};return t.jsxs("button",{type:"button",className:"zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",onClick:()=>{var f;return(f=C.current)==null?void 0:f.focus()},disabled:r,"data-testid":d,children:[t.jsx("input",{ref:C,value:u,onChange:f=>g(f.target.value),onFocus:()=>z(!0),onBlur:()=>z(!1),maxLength:l,disabled:r,className:"zd:absolute zd:opacity-0 zd:pointer-events-none",style:{position:"absolute",opacity:0},"aria-label":"Verification code"}),c.map(f=>t.jsx(je,{char:u[f.index]??"",isFocused:!s&&D&&f.index===u.length},f.id))]})}function be(){const{email:e,otpId:n,otpEncryptionTargetBundle:r,setOtpSession:s,clearOtpSession:i,goToStep:o}=F(),{mutateAsync:d,isPending:l}=v.useSendOTP(),{mutateAsync:c,isPending:u}=v.useVerifyOTP(),[p,D]=h.useState(""),[z,C]=h.useState(!1),[g,f]=h.useState(60);h.useEffect(()=>{if(g<=0)return;const S=setInterval(()=>{f(E=>Math.max(0,E-1))},1e3);return()=>clearInterval(S)},[g]);const m=async()=>{if(!(!p.trim()||!n||!r)){C(!1);try{await c({otpId:n,code:p.trim(),otpEncryptionTargetBundle:r}),i(),o("authenticated")}catch{C(!0)}}},x=S=>{D(S)},w=async()=>{if(!(!e||g>0||l))try{const{otpId:S,otpEncryptionTargetBundle:E}=await d({email:e});s({otpId:S,otpEncryptionTargetBundle:E}),f(60),C(!1)}catch{C(!0)}},y=g<=0&&!l;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center",children:[t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Enter verification code"}),t.jsxs(a.Text,{className:"zd:text-center",children:["Enter the code from the email we sent to"," ",t.jsx(a.Text,{className:"zd:text-solarOrange",children:e})]})]}),t.jsx(ve,{onComplete:x,onChange:()=>C(!1),disabled:u,error:z,autoFocus:!0}),t.jsx(a.Button,{text:"Confirm code",onClick:m,disabled:!p.trim()||u}),t.jsx("div",{className:"zd:flex zd:flex-col zd:gap-1",children:t.jsxs(a.Text,{className:"zd:text-center",children:["Did not get an email?"," ",t.jsx("button",{type:"button",disabled:!y,onClick:w,className:"zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",children:y?"Resend":`Resend in ${g} ${g===1?"second":"seconds"}`})]})})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function Ae({termsAndConditionsUrl:e,privacyPolicyUrl:n,agreedToTerms:r,setAgreedToTerms:s,highlight:i=!1}){const o=!!(e||n);return t.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-5",children:[o&&t.jsxs("div",{className:`zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${i?"zd:border zd:border-negative":"zd:border zd:border-transparent"}`,children:[t.jsx("input",{type:"checkbox",checked:r,onChange:d=>s(d.target.checked),className:"zd:cursor-pointer zd:[color-scheme:light]"}),t.jsxs(a.Text,{className:"zd:flex-1",children:["I agree to the"," ",e&&t.jsx(a.Text,{as:"a",href:e,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Terms & Conditions"}),e&&n&&" and ",n&&t.jsx(a.Text,{as:"a",href:n,target:"_blank",rel:"noopener noreferrer",className:"zd:underline",children:"Privacy Policy"})]})]}),t.jsx(a.PoweredBy,{})]})}const ke=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/blob.webm").href:new URL("blob.webm",document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href);function Ne({className:e}){return t.jsx("video",{className:e,style:{aspectRatio:"1 / 1"},src:ke,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,"aria-hidden":"true",tabIndex:-1})}const Te="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='24'%20height='24'%20fill='url(%23pattern0_19361_9946)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_19361_9946'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_19361_9946'%20transform='scale(0.0136986)'/%3e%3c/pattern%3e%3cimage%20id='image0_19361_9946'%20width='73'%20height='73'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,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'/%3e%3c/defs%3e%3c/svg%3e",P=Te;function H(e,n){return n.rdns&&e.id===n.rdns?!0:!!n.rdns&&e.type==="injected"&&e.id!=="injected"&&e.id!=="zerodev-wallet"&&e.name===n.name}function U(e,n){return H(e,n)?!0:!!n.rdns&&(Array.isArray(e.rdns)?e.rdns.includes(n.rdns):e.rdns===n.rdns)}const Ue=[{id:"metamask",name:"MetaMask",rdns:"io.metamask",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m24.024%2023.824-4.846-1.434-3.655%202.172-2.55-.001-3.656-2.171-4.844%201.434L3%2018.88l1.473-5.488L3%208.751%204.473%203l7.569%204.496h4.413L24.024%203l1.473%205.751-1.473%204.64%201.473%205.488z%22%2F%3E%3Cpath%20fill%3D%22%23ff5c16%22%20d%3D%22m4.474%203%207.57%204.499-.302%203.087zm4.844%2015.881%203.33%202.522-3.33.987zm3.064-4.17-.64-4.123-4.097%202.804h-.002v.001l.013%202.886%201.661-1.567zM24.024%203l-7.57%204.499.3%203.087zM19.18%2018.881l-3.33%202.522%203.33.987zm1.674-5.488v-.002zl-4.097-2.804-.64%204.124h3.064l1.662%201.567z%22%2F%3E%3Cpath%20fill%3D%22%23e34807%22%20d%3D%22m9.317%2022.39-4.844%201.434L3%2018.881h6.317zm3.064-7.68.925%205.962-1.282-3.315-4.37-1.078%201.662-1.568zm6.799%207.68%204.844%201.434%201.473-4.943H19.18zm-3.064-7.68-.925%205.962%201.282-3.315%204.37-1.078-1.663-1.568z%22%2F%3E%3Cpath%20fill%3D%22%23ff8d5d%22%20d%3D%22m3%2018.88%201.473-5.489h3.169l.012%202.887%204.37%201.078%201.282%203.314-.659.73-3.33-2.522H3zm22.497%200-1.473-5.489h-3.17l-.01%202.887-4.371%201.078-1.282%203.314.659.73%203.33-2.522h6.317zM16.455%207.495h-4.413l-.3%203.087%201.565%2010.084h1.884l1.565-10.084z%22%2F%3E%3Cpath%20fill%3D%22%23661800%22%20d%3D%22M4.473%203%203%208.751l1.473%204.64h3.169l4.1-2.805zm6.992%2012.908H10.03l-.781.761%202.776.685-.56-1.447M24.024%203l1.473%205.751-1.473%204.64h-3.17l-4.098-2.805zm-6.99%2012.908h1.437l.782.762-2.78.686.56-1.45zm-1.512%206.687.328-1.193-.66-.73h-1.885l-.659.73.327%201.192%22%2F%3E%3Cpath%20fill%3D%22%23c0c4cd%22%20d%3D%22M15.522%2022.594v1.969h-2.548v-1.969z%22%2F%3E%3Cpath%20fill%3D%22%23e7ebf6%22%20d%3D%22m9.318%2022.388%203.658%202.174v-1.969l-.328-1.192zm9.862%200-3.658%202.174v-1.969l.328-1.192z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M3%203h22.5v21.563H3z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"https://metamask.app.link/wc?uri=",downloadUrl:"https://metamask.io/download"},{id:"trust",name:"Trust Wallet",rdns:"com.trustwallet.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%230500FF%22%20d%3D%22M6%207.583%2013.53%205v17.882C8.15%2020.498%206%2015.928%206%2013.345V7.583Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M22%207.583%2013.53%205v17.882c6.05-2.384%208.47-6.954%208.47-9.537V7.583Z%22%2F%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%2219.768%22%20x2%3D%2214.072%22%20y1%3D%223.753%22%20y2%3D%2222.853%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.02%22%20stop-color%3D%22%2300F%22%2F%3E%3Cstop%20offset%3D%22.08%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.16%22%20stop-color%3D%22%2348FF91%22%2F%3E%3Cstop%20offset%3D%22.42%22%20stop-color%3D%22%230094FF%22%2F%3E%3Cstop%20offset%3D%22.68%22%20stop-color%3D%22%230038FF%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%230500FF%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"trust://wc?uri=",downloadUrl:"https://trustwallet.com/download"},{id:"coinbase",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",icon:"data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22%232C5FF6%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%2023.8C19.4124%2023.8%2023.8%2019.4124%2023.8%2014C23.8%208.58761%2019.4124%204.2%2014%204.2C8.58761%204.2%204.2%208.58761%204.2%2014C4.2%2019.4124%208.58761%2023.8%2014%2023.8ZM11.55%2010.8C11.1358%2010.8%2010.8%2011.1358%2010.8%2011.55V16.45C10.8%2016.8642%2011.1358%2017.2%2011.55%2017.2H16.45C16.8642%2017.2%2017.2%2016.8642%2017.2%2016.45V11.55C17.2%2011.1358%2016.8642%2010.8%2016.45%2010.8H11.55Z%22%20fill%3D%22white%22%2F%3E%0A%3C%2Fsvg%3E",downloadUrl:"https://coinbase.com/wallet/downloads"},{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",icon:"data:image/svg+xml,%3Csvg%20width%3D%22120%22%20height%3D%22120%22%20viewBox%3D%220%200%20120%20120%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20width%3D%22120%22%20height%3D%22120%22%20fill%3D%22url(%23paint0_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2038H26C56.9279%2038%2082%2063.0721%2082%2094V100H94C97.3137%20100%20100%2097.3137%20100%2094C100%2053.1309%2066.8691%2020%2026%2020C22.6863%2020%2020%2022.6863%2020%2026V38Z%22%20fill%3D%22url(%23paint1_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M84%2094H100C100%2097.3137%2097.3137%20100%2094%20100H84V94Z%22%20fill%3D%22url(%23paint2_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2020L26%2036H20L20%2026C20%2022.6863%2022.6863%2020%2026%2020Z%22%20fill%3D%22url(%23paint3_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2036H26C58.0325%2036%2084%2061.9675%2084%2094V100H66V94C66%2071.9086%2048.0914%2054%2026%2054H20V36Z%22%20fill%3D%22url(%23paint4_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M68%2094H84V100H68V94Z%22%20fill%3D%22url(%23paint5_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2052L20%2036L26%2036L26%2052H20Z%22%20fill%3D%22url(%23paint6_linear_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M20%2062C20%2065.3137%2022.6863%2068%2026%2068C40.3594%2068%2052%2079.6406%2052%2094C52%2097.3137%2054.6863%20100%2058%20100H68V94C68%2070.804%2049.196%2052%2026%2052H20V62Z%22%20fill%3D%22url(%23paint7_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M52%2094H68V100H58C54.6863%20100%2052%2097.3137%2052%2094Z%22%20fill%3D%22url(%23paint8_radial_62_329)%22%2F%3E%0A%3Cpath%20d%3D%22M26%2068C22.6863%2068%2020%2065.3137%2020%2062L20%2052L26%2052L26%2068Z%22%20fill%3D%22url(%23paint9_radial_62_329)%22%2F%3E%0A%3Cdefs%3E%0A%3ClinearGradient%20id%3D%22paint0_linear_62_329%22%20x1%3D%2260%22%20y1%3D%220%22%20x2%3D%2260%22%20y2%3D%22120%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23174299%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23001E59%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint1_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(74)%22%3E%0A%3Cstop%20offset%3D%220.770277%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint2_linear_62_329%22%20x1%3D%2283%22%20y1%3D%2297%22%20x2%3D%22100%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%238754C9%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint3_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2220%22%20x2%3D%2223%22%20y2%3D%2237%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%238754C9%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF4000%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint4_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(58)%22%3E%0A%3Cstop%20offset%3D%220.723929%22%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3ClinearGradient%20id%3D%22paint5_linear_62_329%22%20x1%3D%2268%22%20y1%3D%2297%22%20x2%3D%2284%22%20y2%3D%2297%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3ClinearGradient%20id%3D%22paint6_linear_62_329%22%20x1%3D%2223%22%20y1%3D%2252%22%20x2%3D%2223%22%20y2%3D%2236%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%0A%3Cstop%20stop-color%3D%22%23FFF700%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23FF9901%22%2F%3E%0A%3C%2FlinearGradient%3E%0A%3CradialGradient%20id%3D%22paint7_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(26%2094)%20rotate(-90)%20scale(42)%22%3E%0A%3Cstop%20offset%3D%220.59513%22%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint8_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(51%2097)%20scale(17%2045.3333)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3CradialGradient%20id%3D%22paint9_radial_62_329%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientUnits%3D%22userSpaceOnUse%22%20gradientTransform%3D%22translate(23%2069)%20rotate(-90)%20scale(17%20322.37)%22%3E%0A%3Cstop%20stop-color%3D%22%2300AAFF%22%2F%3E%0A%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2301DA40%22%2F%3E%0A%3C%2FradialGradient%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E",mobileLink:"rainbow://wc?uri=",downloadUrl:"https://rainbow.download"},{id:"rabby",name:"Rabby Wallet",rdns:"io.rabby",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%238697FF%22%20d%3D%22M28%200H0v28h28V0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M22.54%2015.078c.677-1.514-2.673-5.744-5.874-7.506-2.017-1.365-4.12-1.178-4.545-.579-.935%201.316%203.094%202.43%205.788%203.731-.58.252-1.125.703-1.446%201.28-1.004-1.096-3.209-2.04-5.796-1.28-1.743.513-3.191%201.721-3.751%203.546a1.097%201.097%200%201%200-.445%202.1c.112%200%20.463-.075.463-.075l5.612.041c-2.244%203.56-4.018%204.081-4.018%204.698s1.697.45%202.335.22c3.05-1.1%206.327-4.531%206.89-5.519%202.36.295%204.345.33%204.786-.657Z%22%2F%3E%3Cpath%20fill%3D%22url(%23c)%22%20fill-rule%3D%22evenodd%22%20d%3D%22m17.885%2010.713.025.01c.125-.049.105-.233.07-.378-.078-.333-1.438-1.676-2.715-2.277-1.743-.82-3.025-.777-3.212-.398.356.726%201.998%201.408%203.714%202.12.723.3%201.46.606%202.118.923Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20fill-rule%3D%22evenodd%22%20d%3D%22M15.701%2018.036a10.296%2010.296%200%200%200-1.2-.37c.482-.862.583-2.138.128-2.945-.639-1.133-1.44-1.736-3.304-1.736-1.024%200-3.783.346-3.832%202.648-.005.242%200%20.464.017.667l5.036.037a17.264%2017.264%200%200%201-1.871%202.483c.669.172%201.221.316%201.728.448.48.125.92.24%201.38.357a21.003%2021.003%200%200%200%201.918-1.59Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3Cpath%20fill%3D%22url(%23e)%22%20d%3D%22M6.848%2016.063c.206%201.75%201.2%202.435%203.232%202.638%202.032.203%203.197.067%204.749.208%201.296.118%202.453.778%202.882.55.386-.205.17-.947-.347-1.423-.67-.617-1.597-1.046-3.229-1.199.325-.89.234-2.138-.27-2.817-.731-.982-2.079-1.426-3.785-1.232-1.782.202-3.49%201.08-3.232%203.275Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%2210.464%22%20x2%3D%2222.394%22%20y1%3D%2213.737%22%20y2%3D%2217.12%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22c%22%20x1%3D%2220.386%22%20x2%3D%2211.779%22%20y1%3D%2213.509%22%20y2%3D%224.879%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237258DC%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23797DEA%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22d%22%20x1%3D%2215.94%22%20x2%3D%227.673%22%20y1%3D%2218.337%22%20y2%3D%2213.584%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%237461EA%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23BFC2FF%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22e%22%20x1%3D%2211.177%22%20x2%3D%2216.765%22%20y1%3D%2213.648%22%20y2%3D%2220.749%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.984%22%20stop-color%3D%22%23D5CEFF%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"rabby://wc?uri=",downloadUrl:"https://rabby.io"},{id:"okx",name:"OKX Wallet",rdns:"com.okex.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10.819%205.556H5.93a.376.376%200%200%200-.375.375v4.888c0%20.207.168.375.375.375h4.888a.376.376%200%200%200%20.375-.376V5.932a.376.376%200%200%200-.376-.375Zm5.64%205.638h-4.886a.376.376%200%200%200-.376.376v4.887c0%20.208.168.376.376.376h4.887a.376.376%200%200%200%20.376-.375V11.57a.376.376%200%200%200-.376-.377Zm.75-5.638h4.887c.208%200%20.376.168.376.375v4.888a.376.376%200%200%201-.376.375H17.21a.376.376%200%200%201-.376-.376V5.933c0-.208.169-.376.376-.376Zm-6.39%2011.277H5.93a.376.376%200%200%200-.375.376v4.887c0%20.208.168.376.375.376h4.888a.376.376%200%200%200%20.375-.376V17.21a.376.376%200%200%200-.376-.376Zm6.39%200h4.887c.208%200%20.376.169.376.376v4.887a.376.376%200%200%201-.376.376H17.21a.376.376%200%200%201-.376-.376V17.21c0-.207.169-.376.376-.376Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"okex://main/wc?uri=",downloadUrl:"https://okx.com/download"},{id:"zerion",name:"Zerion",rdns:"io.zerion.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cpath%20fill%3D%22%232962EF%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M6.073%207c-.48%200-.665.593-.262.841l10.073%206.074a.577.577%200%200%200%20.758-.139l4.43-5.814c.3-.404-.004-.962-.525-.962H6.073ZM21.904%2021c.48%200%20.67-.596.267-.844l-10.075-6.073a.569.569%200%200%200-.751.146l-4.437%205.813c-.301.404.012.958.534.958h14.462Z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"zerion://wc?uri=",downloadUrl:"https://zerion.io"},{id:"uniswap",name:"Uniswap",rdns:"org.uniswap.app",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23FFD8EA%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cg%20fill%3D%22%23FF007A%22%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20d%3D%22M9.635%206.068c-.255-.039-.266-.043-.145-.06.23-.035.773.012%201.148.099.874.202%201.67.722%202.519%201.646l.225.246.323-.051c1.36-.213%202.741-.044%203.899.477.319.144.821.43.882.503.022.024.058.173.082.335.086.557.044.982-.13%201.301-.096.173-.101.228-.037.377a.367.367%200%200%200%20.334.206c.287%200%20.597-.454.74-1.086l.056-.252.113.126c.62.685%201.106%201.618%201.189%202.282l.021.174-.103-.158a1.966%201.966%200%200%200-.59-.604c-.415-.268-.855-.36-2.017-.42-1.05-.053-1.645-.141-2.234-.329-1.003-.32-1.508-.744-2.699-2.27-.53-.678-.855-1.053-1.18-1.354-.74-.687-1.466-1.047-2.396-1.187v-.001Z%22%2F%3E%3Cpath%20d%3D%22M18.725%207.581c.026-.453.088-.753.216-1.026.028-.07.063-.136.104-.198a.69.69%200%200%201-.049.178c-.092.266-.108.629-.043%201.052.081.536.126.613.706%201.192.273.272.589.613.704.761l.21.267-.21-.191c-.255-.233-.841-.69-.972-.755-.086-.042-.1-.042-.153.01-.05.048-.06.12-.068.461-.01.532-.084.873-.263%201.213-.096.187-.111.147-.025-.062.066-.155.072-.224.072-.739%200-1.033-.127-1.283-.864-1.707a8.169%208.169%200%200%200-.684-.346%202.614%202.614%200%200%201-.334-.16c.02-.02.74.185%201.029.293.431.163.502.183.555.164.034-.013.051-.113.068-.407h.001Zm-8.595%201.77c-.517-.696-.838-1.764-.768-2.563l.02-.247.119.02c.222.04.603.179.783.286.49.29.703.673.918%201.657.064.288.147.613.185.725.061.178.294.592.483.862.136.194.046.286-.255.26-.46-.04-1.083-.46-1.485-1Zm7.965%205.182c-2.42-.95-3.273-1.777-3.273-3.17%200-.206.007-.374.016-.374.008%200%20.102.067.208.151.491.384%201.04.548%202.563.765.896.128%201.398.231%201.864.382%201.48.478%202.392%201.449%202.61%202.773.063.384.028%201.104-.076%201.484-.082.3-.329.84-.394.861-.019.007-.037-.061-.04-.154-.025-.496-.283-.98-.715-1.343-.49-.412-1.15-.741-2.763-1.375Zm-1.699.396a4.13%204.13%200%200%200-.117-.5l-.062-.18.115.127c.16.173.285.396.391.693.082.227.09.294.09.662%200%20.361-.011.437-.087.64-.104.3-.28.572-.51.794-.443.44-1.011.683-1.833.784-.142.018-.557.047-.922.066-.922.046-1.529.144-2.073.33a.446.446%200%200%201-.156.036c-.021-.021.35-.237.656-.381.431-.204.861-.315%201.825-.47.475-.078.968-.173%201.093-.21%201.178-.352%201.784-1.263%201.59-2.39Z%22%2F%3E%3Cpath%20d%3D%22M17.506%2016.855c-.321-.675-.396-1.327-.22-1.935.02-.067.05-.119.068-.119a.64.64%200%200%201%20.169.09c.149.097.445.261%201.237.682.988.527%201.553.934%201.936%201.4.335.407.542.872.643%201.438.057.32.023%201.093-.061%201.416-.266%201.018-.882%201.818-1.764%202.285a2.129%202.129%200%200%201-.258.124c-.013%200%20.035-.116.104-.259.297-.605.331-1.193.107-1.848-.138-.401-.418-.89-.982-1.718-.657-.96-.817-1.218-.979-1.556Zm-9.095%203.644c.9-.742%202.016-1.267%203.036-1.43a4.85%204.85%200%200%201%201.575.06c.652.163%201.235.528%201.538.962.296.425.423.794.556%201.618.052.324.109.651.125.724.1.427.293.768.532.939.38.272%201.037.29%201.682.044a.853.853%200%200%201%20.21-.064c.023.023-.301.235-.53.347-.27.141-.572.213-.879.208-.59%200-1.08-.294-1.49-.891a7.027%207.027%200%200%201-.402-.784c-.431-.961-.644-1.253-1.145-1.575-.437-.28-1-.329-1.424-.126-.556.266-.71.96-.312%201.4.187.189.43.313.695.354a.75.75%200%200%200%20.589-.174.728.728%200%200%200%20.251-.551c0-.29-.114-.453-.4-.581-.392-.172-.812.029-.81.388%200%20.153.069.249.226.32.1.044.103.046.02.03-.358-.073-.442-.496-.154-.776.347-.336%201.064-.188%201.31.272.103.194.115.578.025.81-.203.52-.79.793-1.387.644-.407-.102-.571-.211-1.06-.703-.852-.856-1.182-1.023-2.408-1.21l-.237-.035.268-.22Z%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M4.418%205.179c2.842%203.368%204.8%204.757%205.017%205.05.18.243.112.462-.195.632a1.899%201.899%200%200%201-.699.191c-.2%200-.269-.075-.269-.075-.115-.106-.18-.088-.773-1.116A176.911%20176.911%200%200%200%205.968%207.56c-.044-.04-.042-.04%201.448%202.564.24.543.047.741.047.819%200%20.157-.044.24-.242.457-.332.36-.48.765-.587%201.604-.12.94-.456%201.604-1.39%202.741-.545.666-.635.787-.773%201.056-.174.338-.221.527-.24.952a2.9%202.9%200%200%200%20.16%201.174c.122.378.252.626.582%201.125.285.43.448.75.448.876%200%20.099.019.099.461.001%201.054-.232%201.91-.64%202.392-1.142.298-.311.367-.482.37-.907.002-.277-.008-.336-.085-.496-.125-.26-.353-.477-.855-.813-.66-.44-.942-.794-1.018-1.28-.065-.4.01-.682.373-1.427.377-.773.47-1.103.535-1.88.04-.503.096-.701.244-.861.155-.166.293-.222.676-.272.623-.084%201.018-.24%201.343-.534a1.14%201.14%200%200%200%20.421-.869l.014-.28-.16-.179C9.563%209.34%204.036%204.667%204%204.667c-.007%200%20.18.23.418.512Zm1.325%2013.086a.486.486%200%200%200-.157-.652c-.203-.133-.522-.069-.522.103%200%20.053.03.092.098.125.114.058.122.122.032.254s-.082.248.02.328c.168.126.404.057.529-.158ZM10.683%2012c-.29.086-.575.389-.664.706-.053.194-.022.534.058.638.13.169.255.213.596.212.665-.004%201.243-.283%201.311-.632.054-.286-.2-.68-.55-.855a1.33%201.33%200%200%200-.75-.07Zm.78.593c.102-.143.057-.296-.118-.4-.331-.199-.835-.035-.835.272%200%20.153.262.32.502.32.16%200%20.38-.093.45-.192Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M4%204h19v20H4z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",mobileLink:"uniswap://wc?uri=",downloadUrl:"https://wallet.uniswap.org"},{id:"ledger",name:"Ledger",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22M11.65%204.4H4.4V9h1.1V5.5l6.15-.04V4.4Zm.05%205.95v7.25h4.6v-1.1h-3.5l-.04-6.15H11.7ZM4.4%2023.6h7.25v-1.06L5.5%2022.5V19H4.4v4.6ZM16.35%204.4h7.25V9h-1.1V5.5l-6.15-.04V4.4Zm7.25%2019.2h-7.25v-1.06l6.15-.04V19h1.1v4.6Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E",mobileLink:"ledgerlive://wc?uri=",downloadUrl:"https://www.ledger.com/ledger-live"},{id:"binance",name:"Binance Wallet",rdns:"com.binance.wallet",icon:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22130%22%20height%3D%22130%22%20fill%3D%22none%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h130v130H0z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22M45.587%2057.02%2065.01%2037.606l19.43%2019.43%2011.295-11.303L65.01%2015%2034.284%2045.725zM15%2065.004l11.299-11.299%2011.298%2011.299L26.3%2076.302zM45.587%2072.983%2065.01%2092.406l19.43-19.43%2011.303%2011.287-.008.007-30.725%2030.734-30.725-30.718-.016-.016zM92.403%2065.006%20103.7%2053.708%20115%2065.006l-11.299%2011.299z%22%2F%3E%3Cpath%20fill%3D%22%23F3BA2F%22%20d%3D%22m76.471%2064.998-11.46-11.469-8.476%208.475-.98.972-2.005%202.006-.016.016.016.024%2011.46%2011.453%2011.461-11.47.008-.007z%22%2F%3E%3C%2Fsvg%3E",mobileLink:"bnc://app.binance.com/cedefi/wc?uri=",downloadUrl:"https://www.binance.com/en/download"}],A=Ue;function Ie({open:e,onOpenChange:n,wallet:r,pairing:s}){return t.jsx(a.BottomSheet,{open:e,onOpenChange:n,children:t.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[t.jsx(a.BottomSheetTitle,{children:r?`Connect ${r.name}`:"WalletConnect"}),t.jsx(Le,{wallet:r,pairing:s})]})})}function Le({wallet:e,pairing:n}){const{startWalletConnection:r}=F(),{uri:s,error:i,retry:o}=n,d=j.useConnectors(),l=e?d.find(m=>U(m,e)):void 0,[c,u]=h.useState(l?"browser":"mobile"),[p,D]=h.useState(!1),z=s&&(e!=null&&e.mobileLink)?`${e.mobileLink}${encodeURIComponent(s)}`:s,C=async()=>{if(s)try{await navigator.clipboard.writeText(s),D(!0),setTimeout(()=>D(!1),2e3)}catch{}},g=()=>{l&&r({connectorUid:l.uid,name:(e==null?void 0:e.name)??l.name,icon:(e==null?void 0:e.icon)??l.icon})},f=i;return t.jsxs("div",{className:"zd:flex zd:flex-col zd:items-center zd:gap-3",children:[t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:gap-2",children:[t.jsx("img",{src:e?e.icon:P,alt:"",className:"zd:w-8 zd:h-8 zd:rounded-xl"}),t.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:e?e.name:"WalletConnect"}),t.jsx(a.BottomSheetClose,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),e&&t.jsx("div",{className:"zd:flex zd:w-full zd:gap-2",children:["mobile","browser"].map(m=>t.jsx("button",{type:"button",onClick:()=>u(m),className:`zd:flex-1 zd:rounded-2xl zd:py-1.5 zd:text-body3 zd:cursor-pointer ${c===m?"zd:bg-greyScale/10 zd:font-semibold":"zd:text-greyScale/60"}`,children:m==="mobile"?"Mobile":"Browser"},m))}),!e||c==="mobile"?f?t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-2 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:f}),t.jsx(a.Button,{action:"secondary",text:"Try again",onClick:o})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"zd:bg-white zd:rounded-2xl zd:p-2 zd:border zd:border-greyScale/10",children:z?t.jsx(a.QrCode,{value:z,size:176}):t.jsx("div",{className:"zd:w-[176px] zd:h-[176px] zd:flex zd:items-center zd:justify-center",children:t.jsx("div",{className:"zd:w-8 zd:h-8 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})})}),z&&(e==null?void 0:e.mobileLink)&&t.jsxs("a",{href:z,className:"zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Open in ",e.name]}),t.jsx(a.Button,{action:"secondary",text:p?"Copied":"Copy link",onClick:C,disabled:!z})]}):f?t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-2 zd:items-center",children:[t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:f}),t.jsx(a.Button,{action:"secondary",text:"Try again",onClick:l?g:o})]}):l&&e?t.jsxs("button",{type:"button",onClick:g,className:"zd:w-full zd:cursor-pointer zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Open in ",e.name]}):e&&t.jsxs("a",{href:e.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"zd:w-full zd:rounded-2xl zd:bg-greyScale/10 zd:py-2 zd:text-center zd:text-body2 zd:font-semibold",children:["Get ",e.name]})]})}function te(){var e,n;return typeof window>"u"?!1:((n=(e=window.matchMedia)==null?void 0:e.call(window,"(pointer: coarse)"))==null?void 0:n.matches)||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)}function R(e){return e.type==="walletConnect"&&"zdWalletConnect"in e}function Be(e){const{wallet:n,connectors:r,uri:s,mobile:i}=e;return!n.mobileLink||!i||!s||r.some(o=>U(o,n))?null:`${n.mobileLink}${encodeURIComponent(s)}`}function Oe(){const{goToStep:e}=F(),n=j.useConnectors(),r=n.find(R),{connect:s}=j.useConnect(),o=j.useConnections().some(C=>C.connector.uid===(r==null?void 0:r.uid)),{isReconnecting:d}=j.useAccount(),[l,c]=h.useState(null),[u,p]=h.useState(null),D=h.useRef(!1),z=C=>{p(null),c(null),s({connector:C},{onError:g=>p(g.message)})};return h.useEffect(()=>{if(!r||o)return;const C=({type:w,data:y})=>{w==="display_uri"&&typeof y=="string"&&c(y)};r.emitter.on("message",C);const g=()=>p("Proposal expired"),f=()=>e(null);let m,x=!1;return r.getProvider().then(w=>{var y,S,E;x||(m=w,(E=(S=(y=m.signer)==null?void 0:y.client)==null?void 0:S.events)==null||E.on("proposal_expire",g),m.on("connect",f))}).catch(w=>{x||p(w instanceof Error?w.message:String(w))}),!D.current&&!d&&(D.current=!0,z(r)),()=>{var w,y,S;x=!0,(S=(y=(w=m==null?void 0:m.signer)==null?void 0:w.client)==null?void 0:y.events)==null||S.off("proposal_expire",g),m==null||m.off("connect",f),r.emitter.off("message",C)}},[r,o,d]),{uri:l,error:u,retry:()=>{r&&z(r)},deepLinkFor:C=>Be({wallet:C,connectors:n,uri:u?null:l,mobile:te()})}}const ne=h.createContext(null);function N(){const e=h.useContext(ne);if(!e)throw new Error("SignUp.* components must be rendered inside <SignUp>");return e}function _(e){const{setAuthPending:n}=N();h.useEffect(()=>(n(e),()=>n(!1)),[e,n])}const Re=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function W(e){return Re.test(e.trim())}function se(){const{goToStep:e,setEmail:n,setOtpSession:r}=F(),{authPending:s,emailAuthMethod:i,needsAgreement:o,guardAgreement:d,setError:l}=N(),[c,u]=h.useState(""),p=i==="otp",{mutateAsync:D,isPending:z}=v.useSendOTP(),{mutateAsync:C,isPending:g}=v.useSendMagicLink(),f=z||g;_(f);const m=async()=>{if(!(!c||s)&&W(c)&&d()){l(null);try{const x=p?D:C,{otpId:w,otpEncryptionTargetBundle:y}=await x({email:c});n(c),r({otpId:w,otpEncryptionTargetBundle:y}),e(p?"otp-input":"email-verification")}catch(x){l(x instanceof Error?x.message:"Failed to send verification code")}}};return t.jsx(a.Input,{iconName:"email",placeholder:"Enter your email",value:c,onChange:x=>u(x.target.value),type:"email",autoCapitalize:"none",autoComplete:"email",disabled:s,variant:"listItemStyle",onKeyDown:x=>{x.key==="Enter"&&c&&!s&&m()},children:f?t.jsx("div",{className:"zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center",children:t.jsx("div",{className:"zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin"})}):t.jsx("button",{type:"button",disabled:!W(c)||o,className:`zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${W(c)&&!o?"zd:cursor-pointer":"zd:cursor-not-allowed zd:opacity-50"}`,onClick:()=>m(),children:t.jsx(a.Icon,{name:"chevronRight",className:"zd:text-greyScale"})})})}function q(e){let n=e;for(let s=0;s<5&&Me(n);s++){if(n.code===4001)return!0;n=n.cause}return e instanceof Error?e.name==="AbortError"||e.name==="NotAllowedError"||e.name==="UserRejectedRequestError"?!0:e.message.toLowerCase().includes("oauth popup was closed"):!1}function Me(e){return typeof e=="object"&&e!==null}function ie(){const{goToStep:e}=F(),{authPending:n,guardAgreement:r,setError:s}=N(),{mutateAsync:i,isPending:o}=v.useAuthenticateOAuth({mutation:{onSuccess:()=>{e("authenticated")}}});_(o);const d=async()=>{if(!n&&r()){s(null);try{await i({provider:"google"})}catch(l){q(l)||s(l instanceof Error?l.message:String(l))}}};return t.jsx(a.ListItem,{icon:t.jsx(a.ListItemIcon,{name:"google"}),title:"Google",trailing:t.jsx(a.ListItemChevron,{}),disabled:n,onClick:d})}function We({excludeWalletIds:e=[],maxWallets:n=4}){const{startWalletConnection:r}=F(),{authPending:s,guardAgreement:i,registeredWallets:o}=N(),l=j.useConnectors().filter(u=>u.type==="injected"&&u.id!=="injected"&&u.id!=="zerodev-wallet").map(u=>{const p=A.find(D=>U(u,D));return{connector:u,walletId:p==null?void 0:p.id,name:(p==null?void 0:p.name)??u.name,icon:(p==null?void 0:p.icon)??u.icon,ids:p?[p.id,u.id]:[u.id],rank:p?A.indexOf(p):A.length}}).filter(u=>!(u.walletId&&o.includes(u.walletId))).filter(u=>!u.ids.some(p=>e.includes(p))).sort((u,p)=>u.rank-p.rank).slice(0,n),c=u=>{s||i()&&r({connectorUid:u.connector.uid,name:u.name,icon:u.icon})};return t.jsx(t.Fragment,{children:l.map(u=>t.jsx(a.ListItem,{title:u.name,icon:u.icon?t.jsx("img",{src:u.icon,alt:"",className:"zd:w-6 zd:h-6"}):null,subtitle:t.jsx(a.Badge,{text:"INSTALLED"}),trailing:t.jsx(a.ListItemChevron,{}),disabled:s,onClick:()=>c(u)},u.connector.uid))})}function Pe({tile:e}){return t.jsxs("button",{type:"button",onClick:e.onSelect,className:"zd:flex zd:flex-col zd:items-center zd:gap-1.5 zd:cursor-pointer",children:[t.jsx("div",{className:"zd:w-16 zd:h-16 zd:rounded-2xl zd:bg-greyScale/5 zd:flex zd:items-center zd:justify-center",children:e.icon?t.jsx("img",{src:e.icon,alt:"",className:"zd:w-8 zd:h-8"}):t.jsx(a.Icon,{name:"walletOutline",className:"zd:w-8 zd:h-8 zd:text-greyScale"})}),t.jsx(a.Text,{className:"zd:text-body3 zd:max-w-full zd:truncate",children:e.name})]})}function He({open:e,onOpenChange:n,tiles:r}){return t.jsx(a.BottomSheet,{open:e,onOpenChange:n,children:t.jsxs(a.BottomSheetContent,{className:"zd:p-4",children:[t.jsx(a.BottomSheetTitle,{children:"All wallets"}),t.jsxs("div",{className:"zd:mb-3 zd:flex zd:items-center zd:gap-2",children:[t.jsx(a.Text,{className:"zd:text-h3 zd:flex-1",children:"All wallets"}),t.jsx(a.BottomSheetClose,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":"Close",className:"zd:cursor-pointer zd:px-2 zd:text-greyScale/60",children:"✕"})})]}),t.jsx("div",{className:"zd:grid zd:grid-cols-3 zd:gap-3 zd:max-h-80 zd:overflow-y-auto",children:r.map(s=>t.jsx(Pe,{tile:s},s.key))})]})})}function _e({title:e="More wallets"}){const{startWalletConnection:n}=F(),{authPending:r,guardAgreement:s,openWalletSheet:i}=N(),[o,d]=h.useState(!1),l=j.useConnectors(),c=l.filter(f=>f.id!=="zerodev-wallet"&&f.type!=="walletConnect"),u=(f,m,x)=>{r||s()&&(d(!1),n({connectorUid:f.uid,name:m,icon:x}))},p=l.some(R),D=A.map(f=>{const m=c.find(x=>H(x,f));return{key:f.id,name:f.name,icon:f.icon,onSelect:()=>{if(m){u(m,f.name,f.icon);return}if(p){if(r||!s())return;d(!1),i(f);return}const x=c.find(w=>U(w,f));if(x){u(x,f.name,f.icon);return}d(!1),window.open(f.downloadUrl,"_blank","noopener,noreferrer")}}}),z=c.filter(f=>!A.some(m=>U(f,m))).map(f=>({key:f.uid,name:f.name,icon:f.icon,onSelect:()=>u(f,f.name,f.icon)})),C=p?[{key:"walletconnect",name:"WalletConnect",icon:P,onSelect:()=>{r||s()&&(d(!1),i())}}]:[],g=()=>{r||s()&&d(!0)};return t.jsxs(t.Fragment,{children:[t.jsx(a.ListItem,{icon:t.jsx(a.ListItemIcon,{name:"walletOutline",className:"zd:w-5 zd:h-5"}),title:e,trailing:t.jsx(a.ListItemChevron,{}),disabled:r,onClick:g}),t.jsx(He,{open:o,onOpenChange:d,tiles:[...C,...D,...z]})]})}function re(){const{goToStep:e}=F(),{authPending:n,guardAgreement:r,setError:s}=N(),i={onSuccess:()=>{e("authenticated")},onError:p=>{q(p)||s(p instanceof Error?p.message:String(p))}},{mutate:o,isPending:d}=v.useRegisterPasskey({mutation:i}),{mutate:l,isPending:c}=v.useLoginPasskey({mutation:i});_(d||c);const u=p=>()=>{n||r()&&(s(null),p())};return t.jsxs(t.Fragment,{children:[t.jsx(a.Button,{action:"secondary",text:"Create a passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:u(()=>o())}),t.jsx(a.Button,{action:"secondary",text:"Log in with passkey",iconName:"key",trailIcon:!0,disabled:n,onClick:u(()=>l())})]})}function qe({walletId:e}){const n=A.find(z=>z.id===e);if(!n)throw new Error(`Unknown walletId "${e}". Valid ids: ${A.map(z=>z.id).join(", ")}`);const{startWalletConnection:r}=F(),{authPending:s,guardAgreement:i,registerWallet:o,openWalletSheet:d}=N(),l=j.useConnectors();h.useLayoutEffect(()=>o(n.id),[o,n.id]);const c=l.find(z=>H(z,n)),u={title:n.name,icon:t.jsx("img",{src:n.icon,alt:"",className:"zd:w-6 zd:h-6"}),trailing:t.jsx(a.ListItemChevron,{})};if(!c&&l.some(R))return t.jsx(a.ListItem,{...u,disabled:s,onClick:()=>{s||i()&&d(n)}});const p=c??l.find(z=>U(z,n));if(!p)return t.jsx(a.ListItem,{...u,asChild:!0,children:t.jsx("a",{href:n.downloadUrl,target:"_blank",rel:"noopener noreferrer"})});const D=()=>{s||i()&&r({connectorUid:p.uid,name:n.name,icon:n.icon})};return t.jsx(a.ListItem,{...u,...!!c&&{subtitle:t.jsx(a.Badge,{text:"INSTALLED"})},disabled:s,onClick:D})}function Ze(){const{authPending:e,guardAgreement:n,openWalletSheet:r}=N();if(!j.useConnectors().some(R))return null;const i=()=>{e||n()&&r()};return t.jsx(a.ListItem,{title:"WalletConnect",icon:t.jsx("img",{src:P,alt:"",className:"zd:w-6 zd:h-6"}),subtitle:t.jsx(a.Badge,{text:"QR CODE"}),trailing:t.jsx(a.ListItemChevron,{}),disabled:e,onClick:i})}function oe({children:e,termsAndConditionsUrl:n,privacyPolicyUrl:r,emailAuthMethod:s="magicLink"}){const[i,o]=h.useState(!1),[d,l]=h.useState(!1),[c,u]=h.useState(null),[p,D]=h.useState(!1),[z,C]=h.useState([]),g=h.useCallback(E=>(C(I=>[...I,E]),()=>{C(I=>{const M=[...I];return M.splice(M.indexOf(E),1),M})}),[]),[f,m]=h.useState(null),x=Oe(),y=!!(n||r)&&!i,S=()=>y?(l(!0),!1):!0;return t.jsxs(ne.Provider,{value:{authPending:p,emailAuthMethod:s,setAuthPending:D,needsAgreement:y,guardAgreement:S,setError:u,registeredWallets:z,registerWallet:g,openWalletSheet:E=>{const I=E&&x.deepLinkFor(E);I&&(window.location.href=I),m({wallet:E})}},children:[c!==null&&t.jsx("div",{className:"zd:flex zd:items-center zd:justify-center zd:h-full zd:min-h-100",children:t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-4 zd:max-w-md",children:[t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Error occurred"}),t.jsx(a.Text,{className:"zd:text-center zd:text-red-500",children:c}),t.jsx(a.Button,{action:"primary",text:"Try again",onClick:()=>u(null)})]})}),t.jsxs("div",{className:`zd:-mx-4 zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden${c!==null?" zd:hidden":""}`,children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:justify-center",children:[t.jsxs("div",{className:"zd:px-4 zd:flex zd:flex-col zd:items-center",children:[t.jsx("div",{className:"zd:w-full zd:px-16 zd:py-4",children:t.jsx(Ne,{className:"zd:w-full zd:pointer-events-none zd:select-none"})}),t.jsx(a.Text,{className:"zd:text-h2 zd:text-center",children:"Continue to your wallet"}),t.jsx(a.Text,{className:"zd:mt-2 zd:text-center zd:text-greyScale/50",children:"Choose a sign-in method to proceed"})]}),t.jsx("div",{className:"zd:mt-6 zd:mb-4 zd:px-4 zd:flex zd:flex-col zd:gap-2",children:e})]}),t.jsx("div",{className:"zd:px-4",children:t.jsx(Ae,{termsAndConditionsUrl:n,privacyPolicyUrl:r,agreedToTerms:i,setAgreedToTerms:E=>{o(E),E&&l(!1)},highlight:d})})]}),t.jsx(Ie,{pairing:x,open:f!==null,onOpenChange:E=>{E||m(null)},wallet:f==null?void 0:f.wallet})]})}function ae({label:e="or"}){return t.jsxs("div",{className:"zd:-mx-4 zd:my-2 zd:flex zd:items-center zd:gap-3",children:[t.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"}),t.jsx(a.Text,{className:"zd:text-body3",children:e}),t.jsx("div",{className:"zd:h-px zd:flex-1 zd:bg-greyScale/30"})]})}function Ge(e){return t.jsxs(oe,{...e,children:[t.jsx(re,{}),t.jsx(ae,{}),t.jsx(ie,{}),t.jsx(se,{})]})}const le=Object.assign(oe,{Default:Ge,Passkey:re,Google:ie,Email:se,Wallet:qe,WalletConnect:Ze,InstalledWallets:We,MoreWallets:_e,Divider:ae});function Ve(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get("code")}function Ke(){const{otpId:e,otpEncryptionTargetBundle:n,goToStep:r,clearOtpSession:s}=F(),[i]=h.useState(Ve),[o,d]=h.useState(null),[l,c]=h.useState(!1),u=h.useRef(!1),{mutate:p,isPending:D}=v.useVerifyMagicLink({mutation:{onSuccess:()=>{s(),r("authenticated")},onError:z=>{d(z)}}});return h.useEffect(()=>{if(!(u.current||!i)){if(u.current=!0,!e||!n){c(!0);return}p({otpId:e,code:i,otpEncryptionTargetBundle:n})}},[e,n,i,p,r]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[!o&&D&&t.jsx(b,{imageName:"loading",title:"Verifying Your Email",children:"Please wait while we securely connect your wallet."}),!o&&l&&t.jsxs(t.Fragment,{children:[t.jsxs(b,{imageName:"error",title:"Link Expired",children:["This verification link has expired or was already used.",t.jsx("br",{}),"Please sign in again to request a new one."]}),t.jsx(a.Button,{action:"primary",onClick:()=>{B(),r("sign-up")},text:"Choose another sign-in method"})]}),!o&&!l&&!i&&!D&&t.jsxs(t.Fragment,{children:[t.jsxs(b,{imageName:"error",title:"Invalid Link",children:["This verification link is invalid or incomplete.",t.jsx("br",{}),"Please check your email and try again with the correct link."]}),t.jsx(a.Button,{action:"primary",onClick:()=>{B(),r("sign-up")},text:"Choose another sign-in method"})]}),o!=null&&t.jsxs(t.Fragment,{children:[t.jsx(b,{imageName:"error",title:"Oops, something went wrong",children:"We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request."}),t.jsx(a.Button,{action:"primary",onClick:()=>{B(),r("sign-up")},text:"Choose another sign-in method"})]})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function Je(e){let n=e;for(let r=0;r<5&&Qe(n);r++){if(n.code===-32002||n.name==="ResourceUnavailableRpcError")return!0;n=n.cause}return!1}function Qe(e){return typeof e=="object"&&e!==null}const G=new WeakMap;function V(e){let n=G.get(e);return n||(n=new Set,G.set(e,n)),n}function Ye(e,n){if(q(e))return{title:"Request declined",message:`You declined the connection request in ${n}.`,pending:!1};if(Je(e))return{title:`Check ${n}`,message:`Open ${n} and check for an outstanding request. If one is waiting, approve or dismiss it, then try again.`,pending:!0};let r,s;if(typeof e=="string"&&e.length>0)r=e;else if(typeof e=="object"&&e!==null){const i=e,o=i.shortMessage??i.message;typeof o=="string"&&o.length>0&&(r=o),typeof i.code=="number"&&(s=i.code)}return{title:"Couldn’t connect",message:r??`Something went wrong while connecting to ${n}. Please try again.`+(s!==void 0?` (code ${s})`:""),pending:!1}}function Xe(){const{pendingWallet:e,connectError:n,setConnectError:r,clearPendingWallet:s,goToStep:i}=F(),o=j.useConnectors(),d=j.useConfig(),l=ee(),c=e?o.find(g=>g.uid===e.connectorUid):void 0,u=(e==null?void 0:e.name)??"your wallet",p=()=>{const g=l.getState().auth;g.stepHistory.length>0?g.goBack():g.goToStep("sign-up")},D=()=>{s(),i(null)},z=()=>{if(r(null),c&&V(d).has(c.uid))return;if(!c){s(),p();return}if(d.state.current===c.uid){D();return}const g=V(d);g.add(c.uid),ue.connect(d,{connector:c}).then(()=>{g.delete(c.uid),D()},f=>{var x;g.delete(c.uid);const m=l.getState().auth;m.step!=="wallet-connecting"||((x=m.pendingWallet)==null?void 0:x.connectorUid)!==c.uid||r(Ye(f,u))})};h.useEffect(()=>{if(!c)return;const g=c.uid;return d.subscribe(f=>f.status==="connected"?f.current:null,f=>{var w;if(!f)return;const m=(w=d.state.connections.get(f))==null?void 0:w.connector;if((m==null?void 0:m.uid)!==g)return;const x=l.getState().auth;x.clearPendingWallet(),x.goToStep(null)})},[c,d,l]);const C=h.useRef(!1);return h.useEffect(()=>{C.current||(C.current=!0,z())},[]),t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center",children:[n===null?t.jsxs(b,{imageName:"loading",title:`Waiting for ${u}`,children:["Approve or reject the request in your wallet.",t.jsx("br",{}),"Nothing showing? Open the wallet, the request may be waiting behind its unlock screen."]}):t.jsx(b,{imageName:n.pending?"loading":"error",title:n.title,children:n.message}),t.jsxs("div",{className:"zd:flex zd:flex-col zd:gap-1",children:[n!==null&&t.jsx(a.Button,{action:"primary",text:"Try again",onClick:z}),t.jsx(a.Button,{action:"secondary",text:"Choose another sign-in method",onClick:p})]})]}),t.jsx(a.PoweredBy,{className:"zd:self-center zd:pt-4 zd:pb-6"})]})}function $e(){return t.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:t.jsx(b,{imageName:"loading",title:"Authenticating...",children:"Please wait while we complete the OAuth authentication."})})}function e2(){return t.jsx("div",{className:"zd:flex zd:flex-1 zd:items-center zd:justify-center",children:t.jsx(b,{imageName:"loading",title:"Passkey authentication",children:"Please authenticate with your passkey."})})}function t2(e,n){switch(e){case"sign-up":return n?n():t.jsx(le.Default,{});case"email-verification":return t.jsx(Ce,{});case"otp-input":return t.jsx(be,{});case"verifying-otp":return t.jsx(Ke,{});case"oauth-in-progress":return t.jsx($e,{});case"passkey-prompt":return t.jsx(e2,{});case"wallet-connecting":return t.jsx(Xe,{});case"error":return t.jsx(we,{});default:return null}}function n2({onClose:e,size:n,renderSignUp:r,logo:s}={}){const{step:i,goToStep:o,goBack:d,reset:l}=F();h.useEffect(()=>{i===null&&De()&&o("verifying-otp")},[i,o]);const c=t2(i,r);if(!c)return null;const u=()=>{B(),l(),e==null||e()};return t.jsx(a.Screen,{...n&&{size:n},className:i==="sign-up"?"zd:h-auto zd:max-h-202.5":void 0,topNav:t.jsx(a.TopNav,{...d!==null&&{onLeftButtonClick:d},onRightButtonClick:u,...i==="sign-up"&&{...s&&{logo:s},className:"zd:px-4"}}),children:c})}function s2(e){const n=e.toLowerCase();return A.find(r=>{const s=r.name.toLowerCase();return n.includes(s)||s.includes(n)})}function i2(e){return A.find(n=>U(e,n))}function r2(){const{connector:e,isConnected:n}=j.useAccount(),[r,s]=h.useState(void 0),i=!!e&&e.type==="walletConnect";return h.useEffect(()=>{if(!e||!i){s(void 0);return}let o=!1;return e.getProvider().then(d=>{var c,u;if(o)return;const l=(u=(c=d.session)==null?void 0:c.peer)==null?void 0:u.metadata;s(l)}).catch(()=>{}),()=>{o=!0}},[e,i]),h.useMemo(()=>{var d;if(!n||!e)return;if(e.id==="zerodev-wallet")return{name:e.name,icon:e.icon,source:"embedded"};if(i){const l=r!=null&&r.name?s2(r.name):void 0;return{name:(r==null?void 0:r.name)??void 0,icon:((d=r==null?void 0:r.icons)==null?void 0:d[0])??(l==null?void 0:l.icon),walletId:l==null?void 0:l.id,source:"walletconnect"}}const o=i2(e);return{name:e.name,icon:e.icon??(o==null?void 0:o.icon),walletId:o==null?void 0:o.id,source:e.type==="injected"?"injected":"other"}},[e,n,i,r])}function o2(e){const n=r2();return h.useMemo(()=>({walletInfo:n}),[n])}const Z="zerodev:auth:otpSession";function a2(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Z);if(!e)return null;const n=JSON.parse(e);return!(n!=null&&n.otpId)||!(n!=null&&n.otpEncryptionTargetBundle)?null:n}catch{return null}}function l2(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Z,JSON.stringify(e))}catch{}}function K(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Z)}catch{}}const c2=(e,n,r)=>({auth:{step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null,pendingWallet:null,connectError:null,initialize:()=>{const s=a2();s&&e(i=>({auth:{...i.auth,otpId:s.otpId,otpEncryptionTargetBundle:s.otpEncryptionTargetBundle}}))},goToStep:s=>{e(i=>({auth:{...i.auth,step:s,stepHistory:s===null?[]:i.auth.step===null?i.auth.stepHistory:[...i.auth.stepHistory,i.auth.step]}}))},goBack:()=>{const{auth:s}=n();if(s.stepHistory.length===0)return;const i=[...s.stepHistory],o=i.pop();e(d=>({auth:{...d.auth,step:o,stepHistory:i}}))},reset:()=>{K(),e(s=>({auth:{...s.auth,step:null,stepHistory:[],email:null,otpId:null,otpEncryptionTargetBundle:null,pendingWallet:null,connectError:null}}))},startWalletConnection:s=>{e(i=>({auth:{...i.auth,pendingWallet:s,connectError:null,step:"wallet-connecting",stepHistory:i.auth.step===null?i.auth.stepHistory:[...i.auth.stepHistory,i.auth.step]}}))},setConnectError:s=>{e(i=>({auth:{...i.auth,connectError:s}}))},clearPendingWallet:()=>{e(s=>({auth:{...s.auth,pendingWallet:null,connectError:null}}))},setEmail:s=>{e(i=>({auth:{...i.auth,email:s}}))},setOtpSession:({otpId:s,otpEncryptionTargetBundle:i})=>{l2({otpId:s,otpEncryptionTargetBundle:i}),e(o=>({auth:{...o.auth,otpId:s,otpEncryptionTargetBundle:i}}))},clearOtpSession:()=>{K(),e(s=>({auth:{...s.auth,otpId:null,otpEncryptionTargetBundle:null}}))}}}),d2=()=>k.create()(fe.subscribeWithSelector((e,n,r)=>({pendingRequests:[],userConfirmationListenerActive:!1,addPendingRequest:s=>e(i=>({pendingRequests:[...i.pendingRequests,s]})),removePendingRequest:s=>e(i=>({pendingRequests:i.pendingRequests.filter(o=>o.id!==s)})),clearPendingRequests:()=>e({pendingRequests:[]}),setUserConfirmationListenerActive:s=>e({userConfirmationListenerActive:s}),...c2(e,n)})));function u2(e){return new Promise((n,r)=>{const s=e.subscribe(i=>i.auth.step,i=>{i==="authenticated"?(s(),n()):i===null&&(s(),r(new Error("Auth flow dismissed")))})})}function f2(e){const n=v.zeroDevWallet(e),r=d2();return s=>{const i=n(s);return{...i,async connect(o){try{return await i.connect(o)}catch(d){if(o!=null&&o.isReconnecting||!(d instanceof v.NotAuthenticatedError))throw d;if(r.getState().auth.step!==null)throw new Error("Auth flow already in progress");return r.getState().auth.goToStep("sign-up"),await u2(r),i.connect(o)}},async disconnect(){var o;await((o=i.disconnect)==null?void 0:o.call(i)),r.getState().auth.reset()},async setup(){var o;typeof window<"u"&&r.getState().auth.initialize(),await((o=i.setup)==null?void 0:o.call(i)),typeof window>"u"},getKitStore(){return r}}}}const p2={Pending:"zd:text-solarOrange",Success:"zd:text-positive",Failed:"zd:text-negative"};function m2({icon:e,title:n,value:r,chainName:s,chainIconUrl:i,destChainName:o,destChainIconUrl:d,status:l,className:c}){return t.jsxs("div",{className:a.cn("zd:flex zd:w-full zd:items-center zd:gap-2 zd:p-2",c),children:[t.jsx("div",{className:"zd:flex zd:size-11 zd:shrink-0 zd:items-center zd:justify-center zd:rounded-xl zd:bg-white",children:t.jsx(a.Icon,{name:e,className:"zd:size-5"})}),t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:flex-1 zd:flex-col zd:gap-2",children:[t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[t.jsx(a.Text,{className:"zd:shrink-0 zd:whitespace-nowrap zd:text-body1",children:n}),t.jsx(a.Text,{className:"zd:min-w-0 zd:truncate zd:text-right zd:text-body1",children:r})]}),t.jsxs("div",{className:"zd:flex zd:w-full zd:items-center zd:justify-between zd:gap-2",children:[t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-2",children:[t.jsx(J,{name:s,...i&&{iconUrl:i}}),o&&t.jsxs(t.Fragment,{children:[t.jsx(a.Icon,{name:"arrowRightFill","aria-hidden":!0,className:"zd:size-3 zd:shrink-0 zd:opacity-30"}),t.jsx(J,{name:o,...d&&{iconUrl:d}})]})]}),t.jsx(a.Text,{className:a.cn("zd:shrink-0 zd:text-body3",p2[l]),children:l})]})]})]})}function J({name:e,iconUrl:n}){return t.jsxs("div",{className:"zd:flex zd:min-w-0 zd:items-center zd:gap-[5px]",children:[n&&t.jsx("span",{className:"zd:size-3 zd:shrink-0 zd:overflow-hidden zd:rounded-full zd:bg-white",children:t.jsx("img",{src:n,alt:"","aria-hidden":!0,className:"zd:size-full zd:object-cover"})}),t.jsx(a.Text,{className:"zd:truncate zd:text-body3",children:e})]})}const L="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/arbitrum/info/logo.png",Q="https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/base/info/logo.png",T=3600*1e3,h2=[{id:"mock-1",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:L,destChainName:"Base",destChainIconUrl:Q,status:"Pending",timestamp:Date.now()-1*T},{id:"mock-2",icon:"arrowSwapHorizontalOutline",title:"Swapped ETH → USD₮0",value:"2,343 ETH",chainName:"Arbitrum One",chainIconUrl:L,destChainName:"Base",destChainIconUrl:Q,status:"Pending",timestamp:Date.now()-2*T},{id:"mock-3",icon:"lighting",title:"Fixed Yield",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:L,status:"Success",timestamp:Date.now()-3*T},{id:"mock-4",icon:"imageFill",title:"Received NFT",value:"Bored Ape Yacht Club",chainName:"Arbitrum One",chainIconUrl:L,status:"Success",timestamp:Date.now()-4*T},{id:"mock-5",icon:"lighting",title:"Collateral Used",value:"Collateralization enabled for USD₮0",chainName:"Arbitrum One",chainIconUrl:L,status:"Success",timestamp:Date.now()-336*T},{id:"mock-6",icon:"lighting",title:"Liquid Staked ETH",value:"2,323 PT wstETH (25 Jan 2026)",chainName:"Arbitrum One",chainIconUrl:L,status:"Success",timestamp:Date.now()-336*T-1*T}];function O(e){const n=new Date(e);return`${n.getFullYear()}-${n.getMonth()}-${n.getDate()}`}function g2(e,n){const r=O(e);return r===O(n)?"Today":r===O(n-1440*60*1e3)?"Yesterday":new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(new Date(e))}function x2(e,n=Date.now()){var o;const r=[...e].sort((d,l)=>l.timestamp-d.timestamp),s=[];let i=null;for(const d of r){const l=O(d.timestamp);l!==i&&(i=l,s.push({label:g2(d.timestamp,n),entries:[]})),(o=s[s.length-1])==null||o.entries.push(d)}return s}function z2({entries:e=h2,onSelectEntry:n}){const r=x2(e);return t.jsx("div",{className:"zd:flex zd:h-full zd:w-full zd:flex-col zd:gap-1 zd:pt-2 zd:pb-4",children:t.jsx(a.Wrapper,{variant:"ghost",className:"zd:flex zd:w-full zd:flex-1 zd:flex-col zd:gap-1 zd:overflow-y-auto zd:rounded-2xl zd:p-2",children:r.map(s=>t.jsxs(h.Fragment,{children:[t.jsx("div",{className:"zd:flex zd:w-full zd:items-center zd:py-2 zd:pr-2",children:t.jsx(a.Text,{className:"zd:text-body3",children:s.label})}),s.entries.map(i=>n?t.jsx("button",{type:"button",onClick:()=>n(i),className:"zd:w-full zd:cursor-pointer zd:text-left",children:t.jsx(Y,{entry:i})},i.id):t.jsx(Y,{entry:i},i.id))]},s.label))})})}function Y({entry:e}){return t.jsx(m2,{icon:e.icon,title:e.title,value:e.value,chainName:e.chainName,...e.chainIconUrl&&{chainIconUrl:e.chainIconUrl},...e.destChainName&&{destChainName:e.destChainName},...e.destChainIconUrl&&{destChainIconUrl:e.destChainIconUrl},status:e.status})}const C2={history:"History"};function D2({onClose:e,entries:n,onSelectEntry:r,className:s,size:i}){const[o]=h.useState("history"),d=()=>{switch(o){case"history":return t.jsx(z2,{...n&&{entries:n},...r&&{onSelectEntry:r}})}};return t.jsx(a.Screen,{...s&&{className:s},...i&&{size:i},topNav:t.jsx(a.TopNav,{title:C2[o],onRightButtonClick:e}),children:d()})}const ce="WALLETCONNECT_DEEPLINK_CHOICE",X=new WeakSet;function $(e){var s,i,o;const n=(i=(s=e.session)==null?void 0:s.peer)==null?void 0:i.metadata,r=(o=n==null?void 0:n.redirect)==null?void 0:o.native;if(!r||!te()){de();return}try{localStorage.setItem(ce,JSON.stringify({href:r,name:(n==null?void 0:n.name)??""}))}catch{}}function de(){try{localStorage.removeItem(ce)}catch{}}function w2(e){X.has(e)||(X.add(e),e.on("connect",()=>$(e)),e.on("disconnect",de),e.session&&$(e))}function E2(e){if(!e.projectId)throw new Error("zeroDevWalletConnect requires a WalletConnect projectId");const n=pe.walletConnect({...e,showQrModal:!1});return r=>{const s=Object.assign(n(r),{zdWalletConnect:!0}),i=s.getProvider.bind(s);return s.getProvider=async(...o)=>{const d=await i(...o);return w2(d),d},s}}exports.ConnectWallet=n2;exports.SignUp=le;exports.TxHistory=D2;exports.useAuth=F;exports.useWalletInfo=o2;exports.zeroDevWallet=f2;exports.zeroDevWalletConnect=E2;
4
4
  //# sourceMappingURL=index.cjs.map