@zerodev/wallet-react-ui 0.0.3 → 0.0.5

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 (52) hide show
  1. package/README.md +0 -1
  2. package/dist/_types/auth/components/BlobAnimation/index.d.ts +1 -1
  3. package/dist/_types/auth/components/BlobAnimation/index.d.ts.map +1 -1
  4. package/dist/_types/auth/components/CodeInput/index.d.ts +1 -1
  5. package/dist/_types/auth/components/CodeInput/index.d.ts.map +1 -1
  6. package/dist/_types/auth/index.d.ts +1 -1
  7. package/dist/_types/auth/index.d.ts.map +1 -1
  8. package/dist/_types/auth/pages/EmailVerification.d.ts +1 -1
  9. package/dist/_types/auth/pages/EmailVerification.d.ts.map +1 -1
  10. package/dist/_types/auth/pages/ErrorScreen.d.ts +1 -1
  11. package/dist/_types/auth/pages/ErrorScreen.d.ts.map +1 -1
  12. package/dist/_types/auth/pages/OtpInput.d.ts +1 -1
  13. package/dist/_types/auth/pages/OtpInput.d.ts.map +1 -1
  14. package/dist/_types/auth/pages/SignUp.d.ts +1 -1
  15. package/dist/_types/auth/pages/SignUp.d.ts.map +1 -1
  16. package/dist/_types/auth/pages/Verifying.d.ts +1 -1
  17. package/dist/_types/auth/pages/Verifying.d.ts.map +1 -1
  18. package/dist/_types/auth/pages/WalletSelection.d.ts +1 -1
  19. package/dist/_types/auth/pages/WalletSelection.d.ts.map +1 -1
  20. package/dist/_types/shared/components/SignUpFooter/index.d.ts +1 -1
  21. package/dist/_types/shared/components/SignUpFooter/index.d.ts.map +1 -1
  22. package/dist/_types/shared/components/StatusScreen/index.d.ts +1 -1
  23. package/dist/_types/shared/components/StatusScreen/index.d.ts.map +1 -1
  24. package/dist/index.cjs +3 -3
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.mjs +454 -881
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/styles.css +2 -2
  29. package/package.json +11 -13
  30. package/src/auth/index.tsx +3 -4
  31. package/src/auth/pages/EmailVerification.tsx +1 -2
  32. package/src/auth/pages/ErrorScreen.tsx +1 -2
  33. package/src/auth/pages/OtpInput.tsx +1 -2
  34. package/src/auth/pages/SignUp.tsx +12 -4
  35. package/src/auth/pages/Verifying.tsx +1 -2
  36. package/src/auth/pages/WalletSelection.tsx +12 -4
  37. package/src/shared/components/SignUpFooter/index.tsx +1 -2
  38. package/dist/_types/shared/components/PoweredBy/index.d.ts +0 -6
  39. package/dist/_types/shared/components/PoweredBy/index.d.ts.map +0 -1
  40. package/dist/_types/shared/components/Screen/EllipticalRadial.d.ts +0 -23
  41. package/dist/_types/shared/components/Screen/EllipticalRadial.d.ts.map +0 -1
  42. package/dist/_types/shared/components/Screen/MultiRadialBackground.d.ts +0 -4
  43. package/dist/_types/shared/components/Screen/MultiRadialBackground.d.ts.map +0 -1
  44. package/dist/_types/shared/components/Screen/index.d.ts +0 -10
  45. package/dist/_types/shared/components/Screen/index.d.ts.map +0 -1
  46. package/dist/_types/shared/components/TopNav/index.d.ts +0 -10
  47. package/dist/_types/shared/components/TopNav/index.d.ts.map +0 -1
  48. package/src/shared/components/PoweredBy/index.tsx +0 -27
  49. package/src/shared/components/Screen/EllipticalRadial.tsx +0 -65
  50. package/src/shared/components/Screen/MultiRadialBackground.tsx +0 -323
  51. package/src/shared/components/Screen/index.tsx +0 -85
  52. package/src/shared/components/TopNav/index.tsx +0 -48
package/dist/index.mjs CHANGED
@@ -1,516 +1,83 @@
1
- import { jsxs as d, jsx as t, Fragment as b } from "react/jsx-runtime";
2
- import { useId as V, useState as w, useEffect as P, useMemo as re, useRef as K } from "react";
3
- import { useStore as O, create as ie } from "zustand";
4
- import { cn as R, IconButton as q, Text as h, ZeroDevLogo as se, Button as C, Wrapper as ae, ListItem as X, Input as de, Icon as le } from "@zerodev/react-ui";
1
+ import { jsxs as c, jsx as n, Fragment as A } from "react/jsx-runtime";
2
+ import { Text as m, cn as G, PoweredBy as B, Button as E, Wrapper as ne, ListItem as $, ListItemChevron as re, ListItemIcon as D, Input as se, Icon as ie, Screen as ae, TopNav as oe } from "@zerodev/react-ui";
3
+ import { useState as w, useEffect as O, useMemo as le, useRef as K } from "react";
4
+ import { useStore as I, create as de } from "zustand";
5
5
  import { useConfig as ce, useConnect as ue } from "wagmi";
6
- import { useSendMagicLink as Y, useSendOTP as J, useVerifyOTP as pe, useAuthenticateOAuth as fe, useRegisterPasskey as he, useLoginPasskey as ze, useVerifyMagicLink as me, zeroDevWallet as ge, NotAuthenticatedError as ye } from "@zerodev/wallet-react";
6
+ import { useSendMagicLink as Y, useSendOTP as J, useVerifyOTP as he, useAuthenticateOAuth as pe, useRegisterPasskey as me, useLoginPasskey as ze, useVerifyMagicLink as fe, zeroDevWallet as ge, NotAuthenticatedError as ye } from "@zerodev/wallet-react";
7
7
  import { subscribeWithSelector as xe } from "zustand/middleware";
8
- const Z = 52;
9
- function we({
10
- onBack: e,
11
- onClose: i,
12
- title: r,
13
- logo: n,
14
- className: o
15
- }) {
16
- return /* @__PURE__ */ d(
17
- "div",
18
- {
19
- className: R(
20
- "zd:absolute zd:top-4 zd:left-0 zd:right-0 zd:flex zd:flex-row zd:items-center zd:justify-between",
21
- o
22
- ),
23
- style: { height: `calc(${Z / 4} * var(--zd-spacing))` },
24
- children: [
25
- e ? /* @__PURE__ */ t(q, { iconName: "chevronLeft", onClick: e }) : /* @__PURE__ */ t("div", { className: "zd:h-13 zd:w-13" }),
26
- n && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: n }),
27
- r && /* @__PURE__ */ t("div", { className: "zd:absolute zd:left-0 zd:right-0 zd:flex zd:items-center zd:justify-center zd:pointer-events-none", children: /* @__PURE__ */ t(h, { className: "zd:text-body1", children: r }) }),
28
- /* @__PURE__ */ t(q, { iconName: "x", onClick: i })
29
- ]
30
- }
31
- );
32
- }
33
- function ve({
34
- layer: e,
35
- rect: i
36
- }) {
37
- const { id: r, matrix: n, fillOpacity: o, stops: c } = e;
38
- return /* @__PURE__ */ d(b, { children: [
39
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ t(
40
- "radialGradient",
41
- {
42
- id: r,
43
- cx: "0",
44
- cy: "0",
45
- r: "1",
46
- gradientUnits: "userSpaceOnUse",
47
- gradientTransform: `matrix(${n.join(" ")})`,
48
- children: c.map((s, u) => /* @__PURE__ */ t(
49
- "stop",
50
- {
51
- offset: s.offset,
52
- stopColor: s.color,
53
- stopOpacity: s.opacity
54
- },
55
- s.color + u.toString()
56
- ))
57
- }
58
- ) }),
59
- /* @__PURE__ */ t(
60
- "rect",
61
- {
62
- x: i.x,
63
- y: i.y,
64
- width: i.width,
65
- height: i.height,
66
- fill: `url(#${r})`,
67
- fillOpacity: o
68
- }
69
- )
70
- ] });
71
- }
72
- const Ne = "-6 -6 412 812";
73
- function Se() {
74
- return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none", children: /* @__PURE__ */ t(
75
- "svg",
76
- {
77
- width: "100%",
78
- height: "100%",
79
- viewBox: Ne,
80
- preserveAspectRatio: "none",
81
- role: "img",
82
- "aria-label": "Decorative gradient background",
83
- children: /* @__PURE__ */ t("rect", { x: "-6", y: "-6", width: "412", height: "812", fill: "#FBF7F2" })
84
- }
85
- ) });
86
- }
87
- function Ee() {
88
- const e = V(), i = [
89
- {
90
- // (CSS #6) blue → top-right. x-radius widened so the lobe reaches further
91
- // left; y-radius kept short so it stays up top and doesn't bleed into the
92
- // orange band.
93
- id: `${e}-blue`,
94
- matrix: [1850, 0, 0, 645, 381.44, 0],
95
- fillOpacity: 1,
96
- stops: [
97
- { offset: 0, color: "#45ABFB", opacity: 0.66 },
98
- { offset: 0.4615, color: "#1E9AFB", opacity: 0.35 },
99
- { offset: 1, color: "#45ABFB", opacity: 0 }
100
- ]
101
- },
102
- {
103
- // (CSS #5) offWhite → blue, very faint
104
- id: `${e}-offwhite-tr`,
105
- matrix: [55.28, 0, 0, 773.36, 386.68, 13.28],
106
- fillOpacity: 1,
107
- stops: [
108
- { offset: 0, color: "#F7F5F0", opacity: 0.1 },
109
- { offset: 1, color: "#45ABFB", opacity: 0 }
110
- ]
111
- },
112
- {
113
- // (CSS #4) warmGrey
114
- id: `${e}-warmgrey`,
115
- matrix: [326.72, 0, 0, 855.52, 0, 50.32],
116
- fillOpacity: 1,
117
- stops: [
118
- { offset: 0, color: "#E3CFC3", opacity: 1 },
119
- { offset: 1, color: "#E3CFC3", opacity: 0 }
120
- ]
121
- },
122
- {
123
- // (CSS #3) orange — spans the full width across the bottom ~30%, uniform.
124
- id: `${e}-orange`,
125
- matrix: [580, 0, 0, 380, 200, 835],
126
- fillOpacity: 1,
127
- stops: [
128
- { offset: 0, color: "#EE6C2E", opacity: 0.8 },
129
- { offset: 0.55, color: "#EE6C2E", opacity: 0.6 },
130
- { offset: 1, color: "#EE6C2E", opacity: 0.15 }
131
- ]
132
- },
133
- {
134
- // (CSS #2) peach — spread further up (~30% of the bottom), a bit more vivid
135
- id: `${e}-peach`,
136
- matrix: [520, 0, 0, 560, 180, 830],
137
- fillOpacity: 1,
138
- stops: [
139
- { offset: 0, color: "#FAC8AC", opacity: 1 },
140
- { offset: 1, color: "#F27B3E", opacity: 0 }
141
- ]
142
- },
143
- {
144
- // (CSS #1) white glow (topmost of the colour stack)
145
- id: `${e}-white-bl`,
146
- matrix: [90.72, 0, 0, 550.48, 38.04, 702.64],
147
- fillOpacity: 1,
148
- stops: [
149
- { offset: 0, color: "white", opacity: 0.58 },
150
- { offset: 1, color: "white", opacity: 0 }
151
- ]
152
- }
153
- ];
154
- return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
155
- "svg",
156
- {
157
- width: "100%",
158
- height: "100%",
159
- viewBox: "0 0 400 800",
160
- preserveAspectRatio: "none",
161
- role: "presentation",
162
- children: [
163
- i.map((r) => /* @__PURE__ */ t(
164
- ve,
165
- {
166
- layer: r,
167
- rect: { x: 0, y: 0, width: 400, height: 800 }
168
- },
169
- r.id
170
- )),
171
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
172
- "linearGradient",
173
- {
174
- id: `${e}-vfade`,
175
- x1: "0",
176
- y1: "0",
177
- x2: "0",
178
- y2: "800",
179
- gradientUnits: "userSpaceOnUse",
180
- children: [
181
- /* @__PURE__ */ t("stop", { offset: "0", stopColor: "white", stopOpacity: "0.55" }),
182
- /* @__PURE__ */ t("stop", { offset: "0.45", stopColor: "white", stopOpacity: "0.52" }),
183
- /* @__PURE__ */ t("stop", { offset: "0.65", stopColor: "white", stopOpacity: "0.5" }),
184
- /* @__PURE__ */ t("stop", { offset: "0.85", stopColor: "white", stopOpacity: "0.5" }),
185
- /* @__PURE__ */ t("stop", { offset: "1", stopColor: "white", stopOpacity: "0.5" })
186
- ]
187
- }
188
- ) }),
189
- /* @__PURE__ */ t(
190
- "rect",
191
- {
192
- x: "0",
193
- y: "0",
194
- width: "400",
195
- height: "800",
196
- fill: `url(#${e}-vfade)`
197
- }
198
- ),
199
- /* @__PURE__ */ t("defs", { children: /* @__PURE__ */ d(
200
- "linearGradient",
201
- {
202
- id: `${e}-bluefade`,
203
- x1: "0",
204
- y1: "800",
205
- x2: "120",
206
- y2: "640",
207
- gradientUnits: "userSpaceOnUse",
208
- children: [
209
- /* @__PURE__ */ t("stop", { offset: "0", stopColor: "#A7B8E2", stopOpacity: "1" }),
210
- /* @__PURE__ */ t("stop", { offset: "0.33", stopColor: "#A7B8E2", stopOpacity: "0.7" }),
211
- /* @__PURE__ */ t("stop", { offset: "0.66", stopColor: "#A7B8E2", stopOpacity: "0.35" }),
212
- /* @__PURE__ */ t("stop", { offset: "1", stopColor: "#A7B8E2", stopOpacity: "0" })
213
- ]
214
- }
215
- ) }),
216
- /* @__PURE__ */ t(
217
- "rect",
218
- {
219
- x: "0",
220
- y: "0",
221
- width: "400",
222
- height: "800",
223
- fill: `url(#${e}-bluefade)`
224
- }
225
- )
226
- ]
227
- }
228
- ) });
229
- }
230
- function be() {
231
- const e = V(), i = [
232
- {
233
- id: `${e}-g6`,
234
- // (CSS #6) blue, top-right
235
- cx: 0.9536,
236
- cy: 0,
237
- rx: 0.9385,
238
- ry: 1.2256,
239
- stops: [
240
- { offset: 0, color: "#45ABFB", opacity: 0.6 },
241
- { offset: 0.4615, color: "#1E9AFB", opacity: 0.32 },
242
- { offset: 1, color: "#45ABFB", opacity: 0 }
243
- ]
244
- },
245
- {
246
- id: `${e}-g5`,
247
- // (CSS #5) faint light, top-right
248
- cx: 0.9667,
249
- cy: 0.0166,
250
- rx: 0.1382,
251
- ry: 0.9667,
252
- stops: [
253
- { offset: 0, color: "#F7F5F0", opacity: 0.1 },
254
- { offset: 1, color: "#45ABFB", opacity: 0 }
255
- ]
256
- },
257
- {
258
- id: `${e}-g4`,
259
- // (CSS #4) warm grey, top-left
260
- cx: 0,
261
- cy: 0.0629,
262
- rx: 0.8168,
263
- ry: 1.0694,
264
- stops: [
265
- { offset: 0, color: "#E3CFC3", opacity: 1 },
266
- { offset: 1, color: "#E3CFC3", opacity: 0 }
267
- ]
268
- },
269
- {
270
- id: `${e}-g3`,
271
- // (CSS #3) orange, bottom-left
272
- cx: 0.0393,
273
- cy: 1,
274
- rx: 1.0628,
275
- ry: 1.0303,
276
- stops: [
277
- { offset: 0, color: "#FF6B1F", opacity: 1 },
278
- { offset: 0.476, color: "#E76000", opacity: 0.72 },
279
- { offset: 1, color: "#E76000", opacity: 0 }
280
- ]
281
- },
282
- {
283
- id: `${e}-g2`,
284
- // (CSS #2) peach, bottom-center
285
- cx: 0.3476,
286
- cy: 1,
287
- rx: 0.9614,
288
- ry: 0.338,
289
- stops: [
290
- { offset: 0, color: "#FAC8AC", opacity: 0.7 },
291
- { offset: 1, color: "#F27B3E", opacity: 0 }
292
- ]
293
- },
294
- {
295
- id: `${e}-g1`,
296
- // (CSS #1) white glow, bottom-left
297
- cx: 0.0951,
298
- cy: 0.8783,
299
- rx: 0.2268,
300
- ry: 0.6881,
301
- stops: [
302
- { offset: 0, color: "#FFFFFF", opacity: 0.58 },
303
- { offset: 1, color: "#FFFFFF", opacity: 0 }
304
- ]
305
- }
306
- ];
307
- return /* @__PURE__ */ t("div", { className: "zd:absolute zd:inset-0 zd:z-0 zd:rounded-4xl zd:pointer-events-none zd:overflow-hidden", children: /* @__PURE__ */ d(
308
- "svg",
309
- {
310
- width: "100%",
311
- height: "100%",
312
- preserveAspectRatio: "none",
313
- role: "presentation",
314
- children: [
315
- /* @__PURE__ */ t("rect", { width: "100%", height: "100%", fill: "#130E0B" }),
316
- /* @__PURE__ */ t("defs", { children: i.map((r) => /* @__PURE__ */ t(
317
- "radialGradient",
318
- {
319
- id: r.id,
320
- cx: `${r.cx / r.rx * 100}%`,
321
- cy: `${r.cy / r.ry * 100}%`,
322
- r: "100%",
323
- gradientUnits: "objectBoundingBox",
324
- gradientTransform: `scale(${r.rx}, ${r.ry})`,
325
- children: r.stops.map((n, o) => /* @__PURE__ */ t(
326
- "stop",
327
- {
328
- offset: n.offset,
329
- stopColor: n.color,
330
- stopOpacity: n.opacity
331
- },
332
- n.color + o.toString()
333
- ))
334
- },
335
- r.id
336
- )) }),
337
- i.map((r) => /* @__PURE__ */ t(
338
- "rect",
339
- {
340
- width: "100%",
341
- height: "100%",
342
- fill: `url(#${r.id})`
343
- },
344
- `${r.id}-rect`
345
- ))
346
- ]
347
- }
348
- ) });
349
- }
350
- const Ce = Z + 16;
351
- function ke({
352
- children: e,
353
- className: i,
354
- contentClassName: r,
355
- size: n = "lg",
356
- style: o,
357
- topNav: c
358
- }) {
359
- return /* @__PURE__ */ d(
360
- "div",
361
- {
362
- "data-zd-size": n,
363
- className: R(
364
- // 400×810 by default, but never taller/wider than the parent — a
365
- // consumer wrapper with its own size caps the Screen (max-w/h-full =
366
- // 100% of the parent). overflow-hidden clips the frame to its rounded
367
- // border ring; content scrolls in the inner div below.
368
- "zd:relative zd:flex zd:flex-col zd:text-left",
369
- // w-100 = 400px, h-202.5 = 810px at density 1; both compile to
370
- // calc(var(--zd-spacing) * N), so they scale with the size variants.
371
- // rounded-[38px] = inner card radius (32px) + the 6px border-ring gap,
372
- // so the ring has a uniform width — equal inner/outer radii would make
373
- // the corners read thicker than the sides.
374
- "zd:w-100 zd:h-202.5 zd:max-w-full zd:max-h-full zd:overflow-hidden zd:rounded-[38px]",
375
- i
376
- ),
377
- style: o,
378
- children: [
379
- /* @__PURE__ */ t(be, {}),
380
- /* @__PURE__ */ d(
381
- "div",
382
- {
383
- className: R(
384
- // m-1.5 = calc(var(--zd-spacing) * 1.5) = 6px at density 1, so the
385
- // gradient border ring thins with the size variants. (Corner radii
386
- // stay fixed, so at smaller sizes the ring is marginally non-uniform
387
- // at the corners — a minor cosmetic trade-off.)
388
- "zd:flex zd:flex-1 zd:flex-col zd:m-1.5 zd:px-4 zd:overflow-hidden zd:rounded-4xl zd:relative",
389
- r
390
- ),
391
- style: { clipPath: "inset(0 round 32px)" },
392
- children: [
393
- /* @__PURE__ */ t(Se, {}),
394
- /* @__PURE__ */ t(Ee, {}),
395
- /* @__PURE__ */ d("div", { className: "zd:relative zd:z-10 zd:flex zd:flex-1 zd:flex-col zd:min-h-0", children: [
396
- c,
397
- /* @__PURE__ */ t(
398
- "div",
399
- {
400
- className: "zd:flex zd:flex-1 zd:flex-col zd:min-h-0 zd:overflow-y-auto zd:overflow-x-hidden",
401
- style: {
402
- paddingTop: `calc(${Ce / 4} * var(--zd-spacing))`
403
- },
404
- children: e
405
- }
406
- )
407
- ] })
408
- ]
409
- }
410
- )
411
- ]
412
- }
413
- );
414
- }
415
- const Ae = "" + new URL("error.webp", import.meta.url).href, Oe = "" + new URL("loading.webp", import.meta.url).href, Te = "" + new URL("send.webp", import.meta.url).href, Be = "" + new URL("success.webp", import.meta.url).href, Ie = {
416
- error: Ae,
417
- loading: Oe,
418
- send: Te,
419
- success: Be
8
+ const we = "" + new URL("error.webp", import.meta.url).href, Se = "" + new URL("loading.webp", import.meta.url).href, Ne = "" + new URL("send.webp", import.meta.url).href, ve = "" + new URL("success.webp", import.meta.url).href, be = {
9
+ error: we,
10
+ loading: Se,
11
+ send: Ne,
12
+ success: ve
420
13
  };
421
- function I({
14
+ function P({
422
15
  imageName: e,
423
- title: i,
424
- children: r,
425
- className: n
16
+ title: s,
17
+ children: a,
18
+ className: t
426
19
  }) {
427
- return /* @__PURE__ */ d(
20
+ return /* @__PURE__ */ c(
428
21
  "div",
429
22
  {
430
- className: R("zd:flex zd:flex-col zd:gap-8 zd:items-center", n),
23
+ className: G("zd:flex zd:flex-col zd:gap-8 zd:items-center", t),
431
24
  children: [
432
- /* @__PURE__ */ t(
25
+ /* @__PURE__ */ n(
433
26
  "img",
434
27
  {
435
- src: Ie[e],
28
+ src: be[e],
436
29
  alt: e,
437
30
  className: "zd:w-[118px] zd:h-[118px] zd:bg-transparent"
438
31
  }
439
32
  ),
440
- /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
441
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: i }),
442
- /* @__PURE__ */ t(h, { className: "zd:text-center zd:whitespace-pre-wrap", children: r })
33
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:items-center", children: [
34
+ /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center zd:whitespace-pre-wrap", children: s }),
35
+ /* @__PURE__ */ n(m, { className: "zd:text-center zd:whitespace-pre-wrap", children: a })
443
36
  ] })
444
37
  ]
445
38
  }
446
39
  );
447
40
  }
448
- function Q() {
449
- const i = ce().connectors.find((r) => r.id === "zerodev-wallet");
450
- if (!i || !("getKitStore" in i))
41
+ function X() {
42
+ const s = ce().connectors.find((a) => a.id === "zerodev-wallet");
43
+ if (!s || !("getKitStore" in s))
451
44
  throw new Error("useKitStore must be used with the zeroDevWallet connector");
452
- return i.getKitStore();
45
+ return s.getKitStore();
453
46
  }
454
- function F() {
455
- const e = Q(), i = O(e, (l) => l.auth.step), r = O(e, (l) => l.auth.stepHistory), n = O(e, (l) => l.auth.email), o = O(e, (l) => l.auth.otpId), c = O(
47
+ function R() {
48
+ const e = X(), s = I(e, (l) => l.auth.step), a = I(e, (l) => l.auth.stepHistory), t = I(e, (l) => l.auth.email), r = I(e, (l) => l.auth.otpId), d = I(
456
49
  e,
457
50
  (l) => l.auth.otpEncryptionTargetBundle
458
- ), s = O(e, (l) => l.auth.enabledMethods), u = O(e, (l) => l.auth.config);
51
+ ), i = I(e, (l) => l.auth.enabledMethods), u = I(e, (l) => l.auth.config);
459
52
  return {
460
- step: i,
461
- email: n,
462
- otpId: o,
463
- otpEncryptionTargetBundle: c,
464
- enabledMethods: s,
53
+ step: s,
54
+ email: t,
55
+ otpId: r,
56
+ otpEncryptionTargetBundle: d,
57
+ enabledMethods: i,
465
58
  config: u,
466
59
  goToStep: e.getState().auth.goToStep,
467
- goBack: r.length > 0 ? e.getState().auth.goBack : null,
60
+ goBack: a.length > 0 ? e.getState().auth.goBack : null,
468
61
  reset: e.getState().auth.reset,
469
62
  setEmail: e.getState().auth.setEmail,
470
63
  setOtpSession: e.getState().auth.setOtpSession,
471
64
  clearOtpSession: e.getState().auth.clearOtpSession
472
65
  };
473
66
  }
474
- function L({
475
- className: e,
476
- style: i
477
- }) {
478
- return /* @__PURE__ */ d(
479
- "div",
480
- {
481
- className: R(
482
- "zd:gap-1.5 zd:flex zd:flex-row zd:items-center",
483
- e
484
- ),
485
- children: [
486
- /* @__PURE__ */ t(h, { children: "Powered by" }),
487
- /* @__PURE__ */ t(
488
- se,
489
- {
490
- variant: "lockup",
491
- tone: "black",
492
- className: "zd:h-4.5 zd:w-auto",
493
- style: i
494
- }
495
- )
496
- ]
497
- }
498
- );
499
- }
500
- function Fe() {
501
- const { email: e, setOtpSession: i } = F(), { mutateAsync: r, isPending: n } = Y(), [o, c] = w(60), s = o <= 0 && !n;
502
- return P(() => {
503
- if (o <= 0) return;
67
+ function Ee() {
68
+ const { email: e, setOtpSession: s } = R(), { mutateAsync: a, isPending: t } = Y(), [r, d] = w(60), i = r <= 0 && !t;
69
+ return O(() => {
70
+ if (r <= 0) return;
504
71
  const l = setInterval(() => {
505
- c((p) => Math.max(0, p - 1));
72
+ d((h) => Math.max(0, h - 1));
506
73
  }, 1e3);
507
74
  return () => {
508
75
  clearInterval(l);
509
76
  };
510
- }, [o]), /* @__PURE__ */ d(b, { children: [
511
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
512
- /* @__PURE__ */ d(
513
- I,
77
+ }, [r]), /* @__PURE__ */ c(A, { children: [
78
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
79
+ /* @__PURE__ */ c(
80
+ P,
514
81
  {
515
82
  imageName: "send",
516
83
  title: `Check your email!
@@ -518,280 +85,280 @@ function Fe() {
518
85
  children: [
519
86
  "We've sent a magic link to",
520
87
  " ",
521
- /* @__PURE__ */ t(h, { as: "span", className: "zd:text-solarOrange", children: e }),
88
+ /* @__PURE__ */ n(m, { as: "span", className: "zd:text-solarOrange", children: e }),
522
89
  `
523
90
  `,
524
91
  "Please open the email and click the link to log in."
525
92
  ]
526
93
  }
527
94
  ),
528
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
95
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
529
96
  "Did not get an email?",
530
97
  " ",
531
- /* @__PURE__ */ t(
98
+ /* @__PURE__ */ n(
532
99
  "button",
533
100
  {
534
101
  type: "button",
535
- disabled: !s,
102
+ disabled: !i,
536
103
  onClick: async () => {
537
- if (!(!e || !s))
104
+ if (!(!e || !i))
538
105
  try {
539
- const { otpId: l, otpEncryptionTargetBundle: p } = await r({
106
+ const { otpId: l, otpEncryptionTargetBundle: h } = await a({
540
107
  email: e
541
108
  });
542
- i({ otpId: l, otpEncryptionTargetBundle: p }), c(60);
109
+ s({ otpId: l, otpEncryptionTargetBundle: h }), d(60);
543
110
  } catch {
544
111
  }
545
112
  },
546
113
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
547
- children: s ? "Resend" : `Resend in ${o} ${o === 1 ? "second" : "seconds"}`
114
+ children: i ? "Resend" : `Resend in ${r} ${r === 1 ? "second" : "seconds"}`
548
115
  }
549
116
  )
550
117
  ] }) })
551
118
  ] }),
552
- /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
119
+ /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
553
120
  ] });
554
121
  }
555
- function Pe() {
122
+ function ke() {
556
123
  return typeof window > "u" ? !1 : new URLSearchParams(window.location.search).has("code");
557
124
  }
558
- function $() {
125
+ function M() {
559
126
  if (typeof window > "u") return;
560
127
  const e = new URL(window.location.href);
561
128
  e.searchParams.has("code") && (e.searchParams.delete("code"), window.history.replaceState(null, "", e.toString()));
562
129
  }
563
- function Re({
130
+ function Te({
564
131
  title: e = "Oops, something went wrong",
565
- message: i = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
566
- showRetry: r = !1,
567
- showChooseAnother: n = !0
132
+ message: s = "We couldn't complete the sign-in process. This could be due to timeout, an expired link, or a cancelled request.",
133
+ showRetry: a = !1,
134
+ showChooseAnother: t = !0
568
135
  }) {
569
- const { goToStep: o, goBack: c, reset: s } = F();
570
- return /* @__PURE__ */ d(b, { children: [
571
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
572
- /* @__PURE__ */ t(I, { imageName: "error", title: e, children: i }),
573
- /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
574
- r && /* @__PURE__ */ t(C, { action: "primary", text: "Try again", onClick: c ?? (() => o("sign-up")) }),
575
- n && /* @__PURE__ */ t(
576
- C,
136
+ const { goToStep: r, goBack: d, reset: i } = R();
137
+ return /* @__PURE__ */ c(A, { children: [
138
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
139
+ /* @__PURE__ */ n(P, { imageName: "error", title: e, children: s }),
140
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-1", children: [
141
+ a && /* @__PURE__ */ n(E, { action: "primary", text: "Try again", onClick: d ?? (() => r("sign-up")) }),
142
+ t && /* @__PURE__ */ n(
143
+ E,
577
144
  {
578
- action: r ? "secondary" : "primary",
145
+ action: a ? "secondary" : "primary",
579
146
  onClick: () => {
580
- $(), o("sign-up");
147
+ M(), r("sign-up");
581
148
  },
582
149
  text: "Choose another sign-in method"
583
150
  }
584
151
  ),
585
- !r && !n && /* @__PURE__ */ t(C, { action: "primary", text: "Start over", onClick: s })
152
+ !a && !t && /* @__PURE__ */ n(E, { action: "primary", text: "Start over", onClick: i })
586
153
  ] })
587
154
  ] }),
588
- /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
155
+ /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
589
156
  ] });
590
157
  }
591
- const Le = 4, $e = 8, Ue = 6;
592
- function Me(e) {
593
- return Math.max(Le, Math.min($e, e));
158
+ const Ie = 4, Ae = 8, Ce = 6;
159
+ function Le(e) {
160
+ return Math.max(Ie, Math.min(Ae, e));
594
161
  }
595
- function je({ char: e, isFocused: i }) {
596
- return /* @__PURE__ */ t(
597
- ae,
162
+ function Pe({ char: e, isFocused: s }) {
163
+ return /* @__PURE__ */ n(
164
+ ne,
598
165
  {
599
166
  "data-testid": "code-input-box",
600
- "data-active": i || void 0,
601
- className: R(
167
+ "data-active": s || void 0,
168
+ className: G(
602
169
  "zd:h-16 zd:w-14 zd:rounded-lg zd:flex zd:items-center zd:justify-center",
603
- i && "zd:border-[1.5px] zd:border-greyScale"
170
+ s && "zd:border-[1.5px] zd:border-greyScale"
604
171
  ),
605
- children: /* @__PURE__ */ t(h, { className: "zd:text-h2", children: e })
172
+ children: /* @__PURE__ */ n(m, { className: "zd:text-h2", children: e })
606
173
  }
607
174
  );
608
175
  }
609
- function _e({
176
+ function Re({
610
177
  onChange: e,
611
- onComplete: i,
612
- disabled: r = !1,
613
- error: n = !1,
614
- autoFocus: o = !1,
615
- length: c = Ue,
616
- "data-testid": s
178
+ onComplete: s,
179
+ disabled: a = !1,
180
+ error: t = !1,
181
+ autoFocus: r = !1,
182
+ length: d = Ce,
183
+ "data-testid": i
617
184
  }) {
618
- const u = Me(c), l = re(
619
- () => Array.from({ length: u }, (f, g) => ({
185
+ const u = Le(d), l = le(
186
+ () => Array.from({ length: u }, (p, g) => ({
620
187
  id: `char-${g}`,
621
188
  index: g
622
189
  })),
623
190
  [u]
624
- ), [p, x] = w(""), [m, N] = w(!1), k = K(null);
625
- P(() => {
626
- var f;
627
- o && !r && ((f = k.current) == null || f.focus());
628
- }, [o, r]), P(() => {
629
- x((f) => f.slice(0, u));
191
+ ), [h, x] = w(""), [f, N] = w(!1), k = K(null);
192
+ O(() => {
193
+ var p;
194
+ r && !a && ((p = k.current) == null || p.focus());
195
+ }, [r, a]), O(() => {
196
+ x((p) => p.slice(0, u));
630
197
  }, [u]);
631
- const S = (f) => {
632
- const g = f.slice(0, u).toUpperCase();
198
+ const v = (p) => {
199
+ const g = p.slice(0, u).toUpperCase();
633
200
  x(g), e == null || e(g), g.length === u && setTimeout(() => {
634
- var T;
635
- i == null || i(g), (T = k.current) == null || T.blur();
201
+ var C;
202
+ s == null || s(g), (C = k.current) == null || C.blur();
636
203
  }, 0);
637
204
  };
638
- return /* @__PURE__ */ d(
205
+ return /* @__PURE__ */ c(
639
206
  "button",
640
207
  {
641
208
  type: "button",
642
209
  className: "zd:flex zd:flex-row zd:items-center zd:justify-between zd:gap-2 zd:w-full zd:cursor-text",
643
210
  onClick: () => {
644
- var f;
645
- return (f = k.current) == null ? void 0 : f.focus();
211
+ var p;
212
+ return (p = k.current) == null ? void 0 : p.focus();
646
213
  },
647
- disabled: r,
648
- "data-testid": s,
214
+ disabled: a,
215
+ "data-testid": i,
649
216
  children: [
650
- /* @__PURE__ */ t(
217
+ /* @__PURE__ */ n(
651
218
  "input",
652
219
  {
653
220
  ref: k,
654
- value: p,
655
- onChange: (f) => S(f.target.value),
221
+ value: h,
222
+ onChange: (p) => v(p.target.value),
656
223
  onFocus: () => N(!0),
657
224
  onBlur: () => N(!1),
658
225
  maxLength: u,
659
- disabled: r,
226
+ disabled: a,
660
227
  className: "zd:absolute zd:opacity-0 zd:pointer-events-none",
661
228
  style: { position: "absolute", opacity: 0 },
662
229
  "aria-label": "Verification code"
663
230
  }
664
231
  ),
665
- l.map((f) => /* @__PURE__ */ t(
666
- je,
232
+ l.map((p) => /* @__PURE__ */ n(
233
+ Pe,
667
234
  {
668
- char: p[f.index] ?? "",
669
- isFocused: !n && m && f.index === p.length
235
+ char: h[p.index] ?? "",
236
+ isFocused: !t && f && p.index === h.length
670
237
  },
671
- f.id
238
+ p.id
672
239
  ))
673
240
  ]
674
241
  }
675
242
  );
676
243
  }
677
- function He() {
244
+ function Oe() {
678
245
  const {
679
246
  email: e,
680
- otpId: i,
681
- otpEncryptionTargetBundle: r,
682
- setOtpSession: n,
683
- clearOtpSession: o,
684
- goToStep: c,
685
- config: s
686
- } = F(), { mutateAsync: u, isPending: l } = J(), { mutateAsync: p, isPending: x } = pe(), [m, N] = w(""), [k, S] = w(!1), [f, g] = w(60);
687
- P(() => {
688
- if (f <= 0) return;
689
- const v = setInterval(() => {
690
- g((A) => Math.max(0, A - 1));
247
+ otpId: s,
248
+ otpEncryptionTargetBundle: a,
249
+ setOtpSession: t,
250
+ clearOtpSession: r,
251
+ goToStep: d,
252
+ config: i
253
+ } = R(), { mutateAsync: u, isPending: l } = J(), { mutateAsync: h, isPending: x } = he(), [f, N] = w(""), [k, v] = w(!1), [p, g] = w(60);
254
+ O(() => {
255
+ if (p <= 0) return;
256
+ const S = setInterval(() => {
257
+ g((T) => Math.max(0, T - 1));
691
258
  }, 1e3);
692
- return () => clearInterval(v);
693
- }, [f]);
694
- const T = async () => {
695
- var v, A;
696
- if (!(!m.trim() || !i || !r)) {
697
- S(!1);
259
+ return () => clearInterval(S);
260
+ }, [p]);
261
+ const C = async () => {
262
+ var S, T;
263
+ if (!(!f.trim() || !s || !a)) {
264
+ v(!1);
698
265
  try {
699
- await p({
700
- otpId: i,
701
- code: m.trim(),
702
- otpEncryptionTargetBundle: r
703
- }), o(), c("authenticated"), (v = s == null ? void 0 : s.onSuccess) == null || v.call(s);
704
- } catch (_) {
705
- S(!0), (A = s == null ? void 0 : s.onError) == null || A.call(s, _);
266
+ await h({
267
+ otpId: s,
268
+ code: f.trim(),
269
+ otpEncryptionTargetBundle: a
270
+ }), r(), d("authenticated"), (S = i == null ? void 0 : i.onSuccess) == null || S.call(i);
271
+ } catch (F) {
272
+ v(!0), (T = i == null ? void 0 : i.onError) == null || T.call(i, F);
706
273
  }
707
274
  }
708
- }, y = (v) => {
709
- N(v);
710
- }, j = async () => {
711
- if (!(!e || f > 0 || l))
275
+ }, y = (S) => {
276
+ N(S);
277
+ }, H = async () => {
278
+ if (!(!e || p > 0 || l))
712
279
  try {
713
- const { otpId: v, otpEncryptionTargetBundle: A } = await u({ email: e });
714
- n({
715
- otpId: v,
716
- otpEncryptionTargetBundle: A
717
- }), g(60), S(!1);
280
+ const { otpId: S, otpEncryptionTargetBundle: T } = await u({ email: e });
281
+ t({
282
+ otpId: S,
283
+ otpEncryptionTargetBundle: T
284
+ }), g(60), v(!1);
718
285
  } catch {
719
- S(!0);
286
+ v(!0);
720
287
  }
721
- }, U = f <= 0 && !l;
722
- return /* @__PURE__ */ d(b, { children: [
723
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
724
- /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
725
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
726
- /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
288
+ }, U = p <= 0 && !l;
289
+ return /* @__PURE__ */ c(A, { children: [
290
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center zd:items-center", children: [
291
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4", children: [
292
+ /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Enter verification code" }),
293
+ /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
727
294
  "Enter the code from the email we sent to",
728
295
  " ",
729
- /* @__PURE__ */ t(h, { className: "zd:text-solarOrange", children: e })
296
+ /* @__PURE__ */ n(m, { className: "zd:text-solarOrange", children: e })
730
297
  ] })
731
298
  ] }),
732
- /* @__PURE__ */ t(
733
- _e,
299
+ /* @__PURE__ */ n(
300
+ Re,
734
301
  {
735
302
  onComplete: y,
736
- onChange: () => S(!1),
303
+ onChange: () => v(!1),
737
304
  disabled: x,
738
305
  error: k,
739
306
  autoFocus: !0
740
307
  }
741
308
  ),
742
- /* @__PURE__ */ t(
743
- C,
309
+ /* @__PURE__ */ n(
310
+ E,
744
311
  {
745
312
  text: "Confirm code",
746
- onClick: T,
747
- disabled: !m.trim() || x
313
+ onClick: C,
314
+ disabled: !f.trim() || x
748
315
  }
749
316
  ),
750
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ d(h, { className: "zd:text-center", children: [
317
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-1", children: /* @__PURE__ */ c(m, { className: "zd:text-center", children: [
751
318
  "Did not get an email?",
752
319
  " ",
753
- /* @__PURE__ */ t(
320
+ /* @__PURE__ */ n(
754
321
  "button",
755
322
  {
756
323
  type: "button",
757
324
  disabled: !U,
758
- onClick: j,
325
+ onClick: H,
759
326
  className: "zd:cursor-pointer zd:underline zd:disabled:opacity-50 zd:disabled:cursor-not-allowed",
760
- children: U ? "Resend" : `Resend in ${f} ${f === 1 ? "second" : "seconds"}`
327
+ children: U ? "Resend" : `Resend in ${p} ${p === 1 ? "second" : "seconds"}`
761
328
  }
762
329
  )
763
330
  ] }) })
764
331
  ] }),
765
- /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
332
+ /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
766
333
  ] });
767
334
  }
768
- function Ge({
335
+ function Be({
769
336
  termsAndConditionsUrl: e,
770
- privacyPolicyUrl: i,
771
- agreedToTerms: r,
772
- setAgreedToTerms: n,
773
- highlight: o = !1
337
+ privacyPolicyUrl: s,
338
+ agreedToTerms: a,
339
+ setAgreedToTerms: t,
340
+ highlight: r = !1
774
341
  }) {
775
- return /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
776
- !!(e || i) && /* @__PURE__ */ d(
342
+ return /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:items-center zd:gap-5", children: [
343
+ !!(e || s) && /* @__PURE__ */ c(
777
344
  "div",
778
345
  {
779
- className: `zd:flex zd:flex-row zd:items-center zd:gap-2 zd:rounded-md zd:p-2 zd:transition-colors ${o ? "zd:border zd:border-negative" : "zd:border zd:border-transparent"}`,
346
+ 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"}`,
780
347
  children: [
781
- /* @__PURE__ */ t(
348
+ /* @__PURE__ */ n(
782
349
  "input",
783
350
  {
784
351
  type: "checkbox",
785
- checked: r,
786
- onChange: (s) => n(s.target.checked),
352
+ checked: a,
353
+ onChange: (i) => t(i.target.checked),
787
354
  className: "zd:cursor-pointer zd:[color-scheme:light]"
788
355
  }
789
356
  ),
790
- /* @__PURE__ */ d(h, { className: "zd:flex-1", children: [
357
+ /* @__PURE__ */ c(m, { className: "zd:flex-1", children: [
791
358
  "I agree to the",
792
359
  " ",
793
- e && /* @__PURE__ */ t(
794
- h,
360
+ e && /* @__PURE__ */ n(
361
+ m,
795
362
  {
796
363
  as: "a",
797
364
  href: e,
@@ -801,12 +368,12 @@ function Ge({
801
368
  children: "Terms & Conditions"
802
369
  }
803
370
  ),
804
- e && i && " and ",
805
- i && /* @__PURE__ */ t(
806
- h,
371
+ e && s && " and ",
372
+ s && /* @__PURE__ */ n(
373
+ m,
807
374
  {
808
375
  as: "a",
809
- href: i,
376
+ href: s,
810
377
  target: "_blank",
811
378
  rel: "noopener noreferrer",
812
379
  className: "zd:underline",
@@ -817,21 +384,21 @@ function Ge({
817
384
  ]
818
385
  }
819
386
  ),
820
- /* @__PURE__ */ t(L, {})
387
+ /* @__PURE__ */ n(B, {})
821
388
  ] });
822
389
  }
823
- const We = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
824
- function M(e) {
825
- return We.test(e.trim());
390
+ const Me = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
391
+ function j(e) {
392
+ return Me.test(e.trim());
826
393
  }
827
- const qe = "" + new URL("blob.webm", import.meta.url).href;
828
- function De({ className: e }) {
829
- return /* @__PURE__ */ t(
394
+ const Ue = "" + new URL("blob.webm", import.meta.url).href;
395
+ function je({ className: e }) {
396
+ return /* @__PURE__ */ n(
830
397
  "video",
831
398
  {
832
399
  className: e,
833
400
  style: { aspectRatio: "1 / 1" },
834
- src: qe,
401
+ src: Ue,
835
402
  autoPlay: !0,
836
403
  loop: !0,
837
404
  muted: !0,
@@ -841,194 +408,194 @@ function De({ className: e }) {
841
408
  }
842
409
  );
843
410
  }
844
- function H(e) {
411
+ function _(e) {
845
412
  return e instanceof Error ? e.name === "AbortError" || e.name === "NotAllowedError" ? !0 : e.message.toLowerCase().includes("oauth popup was closed") : !1;
846
413
  }
847
- function Ve() {
848
- const { goToStep: e, setEmail: i, setOtpSession: r, config: n, enabledMethods: o } = F(), [c, s] = w(!1), [u, l] = w(!1), [p, x] = w(""), m = (n == null ? void 0 : n.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = J(), { mutateAsync: S, isPending: f } = Y(), g = k || f, [T, y] = w(null), { mutateAsync: j, isPending: U } = fe({
414
+ function He() {
415
+ const { goToStep: e, setEmail: s, setOtpSession: a, config: t, enabledMethods: r } = R(), [d, i] = w(!1), [u, l] = w(!1), [h, x] = w(""), f = (t == null ? void 0 : t.emailAuthMethod) === "otp", { mutateAsync: N, isPending: k } = J(), { mutateAsync: v, isPending: p } = Y(), g = k || p, [C, y] = w(null), { mutateAsync: H, isPending: U } = pe({
849
416
  mutation: {
850
417
  onSuccess: async () => {
851
- var a;
852
- e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
418
+ var o;
419
+ e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
853
420
  },
854
- onError: (a) => {
421
+ onError: (o) => {
855
422
  var z;
856
- (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
423
+ (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
857
424
  }
858
425
  }
859
- }), { mutate: v, isPending: A } = he({
426
+ }), { mutate: S, isPending: T } = me({
860
427
  mutation: {
861
428
  onSuccess: () => {
862
- var a;
863
- e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
429
+ var o;
430
+ e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
864
431
  },
865
- onError: (a) => {
432
+ onError: (o) => {
866
433
  var z;
867
- H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
434
+ _(o) || y(o instanceof Error ? o.message : String(o)), (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
868
435
  }
869
436
  }
870
- }), { mutate: _, isPending: ee } = ze({
437
+ }), { mutate: F, isPending: Q } = ze({
871
438
  mutation: {
872
439
  onSuccess: () => {
873
- var a;
874
- e("authenticated"), (a = n == null ? void 0 : n.onSuccess) == null || a.call(n);
440
+ var o;
441
+ e("authenticated"), (o = t == null ? void 0 : t.onSuccess) == null || o.call(t);
875
442
  },
876
- onError: (a) => {
443
+ onError: (o) => {
877
444
  var z;
878
- H(a) || y(a instanceof Error ? a.message : String(a)), (z = n == null ? void 0 : n.onError) == null || z.call(n, a);
445
+ _(o) || y(o instanceof Error ? o.message : String(o)), (z = t == null ? void 0 : t.onError) == null || z.call(t, o);
879
446
  }
880
447
  }
881
- }), E = U || g || A || ee, B = !!(n != null && n.termsAndConditionsUrl || n != null && n.privacyPolicyUrl) && !c, te = () => {
882
- if (!E) {
883
- if (B) {
448
+ }), b = U || g || T || Q, L = !!(t != null && t.termsAndConditionsUrl || t != null && t.privacyPolicyUrl) && !d, Z = () => {
449
+ if (!b) {
450
+ if (L) {
884
451
  l(!0);
885
452
  return;
886
453
  }
887
- y(null), v();
454
+ y(null), S();
888
455
  }
889
- }, ne = () => {
890
- if (!E) {
891
- if (B) {
456
+ }, ee = () => {
457
+ if (!b) {
458
+ if (L) {
892
459
  l(!0);
893
460
  return;
894
461
  }
895
- y(null), _();
462
+ y(null), F();
896
463
  }
897
- }, oe = async () => {
898
- if (B) {
464
+ }, te = async () => {
465
+ if (L) {
899
466
  l(!0);
900
467
  return;
901
468
  }
902
469
  y(null);
903
470
  try {
904
- await j({ provider: "google" });
905
- } catch (a) {
906
- const z = a instanceof Error ? a.message : String(a);
907
- H(a) || y(z);
471
+ await H({ provider: "google" });
472
+ } catch (o) {
473
+ const z = o instanceof Error ? o.message : String(o);
474
+ _(o) || y(z);
908
475
  }
909
- }, W = m ? async () => {
910
- if (!(!p || E) && M(p)) {
911
- if (B) {
476
+ }, W = f ? async () => {
477
+ if (!(!h || b) && j(h)) {
478
+ if (L) {
912
479
  l(!0);
913
480
  return;
914
481
  }
915
482
  y(null);
916
483
  try {
917
- const { otpId: a, otpEncryptionTargetBundle: z } = await N({
918
- email: p
484
+ const { otpId: o, otpEncryptionTargetBundle: z } = await N({
485
+ email: h
919
486
  });
920
- i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("otp-input");
921
- } catch (a) {
487
+ s(h), a({ otpId: o, otpEncryptionTargetBundle: z }), e("otp-input");
488
+ } catch (o) {
922
489
  y(
923
- a instanceof Error ? a.message : "Failed to send verification code"
490
+ o instanceof Error ? o.message : "Failed to send verification code"
924
491
  );
925
492
  }
926
493
  }
927
494
  } : async () => {
928
- if (!(!p || E) && M(p)) {
929
- if (B) {
495
+ if (!(!h || b) && j(h)) {
496
+ if (L) {
930
497
  l(!0);
931
498
  return;
932
499
  }
933
500
  y(null);
934
501
  try {
935
- const { otpId: a, otpEncryptionTargetBundle: z } = await S({
936
- email: p
502
+ const { otpId: o, otpEncryptionTargetBundle: z } = await v({
503
+ email: h
937
504
  });
938
- i(p), r({ otpId: a, otpEncryptionTargetBundle: z }), e("email-verification");
939
- } catch (a) {
505
+ s(h), a({ otpId: o, otpEncryptionTargetBundle: z }), e("email-verification");
506
+ } catch (o) {
940
507
  y(
941
- a instanceof Error ? a.message : "Failed to send verification code"
508
+ o instanceof Error ? o.message : "Failed to send verification code"
942
509
  );
943
510
  }
944
511
  }
945
512
  };
946
- return T ? /* @__PURE__ */ t("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ d("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
947
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
948
- /* @__PURE__ */ t(h, { className: "zd:text-center zd:text-red-500", children: T }),
949
- /* @__PURE__ */ t(
950
- C,
513
+ return C ? /* @__PURE__ */ n("div", { className: "zd:flex zd:items-center zd:justify-center zd:h-full", children: /* @__PURE__ */ c("div", { className: "zd:flex zd:flex-col zd:gap-4 zd:max-w-md", children: [
514
+ /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Error occurred" }),
515
+ /* @__PURE__ */ n(m, { className: "zd:text-center zd:text-red-500", children: C }),
516
+ /* @__PURE__ */ n(
517
+ E,
951
518
  {
952
519
  action: "primary",
953
520
  text: "Try again",
954
521
  onClick: () => y(null)
955
522
  }
956
523
  )
957
- ] }) }) : /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
958
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
959
- /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
960
- /* @__PURE__ */ t("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ t(De, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
961
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
962
- /* @__PURE__ */ t(h, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
524
+ ] }) }) : /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-between zd:pb-4 zd:overflow-y-auto zd:overflow-x-hidden", children: [
525
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:justify-center", children: [
526
+ /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:items-center", children: [
527
+ /* @__PURE__ */ n("div", { className: "zd:w-full zd:px-16 zd:py-4", children: /* @__PURE__ */ n(je, { className: "zd:w-full zd:pointer-events-none zd:select-none" }) }),
528
+ /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Continue to your wallet" }),
529
+ /* @__PURE__ */ n(m, { className: "zd:mt-2 zd:text-center zd:text-greyScale/50", children: "Choose a sign-in method to proceed" })
963
530
  ] }),
964
- /* @__PURE__ */ d("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
965
- o.includes("passkey") && /* @__PURE__ */ d(b, { children: [
966
- /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
967
- /* @__PURE__ */ t(
968
- C,
531
+ /* @__PURE__ */ c("div", { className: "zd:mt-6 zd:flex zd:flex-col zd:gap-4 zd:mb-4", children: [
532
+ r.includes("passkey") && /* @__PURE__ */ c(A, { children: [
533
+ /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
534
+ /* @__PURE__ */ n(
535
+ E,
969
536
  {
970
537
  action: "secondary",
971
538
  text: "Create a passkey",
972
539
  iconName: "key",
973
540
  trailIcon: !0,
974
- disabled: E,
975
- onClick: te
541
+ disabled: b,
542
+ onClick: Z
976
543
  }
977
544
  ),
978
- /* @__PURE__ */ t(
979
- C,
545
+ /* @__PURE__ */ n(
546
+ E,
980
547
  {
981
548
  action: "secondary",
982
549
  text: "Log in with passkey",
983
550
  iconName: "key",
984
551
  trailIcon: !0,
985
- disabled: E,
986
- onClick: ne
552
+ disabled: b,
553
+ onClick: ee
987
554
  }
988
555
  )
989
556
  ] }),
990
- /* @__PURE__ */ d("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
991
- /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
992
- /* @__PURE__ */ t(h, { className: "zd:text-body3", children: "or" }),
993
- /* @__PURE__ */ t("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
557
+ /* @__PURE__ */ c("div", { className: "zd:flex zd:items-center zd:gap-3", children: [
558
+ /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" }),
559
+ /* @__PURE__ */ n(m, { className: "zd:text-body3", children: "or" }),
560
+ /* @__PURE__ */ n("div", { className: "zd:h-px zd:flex-1 zd:bg-greyScale/30" })
994
561
  ] })
995
562
  ] }),
996
- /* @__PURE__ */ d("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
997
- o.includes("google") && /* @__PURE__ */ t(
998
- X,
563
+ /* @__PURE__ */ c("div", { className: "zd:px-4 zd:flex zd:flex-col zd:gap-2", children: [
564
+ r.includes("google") && /* @__PURE__ */ n(
565
+ $,
999
566
  {
1000
- iconName: "google",
567
+ icon: /* @__PURE__ */ n(D, { name: "google" }),
1001
568
  title: "Google",
1002
- chevron: !0,
569
+ trailing: /* @__PURE__ */ n(re, {}),
1003
570
  className: "zd:rounded-3xl",
1004
- disabled: E,
1005
- onClick: oe
571
+ disabled: b,
572
+ onClick: te
1006
573
  }
1007
574
  ),
1008
- o.includes("email") && /* @__PURE__ */ t(
1009
- de,
575
+ r.includes("email") && /* @__PURE__ */ n(
576
+ se,
1010
577
  {
1011
578
  iconName: "email",
1012
579
  placeholder: "Enter your email",
1013
- value: p,
1014
- onChange: (a) => x(a.target.value),
580
+ value: h,
581
+ onChange: (o) => x(o.target.value),
1015
582
  type: "email",
1016
583
  autoCapitalize: "none",
1017
584
  autoComplete: "email",
1018
- disabled: E,
585
+ disabled: b,
1019
586
  variant: "listItemStyle",
1020
587
  containerClassName: "zd:rounded-3xl",
1021
- onKeyDown: (a) => {
1022
- a.key === "Enter" && p && !E && W();
588
+ onKeyDown: (o) => {
589
+ o.key === "Enter" && h && !b && W();
1023
590
  },
1024
- children: g ? /* @__PURE__ */ t("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ t("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ t(
591
+ children: g ? /* @__PURE__ */ n("div", { className: "zd:w-13 zd:h-13 zd:flex zd:items-center zd:justify-center", children: /* @__PURE__ */ n("div", { className: "zd:w-5 zd:h-5 zd:border-2 zd:border-solarOrange zd:border-t-transparent zd:rounded-full zd:animate-spin" }) }) : /* @__PURE__ */ n(
1025
592
  "button",
1026
593
  {
1027
594
  type: "button",
1028
- disabled: !M(p) || B,
1029
- className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${M(p) && !B ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
595
+ disabled: !j(h) || L,
596
+ className: `zd:w-13 zd:h-13 zd:rounded-2xl zd:flex zd:items-center zd:justify-center zd:transition-colors ${j(h) && !L ? "zd:cursor-pointer" : "zd:cursor-not-allowed zd:opacity-50"}`,
1030
597
  onClick: () => W(),
1031
- children: /* @__PURE__ */ t(le, { name: "chevronRight", className: "zd:text-greyScale" })
598
+ children: /* @__PURE__ */ n(ie, { name: "chevronRight", className: "zd:text-greyScale" })
1032
599
  }
1033
600
  )
1034
601
  }
@@ -1036,91 +603,91 @@ function Ve() {
1036
603
  ] })
1037
604
  ] })
1038
605
  ] }),
1039
- /* @__PURE__ */ t("div", { className: "zd:px-4", children: /* @__PURE__ */ t(
1040
- Ge,
606
+ /* @__PURE__ */ n("div", { className: "zd:px-4", children: /* @__PURE__ */ n(
607
+ Be,
1041
608
  {
1042
- termsAndConditionsUrl: n == null ? void 0 : n.termsAndConditionsUrl,
1043
- privacyPolicyUrl: n == null ? void 0 : n.privacyPolicyUrl,
1044
- agreedToTerms: c,
1045
- setAgreedToTerms: (a) => {
1046
- s(a), a && l(!1);
609
+ termsAndConditionsUrl: t == null ? void 0 : t.termsAndConditionsUrl,
610
+ privacyPolicyUrl: t == null ? void 0 : t.privacyPolicyUrl,
611
+ agreedToTerms: d,
612
+ setAgreedToTerms: (o) => {
613
+ i(o), o && l(!1);
1047
614
  },
1048
615
  highlight: u
1049
616
  }
1050
617
  ) })
1051
618
  ] });
1052
619
  }
1053
- function Ke() {
620
+ function Fe() {
1054
621
  return typeof window > "u" ? null : new URLSearchParams(window.location.search).get("code");
1055
622
  }
1056
- function Xe() {
623
+ function _e() {
1057
624
  const {
1058
625
  otpId: e,
1059
- otpEncryptionTargetBundle: i,
1060
- goToStep: r,
1061
- clearOtpSession: n,
1062
- config: o
1063
- } = F(), [c] = w(Ke), [s, u] = w(null), l = K(!1), { mutate: p, isPending: x } = me({
626
+ otpEncryptionTargetBundle: s,
627
+ goToStep: a,
628
+ clearOtpSession: t,
629
+ config: r
630
+ } = R(), [d] = w(Fe), [i, u] = w(null), l = K(!1), { mutate: h, isPending: x } = fe({
1064
631
  mutation: {
1065
632
  onSuccess: async () => {
1066
- var m;
1067
- n(), r("authenticated"), (m = o == null ? void 0 : o.onSuccess) == null || m.call(o);
633
+ var f;
634
+ t(), a("authenticated"), (f = r == null ? void 0 : r.onSuccess) == null || f.call(r);
1068
635
  },
1069
- onError: (m) => {
636
+ onError: (f) => {
1070
637
  var N;
1071
- u(m), (N = o == null ? void 0 : o.onError) == null || N.call(o, m);
638
+ u(f), (N = r == null ? void 0 : r.onError) == null || N.call(r, f);
1072
639
  }
1073
640
  }
1074
641
  });
1075
- return P(() => {
1076
- if (!(l.current || !c)) {
1077
- if (l.current = !0, !e || !i) {
1078
- $(), r(null);
642
+ return O(() => {
643
+ if (!(l.current || !d)) {
644
+ if (l.current = !0, !e || !s) {
645
+ M(), a(null);
1079
646
  return;
1080
647
  }
1081
- p({ otpId: e, code: c, otpEncryptionTargetBundle: i });
648
+ h({ otpId: e, code: d, otpEncryptionTargetBundle: s });
1082
649
  }
1083
- }, [e, i, c, p, r]), /* @__PURE__ */ d(b, { children: [
1084
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
1085
- !s && x && /* @__PURE__ */ t(I, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
1086
- !s && !c && !x && /* @__PURE__ */ d(b, { children: [
1087
- /* @__PURE__ */ d(I, { imageName: "error", title: "Invalid Link", children: [
650
+ }, [e, s, d, h, a]), /* @__PURE__ */ c(A, { children: [
651
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:items-center zd:justify-center", children: [
652
+ !i && x && /* @__PURE__ */ n(P, { imageName: "loading", title: "Verifying Your Email", children: "Please wait while we securely connect your wallet." }),
653
+ !i && !d && !x && /* @__PURE__ */ c(A, { children: [
654
+ /* @__PURE__ */ c(P, { imageName: "error", title: "Invalid Link", children: [
1088
655
  "This verification link is invalid or incomplete.",
1089
- /* @__PURE__ */ t("br", {}),
656
+ /* @__PURE__ */ n("br", {}),
1090
657
  "Please check your email and try again with the correct link."
1091
658
  ] }),
1092
- /* @__PURE__ */ t(
1093
- C,
659
+ /* @__PURE__ */ n(
660
+ E,
1094
661
  {
1095
662
  action: "primary",
1096
663
  onClick: () => {
1097
- $(), r("sign-up");
664
+ M(), a("sign-up");
1098
665
  },
1099
666
  text: "Choose another sign-in method"
1100
667
  }
1101
668
  )
1102
669
  ] }),
1103
- s != null && /* @__PURE__ */ d(b, { children: [
1104
- /* @__PURE__ */ t(I, { 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." }),
1105
- /* @__PURE__ */ t(
1106
- C,
670
+ i != null && /* @__PURE__ */ c(A, { children: [
671
+ /* @__PURE__ */ n(P, { 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." }),
672
+ /* @__PURE__ */ n(
673
+ E,
1107
674
  {
1108
675
  action: "primary",
1109
676
  onClick: () => {
1110
- $(), r("sign-up");
677
+ M(), a("sign-up");
1111
678
  },
1112
679
  text: "Choose another sign-in method"
1113
680
  }
1114
681
  )
1115
682
  ] })
1116
683
  ] }),
1117
- /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
684
+ /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
1118
685
  ] });
1119
686
  }
1120
- function Ye() {
1121
- const { goToStep: e } = F(), { connect: i, connectors: r, isPending: n } = ue(), o = r.filter((s) => s.id !== "zerodev-wallet"), c = (s) => {
1122
- i(
1123
- { connector: s },
687
+ function qe() {
688
+ const { goToStep: e } = R(), { connect: s, connectors: a, isPending: t } = ue(), r = a.filter((i) => i.id !== "zerodev-wallet"), d = (i) => {
689
+ s(
690
+ { connector: i },
1124
691
  {
1125
692
  onSuccess: () => {
1126
693
  e(null);
@@ -1128,82 +695,88 @@ function Ye() {
1128
695
  }
1129
696
  );
1130
697
  };
1131
- return /* @__PURE__ */ d(b, { children: [
1132
- /* @__PURE__ */ d("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
1133
- /* @__PURE__ */ t(h, { className: "zd:text-h2 zd:text-center", children: "Select your wallet" }),
1134
- /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-col zd:gap-2", children: o.length === 0 ? /* @__PURE__ */ t(h, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : o.map((s) => /* @__PURE__ */ t(
1135
- X,
698
+ return /* @__PURE__ */ c(A, { children: [
699
+ /* @__PURE__ */ c("div", { className: "zd:flex-1 zd:flex zd:flex-col zd:gap-8 zd:justify-center", children: [
700
+ /* @__PURE__ */ n(m, { className: "zd:text-h2 zd:text-center", children: "Select your wallet" }),
701
+ /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-col zd:gap-2", children: r.length === 0 ? /* @__PURE__ */ n(m, { className: "zd:text-center", children: "No wallets detected. Install a browser wallet extension to continue." }) : r.map((i) => /* @__PURE__ */ n(
702
+ $,
1136
703
  {
1137
- title: s.name,
1138
- iconName: "walletOutline",
1139
- ...s.icon ? { imageUri: s.icon } : {},
1140
- disabled: n,
1141
- onClick: () => c(s),
704
+ title: i.name,
705
+ icon: i.icon ? /* @__PURE__ */ n(
706
+ "img",
707
+ {
708
+ src: i.icon,
709
+ alt: "",
710
+ className: "zd:w-6 zd:h-6"
711
+ }
712
+ ) : /* @__PURE__ */ n(D, { name: "walletOutline" }),
713
+ disabled: t,
714
+ onClick: () => d(i),
1142
715
  className: "zd:rounded-3xl"
1143
716
  },
1144
- s.uid
717
+ i.uid
1145
718
  )) })
1146
719
  ] }),
1147
- /* @__PURE__ */ t(L, { className: "zd:self-center zd:pt-4 zd:pb-6" })
720
+ /* @__PURE__ */ n(B, { className: "zd:self-center zd:pt-4 zd:pb-6" })
1148
721
  ] });
1149
722
  }
1150
- const Je = {
723
+ const We = {
1151
724
  "wallet-selection": "Choose your wallet"
1152
725
  };
1153
- function Ze() {
1154
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
726
+ function Ve() {
727
+ return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(P, { imageName: "loading", title: "Authenticating...", children: "Please wait while we complete the OAuth authentication." }) });
1155
728
  }
1156
- function Qe() {
1157
- return /* @__PURE__ */ t("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ t(I, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
729
+ function Ge() {
730
+ return /* @__PURE__ */ n("div", { className: "zd:flex zd:flex-1 zd:items-center zd:justify-center", children: /* @__PURE__ */ n(P, { imageName: "loading", title: "Passkey authentication", children: "Please authenticate with your passkey." }) });
1158
731
  }
1159
- function et(e) {
732
+ function $e(e) {
1160
733
  switch (e) {
1161
734
  case "sign-up":
1162
- return /* @__PURE__ */ t(Ve, {});
735
+ return /* @__PURE__ */ n(He, {});
1163
736
  case "email-verification":
1164
- return /* @__PURE__ */ t(Fe, {});
737
+ return /* @__PURE__ */ n(Ee, {});
1165
738
  case "otp-input":
1166
- return /* @__PURE__ */ t(He, {});
739
+ return /* @__PURE__ */ n(Oe, {});
1167
740
  case "verifying-otp":
1168
- return /* @__PURE__ */ t(Xe, {});
741
+ return /* @__PURE__ */ n(_e, {});
1169
742
  case "oauth-in-progress":
1170
- return /* @__PURE__ */ t(Ze, {});
743
+ return /* @__PURE__ */ n(Ve, {});
1171
744
  case "passkey-prompt":
1172
- return /* @__PURE__ */ t(Qe, {});
745
+ return /* @__PURE__ */ n(Ge, {});
1173
746
  case "wallet-selection":
1174
- return /* @__PURE__ */ t(Ye, {});
747
+ return /* @__PURE__ */ n(qe, {});
1175
748
  case "error":
1176
- return /* @__PURE__ */ t(Re, {});
749
+ return /* @__PURE__ */ n(Te, {});
1177
750
  default:
1178
751
  return null;
1179
752
  }
1180
753
  }
1181
- function mt({
754
+ function lt({
1182
755
  onClose: e,
1183
- size: i
756
+ size: s
1184
757
  } = {}) {
1185
- const { step: r, goToStep: n, goBack: o, reset: c } = F(), s = O(Q(), (x) => x.logo);
1186
- P(() => {
1187
- r === null && Pe() && n("verifying-otp");
1188
- }, [r, n]);
1189
- const u = et(r);
758
+ const { step: a, goToStep: t, goBack: r, reset: d } = R(), i = I(X(), (x) => x.logo);
759
+ O(() => {
760
+ a === null && ke() && t("verifying-otp");
761
+ }, [a, t]);
762
+ const u = $e(a);
1190
763
  if (!u) return null;
1191
764
  const l = () => {
1192
- $(), c(), e == null || e();
1193
- }, p = r ? Je[r] : void 0;
1194
- return /* @__PURE__ */ t(
1195
- ke,
765
+ M(), d(), e == null || e();
766
+ }, h = a ? We[a] : void 0;
767
+ return /* @__PURE__ */ n(
768
+ ae,
1196
769
  {
1197
- ...i && { size: i },
1198
- contentClassName: r === "sign-up" ? "zd:px-0" : void 0,
1199
- topNav: /* @__PURE__ */ t(
1200
- we,
770
+ ...s && { size: s },
771
+ contentClassName: a === "sign-up" ? "zd:px-0" : void 0,
772
+ topNav: /* @__PURE__ */ n(
773
+ oe,
1201
774
  {
1202
- ...o !== null && { onBack: o },
1203
- onClose: l,
1204
- ...p && { title: p },
1205
- ...r === "sign-up" && {
1206
- ...s && { logo: s },
775
+ ...r !== null && { onLeftButtonClick: r },
776
+ onRightButtonClick: l,
777
+ ...h && { title: h },
778
+ ...a === "sign-up" && {
779
+ ...i && { logo: i },
1207
780
  className: "zd:px-4"
1208
781
  }
1209
782
  }
@@ -1212,36 +785,36 @@ function mt({
1212
785
  }
1213
786
  );
1214
787
  }
1215
- const G = "zerodev:auth:otpSession";
1216
- function tt() {
788
+ const q = "zerodev:auth:otpSession";
789
+ function De() {
1217
790
  if (typeof window > "u") return null;
1218
791
  try {
1219
- const e = window.localStorage.getItem(G);
792
+ const e = window.localStorage.getItem(q);
1220
793
  if (!e) return null;
1221
- const i = JSON.parse(e);
1222
- return !(i != null && i.otpId) || !(i != null && i.otpEncryptionTargetBundle) ? null : i;
794
+ const s = JSON.parse(e);
795
+ return !(s != null && s.otpId) || !(s != null && s.otpEncryptionTargetBundle) ? null : s;
1223
796
  } catch {
1224
797
  return null;
1225
798
  }
1226
799
  }
1227
- function nt(e) {
800
+ function Ke(e) {
1228
801
  if (!(typeof window > "u"))
1229
802
  try {
1230
803
  window.localStorage.setItem(
1231
- G,
804
+ q,
1232
805
  JSON.stringify(e)
1233
806
  );
1234
807
  } catch {
1235
808
  }
1236
809
  }
1237
- function D() {
810
+ function V() {
1238
811
  if (!(typeof window > "u"))
1239
812
  try {
1240
- window.localStorage.removeItem(G);
813
+ window.localStorage.removeItem(q);
1241
814
  } catch {
1242
815
  }
1243
816
  }
1244
- const ot = (e, i, r) => ({
817
+ const Ye = (e, s, a) => ({
1245
818
  auth: {
1246
819
  // Initial state
1247
820
  step: null,
@@ -1252,45 +825,45 @@ const ot = (e, i, r) => ({
1252
825
  otpEncryptionTargetBundle: null,
1253
826
  config: null,
1254
827
  // Actions
1255
- initialize: (n) => {
1256
- const o = tt();
1257
- e((c) => ({
828
+ initialize: (t) => {
829
+ const r = De();
830
+ e((d) => ({
1258
831
  auth: {
1259
- ...c.auth,
1260
- config: n,
1261
- enabledMethods: n.enabledMethods,
1262
- ...o && {
1263
- otpId: o.otpId,
1264
- otpEncryptionTargetBundle: o.otpEncryptionTargetBundle
832
+ ...d.auth,
833
+ config: t,
834
+ enabledMethods: t.enabledMethods,
835
+ ...r && {
836
+ otpId: r.otpId,
837
+ otpEncryptionTargetBundle: r.otpEncryptionTargetBundle
1265
838
  }
1266
839
  }
1267
840
  }));
1268
841
  },
1269
- goToStep: (n) => {
1270
- e((o) => ({
842
+ goToStep: (t) => {
843
+ e((r) => ({
1271
844
  auth: {
1272
- ...o.auth,
1273
- step: n,
1274
- stepHistory: o.auth.step === null ? o.auth.stepHistory : [...o.auth.stepHistory, o.auth.step]
845
+ ...r.auth,
846
+ step: t,
847
+ stepHistory: r.auth.step === null ? r.auth.stepHistory : [...r.auth.stepHistory, r.auth.step]
1275
848
  }
1276
849
  }));
1277
850
  },
1278
851
  goBack: () => {
1279
- const { auth: n } = i();
1280
- if (n.stepHistory.length === 0) return;
1281
- const o = [...n.stepHistory], c = o.pop();
1282
- e((s) => ({
852
+ const { auth: t } = s();
853
+ if (t.stepHistory.length === 0) return;
854
+ const r = [...t.stepHistory], d = r.pop();
855
+ e((i) => ({
1283
856
  auth: {
1284
- ...s.auth,
1285
- step: c,
1286
- stepHistory: o
857
+ ...i.auth,
858
+ step: d,
859
+ stepHistory: r
1287
860
  }
1288
861
  }));
1289
862
  },
1290
863
  reset: () => {
1291
- D(), e((n) => ({
864
+ V(), e((t) => ({
1292
865
  auth: {
1293
- ...n.auth,
866
+ ...t.auth,
1294
867
  step: null,
1295
868
  stepHistory: [],
1296
869
  email: null,
@@ -1299,95 +872,95 @@ const ot = (e, i, r) => ({
1299
872
  }
1300
873
  }));
1301
874
  },
1302
- setEmail: (n) => {
1303
- e((o) => ({
875
+ setEmail: (t) => {
876
+ e((r) => ({
1304
877
  auth: {
1305
- ...o.auth,
1306
- email: n
878
+ ...r.auth,
879
+ email: t
1307
880
  }
1308
881
  }));
1309
882
  },
1310
- setOtpSession: ({ otpId: n, otpEncryptionTargetBundle: o }) => {
1311
- nt({ otpId: n, otpEncryptionTargetBundle: o }), e((c) => ({
883
+ setOtpSession: ({ otpId: t, otpEncryptionTargetBundle: r }) => {
884
+ Ke({ otpId: t, otpEncryptionTargetBundle: r }), e((d) => ({
1312
885
  auth: {
1313
- ...c.auth,
1314
- otpId: n,
1315
- otpEncryptionTargetBundle: o
886
+ ...d.auth,
887
+ otpId: t,
888
+ otpEncryptionTargetBundle: r
1316
889
  }
1317
890
  }));
1318
891
  },
1319
892
  clearOtpSession: () => {
1320
- D(), e((n) => ({
893
+ V(), e((t) => ({
1321
894
  auth: {
1322
- ...n.auth,
895
+ ...t.auth,
1323
896
  otpId: null,
1324
897
  otpEncryptionTargetBundle: null
1325
898
  }
1326
899
  }));
1327
900
  }
1328
901
  }
1329
- }), rt = (e = {}) => ie()(
1330
- xe((i, r, n) => ({
902
+ }), Je = (e = {}) => de()(
903
+ xe((s, a, t) => ({
1331
904
  pendingRequests: [],
1332
905
  userConfirmationListenerActive: !1,
1333
906
  logo: e.logo ?? null,
1334
- addPendingRequest: (o) => i((c) => ({
1335
- pendingRequests: [...c.pendingRequests, o]
907
+ addPendingRequest: (r) => s((d) => ({
908
+ pendingRequests: [...d.pendingRequests, r]
1336
909
  })),
1337
- removePendingRequest: (o) => i((c) => ({
1338
- pendingRequests: c.pendingRequests.filter((s) => s.id !== o)
910
+ removePendingRequest: (r) => s((d) => ({
911
+ pendingRequests: d.pendingRequests.filter((i) => i.id !== r)
1339
912
  })),
1340
- clearPendingRequests: () => i({ pendingRequests: [] }),
1341
- setUserConfirmationListenerActive: (o) => i({ userConfirmationListenerActive: o }),
1342
- ...ot(i, r)
913
+ clearPendingRequests: () => s({ pendingRequests: [] }),
914
+ setUserConfirmationListenerActive: (r) => s({ userConfirmationListenerActive: r }),
915
+ ...Ye(s, a)
1343
916
  }))
1344
917
  );
1345
- function it(e) {
1346
- return new Promise((i, r) => {
1347
- const n = e.subscribe(
1348
- (o) => o.auth.step,
1349
- (o) => {
1350
- o === "authenticated" ? (n(), i()) : o === null && (n(), r(new Error("Auth flow dismissed")));
918
+ function Xe(e) {
919
+ return new Promise((s, a) => {
920
+ const t = e.subscribe(
921
+ (r) => r.auth.step,
922
+ (r) => {
923
+ r === "authenticated" ? (t(), s()) : r === null && (t(), a(new Error("Auth flow dismissed")));
1351
924
  }
1352
925
  );
1353
926
  });
1354
927
  }
1355
- function gt(e) {
1356
- var n, o;
1357
- const i = ge(e), r = rt({ logo: (n = e.config) == null ? void 0 : n.logo });
1358
- return (o = e.config) != null && o.auth && r.getState().auth.initialize(e.config.auth), (c) => {
1359
- const s = i(c);
928
+ function dt(e) {
929
+ var t, r;
930
+ const s = ge(e), a = Je({ logo: (t = e.config) == null ? void 0 : t.logo });
931
+ return (r = e.config) != null && r.auth && a.getState().auth.initialize(e.config.auth), (d) => {
932
+ const i = s(d);
1360
933
  return {
1361
- ...s,
934
+ ...i,
1362
935
  async connect(u) {
1363
936
  var l;
1364
937
  try {
1365
- return await s.connect(u);
1366
- } catch (p) {
1367
- if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(p instanceof ye))
1368
- throw p;
1369
- if (r.getState().auth.step !== null)
938
+ return await i.connect(u);
939
+ } catch (h) {
940
+ if (u != null && u.isReconnecting || !((l = e.config) != null && l.auth) || !(h instanceof ye))
941
+ throw h;
942
+ if (a.getState().auth.step !== null)
1370
943
  throw new Error("Auth flow already in progress");
1371
- return r.getState().auth.goToStep("sign-up"), await it(r), s.connect(u);
944
+ return a.getState().auth.goToStep("sign-up"), await Xe(a), i.connect(u);
1372
945
  }
1373
946
  },
1374
947
  async disconnect() {
1375
948
  var u, l;
1376
- await ((u = s.disconnect) == null ? void 0 : u.call(s)), (l = e.config) != null && l.auth && r.getState().auth.reset();
949
+ await ((u = i.disconnect) == null ? void 0 : u.call(i)), (l = e.config) != null && l.auth && a.getState().auth.reset();
1377
950
  },
1378
951
  async setup() {
1379
952
  var u;
1380
- await ((u = s.setup) == null ? void 0 : u.call(s)), typeof window > "u";
953
+ await ((u = i.setup) == null ? void 0 : u.call(i)), typeof window > "u";
1381
954
  },
1382
955
  getKitStore() {
1383
- return r;
956
+ return a;
1384
957
  }
1385
958
  };
1386
959
  };
1387
960
  }
1388
961
  export {
1389
- mt as AuthFlow,
1390
- F as useAuth,
1391
- gt as zeroDevWallet
962
+ lt as AuthFlow,
963
+ R as useAuth,
964
+ dt as zeroDevWallet
1392
965
  };
1393
966
  //# sourceMappingURL=index.mjs.map