@coinbase/cdp-react 0.0.86 → 0.0.88

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 (113) hide show
  1. package/dist/assets/CDPReactProvider.css +1 -1
  2. package/dist/assets/EnrollMfaFlow.css +1 -1
  3. package/dist/assets/VerifyMfaFlow.css +1 -1
  4. package/dist/assets/VerifyMfaFlowBackButton.css +1 -0
  5. package/dist/assets/VerifyMfaInline.css +1 -1
  6. package/dist/assets/VerifyMfaItem.css +1 -0
  7. package/dist/assets/VerifyMfaItems.css +1 -0
  8. package/dist/assets/sms.css +1 -0
  9. package/dist/chunks/CDPReactProvider.BkmtXUv1.js +337 -0
  10. package/dist/chunks/{LinkAuthFlow.BaUSMzGH.js → LinkAuthFlow.B4FAtf4V.js} +13 -13
  11. package/dist/chunks/index.BX4k-ruQ.js +12 -0
  12. package/dist/chunks/index.Bgx0-QLY.js +12 -0
  13. package/dist/chunks/{index.C_DV0Ud7.js → index.DgrgIsTX.js} +1 -1
  14. package/dist/chunks/useSendComponentCallOnce.DGjALrnZ.js +278 -0
  15. package/dist/components/AuthButton/index.js +1 -1
  16. package/dist/components/CDPReactProvider/index.js +1 -1
  17. package/dist/components/CopyEvmKeyButton/index.js +1 -1
  18. package/dist/components/CopySolanaKeyButton/index.js +1 -1
  19. package/dist/components/EnrollMfa/EnrollMfaDescription.js +4 -3
  20. package/dist/components/EnrollMfa/EnrollMfaFlow.js +27 -26
  21. package/dist/components/EnrollMfa/EnrollMfaFlowBackButton.js +7 -6
  22. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.d.ts +1 -1
  23. package/dist/components/EnrollMfa/EnrollMfaFlowProvider.js +5 -4
  24. package/dist/components/EnrollMfa/EnrollMfaImage.js +7 -6
  25. package/dist/components/EnrollMfa/EnrollMfaItem.js +7 -6
  26. package/dist/components/EnrollMfa/EnrollMfaItems.js +28 -25
  27. package/dist/components/EnrollMfa/EnrollMfaProvider.js +22 -17
  28. package/dist/components/EnrollMfa/EnrollMfaTitle.js +8 -7
  29. package/dist/components/EnrollMfa/index.js +134 -128
  30. package/dist/components/EnrollMfa/methods/sms.d.ts +6 -0
  31. package/dist/components/EnrollMfa/methods/sms.js +148 -0
  32. package/dist/components/EnrollMfa/methods/totp.js +24 -19
  33. package/dist/components/EnrollMfa/types.d.ts +17 -5
  34. package/dist/components/EnrollMfa/types.js +1 -0
  35. package/dist/components/EnrollMfa/useEnrollMfaReducer.js +51 -38
  36. package/dist/components/EnrollMfaModal/index.js +2 -2
  37. package/dist/components/ExportWallet/index.js +109 -101
  38. package/dist/components/ExportWalletModal/index.js +2 -2
  39. package/dist/components/Fund/index.js +2 -2
  40. package/dist/components/FundModal/index.js +2 -2
  41. package/dist/components/LinkAuth/LinkAuthFlow.js +2 -2
  42. package/dist/components/LinkAuth/LinkAuthFlowBackButton.js +2 -2
  43. package/dist/components/LinkAuth/LinkAuthFlowProvider.js +2 -2
  44. package/dist/components/LinkAuth/LinkAuthItem.js +1 -1
  45. package/dist/components/LinkAuth/LinkAuthItems.js +1 -1
  46. package/dist/components/LinkAuth/LinkAuthProvider.js +1 -1
  47. package/dist/components/LinkAuth/index.js +4 -4
  48. package/dist/components/LinkAuth/types.js +1 -1
  49. package/dist/components/LinkAuth/utils.js +1 -1
  50. package/dist/components/LinkAuthModal/index.js +3 -3
  51. package/dist/components/OAuthStatusModal/index.js +2 -2
  52. package/dist/components/SendEvmTransactionButton/index.js +1 -1
  53. package/dist/components/SendSolanaTransactionButton/index.js +1 -1
  54. package/dist/components/SignIn/SignInAuthMethodButtons.js +1 -1
  55. package/dist/components/SignIn/SignInBackButton.js +12 -12
  56. package/dist/components/SignIn/SignInDescription.js +2 -2
  57. package/dist/components/SignIn/SignInForm.js +2 -2
  58. package/dist/components/SignIn/SignInImage.js +1 -1
  59. package/dist/components/SignIn/SignInProvider.js +1 -1
  60. package/dist/components/SignIn/SignInTitle.js +2 -2
  61. package/dist/components/SignIn/flows/SignInWithEmail.js +1 -1
  62. package/dist/components/SignIn/flows/SignInWithOAuth.js +1 -1
  63. package/dist/components/SignIn/flows/SignInWithSms.js +74 -84
  64. package/dist/components/SignIn/index.js +2 -2
  65. package/dist/components/SignIn/types.d.ts +2 -0
  66. package/dist/components/SignIn/types.js +1 -1
  67. package/dist/components/SignIn/useSignInReducer.js +20 -6
  68. package/dist/components/SignInModal/index.js +2 -2
  69. package/dist/components/SignOutButton/index.js +1 -1
  70. package/dist/components/VerifyMfa/VerifyMfaDescription.d.ts +1 -1
  71. package/dist/components/VerifyMfa/VerifyMfaDescription.js +24 -14
  72. package/dist/components/VerifyMfa/VerifyMfaFlow.d.ts +5 -4
  73. package/dist/components/VerifyMfa/VerifyMfaFlow.js +52 -13
  74. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.d.ts +9 -0
  75. package/dist/components/VerifyMfa/VerifyMfaFlowBackButton.js +40 -0
  76. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.d.ts +23 -0
  77. package/dist/components/VerifyMfa/VerifyMfaFlowProvider.js +37 -0
  78. package/dist/components/VerifyMfa/VerifyMfaImage.d.ts +1 -1
  79. package/dist/components/VerifyMfa/VerifyMfaImage.js +25 -13
  80. package/dist/components/VerifyMfa/VerifyMfaItem.d.ts +10 -0
  81. package/dist/components/VerifyMfa/VerifyMfaItem.js +27 -0
  82. package/dist/components/VerifyMfa/VerifyMfaItems.d.ts +9 -0
  83. package/dist/components/VerifyMfa/VerifyMfaItems.js +31 -0
  84. package/dist/components/VerifyMfa/VerifyMfaProvider.js +27 -14
  85. package/dist/components/VerifyMfa/VerifyMfaTitle.d.ts +1 -1
  86. package/dist/components/VerifyMfa/VerifyMfaTitle.js +23 -13
  87. package/dist/components/VerifyMfa/index.d.ts +6 -2
  88. package/dist/components/VerifyMfa/index.js +24 -15
  89. package/dist/components/VerifyMfa/methods/sms.d.ts +6 -0
  90. package/dist/components/VerifyMfa/methods/sms.js +90 -0
  91. package/dist/components/VerifyMfa/methods/totp.js +40 -39
  92. package/dist/components/VerifyMfa/types.d.ts +21 -2
  93. package/dist/components/VerifyMfa/types.js +1 -0
  94. package/dist/components/VerifyMfa/useVerifyMfaReducer.d.ts +2 -1
  95. package/dist/components/VerifyMfa/useVerifyMfaReducer.js +29 -4
  96. package/dist/components/VerifyMfaInline/index.d.ts +1 -1
  97. package/dist/components/VerifyMfaInline/index.js +133 -116
  98. package/dist/components/VerifyMfaModal/index.js +8 -6
  99. package/dist/components/ui/SwitchTransition/index.js +3 -3
  100. package/dist/hooks/usePhoneNumberState.d.ts +15 -0
  101. package/dist/hooks/usePhoneNumberState.js +39 -0
  102. package/dist/hooks/useTransitionMap.js +24 -22
  103. package/dist/hooks/useVerifyMfaModal.js +2 -2
  104. package/dist/index.js +60 -52
  105. package/dist/utils/transition.d.ts +3 -3
  106. package/dist/utils/transition.js +21 -20
  107. package/dist/version.d.ts +1 -1
  108. package/dist/version.js +1 -1
  109. package/package.json +6 -6
  110. package/dist/chunks/CDPReactProvider.CIQm4C4z.js +0 -299
  111. package/dist/chunks/index.CKQKBoX2.js +0 -9
  112. package/dist/chunks/index.Dp-lIxM1.js +0 -9
  113. package/dist/chunks/useSendComponentCallOnce.BHZMuo6E.js +0 -273
@@ -0,0 +1,278 @@
1
+ import { useRef as L, useEffect as M } from "react";
2
+ function N(f) {
3
+ return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
4
+ }
5
+ var w = { exports: {} }, T = { exports: {} }, C;
6
+ function q() {
7
+ return C || (C = 1, function() {
8
+ var f = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = {
9
+ // Bit-wise rotation left
10
+ rotl: function(c, u) {
11
+ return c << u | c >>> 32 - u;
12
+ },
13
+ // Bit-wise rotation right
14
+ rotr: function(c, u) {
15
+ return c << 32 - u | c >>> u;
16
+ },
17
+ // Swap big-endian to little-endian and vice versa
18
+ endian: function(c) {
19
+ if (c.constructor == Number)
20
+ return d.rotl(c, 8) & 16711935 | d.rotl(c, 24) & 4278255360;
21
+ for (var u = 0; u < c.length; u++)
22
+ c[u] = d.endian(c[u]);
23
+ return c;
24
+ },
25
+ // Generate an array of any length of random bytes
26
+ randomBytes: function(c) {
27
+ for (var u = []; c > 0; c--)
28
+ u.push(Math.floor(Math.random() * 256));
29
+ return u;
30
+ },
31
+ // Convert a byte array to big-endian 32-bit words
32
+ bytesToWords: function(c) {
33
+ for (var u = [], a = 0, s = 0; a < c.length; a++, s += 8)
34
+ u[s >>> 5] |= c[a] << 24 - s % 32;
35
+ return u;
36
+ },
37
+ // Convert big-endian 32-bit words to a byte array
38
+ wordsToBytes: function(c) {
39
+ for (var u = [], a = 0; a < c.length * 32; a += 8)
40
+ u.push(c[a >>> 5] >>> 24 - a % 32 & 255);
41
+ return u;
42
+ },
43
+ // Convert a byte array to a hex string
44
+ bytesToHex: function(c) {
45
+ for (var u = [], a = 0; a < c.length; a++)
46
+ u.push((c[a] >>> 4).toString(16)), u.push((c[a] & 15).toString(16));
47
+ return u.join("");
48
+ },
49
+ // Convert a hex string to a byte array
50
+ hexToBytes: function(c) {
51
+ for (var u = [], a = 0; a < c.length; a += 2)
52
+ u.push(parseInt(c.substr(a, 2), 16));
53
+ return u;
54
+ },
55
+ // Convert a byte array to a base-64 string
56
+ bytesToBase64: function(c) {
57
+ for (var u = [], a = 0; a < c.length; a += 3)
58
+ for (var s = c[a] << 16 | c[a + 1] << 8 | c[a + 2], l = 0; l < 4; l++)
59
+ a * 8 + l * 6 <= c.length * 8 ? u.push(f.charAt(s >>> 6 * (3 - l) & 63)) : u.push("=");
60
+ return u.join("");
61
+ },
62
+ // Convert a base-64 string to a byte array
63
+ base64ToBytes: function(c) {
64
+ c = c.replace(/[^A-Z0-9+\/]/ig, "");
65
+ for (var u = [], a = 0, s = 0; a < c.length; s = ++a % 4)
66
+ s != 0 && u.push((f.indexOf(c.charAt(a - 1)) & Math.pow(2, -2 * s + 8) - 1) << s * 2 | f.indexOf(c.charAt(a)) >>> 6 - s * 2);
67
+ return u;
68
+ }
69
+ };
70
+ T.exports = d;
71
+ }()), T.exports;
72
+ }
73
+ var F, m;
74
+ function x() {
75
+ if (m) return F;
76
+ m = 1;
77
+ var f = {
78
+ // UTF-8 encoding
79
+ utf8: {
80
+ // Convert a string to a byte array
81
+ stringToBytes: function(d) {
82
+ return f.bin.stringToBytes(unescape(encodeURIComponent(d)));
83
+ },
84
+ // Convert a byte array to a string
85
+ bytesToString: function(d) {
86
+ return decodeURIComponent(escape(f.bin.bytesToString(d)));
87
+ }
88
+ },
89
+ // Binary encoding
90
+ bin: {
91
+ // Convert a string to a byte array
92
+ stringToBytes: function(d) {
93
+ for (var c = [], u = 0; u < d.length; u++)
94
+ c.push(d.charCodeAt(u) & 255);
95
+ return c;
96
+ },
97
+ // Convert a byte array to a string
98
+ bytesToString: function(d) {
99
+ for (var c = [], u = 0; u < d.length; u++)
100
+ c.push(String.fromCharCode(d[u]));
101
+ return c.join("");
102
+ }
103
+ }
104
+ };
105
+ return F = f, F;
106
+ }
107
+ /*!
108
+ * Determine if an object is a Buffer
109
+ *
110
+ * @author Feross Aboukhadijeh <https://feross.org>
111
+ * @license MIT
112
+ */
113
+ var S, O;
114
+ function H() {
115
+ if (O) return S;
116
+ O = 1, S = function(c) {
117
+ return c != null && (f(c) || d(c) || !!c._isBuffer);
118
+ };
119
+ function f(c) {
120
+ return !!c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c);
121
+ }
122
+ function d(c) {
123
+ return typeof c.readFloatLE == "function" && typeof c.slice == "function" && f(c.slice(0, 0));
124
+ }
125
+ return S;
126
+ }
127
+ var A;
128
+ function V() {
129
+ return A || (A = 1, function() {
130
+ var f = q(), d = x().utf8, c = H(), u = x().bin, a = function(s, l) {
131
+ s.constructor == String ? l && l.encoding === "binary" ? s = u.stringToBytes(s) : s = d.stringToBytes(s) : c(s) ? s = Array.prototype.slice.call(s, 0) : !Array.isArray(s) && s.constructor !== Uint8Array && (s = s.toString());
132
+ for (var o = f.bytesToWords(s), y = s.length * 8, e = 1732584193, n = -271733879, r = -1732584194, t = 271733878, i = 0; i < o.length; i++)
133
+ o[i] = (o[i] << 8 | o[i] >>> 24) & 16711935 | (o[i] << 24 | o[i] >>> 8) & 4278255360;
134
+ o[y >>> 5] |= 128 << y % 32, o[(y + 64 >>> 9 << 4) + 14] = y;
135
+ for (var p = a._ff, h = a._gg, v = a._hh, _ = a._ii, i = 0; i < o.length; i += 16) {
136
+ var P = e, k = n, D = r, U = t;
137
+ e = p(e, n, r, t, o[i + 0], 7, -680876936), t = p(t, e, n, r, o[i + 1], 12, -389564586), r = p(r, t, e, n, o[i + 2], 17, 606105819), n = p(n, r, t, e, o[i + 3], 22, -1044525330), e = p(e, n, r, t, o[i + 4], 7, -176418897), t = p(t, e, n, r, o[i + 5], 12, 1200080426), r = p(r, t, e, n, o[i + 6], 17, -1473231341), n = p(n, r, t, e, o[i + 7], 22, -45705983), e = p(e, n, r, t, o[i + 8], 7, 1770035416), t = p(t, e, n, r, o[i + 9], 12, -1958414417), r = p(r, t, e, n, o[i + 10], 17, -42063), n = p(n, r, t, e, o[i + 11], 22, -1990404162), e = p(e, n, r, t, o[i + 12], 7, 1804603682), t = p(t, e, n, r, o[i + 13], 12, -40341101), r = p(r, t, e, n, o[i + 14], 17, -1502002290), n = p(n, r, t, e, o[i + 15], 22, 1236535329), e = h(e, n, r, t, o[i + 1], 5, -165796510), t = h(t, e, n, r, o[i + 6], 9, -1069501632), r = h(r, t, e, n, o[i + 11], 14, 643717713), n = h(n, r, t, e, o[i + 0], 20, -373897302), e = h(e, n, r, t, o[i + 5], 5, -701558691), t = h(t, e, n, r, o[i + 10], 9, 38016083), r = h(r, t, e, n, o[i + 15], 14, -660478335), n = h(n, r, t, e, o[i + 4], 20, -405537848), e = h(e, n, r, t, o[i + 9], 5, 568446438), t = h(t, e, n, r, o[i + 14], 9, -1019803690), r = h(r, t, e, n, o[i + 3], 14, -187363961), n = h(n, r, t, e, o[i + 8], 20, 1163531501), e = h(e, n, r, t, o[i + 13], 5, -1444681467), t = h(t, e, n, r, o[i + 2], 9, -51403784), r = h(r, t, e, n, o[i + 7], 14, 1735328473), n = h(n, r, t, e, o[i + 12], 20, -1926607734), e = v(e, n, r, t, o[i + 5], 4, -378558), t = v(t, e, n, r, o[i + 8], 11, -2022574463), r = v(r, t, e, n, o[i + 11], 16, 1839030562), n = v(n, r, t, e, o[i + 14], 23, -35309556), e = v(e, n, r, t, o[i + 1], 4, -1530992060), t = v(t, e, n, r, o[i + 4], 11, 1272893353), r = v(r, t, e, n, o[i + 7], 16, -155497632), n = v(n, r, t, e, o[i + 10], 23, -1094730640), e = v(e, n, r, t, o[i + 13], 4, 681279174), t = v(t, e, n, r, o[i + 0], 11, -358537222), r = v(r, t, e, n, o[i + 3], 16, -722521979), n = v(n, r, t, e, o[i + 6], 23, 76029189), e = v(e, n, r, t, o[i + 9], 4, -640364487), t = v(t, e, n, r, o[i + 12], 11, -421815835), r = v(r, t, e, n, o[i + 15], 16, 530742520), n = v(n, r, t, e, o[i + 2], 23, -995338651), e = _(e, n, r, t, o[i + 0], 6, -198630844), t = _(t, e, n, r, o[i + 7], 10, 1126891415), r = _(r, t, e, n, o[i + 14], 15, -1416354905), n = _(n, r, t, e, o[i + 5], 21, -57434055), e = _(e, n, r, t, o[i + 12], 6, 1700485571), t = _(t, e, n, r, o[i + 3], 10, -1894986606), r = _(r, t, e, n, o[i + 10], 15, -1051523), n = _(n, r, t, e, o[i + 1], 21, -2054922799), e = _(e, n, r, t, o[i + 8], 6, 1873313359), t = _(t, e, n, r, o[i + 15], 10, -30611744), r = _(r, t, e, n, o[i + 6], 15, -1560198380), n = _(n, r, t, e, o[i + 13], 21, 1309151649), e = _(e, n, r, t, o[i + 4], 6, -145523070), t = _(t, e, n, r, o[i + 11], 10, -1120210379), r = _(r, t, e, n, o[i + 2], 15, 718787259), n = _(n, r, t, e, o[i + 9], 21, -343485551), e = e + P >>> 0, n = n + k >>> 0, r = r + D >>> 0, t = t + U >>> 0;
138
+ }
139
+ return f.endian([e, n, r, t]);
140
+ };
141
+ a._ff = function(s, l, o, y, e, n, r) {
142
+ var t = s + (l & o | ~l & y) + (e >>> 0) + r;
143
+ return (t << n | t >>> 32 - n) + l;
144
+ }, a._gg = function(s, l, o, y, e, n, r) {
145
+ var t = s + (l & y | o & ~y) + (e >>> 0) + r;
146
+ return (t << n | t >>> 32 - n) + l;
147
+ }, a._hh = function(s, l, o, y, e, n, r) {
148
+ var t = s + (l ^ o ^ y) + (e >>> 0) + r;
149
+ return (t << n | t >>> 32 - n) + l;
150
+ }, a._ii = function(s, l, o, y, e, n, r) {
151
+ var t = s + (o ^ (l | ~y)) + (e >>> 0) + r;
152
+ return (t << n | t >>> 32 - n) + l;
153
+ }, a._blocksize = 16, a._digestsize = 16, w.exports = function(s, l) {
154
+ if (s == null)
155
+ throw new Error("Illegal argument " + s);
156
+ var o = f.wordsToBytes(a(s, l));
157
+ return l && l.asBytes ? o : l && l.asString ? u.bytesToString(o) : f.bytesToHex(o);
158
+ };
159
+ }()), w.exports;
160
+ }
161
+ var G = V();
162
+ const J = /* @__PURE__ */ N(G);
163
+ function K() {
164
+ try {
165
+ return typeof navigator < "u" && navigator.product === "ReactNative";
166
+ } catch {
167
+ return !1;
168
+ }
169
+ }
170
+ function $() {
171
+ try {
172
+ if (typeof window > "u")
173
+ return typeof process < "u" && process.env && "__NEXT_PROCESSED_ENV" in process.env;
174
+ const f = window;
175
+ return !!(f.__NEXT_DATA__ || f.next || document.getElementById("__next"));
176
+ } catch {
177
+ return !1;
178
+ }
179
+ }
180
+ function z() {
181
+ try {
182
+ if (typeof window > "u")
183
+ return !1;
184
+ const f = window;
185
+ return !!(f.__VUE__ || f.__VUE_DEVTOOLS_GLOBAL_HOOK__ || document.querySelector("[data-v-]"));
186
+ } catch {
187
+ return !1;
188
+ }
189
+ }
190
+ function W() {
191
+ try {
192
+ if (typeof window > "u")
193
+ return !1;
194
+ const f = window;
195
+ return f.__REACT_DEVTOOLS_GLOBAL_HOOK__ || f.React ? !0 : !!document.querySelector(
196
+ "[data-reactroot], [data-reactid], ._reactRoot, ._reactRootContainer"
197
+ );
198
+ } catch {
199
+ return !1;
200
+ }
201
+ }
202
+ function X() {
203
+ return W() ? "react" : K() ? "react-native" : $() ? "nextjs" : z() ? "vue" : "unknown";
204
+ }
205
+ let R = null;
206
+ function Y() {
207
+ return R === null && (R = X()), R;
208
+ }
209
+ const Z = "1f8d3e558f493e38a037dbfadb8ba344", b = "d473b1dcc969105adab157226cd9cf63", B = Symbol.for("@coinbase/cdp-analytics");
210
+ function Q() {
211
+ const f = globalThis;
212
+ return f[B] || (f[B] = {
213
+ developerIdentifier: "",
214
+ endUserIdentifier: "",
215
+ enabled: !0,
216
+ isProduction: !1,
217
+ isUsingMocks: !1,
218
+ sendEvent: E,
219
+ sendActionCallEvent: (d) => E({ ...d, type: "action_call" }),
220
+ sendHookCallEvent: (d) => E({ ...d, type: "hook_call" }),
221
+ sendComponentCallEvent: (d) => E({ ...d, type: "component_call" }),
222
+ sendSessionRefreshEvent: (d) => E({ ...d, type: "session_refresh" }),
223
+ versionRegistry: {},
224
+ registerPackageVersion: (d, c) => {
225
+ g.versionRegistry[d] = c;
226
+ }
227
+ }), f[B];
228
+ }
229
+ const g = Q(), j = /* @__PURE__ */ new Set(["session_refresh"]);
230
+ async function E(f) {
231
+ if (!g.enabled)
232
+ return;
233
+ const c = j.has(f.type) ? g.endUserIdentifier : g.developerIdentifier;
234
+ if (!c)
235
+ return;
236
+ const u = Date.now(), s = [{
237
+ user_id: c,
238
+ event_type: f.type,
239
+ platform: I() ? "web" : "native",
240
+ timestamp: u,
241
+ event_properties: {
242
+ project_name: "cdp-embedded-wallet",
243
+ framework: Y(),
244
+ isLocalHost: nn(),
245
+ isUsingMocks: g.isUsingMocks,
246
+ package_versions: g.versionRegistry,
247
+ ...f
248
+ }
249
+ }], l = JSON.stringify(s), o = u.toString(), y = J(l + o), e = {
250
+ client: g.isProduction ? b : Z,
251
+ e: l,
252
+ checksum: y
253
+ };
254
+ await fetch("https://cca-lite.coinbase.com/amp", {
255
+ method: "POST",
256
+ mode: "no-cors",
257
+ headers: {
258
+ "Content-Type": "application/json"
259
+ },
260
+ body: JSON.stringify(e)
261
+ });
262
+ }
263
+ function I() {
264
+ return typeof window < "u" && typeof document < "u";
265
+ }
266
+ function nn() {
267
+ return I() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
268
+ }
269
+ function en(f) {
270
+ const d = L(!1);
271
+ M(() => {
272
+ d.current || (g.sendComponentCallEvent({ name: f }), d.current = !0);
273
+ }, [f]);
274
+ }
275
+ export {
276
+ g as A,
277
+ en as u
278
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as u, jsxs as j, Fragment as k } from "react/jsx-runtime";
2
2
  import { useIsInitialized as y, useIsSignedIn as z } from "@coinbase/cdp-hooks";
3
- import { u as D } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
+ import { u as D } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
4
4
  import { useState as m, useRef as M, useCallback as x, useEffect as f } from "react";
5
5
  import { SignInModal as N } from "../SignInModal/index.js";
6
6
  import { SignOutButton as $ } from "../SignOutButton/index.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@coinbase/cdp-hooks";
3
3
  import "react";
4
- import { c as p, A as m, C as t, O as A, u as H, a as T } from "../../chunks/CDPReactProvider.CIQm4C4z.js";
4
+ import { c as p, A as m, C as t, O as A, u as H, a as T } from "../../chunks/CDPReactProvider.BkmtXUv1.js";
5
5
  import "../ThemeProvider/index.js";
6
6
  export {
7
7
  p as ALL_AUTH_METHODS,
@@ -1,6 +1,6 @@
1
1
  import { jsx as B } from "react/jsx-runtime";
2
2
  import { useConfig as S } from "@coinbase/cdp-hooks";
3
- import { u as _ } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
+ import { u as _ } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
4
4
  import { useRef as j, useState as i, useCallback as E } from "react";
5
5
  import "../ui/Button/index.js";
6
6
  import { IframeButton as K } from "../ui/IframeButton/index.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx as B } from "react/jsx-runtime";
2
2
  import { useConfig as _ } from "@coinbase/cdp-hooks";
3
- import { u as j } from "../../chunks/useSendComponentCallOnce.BHZMuo6E.js";
3
+ import { u as j } from "../../chunks/useSendComponentCallOnce.DGjALrnZ.js";
4
4
  import { useRef as K, useState as i, useCallback as T } from "react";
5
5
  import "../ui/Button/index.js";
6
6
  import { IframeButton as U } from "../ui/IframeButton/index.js";
@@ -1,11 +1,12 @@
1
1
  import { jsx as t, Fragment as d } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useEnrollMfaContext as f } from "./EnrollMfaProvider.js";
4
- import { m as h } from "../../chunks/index.CKQKBoX2.js";
4
+ import { m as h } from "../../chunks/index.Bgx0-QLY.js";
5
+ import "@coinbase/cdp-core";
5
6
  import "@coinbase/cdp-hooks";
6
7
  import '../../assets/EnrollMfaDescription.css';const _ = "EnrollMfaDescription-module__description___qWKL6", u = {
7
8
  description: _
8
- }, q = ({
9
+ }, v = ({
9
10
  as: s = "p",
10
11
  children: n,
11
12
  className: r = "",
@@ -17,5 +18,5 @@ import '../../assets/EnrollMfaDescription.css';const _ = "EnrollMfaDescription-m
17
18
  return /* @__PURE__ */ t(s, { className: `${u.description} ${r}`, ...m, children: n ?? a });
18
19
  };
19
20
  export {
20
- q as EnrollMfaDescription
21
+ v as EnrollMfaDescription
21
22
  };
@@ -1,46 +1,47 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import "react";
3
- import { SwitchSlideTransition as _ } from "../ui/SwitchSlideTransition/index.js";
4
- import { useEnrollMfaFlowInternal as h } from "./EnrollMfaFlowProvider.js";
5
- import { EnrollMfaItems as w } from "./EnrollMfaItems.js";
6
- import { useEnrollMfaContext as M } from "./EnrollMfaProvider.js";
7
- import { m as S } from "../../chunks/index.CKQKBoX2.js";
3
+ import { SwitchSlideTransition as E } from "../ui/SwitchSlideTransition/index.js";
4
+ import { useEnrollMfaFlowInternal as _ } from "./EnrollMfaFlowProvider.js";
5
+ import { EnrollMfaItems as M } from "./EnrollMfaItems.js";
6
+ import { useEnrollMfaContext as h } from "./EnrollMfaProvider.js";
7
+ import { m as S } from "../../chunks/index.Bgx0-QLY.js";
8
+ import "@coinbase/cdp-core";
8
9
  import "@coinbase/cdp-hooks";
9
- import { STEPS as b } from "./useEnrollMfaReducer.js";
10
- import '../../assets/EnrollMfaFlow.css';const x = "EnrollMfaFlow-module__list___oGYkb", s = {
11
- "method-wrapper": "EnrollMfaFlow-module__method-wrapper___yT4Pj",
12
- list: x
13
- }, $ = ({
14
- autoFocus: e = !1,
15
- animateHeight: m = !0,
10
+ import { STEPS as $ } from "./useEnrollMfaReducer.js";
11
+ import '../../assets/EnrollMfaFlow.css';const b = "EnrollMfaFlow-module__wrapper___OVdk0", v = "EnrollMfaFlow-module__list___oGYkb", e = {
12
+ wrapper: b,
13
+ list: v
14
+ }, D = ({
15
+ autoFocus: n = !0,
16
+ animateHeight: p = !0,
16
17
  children: l,
17
- className: a = "",
18
- ...p
18
+ className: i = "",
19
+ ...s
19
20
  }) => {
20
- const { state: n } = M(), { startEnrollment: f, submit: d, transitionRef: c } = h(), { method: i } = n;
21
+ const { state: m } = h(), { startEnrollment: f, submit: c, transitionRef: d } = _(), { method: a } = m;
21
22
  return /* @__PURE__ */ t(
22
- _,
23
+ E,
23
24
  {
24
- autoFocus: e,
25
- animateHeight: m,
26
- items: b,
25
+ autoFocus: n,
26
+ animateHeight: p,
27
+ items: $,
27
28
  initialEntered: !0,
28
29
  timeout: 250,
29
- direction: n.flowDirection,
30
- transitionRef: c,
30
+ direction: m.flowDirection,
31
+ transitionRef: d,
31
32
  children: ({ itemKey: r, ...u }) => {
32
33
  let o = null;
33
34
  if (r === "list")
34
- o = /* @__PURE__ */ t(w, { className: s.list, onSetUp: f });
35
+ o = /* @__PURE__ */ t("div", { className: `${e.wrapper} ${i}`, ...s, children: /* @__PURE__ */ t(M, { className: e.list, onSetUp: f }) });
35
36
  else {
36
- const E = S[i].content;
37
- o = /* @__PURE__ */ t("div", { className: `${s["method-wrapper"]} ${a}`, ...p, children: /* @__PURE__ */ t(E, { autoFocus: e, step: r, onSubmit: d }) });
37
+ const w = S[a].content;
38
+ o = /* @__PURE__ */ t("div", { className: `${e.wrapper} ${i}`, ...s, children: /* @__PURE__ */ t(w, { autoFocus: n, step: r, onSubmit: c }) });
38
39
  }
39
- return /* @__PURE__ */ t("div", { ...u, children: l ? l({ step: r, method: i, Content: o }) : o });
40
+ return /* @__PURE__ */ t("div", { ...u, children: l ? l({ step: r, method: a, Content: o }) : o });
40
41
  }
41
42
  }
42
43
  );
43
44
  };
44
45
  export {
45
- $ as EnrollMfaFlow
46
+ D as EnrollMfaFlow
46
47
  };
@@ -1,15 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { c as p } from "../../chunks/lite.1fxw3LjI.js";
2
+ import { c as u } from "../../chunks/lite.1fxw3LjI.js";
3
3
  import "react";
4
4
  import { Button as f } from "../ui/Button/index.js";
5
5
  import { IconArrowLeft as _ } from "../../icons/IconArrowLeft.js";
6
6
  import { useEnrollMfaFlowInternal as b } from "./EnrollMfaFlowProvider.js";
7
7
  import { useEnrollMfaContext as B } from "./EnrollMfaProvider.js";
8
+ import "@coinbase/cdp-core";
8
9
  import "@coinbase/cdp-hooks";
9
10
  import '../../assets/EnrollMfaFlowBackButton.css';const k = "EnrollMfaFlowBackButton-module__button___8J7mz", d = "EnrollMfaFlowBackButton-module__icon___H7y5j", t = {
10
11
  button: k,
11
12
  icon: d
12
- }, N = ({
13
+ }, h = ({
13
14
  ["aria-label"]: n = "Back",
14
15
  children: r,
15
16
  className: l = "",
@@ -19,13 +20,13 @@ import '../../assets/EnrollMfaFlowBackButton.css';const k = "EnrollMfaFlowBackBu
19
20
  step: e,
20
21
  ...m
21
22
  }) => {
22
- const { back: i } = b(), { state: u } = B();
23
- return (e || u.step) === "list" ? null : /* @__PURE__ */ o(
23
+ const { back: i } = b(), { state: p } = B();
24
+ return (e || p.step) === "list" ? null : /* @__PURE__ */ o(
24
25
  f,
25
26
  {
26
27
  type: "button",
27
28
  "aria-label": n,
28
- className: p(t.button, l),
29
+ className: u(t.button, l),
29
30
  onClick: s ?? i,
30
31
  size: a,
31
32
  variant: c,
@@ -35,5 +36,5 @@ import '../../assets/EnrollMfaFlowBackButton.css';const k = "EnrollMfaFlowBackBu
35
36
  );
36
37
  };
37
38
  export {
38
- N as EnrollMfaFlowBackButton
39
+ h as EnrollMfaFlowBackButton
39
40
  };
@@ -3,7 +3,7 @@ import { SwitchSlideTransitionRef } from '../ui/SwitchSlideTransition';
3
3
  import { EnrollMfaStep, MfaMethod } from './types';
4
4
  export interface EnrollMfaFlowContextValue {
5
5
  back: () => void;
6
- startEnrollment: (method: MfaMethod) => void;
6
+ startEnrollment: (method: MfaMethod) => Promise<void>;
7
7
  submit: (e: FormEvent<HTMLFormElement>) => void;
8
8
  }
9
9
  export interface EnrollMfaFlowContextValueInternal extends EnrollMfaFlowContextValue {
@@ -1,15 +1,16 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { createContext as u, useContext as i, useMemo as c } from "react";
3
+ import "@coinbase/cdp-core";
3
4
  import "@coinbase/cdp-hooks";
4
5
  const l = u(null), f = () => {
5
6
  const o = i(l);
6
7
  if (!o)
7
8
  throw new Error("useEnrollMfaFlowInternal must be used within a EnrollMfaFlowContext.Provider");
8
9
  return o;
9
- }, E = () => {
10
+ }, M = () => {
10
11
  const { transitionRef: o, ...t } = f();
11
12
  return t;
12
- }, M = ({
13
+ }, F = ({
13
14
  children: o,
14
15
  onBack: t,
15
16
  onStartEnrollment: r,
@@ -28,7 +29,7 @@ const l = u(null), f = () => {
28
29
  return /* @__PURE__ */ a(l.Provider, { value: s, children: o });
29
30
  };
30
31
  export {
31
- M as EnrollMfaFlowProvider,
32
- E as useEnrollMfaFlow,
32
+ F as EnrollMfaFlowProvider,
33
+ M as useEnrollMfaFlow,
33
34
  f as useEnrollMfaFlowInternal
34
35
  };
@@ -1,9 +1,10 @@
1
- import { jsx as m } from "react/jsx-runtime";
1
+ import { jsx as e } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useEnrollMfaContext as l } from "./EnrollMfaProvider.js";
4
- import { m as c } from "../../chunks/index.CKQKBoX2.js";
4
+ import { m as c } from "../../chunks/index.Bgx0-QLY.js";
5
+ import "@coinbase/cdp-core";
5
6
  import "@coinbase/cdp-hooks";
6
- const M = ({
7
+ const u = ({
7
8
  as: r = "div",
8
9
  children: t,
9
10
  className: s = "",
@@ -11,9 +12,9 @@ const M = ({
11
12
  step: p,
12
13
  ...a
13
14
  }) => {
14
- const { state: o } = l(), i = p || o.step, e = n || o.method, f = c[e].image;
15
- return /* @__PURE__ */ m(r, { className: s, ...a, children: t || /* @__PURE__ */ m(f, { step: i, method: e }) });
15
+ const { state: o } = l(), i = p || o.step, m = n || o.method, f = c[m].image;
16
+ return /* @__PURE__ */ e(r, { className: s, ...a, children: t || /* @__PURE__ */ e(f, { step: i, method: m }) });
16
17
  };
17
18
  export {
18
- M as EnrollMfaImage
19
+ u as EnrollMfaImage
19
20
  };
@@ -1,21 +1,22 @@
1
- import { jsx as m } from "react/jsx-runtime";
1
+ import { jsx as n } from "react/jsx-runtime";
2
2
  import { useCurrentUser as l } from "@coinbase/cdp-hooks";
3
3
  import "react";
4
4
  import { ToggleListItem as a } from "../ui/ToggleListItem/index.js";
5
- const u = ({ method: e, icon: o, label: s, isPending: n, onSetUp: i }) => {
5
+ import "@coinbase/cdp-core";
6
+ const A = ({ method: e, icon: o, label: s, isPending: i, onSetUp: m }) => {
6
7
  const { currentUser: t } = l(), r = t?.mfaMethods?.[e]?.enrolledAt ? Date.now() > new Date(t.mfaMethods[e].enrolledAt).getTime() : !1;
7
- return /* @__PURE__ */ m(
8
+ return /* @__PURE__ */ n(
8
9
  a,
9
10
  {
10
11
  icon: o,
11
12
  label: s,
12
13
  isActive: r,
13
- isPending: n,
14
- onActivate: i,
14
+ isPending: i,
15
+ onActivate: m,
15
16
  isDisabled: r
16
17
  }
17
18
  );
18
19
  };
19
20
  export {
20
- u as EnrollMfaItem
21
+ A as EnrollMfaItem
21
22
  };
@@ -1,39 +1,42 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ import { jsx as t } from "react/jsx-runtime";
2
2
  import { c as u } from "../../chunks/lite.1fxw3LjI.js";
3
- import { useMemo as d } from "react";
4
- import { IconPinCode as I } from "../../icons/IconPinCode.js";
5
- import { EnrollMfaItem as M } from "./EnrollMfaItem.js";
6
- import { useEnrollMfaContext as E } from "./EnrollMfaProvider.js";
3
+ import { useMemo as I } from "react";
4
+ import { IconPhone as M } from "../../icons/IconPhone.js";
5
+ import { IconPinCode as d } from "../../icons/IconPinCode.js";
6
+ import { EnrollMfaItem as E } from "./EnrollMfaItem.js";
7
+ import { useEnrollMfaContext as P } from "./EnrollMfaProvider.js";
8
+ import "@coinbase/cdp-core";
7
9
  import "@coinbase/cdp-hooks";
8
10
  import '../../assets/EnrollMfaItems.css';const _ = "EnrollMfaItems-module__list___5ZZmE", x = {
9
11
  list: _
10
- }, P = {
11
- totp: { Icon: /* @__PURE__ */ n(I, {}), label: "Authenticator app" }
12
- }, w = ({ children: l, className: m = "", onSetUp: s, ...c }) => {
13
- const { state: a } = E(), { methods: r, method: i, isPending: e } = a, p = d(() => r.map((t) => {
14
- const { Icon: o, label: f } = P[t];
12
+ }, b = {
13
+ totp: { Icon: /* @__PURE__ */ t(d, {}), label: "Authenticator app" },
14
+ sms: { Icon: /* @__PURE__ */ t(M, {}), label: "SMS" }
15
+ }, N = ({ children: l, className: m = "", onSetUp: r, ...c }) => {
16
+ const { state: a } = P(), { methods: s, method: i, isPending: e } = a, p = I(() => s.map((o) => {
17
+ const { Icon: n, label: f } = b[o];
15
18
  return {
16
- method: t,
17
- icon: o,
19
+ method: o,
20
+ icon: n,
18
21
  label: f,
19
22
  onSetUp: async () => {
20
- await s?.(t);
23
+ await r?.(o);
21
24
  }
22
25
  };
23
- }), [r, s]);
24
- return /* @__PURE__ */ n("ul", { className: u(x.list, m), ...c, children: p.map(({ method: t, ...o }) => /* @__PURE__ */ n("li", { children: l?.({
25
- ...o,
26
- method: t,
27
- isPending: e && i === t
28
- }) || /* @__PURE__ */ n(
29
- M,
26
+ }), [s, r]);
27
+ return /* @__PURE__ */ t("ul", { className: u(x.list, m), ...c, children: p.map(({ method: o, ...n }) => /* @__PURE__ */ t("li", { children: l?.({
28
+ ...n,
29
+ method: o,
30
+ isPending: e && i === o
31
+ }) || /* @__PURE__ */ t(
32
+ E,
30
33
  {
31
- ...o,
32
- method: t,
33
- isPending: e && i === t
34
+ ...n,
35
+ method: o,
36
+ isPending: e && i === o
34
37
  }
35
- ) }, t)) });
38
+ ) }, o)) });
36
39
  };
37
40
  export {
38
- w as EnrollMfaItems
41
+ N as EnrollMfaItems
39
42
  };