doct-ui-auth-kit 1.0.0

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 (56) hide show
  1. package/README.md +266 -0
  2. package/dist/adapters/http-auth-adapter.d.ts +11 -0
  3. package/dist/adapters/index.d.ts +1 -0
  4. package/dist/auth-methods/apple.d.ts +19 -0
  5. package/dist/auth-methods/google.d.ts +65 -0
  6. package/dist/auth-methods/index.d.ts +2 -0
  7. package/dist/components/auth/repeat-login.d.ts +24 -0
  8. package/dist/components/form/rhf-doct-phone-input.d.ts +2 -0
  9. package/dist/components/form/rhf-input-field.d.ts +2 -0
  10. package/dist/components/form/rhf-otp-input-field.d.ts +2 -0
  11. package/dist/components/form/rhf-password-field.d.ts +2 -0
  12. package/dist/components/layout/auth-layout.d.ts +89 -0
  13. package/dist/components/layout/image-slider.d.ts +45 -0
  14. package/dist/components/layout/index.d.ts +6 -0
  15. package/dist/components/layout/main-layout.d.ts +74 -0
  16. package/dist/constants/demo-slider.d.ts +16 -0
  17. package/dist/constants/index.d.ts +1 -0
  18. package/dist/core/auth-api-adapter.d.ts +38 -0
  19. package/dist/core/auth-context.d.ts +67 -0
  20. package/dist/core/auth-flow.d.ts +5 -0
  21. package/dist/core/auth-provider.d.ts +39 -0
  22. package/dist/core/auth-types.d.ts +68 -0
  23. package/dist/core/device-detection.d.ts +23 -0
  24. package/dist/core/index.d.ts +11 -0
  25. package/dist/core/sso-session.d.ts +35 -0
  26. package/dist/core/use-auth-flow.d.ts +79 -0
  27. package/dist/docthub.svg +5 -0
  28. package/dist/hooks/index.d.ts +3 -0
  29. package/dist/hooks/use-login-entry-form.d.ts +32 -0
  30. package/dist/hooks/use-otp-verification.d.ts +29 -0
  31. package/dist/hooks/use-signup-form.d.ts +37 -0
  32. package/dist/index.d.ts +26 -0
  33. package/dist/index.js +7405 -0
  34. package/dist/logo.png +0 -0
  35. package/dist/pages/conflict.d.ts +12 -0
  36. package/dist/pages/foreign-email-collect.d.ts +16 -0
  37. package/dist/pages/index.d.ts +7 -0
  38. package/dist/pages/login-entry.d.ts +23 -0
  39. package/dist/pages/main-login.d.ts +26 -0
  40. package/dist/pages/otp-verification.d.ts +21 -0
  41. package/dist/pages/repeat-login.d.ts +20 -0
  42. package/dist/pages/signup.d.ts +17 -0
  43. package/dist/pages.js +10 -0
  44. package/dist/signup-Cnybfnhd.js +720 -0
  45. package/dist/slider/slide-1.png +0 -0
  46. package/dist/slider/slide-2.png +0 -0
  47. package/dist/slider/slide-3.png +0 -0
  48. package/dist/slider/slide-4.png +0 -0
  49. package/dist/slider/slide-5.png +0 -0
  50. package/dist/types/auth-layout-types.d.ts +94 -0
  51. package/dist/types/common.d.ts +25 -0
  52. package/dist/types/forms.d.ts +124 -0
  53. package/dist/types/index.d.ts +6 -0
  54. package/dist/types/user.d.ts +31 -0
  55. package/dist/vite.svg +1 -0
  56. package/package.json +104 -0
@@ -0,0 +1,720 @@
1
+ import { jsx as d, jsxs as O } from "react/jsx-runtime";
2
+ import { DoctTypography as P, DoctButton as x, DoctLabeledInput as re, DoctPhoneInput as ie, DoctOtpInput as oe } from "docthub-core-components";
3
+ import { useFormContext as B, Controller as V, useForm as q, FormProvider as z } from "react-hook-form";
4
+ import { z as _ } from "zod";
5
+ import R, { useState as ae, useEffect as se } from "react";
6
+ var T = { exports: {} }, A = {};
7
+ var U;
8
+ function ce() {
9
+ if (U) return A;
10
+ U = 1;
11
+ var t = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
12
+ return A.c = function(e) {
13
+ return t.H.useMemoCache(e);
14
+ }, A;
15
+ }
16
+ var H = {};
17
+ var G;
18
+ function me() {
19
+ return G || (G = 1, process.env.NODE_ENV !== "production" && (function() {
20
+ var t = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
21
+ H.c = function(e) {
22
+ var n = t.H;
23
+ return n === null && console.error(
24
+ `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
25
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
26
+ 2. You might be breaking the Rules of Hooks
27
+ 3. You might have more than one copy of React in the same app
28
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
29
+ ), n.useMemoCache(e);
30
+ };
31
+ })()), H;
32
+ }
33
+ var Y;
34
+ function ue() {
35
+ return Y || (Y = 1, process.env.NODE_ENV === "production" ? T.exports = ce() : T.exports = me()), T.exports;
36
+ }
37
+ var N = ue();
38
+ function Ae(t) {
39
+ const e = N.c(11), {
40
+ error: n,
41
+ onGoBack: r
42
+ } = t, o = n?.message ?? "This account is already linked to another identifier. Please use that method to sign in or try a different one.", i = n?.linkedIdentifier;
43
+ let u;
44
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ d(P, { variant: "h5", weight: "extraBold", align: "left", className: "mb-2 text-black", children: "Account already exists" }), e[0] = u) : u = e[0];
45
+ let a;
46
+ e[1] !== o ? (a = /* @__PURE__ */ d(P, { variant: "body2", align: "left", className: "mb-4 text-black/80", children: o }), e[1] = o, e[2] = a) : a = e[2];
47
+ let l;
48
+ e[3] !== i ? (l = i ? /* @__PURE__ */ O(P, { variant: "title2", align: "left", className: "mb-4 text-black/70", children: [
49
+ "Linked to: ",
50
+ i
51
+ ] }) : null, e[3] = i, e[4] = l) : l = e[4];
52
+ let m;
53
+ e[5] !== r ? (m = /* @__PURE__ */ d(x, { variant: "primary", size: "large", fullWidth: !0, onClick: r, children: "Go back" }), e[5] = r, e[6] = m) : m = e[6];
54
+ let s;
55
+ return e[7] !== a || e[8] !== l || e[9] !== m ? (s = /* @__PURE__ */ O("div", { className: "w-full flex flex-col gap-[12px]", children: [
56
+ u,
57
+ a,
58
+ l,
59
+ m
60
+ ] }), e[7] = a, e[8] = l, e[9] = m, e[10] = s) : s = e[10], s;
61
+ }
62
+ function D(t) {
63
+ const e = N.c(14), {
64
+ name: n,
65
+ label: r,
66
+ placeholder: o,
67
+ className: i,
68
+ control: u,
69
+ required: a,
70
+ type: l,
71
+ disabled: m,
72
+ onKeyDown: s,
73
+ maxLength: c,
74
+ numericOnly: f
75
+ } = t, b = B(), p = u || b.control;
76
+ let h;
77
+ e[0] !== i || e[1] !== m || e[2] !== r || e[3] !== c || e[4] !== f || e[5] !== s || e[6] !== o || e[7] !== a || e[8] !== l ? (h = (v) => {
78
+ const {
79
+ field: S,
80
+ fieldState: E
81
+ } = v;
82
+ return /* @__PURE__ */ d(re, { ...S, value: S.value ?? "", ...r !== void 0 && {
83
+ label: r
84
+ }, ...o !== void 0 && {
85
+ placeholder: o
86
+ }, ...E.error?.message !== void 0 && {
87
+ error: E.error?.message
88
+ }, ...i !== void 0 && {
89
+ className: i
90
+ }, ...a !== void 0 && {
91
+ required: a
92
+ }, type: l, ...m !== void 0 && {
93
+ disabled: m
94
+ }, onKeyDown: f ? (y) => {
95
+ !/[0-9]/.test(y.key) && !["Backspace", "Tab", "Delete", "ArrowLeft", "ArrowRight", "Home", "End"].includes(y.key) && y.preventDefault(), s?.(y);
96
+ } : s, ...c !== void 0 && {
97
+ maxLength: c
98
+ }, onChange: (y) => {
99
+ const C = y.target?.value;
100
+ if (typeof C == "string") {
101
+ S.onChange(C.replace(/^\s+/, ""));
102
+ let w = C.replace(/^\s+/, "");
103
+ f && (w = w.replace(/\D/g, "")), S.onChange(w);
104
+ } else
105
+ S.onChange(C);
106
+ }, onBlur: () => {
107
+ const y = S.value;
108
+ if (typeof y == "string") {
109
+ const C = y.trim();
110
+ C !== y && S.onChange(C);
111
+ }
112
+ S.onBlur();
113
+ } });
114
+ }, e[0] = i, e[1] = m, e[2] = r, e[3] = c, e[4] = f, e[5] = s, e[6] = o, e[7] = a, e[8] = l, e[9] = h) : h = e[9];
115
+ let g;
116
+ return e[10] !== n || e[11] !== p || e[12] !== h ? (g = /* @__PURE__ */ d(V, { name: n, control: p, render: h }), e[10] = n, e[11] = p, e[12] = h, e[13] = g) : g = e[13], g;
117
+ }
118
+ const fe = _.object({
119
+ fullName: _.string().min(1, "Full name is required"),
120
+ email: _.string().min(1, "Email is required").email("Enter a valid email address")
121
+ });
122
+ function He(t) {
123
+ const e = N.c(17), {
124
+ maskedPhone: n,
125
+ onSubmit: r
126
+ } = t;
127
+ let o;
128
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {
129
+ defaultValues: {
130
+ fullName: "",
131
+ email: ""
132
+ },
133
+ mode: "onSubmit"
134
+ }, e[0] = o) : o = e[0];
135
+ const i = q(o);
136
+ let u;
137
+ e[1] !== i || e[2] !== r ? (u = (p) => {
138
+ const h = fe.safeParse(p);
139
+ if (!h.success) {
140
+ for (const g of h.error.issues) {
141
+ const v = g.path[0];
142
+ typeof v == "string" && i.setError(v, {
143
+ message: g.message
144
+ });
145
+ }
146
+ return;
147
+ }
148
+ r?.({
149
+ fullName: h.data.fullName.trim(),
150
+ email: h.data.email.trim().toLowerCase()
151
+ });
152
+ }, e[1] = i, e[2] = r, e[3] = u) : u = e[3];
153
+ const a = u;
154
+ let l;
155
+ e[4] !== a || e[5] !== i ? (l = i.handleSubmit(a), e[4] = a, e[5] = i, e[6] = l) : l = e[6];
156
+ let m;
157
+ e[7] !== n ? (m = n ? /* @__PURE__ */ O(P, { variant: "body2", className: "mb-4 text-black/70", children: [
158
+ "We'll send the verification code to your email instead of",
159
+ " ",
160
+ n,
161
+ "."
162
+ ] }) : null, e[7] = n, e[8] = m) : m = e[8];
163
+ let s, c;
164
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ O("div", { className: "mb-6 flex w-full flex-col gap-[12px]", children: [
165
+ /* @__PURE__ */ d(D, { name: "fullName", placeholder: "Full name*", required: !0, type: "text", className: "w-full" }),
166
+ /* @__PURE__ */ d(D, { name: "email", placeholder: "Email address*", type: "email", required: !0, className: "w-full" })
167
+ ] }), c = /* @__PURE__ */ d(x, { type: "submit", variant: "primary", size: "large", fullWidth: !0, children: "Continue" }), e[9] = s, e[10] = c) : (s = e[9], c = e[10]);
168
+ let f;
169
+ e[11] !== l || e[12] !== m ? (f = /* @__PURE__ */ O("form", { onSubmit: l, className: "w-full flex flex-col", children: [
170
+ m,
171
+ s,
172
+ c
173
+ ] }), e[11] = l, e[12] = m, e[13] = f) : f = e[13];
174
+ let b;
175
+ return e[14] !== i || e[15] !== f ? (b = /* @__PURE__ */ d(z, { ...i, children: f }), e[14] = i, e[15] = f, e[16] = b) : b = e[16], b;
176
+ }
177
+ function X(t) {
178
+ const e = N.c(13), {
179
+ name: n,
180
+ label: r,
181
+ placeholder: o,
182
+ helperText: i,
183
+ defaultCountry: u,
184
+ variant: a,
185
+ required: l,
186
+ disabled: m,
187
+ control: s,
188
+ error: c
189
+ } = t, f = o === void 0 ? "Enter phone number" : o, b = u === void 0 ? "IN" : u, p = a === void 0 ? "default" : a, h = B(), g = s ?? h.control;
190
+ let v;
191
+ e[0] !== b || e[1] !== m || e[2] !== c || e[3] !== i || e[4] !== r || e[5] !== f || e[6] !== l || e[7] !== p ? (v = (E) => {
192
+ const {
193
+ field: y,
194
+ fieldState: C
195
+ } = E, w = c ?? C.error?.message;
196
+ return /* @__PURE__ */ d(ie, { placeholder: f, value: y.value ?? "", onValueChange: (j) => y.onChange(j ?? ""), defaultCountry: b, variant: p ?? "default", required: l ?? !1, disabled: m ?? !1, ...r != null && {
197
+ label: r
198
+ }, ...i != null && {
199
+ helperText: i
200
+ }, ...w !== void 0 && {
201
+ error: w
202
+ } });
203
+ }, e[0] = b, e[1] = m, e[2] = c, e[3] = i, e[4] = r, e[5] = f, e[6] = l, e[7] = p, e[8] = v) : v = e[8];
204
+ let S;
205
+ return e[9] !== n || e[10] !== g || e[11] !== v ? (S = /* @__PURE__ */ d(V, { name: n, control: g, render: v }), e[9] = n, e[10] = g, e[11] = v, e[12] = S) : S = e[12], S;
206
+ }
207
+ const de = _.object({
208
+ phone: _.string().min(1, "Phone number is required")
209
+ }), he = _.object({
210
+ email: _.string().min(1, "Email is required").email("Enter a valid email address")
211
+ }), pe = {
212
+ phone: de,
213
+ email: he
214
+ };
215
+ function ge(t) {
216
+ const e = N.c(12), {
217
+ mode: n,
218
+ onSubmit: r
219
+ } = t, o = n === "phone";
220
+ let i;
221
+ e[0] !== o ? (i = o ? {
222
+ phone: ""
223
+ } : {
224
+ email: ""
225
+ }, e[0] = o, e[1] = i) : i = e[1];
226
+ const u = i;
227
+ let a;
228
+ e[2] !== u ? (a = {
229
+ defaultValues: u,
230
+ mode: "onSubmit"
231
+ }, e[2] = u, e[3] = a) : a = e[3];
232
+ const l = q(a);
233
+ let m;
234
+ e[4] !== l || e[5] !== n || e[6] !== r ? (m = (f) => {
235
+ const p = pe[n].safeParse(f);
236
+ if (!p.success) {
237
+ for (const h of p.error.issues) {
238
+ const g = h.path[0];
239
+ typeof g == "string" && l.setError(g, {
240
+ message: h.message
241
+ });
242
+ }
243
+ return;
244
+ }
245
+ r?.(p.data);
246
+ }, e[4] = l, e[5] = n, e[6] = r, e[7] = m) : m = e[7];
247
+ const s = m;
248
+ let c;
249
+ return e[8] !== s || e[9] !== o || e[10] !== l ? (c = {
250
+ methods: l,
251
+ handleSubmit: s,
252
+ isPhone: o
253
+ }, e[8] = s, e[9] = o, e[10] = l, e[11] = c) : c = e[11], c;
254
+ }
255
+ function Be(t) {
256
+ const e = N.c(15), {
257
+ mode: n,
258
+ onSubmit: r
259
+ } = t;
260
+ let o;
261
+ e[0] !== n || e[1] !== r ? (o = {
262
+ mode: n,
263
+ onSubmit: r
264
+ }, e[0] = n, e[1] = r, e[2] = o) : o = e[2];
265
+ const {
266
+ methods: i,
267
+ handleSubmit: u,
268
+ isPhone: a
269
+ } = ge(o);
270
+ let l;
271
+ e[3] !== u || e[4] !== i ? (l = i.handleSubmit(u), e[3] = u, e[4] = i, e[5] = l) : l = e[5];
272
+ let m;
273
+ e[6] !== a ? (m = /* @__PURE__ */ d("div", { className: "mb-6 flex w-full flex-col gap-[12px]", children: a ? /* @__PURE__ */ d(X, { name: "phone", placeholder: "Phone number", required: !0, defaultCountry: "IN" }) : /* @__PURE__ */ d(D, { name: "email", placeholder: "Enter email address", type: "email", required: !0 }) }), e[6] = a, e[7] = m) : m = e[7];
274
+ let s;
275
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ d(x, { type: "submit", variant: "primary", size: "large", fullWidth: !0, children: "Continue" }), e[8] = s) : s = e[8];
276
+ let c;
277
+ e[9] !== l || e[10] !== m ? (c = /* @__PURE__ */ O("form", { onSubmit: l, className: "w-full flex flex-col", children: [
278
+ m,
279
+ s
280
+ ] }), e[9] = l, e[10] = m, e[11] = c) : c = e[11];
281
+ let f;
282
+ return e[12] !== i || e[13] !== c ? (f = /* @__PURE__ */ d(z, { ...i, children: c }), e[12] = i, e[13] = c, e[14] = f) : f = e[14], f;
283
+ }
284
+ var Z = {
285
+ color: void 0,
286
+ size: void 0,
287
+ className: void 0,
288
+ style: void 0,
289
+ attr: void 0
290
+ }, K = R.createContext && /* @__PURE__ */ R.createContext(Z), be = ["attr", "size", "title"];
291
+ function ve(t, e) {
292
+ if (t == null) return {};
293
+ var n = ye(t, e), r, o;
294
+ if (Object.getOwnPropertySymbols) {
295
+ var i = Object.getOwnPropertySymbols(t);
296
+ for (o = 0; o < i.length; o++)
297
+ r = i[o], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
298
+ }
299
+ return n;
300
+ }
301
+ function ye(t, e) {
302
+ if (t == null) return {};
303
+ var n = {};
304
+ for (var r in t)
305
+ if (Object.prototype.hasOwnProperty.call(t, r)) {
306
+ if (e.indexOf(r) >= 0) continue;
307
+ n[r] = t[r];
308
+ }
309
+ return n;
310
+ }
311
+ function k() {
312
+ return k = Object.assign ? Object.assign.bind() : function(t) {
313
+ for (var e = 1; e < arguments.length; e++) {
314
+ var n = arguments[e];
315
+ for (var r in n)
316
+ Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
317
+ }
318
+ return t;
319
+ }, k.apply(this, arguments);
320
+ }
321
+ function J(t, e) {
322
+ var n = Object.keys(t);
323
+ if (Object.getOwnPropertySymbols) {
324
+ var r = Object.getOwnPropertySymbols(t);
325
+ e && (r = r.filter(function(o) {
326
+ return Object.getOwnPropertyDescriptor(t, o).enumerable;
327
+ })), n.push.apply(n, r);
328
+ }
329
+ return n;
330
+ }
331
+ function I(t) {
332
+ for (var e = 1; e < arguments.length; e++) {
333
+ var n = arguments[e] != null ? arguments[e] : {};
334
+ e % 2 ? J(Object(n), !0).forEach(function(r) {
335
+ Se(t, r, n[r]);
336
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : J(Object(n)).forEach(function(r) {
337
+ Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
338
+ });
339
+ }
340
+ return t;
341
+ }
342
+ function Se(t, e, n) {
343
+ return e = Ce(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
344
+ }
345
+ function Ce(t) {
346
+ var e = _e(t, "string");
347
+ return typeof e == "symbol" ? e : e + "";
348
+ }
349
+ function _e(t, e) {
350
+ if (typeof t != "object" || !t) return t;
351
+ var n = t[Symbol.toPrimitive];
352
+ if (n !== void 0) {
353
+ var r = n.call(t, e);
354
+ if (typeof r != "object") return r;
355
+ throw new TypeError("@@toPrimitive must return a primitive value.");
356
+ }
357
+ return (e === "string" ? String : Number)(t);
358
+ }
359
+ function ee(t) {
360
+ return t && t.map((e, n) => /* @__PURE__ */ R.createElement(e.tag, I({
361
+ key: n
362
+ }, e.attr), ee(e.child)));
363
+ }
364
+ function te(t) {
365
+ return (e) => /* @__PURE__ */ R.createElement(Ne, k({
366
+ attr: I({}, t.attr)
367
+ }, e), ee(t.child));
368
+ }
369
+ function Ne(t) {
370
+ var e = (n) => {
371
+ var {
372
+ attr: r,
373
+ size: o,
374
+ title: i
375
+ } = t, u = ve(t, be), a = o || n.size || "1em", l;
376
+ return n.className && (l = n.className), t.className && (l = (l ? l + " " : "") + t.className), /* @__PURE__ */ R.createElement("svg", k({
377
+ stroke: "currentColor",
378
+ fill: "currentColor",
379
+ strokeWidth: "0"
380
+ }, n.attr, r, u, {
381
+ className: l,
382
+ style: I(I({
383
+ color: t.color || n.color
384
+ }, n.style), t.style),
385
+ height: a,
386
+ width: a,
387
+ xmlns: "http://www.w3.org/2000/svg"
388
+ }), i && /* @__PURE__ */ R.createElement("title", null, i), t.children);
389
+ };
390
+ return K !== void 0 ? /* @__PURE__ */ R.createElement(K.Consumer, null, (n) => e(n)) : e(Z);
391
+ }
392
+ function xe(t) {
393
+ return te({ attr: { viewBox: "0 0 384 512" }, child: [{ tag: "path", attr: { d: "M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z" }, child: [] }] })(t);
394
+ }
395
+ function Oe(t) {
396
+ return te({ attr: { version: "1.1", x: "0px", y: "0px", viewBox: "0 0 48 48", enableBackground: "new 0 0 48 48" }, child: [{ tag: "path", attr: { fill: "#FFC107", d: `M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r
397
+ c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r
398
+ c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z` }, child: [] }, { tag: "path", attr: { fill: "#FF3D00", d: `M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r
399
+ C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z` }, child: [] }, { tag: "path", attr: { fill: "#4CAF50", d: `M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r
400
+ c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z` }, child: [] }, { tag: "path", attr: { fill: "#1976D2", d: `M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r
401
+ c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z` }, child: [] }] })(t);
402
+ }
403
+ function Ve(t) {
404
+ const e = N.c(19), {
405
+ onContinueWithMobile: n,
406
+ onContinueWithEmail: r,
407
+ onContinueWithGoogle: o,
408
+ onContinueWithApple: i
409
+ } = t, u = Ee;
410
+ let a;
411
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = u("Continue with Mobile"), e[0] = a) : a = e[0];
412
+ let l;
413
+ e[1] !== n ? (l = /* @__PURE__ */ d(x, { variant: "outline", size: "large", fullWidth: !0, onClick: n, children: a }), e[1] = n, e[2] = l) : l = e[2];
414
+ let m;
415
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = u("Continue with Email"), e[3] = m) : m = e[3];
416
+ let s;
417
+ e[4] !== r ? (s = /* @__PURE__ */ d(x, { variant: "outline", size: "large", fullWidth: !0, onClick: r, children: m }), e[4] = r, e[5] = s) : s = e[5];
418
+ let c;
419
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ d(Oe, { "aria-hidden": "true" }), e[6] = c) : c = e[6];
420
+ let f;
421
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = u("Continue with Google"), e[7] = f) : f = e[7];
422
+ let b;
423
+ e[8] !== o ? (b = /* @__PURE__ */ d(x, { variant: "outline", size: "large", fullWidth: !0, icon: c, iconPosition: "left", onClick: o, children: f }), e[8] = o, e[9] = b) : b = e[9];
424
+ let p;
425
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ d(xe, { "aria-hidden": "true" }), e[10] = p) : p = e[10];
426
+ let h;
427
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = u("Continue with Apple"), e[11] = h) : h = e[11];
428
+ let g;
429
+ e[12] !== i ? (g = /* @__PURE__ */ d(x, { variant: "outline", size: "large", fullWidth: !0, icon: p, iconPosition: "left", onClick: i, children: h }), e[12] = i, e[13] = g) : g = e[13];
430
+ let v;
431
+ return e[14] !== g || e[15] !== l || e[16] !== s || e[17] !== b ? (v = /* @__PURE__ */ O("div", { className: "w-full flex flex-col gap-[12px]", children: [
432
+ l,
433
+ s,
434
+ b,
435
+ g
436
+ ] }), e[14] = g, e[15] = l, e[16] = s, e[17] = b, e[18] = v) : v = e[18], v;
437
+ }
438
+ function Ee(t) {
439
+ return /* @__PURE__ */ d(P, { variant: "textLabel1", weight: "semiBold", align: "center", className: "opacity-80", children: t });
440
+ }
441
+ function we(t) {
442
+ const e = N.c(9), {
443
+ name: n,
444
+ label: r,
445
+ className: o,
446
+ control: i,
447
+ length: u,
448
+ inputClassName: a
449
+ } = t, l = u === void 0 ? 6 : u, m = B(), s = i || m.control;
450
+ let c;
451
+ e[0] !== o || e[1] !== a || e[2] !== r || e[3] !== l ? (c = (b) => {
452
+ const {
453
+ field: p,
454
+ fieldState: h
455
+ } = b;
456
+ return /* @__PURE__ */ O("div", { children: [
457
+ r && /* @__PURE__ */ d("label", { className: "block mb-1", children: r }),
458
+ /* @__PURE__ */ d(oe, { length: l, value: p.value || [], onChange: p.onChange, ...o && {
459
+ className: o
460
+ }, ...a && {
461
+ inputClassName: a
462
+ }, ...h.error?.message !== void 0 && h.error?.message !== "" && {
463
+ error: h.error.message
464
+ } })
465
+ ] });
466
+ }, e[0] = o, e[1] = a, e[2] = r, e[3] = l, e[4] = c) : c = e[4];
467
+ let f;
468
+ return e[5] !== n || e[6] !== s || e[7] !== c ? (f = /* @__PURE__ */ d(V, { name: n, control: s, render: c }), e[5] = n, e[6] = s, e[7] = c, e[8] = f) : f = e[8], f;
469
+ }
470
+ const L = 6, Q = 120, Pe = _.object({
471
+ otp: _.array(_.string()).length(L, "Enter all 6 digits").refine((t) => t.every((e) => /^\d$/.test(e)) && t.join("").length === L, "Invalid OTP! Please use correct code and submit again.")
472
+ }), Re = {
473
+ phone: "6 digit OTP has been sent to your Mobile",
474
+ email: "6 digit OTP has been sent to your Email"
475
+ };
476
+ function je(t) {
477
+ const e = N.c(24);
478
+ let n;
479
+ e[0] !== t ? (n = t === void 0 ? {} : t, e[0] = t, e[1] = n) : n = e[1];
480
+ const {
481
+ onSubmit: r,
482
+ onResendCode: o
483
+ } = n, [i, u] = ae(Q), a = i <= 0;
484
+ let l;
485
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = Array.from({
486
+ length: L
487
+ }, Fe), e[2] = l) : l = e[2];
488
+ const m = l;
489
+ let s;
490
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {
491
+ defaultValues: {
492
+ otp: m
493
+ },
494
+ mode: "onSubmit"
495
+ }, e[3] = s) : s = e[3];
496
+ const c = q(s);
497
+ let f, b;
498
+ e[4] !== i ? (f = () => {
499
+ if (i <= 0)
500
+ return;
501
+ const M = setInterval(() => {
502
+ u(De);
503
+ }, 1e3);
504
+ return () => clearInterval(M);
505
+ }, b = [i], e[4] = i, e[5] = f, e[6] = b) : (f = e[5], b = e[6]), se(f, b);
506
+ let p;
507
+ e[7] !== c || e[8] !== r ? (p = (M) => {
508
+ const $ = Pe.safeParse(M);
509
+ if (!$.success) {
510
+ const le = $.error.issues[0]?.message ?? "Invalid OTP";
511
+ c.setError("otp", {
512
+ message: le
513
+ });
514
+ return;
515
+ }
516
+ const ne = $.data.otp.join("");
517
+ r?.(ne);
518
+ }, e[7] = c, e[8] = r, e[9] = p) : p = e[9];
519
+ const h = p;
520
+ let g;
521
+ e[10] !== a || e[11] !== o ? (g = () => {
522
+ a && (o?.(), u(Q));
523
+ }, e[10] = a, e[11] = o, e[12] = g) : g = e[12];
524
+ const v = g, S = Math.floor(i / 60), E = i % 60, y = String(S);
525
+ let C;
526
+ e[13] !== y ? (C = y.padStart(2, "0"), e[13] = y, e[14] = C) : C = e[14];
527
+ const w = String(E);
528
+ let j;
529
+ e[15] !== w ? (j = w.padStart(2, "0"), e[15] = w, e[16] = j) : j = e[16];
530
+ const W = `Resend code in: ${C}:${j}`;
531
+ let F;
532
+ return e[17] !== a || e[18] !== v || e[19] !== h || e[20] !== c || e[21] !== i || e[22] !== W ? (F = {
533
+ methods: c,
534
+ handleSubmit: h,
535
+ handleResend: v,
536
+ resendSecondsLeft: i,
537
+ canResend: a,
538
+ timerText: W
539
+ }, e[17] = a, e[18] = v, e[19] = h, e[20] = c, e[21] = i, e[22] = W, e[23] = F) : F = e[23], F;
540
+ }
541
+ function De(t) {
542
+ return t <= 1 ? 0 : t - 1;
543
+ }
544
+ function Fe() {
545
+ return "";
546
+ }
547
+ function Ue(t) {
548
+ const e = N.c(24), {
549
+ mode: n,
550
+ title: r,
551
+ recipientDisplay: o,
552
+ onSubmit: i,
553
+ onResendCode: u
554
+ } = t;
555
+ let a;
556
+ e[0] !== u || e[1] !== i ? (a = {
557
+ onSubmit: i,
558
+ onResendCode: u
559
+ }, e[0] = u, e[1] = i, e[2] = a) : a = e[2];
560
+ const {
561
+ methods: l,
562
+ handleSubmit: m,
563
+ handleResend: s,
564
+ canResend: c,
565
+ timerText: f
566
+ } = je(a), b = r ?? Re[n];
567
+ let p;
568
+ e[3] !== m || e[4] !== l ? (p = l.handleSubmit(m), e[3] = m, e[4] = l, e[5] = p) : p = e[5];
569
+ let h;
570
+ e[6] !== b ? (h = /* @__PURE__ */ d(P, { variant: "h5", weight: "extraBold", align: "left", className: "mb-2 text-black", children: b }), e[6] = b, e[7] = h) : h = e[7];
571
+ let g;
572
+ e[8] !== o ? (g = /* @__PURE__ */ d(P, { variant: "title2", align: "left", className: "mb-6 text-black/80", children: o }), e[8] = o, e[9] = g) : g = e[9];
573
+ let v;
574
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ d("div", { className: "mb-4 flex w-full flex-col gap-[12px]", children: /* @__PURE__ */ d(we, { name: "otp", length: L }) }), e[10] = v) : v = e[10];
575
+ let S;
576
+ e[11] !== c || e[12] !== s || e[13] !== f ? (S = /* @__PURE__ */ d("div", { className: "mb-6 flex items-center gap-2", children: c ? /* @__PURE__ */ d(x, { type: "button", variant: "outline", size: "medium", onClick: s, children: "Resend Code" }) : /* @__PURE__ */ d(P, { variant: "body2", align: "left", className: "text-black/80", children: f }) }), e[11] = c, e[12] = s, e[13] = f, e[14] = S) : S = e[14];
577
+ let E;
578
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ d(x, { type: "submit", variant: "primary", size: "large", fullWidth: !0, children: "Submit" }), e[15] = E) : E = e[15];
579
+ let y;
580
+ e[16] !== p || e[17] !== h || e[18] !== g || e[19] !== S ? (y = /* @__PURE__ */ O("form", { onSubmit: p, className: "flex w-full flex-col", children: [
581
+ h,
582
+ g,
583
+ v,
584
+ S,
585
+ E
586
+ ] }), e[16] = p, e[17] = h, e[18] = g, e[19] = S, e[20] = y) : y = e[20];
587
+ let C;
588
+ return e[21] !== l || e[22] !== y ? (C = /* @__PURE__ */ d(z, { ...l, children: y }), e[21] = l, e[22] = y, e[23] = C) : C = e[23], C;
589
+ }
590
+ function Ge(t) {
591
+ const e = N.c(11), {
592
+ lastUsedMethod: n,
593
+ onContinueWithLastMethod: r,
594
+ onUseAnotherMethod: o
595
+ } = t, u = `Continue with ${n === void 0 ? "Mobile" : n}`;
596
+ let a;
597
+ e[0] !== u ? (a = /* @__PURE__ */ d(P, { variant: "textLabel1", weight: "semiBold", align: "center", className: "text-white", children: u }), e[0] = u, e[1] = a) : a = e[1];
598
+ let l;
599
+ e[2] !== r || e[3] !== a ? (l = /* @__PURE__ */ d(x, { variant: "primary", size: "large", fullWidth: !0, onClick: r, children: a }), e[2] = r, e[3] = a, e[4] = l) : l = e[4];
600
+ let m;
601
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ d(P, { variant: "textLabel1", weight: "semiBold", align: "center", className: "opacity-80", children: "Use another method" }), e[5] = m) : m = e[5];
602
+ let s;
603
+ e[6] !== o ? (s = /* @__PURE__ */ d(x, { variant: "outline", size: "large", fullWidth: !0, onClick: o, children: m }), e[6] = o, e[7] = s) : s = e[7];
604
+ let c;
605
+ return e[8] !== l || e[9] !== s ? (c = /* @__PURE__ */ O("div", { className: "w-full flex flex-col gap-[12px]", children: [
606
+ l,
607
+ s
608
+ ] }), e[8] = l, e[9] = s, e[10] = c) : c = e[10], c;
609
+ }
610
+ const Te = _.object({
611
+ fullName: _.string().min(1, "Full name is required"),
612
+ phone: _.string().min(1, "Phone number is required")
613
+ }), ke = _.object({
614
+ fullName: _.string().min(1, "Full name is required"),
615
+ email: _.string().min(1, "Email is required").email("Enter a valid email address")
616
+ }), Ie = {
617
+ phone: Te,
618
+ email: ke
619
+ };
620
+ function Le(t) {
621
+ const e = N.c(12), {
622
+ mode: n,
623
+ onSubmit: r
624
+ } = t, o = n === "phone";
625
+ let i;
626
+ e[0] !== o ? (i = o ? {
627
+ fullName: "",
628
+ phone: ""
629
+ } : {
630
+ fullName: "",
631
+ email: ""
632
+ }, e[0] = o, e[1] = i) : i = e[1];
633
+ const u = i;
634
+ let a;
635
+ e[2] !== u ? (a = {
636
+ defaultValues: u,
637
+ mode: "onSubmit"
638
+ }, e[2] = u, e[3] = a) : a = e[3];
639
+ const l = q(a);
640
+ let m;
641
+ e[4] !== l || e[5] !== n || e[6] !== r ? (m = (f) => {
642
+ const p = Ie[n].safeParse(f);
643
+ if (!p.success) {
644
+ for (const g of p.error.issues) {
645
+ const v = g.path[0];
646
+ typeof v == "string" && l.setError(v, {
647
+ message: g.message
648
+ });
649
+ }
650
+ return;
651
+ }
652
+ const h = p.data;
653
+ r?.({
654
+ fullName: h.fullName,
655
+ ..."phone" in h && {
656
+ phone: h.phone
657
+ },
658
+ ..."email" in h && {
659
+ email: h.email
660
+ }
661
+ });
662
+ }, e[4] = l, e[5] = n, e[6] = r, e[7] = m) : m = e[7];
663
+ const s = m;
664
+ let c;
665
+ return e[8] !== s || e[9] !== o || e[10] !== l ? (c = {
666
+ methods: l,
667
+ handleSubmit: s,
668
+ isPhone: o
669
+ }, e[8] = s, e[9] = o, e[10] = l, e[11] = c) : c = e[11], c;
670
+ }
671
+ function Ye(t) {
672
+ const e = N.c(16), {
673
+ mode: n,
674
+ onSubmit: r
675
+ } = t;
676
+ let o;
677
+ e[0] !== n || e[1] !== r ? (o = {
678
+ mode: n,
679
+ onSubmit: r
680
+ }, e[0] = n, e[1] = r, e[2] = o) : o = e[2];
681
+ const {
682
+ methods: i,
683
+ handleSubmit: u,
684
+ isPhone: a
685
+ } = Le(o);
686
+ let l;
687
+ e[3] !== u || e[4] !== i ? (l = i.handleSubmit(u), e[3] = u, e[4] = i, e[5] = l) : l = e[5];
688
+ let m;
689
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ d(D, { name: "fullName", placeholder: "Full name*", required: !0, type: "text", className: "w-full" }), e[6] = m) : m = e[6];
690
+ let s;
691
+ e[7] !== a ? (s = /* @__PURE__ */ O("div", { className: "mb-6 flex w-full flex-col gap-[12px]", children: [
692
+ m,
693
+ a ? /* @__PURE__ */ d(X, { name: "phone", placeholder: "Phone number", required: !0, defaultCountry: "IN" }) : /* @__PURE__ */ d(D, { name: "email", placeholder: "Email address", type: "email", className: "w-full" })
694
+ ] }), e[7] = a, e[8] = s) : s = e[8];
695
+ let c;
696
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ d(x, { type: "submit", variant: "primary", size: "large", fullWidth: !0, children: "Continue" }), e[9] = c) : c = e[9];
697
+ let f;
698
+ e[10] !== l || e[11] !== s ? (f = /* @__PURE__ */ O("form", { onSubmit: l, className: "w-full flex flex-col items-center", children: [
699
+ s,
700
+ c
701
+ ] }), e[10] = l, e[11] = s, e[12] = f) : f = e[12];
702
+ let b;
703
+ return e[13] !== i || e[14] !== f ? (b = /* @__PURE__ */ d(z, { ...i, children: f }), e[13] = i, e[14] = f, e[15] = b) : b = e[15], b;
704
+ }
705
+ export {
706
+ Ae as C,
707
+ Re as D,
708
+ He as F,
709
+ Be as L,
710
+ Ve as M,
711
+ Ue as O,
712
+ Ge as R,
713
+ Ye as S,
714
+ L as a,
715
+ Q as b,
716
+ N as c,
717
+ je as d,
718
+ Le as e,
719
+ ge as u
720
+ };