@truworth/twc-auth 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.
- package/README.md +343 -0
- package/dist/index.esm.js +2026 -0
- package/dist/index.umd.js +70 -0
- package/dist/vite.svg +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,2026 @@
|
|
|
1
|
+
import ae, { forwardRef as tt, createElement as Ae, useState as E, useEffect as K } from "react";
|
|
2
|
+
import { useForm as Ce, Flex as I, Button as A, Typography as x, Form as q, PasswordInput as Fe, TextInput as me, AutoCompleteField as It, ResponsiveModal as At, OTPInput as Ft, Slider as Dt, Container as rt, Row as fe, Col as J, RadioGroup as Lt, CustomCheckbox as zt } from "@truworth/twc-web-design";
|
|
3
|
+
var we = { exports: {} }, ce = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var Ze;
|
|
14
|
+
function Mt() {
|
|
15
|
+
if (Ze) return ce;
|
|
16
|
+
Ze = 1;
|
|
17
|
+
var i = ae, f = Symbol.for("react.element"), d = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, w = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function v(c, a, N) {
|
|
19
|
+
var g, C = {}, b = null, p = null;
|
|
20
|
+
N !== void 0 && (b = "" + N), a.key !== void 0 && (b = "" + a.key), a.ref !== void 0 && (p = a.ref);
|
|
21
|
+
for (g in a) u.call(a, g) && !h.hasOwnProperty(g) && (C[g] = a[g]);
|
|
22
|
+
if (c && c.defaultProps) for (g in a = c.defaultProps, a) C[g] === void 0 && (C[g] = a[g]);
|
|
23
|
+
return { $$typeof: f, type: c, key: b, ref: p, props: C, _owner: w.current };
|
|
24
|
+
}
|
|
25
|
+
return ce.Fragment = d, ce.jsx = v, ce.jsxs = v, ce;
|
|
26
|
+
}
|
|
27
|
+
var de = {};
|
|
28
|
+
/**
|
|
29
|
+
* @license React
|
|
30
|
+
* react-jsx-runtime.development.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
var Qe;
|
|
38
|
+
function $t() {
|
|
39
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
|
+
var i = ae, f = Symbol.for("react.element"), d = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), c = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), _ = Symbol.iterator, F = "@@iterator";
|
|
41
|
+
function n(e) {
|
|
42
|
+
if (e === null || typeof e != "object")
|
|
43
|
+
return null;
|
|
44
|
+
var r = _ && e[_] || e[F];
|
|
45
|
+
return typeof r == "function" ? r : null;
|
|
46
|
+
}
|
|
47
|
+
var m = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function o(e) {
|
|
49
|
+
{
|
|
50
|
+
for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
|
|
51
|
+
s[l - 1] = arguments[l];
|
|
52
|
+
D("error", e, s);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function D(e, r, s) {
|
|
56
|
+
{
|
|
57
|
+
var l = m.ReactDebugCurrentFrame, S = l.getStackAddendum();
|
|
58
|
+
S !== "" && (r += "%s", s = s.concat([S]));
|
|
59
|
+
var R = s.map(function(j) {
|
|
60
|
+
return String(j);
|
|
61
|
+
});
|
|
62
|
+
R.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, R);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var M = !1, O = !1, $ = !1, H = !1, Z = !1, ee;
|
|
66
|
+
ee = Symbol.for("react.module.reference");
|
|
67
|
+
function ne(e) {
|
|
68
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === h || Z || e === w || e === N || e === g || H || e === p || M || O || $ || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === C || e.$$typeof === v || e.$$typeof === c || e.$$typeof === a || // This needs to include all possible module reference object
|
|
69
|
+
// types supported by any Flight configuration anywhere since
|
|
70
|
+
// we don't know which Flight build this will end up being used
|
|
71
|
+
// with.
|
|
72
|
+
e.$$typeof === ee || e.getModuleId !== void 0));
|
|
73
|
+
}
|
|
74
|
+
function te(e, r, s) {
|
|
75
|
+
var l = e.displayName;
|
|
76
|
+
if (l)
|
|
77
|
+
return l;
|
|
78
|
+
var S = r.displayName || r.name || "";
|
|
79
|
+
return S !== "" ? s + "(" + S + ")" : s;
|
|
80
|
+
}
|
|
81
|
+
function T(e) {
|
|
82
|
+
return e.displayName || "Context";
|
|
83
|
+
}
|
|
84
|
+
function P(e) {
|
|
85
|
+
if (e == null)
|
|
86
|
+
return null;
|
|
87
|
+
if (typeof e.tag == "number" && o("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
+
return e.displayName || e.name || null;
|
|
89
|
+
if (typeof e == "string")
|
|
90
|
+
return e;
|
|
91
|
+
switch (e) {
|
|
92
|
+
case u:
|
|
93
|
+
return "Fragment";
|
|
94
|
+
case d:
|
|
95
|
+
return "Portal";
|
|
96
|
+
case h:
|
|
97
|
+
return "Profiler";
|
|
98
|
+
case w:
|
|
99
|
+
return "StrictMode";
|
|
100
|
+
case N:
|
|
101
|
+
return "Suspense";
|
|
102
|
+
case g:
|
|
103
|
+
return "SuspenseList";
|
|
104
|
+
}
|
|
105
|
+
if (typeof e == "object")
|
|
106
|
+
switch (e.$$typeof) {
|
|
107
|
+
case c:
|
|
108
|
+
var r = e;
|
|
109
|
+
return T(r) + ".Consumer";
|
|
110
|
+
case v:
|
|
111
|
+
var s = e;
|
|
112
|
+
return T(s._context) + ".Provider";
|
|
113
|
+
case a:
|
|
114
|
+
return te(e, e.render, "ForwardRef");
|
|
115
|
+
case C:
|
|
116
|
+
var l = e.displayName || null;
|
|
117
|
+
return l !== null ? l : P(e.type) || "Memo";
|
|
118
|
+
case b: {
|
|
119
|
+
var S = e, R = S._payload, j = S._init;
|
|
120
|
+
try {
|
|
121
|
+
return P(j(R));
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
var W = Object.assign, U = 0, X, ge, pe, L, G, oe, ie;
|
|
130
|
+
function De() {
|
|
131
|
+
}
|
|
132
|
+
De.__reactDisabledLog = !0;
|
|
133
|
+
function ot() {
|
|
134
|
+
{
|
|
135
|
+
if (U === 0) {
|
|
136
|
+
X = console.log, ge = console.info, pe = console.warn, L = console.error, G = console.group, oe = console.groupCollapsed, ie = console.groupEnd;
|
|
137
|
+
var e = {
|
|
138
|
+
configurable: !0,
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
value: De,
|
|
141
|
+
writable: !0
|
|
142
|
+
};
|
|
143
|
+
Object.defineProperties(console, {
|
|
144
|
+
info: e,
|
|
145
|
+
log: e,
|
|
146
|
+
warn: e,
|
|
147
|
+
error: e,
|
|
148
|
+
group: e,
|
|
149
|
+
groupCollapsed: e,
|
|
150
|
+
groupEnd: e
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
U++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function it() {
|
|
157
|
+
{
|
|
158
|
+
if (U--, U === 0) {
|
|
159
|
+
var e = {
|
|
160
|
+
configurable: !0,
|
|
161
|
+
enumerable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
};
|
|
164
|
+
Object.defineProperties(console, {
|
|
165
|
+
log: W({}, e, {
|
|
166
|
+
value: X
|
|
167
|
+
}),
|
|
168
|
+
info: W({}, e, {
|
|
169
|
+
value: ge
|
|
170
|
+
}),
|
|
171
|
+
warn: W({}, e, {
|
|
172
|
+
value: pe
|
|
173
|
+
}),
|
|
174
|
+
error: W({}, e, {
|
|
175
|
+
value: L
|
|
176
|
+
}),
|
|
177
|
+
group: W({}, e, {
|
|
178
|
+
value: G
|
|
179
|
+
}),
|
|
180
|
+
groupCollapsed: W({}, e, {
|
|
181
|
+
value: oe
|
|
182
|
+
}),
|
|
183
|
+
groupEnd: W({}, e, {
|
|
184
|
+
value: ie
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
U < 0 && o("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var Se = m.ReactCurrentDispatcher, Re;
|
|
192
|
+
function xe(e, r, s) {
|
|
193
|
+
{
|
|
194
|
+
if (Re === void 0)
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (S) {
|
|
198
|
+
var l = S.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
Re = l && l[1] || "";
|
|
200
|
+
}
|
|
201
|
+
return `
|
|
202
|
+
` + Re + e;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var _e = !1, ye;
|
|
206
|
+
{
|
|
207
|
+
var lt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
+
ye = new lt();
|
|
209
|
+
}
|
|
210
|
+
function Le(e, r) {
|
|
211
|
+
if (!e || _e)
|
|
212
|
+
return "";
|
|
213
|
+
{
|
|
214
|
+
var s = ye.get(e);
|
|
215
|
+
if (s !== void 0)
|
|
216
|
+
return s;
|
|
217
|
+
}
|
|
218
|
+
var l;
|
|
219
|
+
_e = !0;
|
|
220
|
+
var S = Error.prepareStackTrace;
|
|
221
|
+
Error.prepareStackTrace = void 0;
|
|
222
|
+
var R;
|
|
223
|
+
R = Se.current, Se.current = null, ot();
|
|
224
|
+
try {
|
|
225
|
+
if (r) {
|
|
226
|
+
var j = function() {
|
|
227
|
+
throw Error();
|
|
228
|
+
};
|
|
229
|
+
if (Object.defineProperty(j.prototype, "props", {
|
|
230
|
+
set: function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
}
|
|
233
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
+
try {
|
|
235
|
+
Reflect.construct(j, []);
|
|
236
|
+
} catch (Y) {
|
|
237
|
+
l = Y;
|
|
238
|
+
}
|
|
239
|
+
Reflect.construct(e, [], j);
|
|
240
|
+
} else {
|
|
241
|
+
try {
|
|
242
|
+
j.call();
|
|
243
|
+
} catch (Y) {
|
|
244
|
+
l = Y;
|
|
245
|
+
}
|
|
246
|
+
e.call(j.prototype);
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
try {
|
|
250
|
+
throw Error();
|
|
251
|
+
} catch (Y) {
|
|
252
|
+
l = Y;
|
|
253
|
+
}
|
|
254
|
+
e();
|
|
255
|
+
}
|
|
256
|
+
} catch (Y) {
|
|
257
|
+
if (Y && l && typeof Y.stack == "string") {
|
|
258
|
+
for (var y = Y.stack.split(`
|
|
259
|
+
`), B = l.stack.split(`
|
|
260
|
+
`), k = y.length - 1, z = B.length - 1; k >= 1 && z >= 0 && y[k] !== B[z]; )
|
|
261
|
+
z--;
|
|
262
|
+
for (; k >= 1 && z >= 0; k--, z--)
|
|
263
|
+
if (y[k] !== B[z]) {
|
|
264
|
+
if (k !== 1 || z !== 1)
|
|
265
|
+
do
|
|
266
|
+
if (k--, z--, z < 0 || y[k] !== B[z]) {
|
|
267
|
+
var V = `
|
|
268
|
+
` + y[k].replace(" at new ", " at ");
|
|
269
|
+
return e.displayName && V.includes("<anonymous>") && (V = V.replace("<anonymous>", e.displayName)), typeof e == "function" && ye.set(e, V), V;
|
|
270
|
+
}
|
|
271
|
+
while (k >= 1 && z >= 0);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} finally {
|
|
276
|
+
_e = !1, Se.current = R, it(), Error.prepareStackTrace = S;
|
|
277
|
+
}
|
|
278
|
+
var se = e ? e.displayName || e.name : "", Q = se ? xe(se) : "";
|
|
279
|
+
return typeof e == "function" && ye.set(e, Q), Q;
|
|
280
|
+
}
|
|
281
|
+
function ct(e, r, s) {
|
|
282
|
+
return Le(e, !1);
|
|
283
|
+
}
|
|
284
|
+
function dt(e) {
|
|
285
|
+
var r = e.prototype;
|
|
286
|
+
return !!(r && r.isReactComponent);
|
|
287
|
+
}
|
|
288
|
+
function ve(e, r, s) {
|
|
289
|
+
if (e == null)
|
|
290
|
+
return "";
|
|
291
|
+
if (typeof e == "function")
|
|
292
|
+
return Le(e, dt(e));
|
|
293
|
+
if (typeof e == "string")
|
|
294
|
+
return xe(e);
|
|
295
|
+
switch (e) {
|
|
296
|
+
case N:
|
|
297
|
+
return xe("Suspense");
|
|
298
|
+
case g:
|
|
299
|
+
return xe("SuspenseList");
|
|
300
|
+
}
|
|
301
|
+
if (typeof e == "object")
|
|
302
|
+
switch (e.$$typeof) {
|
|
303
|
+
case a:
|
|
304
|
+
return ct(e.render);
|
|
305
|
+
case C:
|
|
306
|
+
return ve(e.type, r, s);
|
|
307
|
+
case b: {
|
|
308
|
+
var l = e, S = l._payload, R = l._init;
|
|
309
|
+
try {
|
|
310
|
+
return ve(R(S), r, s);
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
var le = Object.prototype.hasOwnProperty, ze = {}, Me = m.ReactDebugCurrentFrame;
|
|
318
|
+
function be(e) {
|
|
319
|
+
if (e) {
|
|
320
|
+
var r = e._owner, s = ve(e.type, e._source, r ? r.type : null);
|
|
321
|
+
Me.setExtraStackFrame(s);
|
|
322
|
+
} else
|
|
323
|
+
Me.setExtraStackFrame(null);
|
|
324
|
+
}
|
|
325
|
+
function ut(e, r, s, l, S) {
|
|
326
|
+
{
|
|
327
|
+
var R = Function.call.bind(le);
|
|
328
|
+
for (var j in e)
|
|
329
|
+
if (R(e, j)) {
|
|
330
|
+
var y = void 0;
|
|
331
|
+
try {
|
|
332
|
+
if (typeof e[j] != "function") {
|
|
333
|
+
var B = Error((l || "React class") + ": " + s + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
+
throw B.name = "Invariant Violation", B;
|
|
335
|
+
}
|
|
336
|
+
y = e[j](r, j, l, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
+
} catch (k) {
|
|
338
|
+
y = k;
|
|
339
|
+
}
|
|
340
|
+
y && !(y instanceof Error) && (be(S), o("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", s, j, typeof y), be(null)), y instanceof Error && !(y.message in ze) && (ze[y.message] = !0, be(S), o("Failed %s type: %s", s, y.message), be(null));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var mt = Array.isArray;
|
|
345
|
+
function Pe(e) {
|
|
346
|
+
return mt(e);
|
|
347
|
+
}
|
|
348
|
+
function ft(e) {
|
|
349
|
+
{
|
|
350
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
+
return s;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function ht(e) {
|
|
355
|
+
try {
|
|
356
|
+
return $e(e), !1;
|
|
357
|
+
} catch {
|
|
358
|
+
return !0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function $e(e) {
|
|
362
|
+
return "" + e;
|
|
363
|
+
}
|
|
364
|
+
function We(e) {
|
|
365
|
+
if (ht(e))
|
|
366
|
+
return o("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ft(e)), $e(e);
|
|
367
|
+
}
|
|
368
|
+
var Be = m.ReactCurrentOwner, gt = {
|
|
369
|
+
key: !0,
|
|
370
|
+
ref: !0,
|
|
371
|
+
__self: !0,
|
|
372
|
+
__source: !0
|
|
373
|
+
}, Ye, Ve;
|
|
374
|
+
function pt(e) {
|
|
375
|
+
if (le.call(e, "ref")) {
|
|
376
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
+
if (r && r.isReactWarning)
|
|
378
|
+
return !1;
|
|
379
|
+
}
|
|
380
|
+
return e.ref !== void 0;
|
|
381
|
+
}
|
|
382
|
+
function xt(e) {
|
|
383
|
+
if (le.call(e, "key")) {
|
|
384
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
+
if (r && r.isReactWarning)
|
|
386
|
+
return !1;
|
|
387
|
+
}
|
|
388
|
+
return e.key !== void 0;
|
|
389
|
+
}
|
|
390
|
+
function yt(e, r) {
|
|
391
|
+
typeof e.ref == "string" && Be.current;
|
|
392
|
+
}
|
|
393
|
+
function vt(e, r) {
|
|
394
|
+
{
|
|
395
|
+
var s = function() {
|
|
396
|
+
Ye || (Ye = !0, o("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
397
|
+
};
|
|
398
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
+
get: s,
|
|
400
|
+
configurable: !0
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function bt(e, r) {
|
|
405
|
+
{
|
|
406
|
+
var s = function() {
|
|
407
|
+
Ve || (Ve = !0, o("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
408
|
+
};
|
|
409
|
+
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
+
get: s,
|
|
411
|
+
configurable: !0
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
var wt = function(e, r, s, l, S, R, j) {
|
|
416
|
+
var y = {
|
|
417
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
+
$$typeof: f,
|
|
419
|
+
// Built-in properties that belong on the element
|
|
420
|
+
type: e,
|
|
421
|
+
key: r,
|
|
422
|
+
ref: s,
|
|
423
|
+
props: j,
|
|
424
|
+
// Record the component responsible for creating this element.
|
|
425
|
+
_owner: R
|
|
426
|
+
};
|
|
427
|
+
return y._store = {}, Object.defineProperty(y._store, "validated", {
|
|
428
|
+
configurable: !1,
|
|
429
|
+
enumerable: !1,
|
|
430
|
+
writable: !0,
|
|
431
|
+
value: !1
|
|
432
|
+
}), Object.defineProperty(y, "_self", {
|
|
433
|
+
configurable: !1,
|
|
434
|
+
enumerable: !1,
|
|
435
|
+
writable: !1,
|
|
436
|
+
value: l
|
|
437
|
+
}), Object.defineProperty(y, "_source", {
|
|
438
|
+
configurable: !1,
|
|
439
|
+
enumerable: !1,
|
|
440
|
+
writable: !1,
|
|
441
|
+
value: S
|
|
442
|
+
}), Object.freeze && (Object.freeze(y.props), Object.freeze(y)), y;
|
|
443
|
+
};
|
|
444
|
+
function jt(e, r, s, l, S) {
|
|
445
|
+
{
|
|
446
|
+
var R, j = {}, y = null, B = null;
|
|
447
|
+
s !== void 0 && (We(s), y = "" + s), xt(r) && (We(r.key), y = "" + r.key), pt(r) && (B = r.ref, yt(r, S));
|
|
448
|
+
for (R in r)
|
|
449
|
+
le.call(r, R) && !gt.hasOwnProperty(R) && (j[R] = r[R]);
|
|
450
|
+
if (e && e.defaultProps) {
|
|
451
|
+
var k = e.defaultProps;
|
|
452
|
+
for (R in k)
|
|
453
|
+
j[R] === void 0 && (j[R] = k[R]);
|
|
454
|
+
}
|
|
455
|
+
if (y || B) {
|
|
456
|
+
var z = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
+
y && vt(j, z), B && bt(j, z);
|
|
458
|
+
}
|
|
459
|
+
return wt(e, y, B, S, l, Be.current, j);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
var Oe = m.ReactCurrentOwner, qe = m.ReactDebugCurrentFrame;
|
|
463
|
+
function re(e) {
|
|
464
|
+
if (e) {
|
|
465
|
+
var r = e._owner, s = ve(e.type, e._source, r ? r.type : null);
|
|
466
|
+
qe.setExtraStackFrame(s);
|
|
467
|
+
} else
|
|
468
|
+
qe.setExtraStackFrame(null);
|
|
469
|
+
}
|
|
470
|
+
var Te;
|
|
471
|
+
Te = !1;
|
|
472
|
+
function ke(e) {
|
|
473
|
+
return typeof e == "object" && e !== null && e.$$typeof === f;
|
|
474
|
+
}
|
|
475
|
+
function Ue() {
|
|
476
|
+
{
|
|
477
|
+
if (Oe.current) {
|
|
478
|
+
var e = P(Oe.current.type);
|
|
479
|
+
if (e)
|
|
480
|
+
return `
|
|
481
|
+
|
|
482
|
+
Check the render method of \`` + e + "`.";
|
|
483
|
+
}
|
|
484
|
+
return "";
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function Nt(e) {
|
|
488
|
+
return "";
|
|
489
|
+
}
|
|
490
|
+
var Ge = {};
|
|
491
|
+
function Ct(e) {
|
|
492
|
+
{
|
|
493
|
+
var r = Ue();
|
|
494
|
+
if (!r) {
|
|
495
|
+
var s = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
+
s && (r = `
|
|
497
|
+
|
|
498
|
+
Check the top-level render call using <` + s + ">.");
|
|
499
|
+
}
|
|
500
|
+
return r;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function Je(e, r) {
|
|
504
|
+
{
|
|
505
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
+
return;
|
|
507
|
+
e._store.validated = !0;
|
|
508
|
+
var s = Ct(r);
|
|
509
|
+
if (Ge[s])
|
|
510
|
+
return;
|
|
511
|
+
Ge[s] = !0;
|
|
512
|
+
var l = "";
|
|
513
|
+
e && e._owner && e._owner !== Oe.current && (l = " It was passed a child from " + P(e._owner.type) + "."), re(e), o('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, l), re(null);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function Xe(e, r) {
|
|
517
|
+
{
|
|
518
|
+
if (typeof e != "object")
|
|
519
|
+
return;
|
|
520
|
+
if (Pe(e))
|
|
521
|
+
for (var s = 0; s < e.length; s++) {
|
|
522
|
+
var l = e[s];
|
|
523
|
+
ke(l) && Je(l, r);
|
|
524
|
+
}
|
|
525
|
+
else if (ke(e))
|
|
526
|
+
e._store && (e._store.validated = !0);
|
|
527
|
+
else if (e) {
|
|
528
|
+
var S = n(e);
|
|
529
|
+
if (typeof S == "function" && S !== e.entries)
|
|
530
|
+
for (var R = S.call(e), j; !(j = R.next()).done; )
|
|
531
|
+
ke(j.value) && Je(j.value, r);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function Et(e) {
|
|
536
|
+
{
|
|
537
|
+
var r = e.type;
|
|
538
|
+
if (r == null || typeof r == "string")
|
|
539
|
+
return;
|
|
540
|
+
var s;
|
|
541
|
+
if (typeof r == "function")
|
|
542
|
+
s = r.propTypes;
|
|
543
|
+
else if (typeof r == "object" && (r.$$typeof === a || // Note: Memo only checks outer props here.
|
|
544
|
+
// Inner props are checked in the reconciler.
|
|
545
|
+
r.$$typeof === C))
|
|
546
|
+
s = r.propTypes;
|
|
547
|
+
else
|
|
548
|
+
return;
|
|
549
|
+
if (s) {
|
|
550
|
+
var l = P(r);
|
|
551
|
+
ut(s, e.props, "prop", l, e);
|
|
552
|
+
} else if (r.PropTypes !== void 0 && !Te) {
|
|
553
|
+
Te = !0;
|
|
554
|
+
var S = P(r);
|
|
555
|
+
o("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
556
|
+
}
|
|
557
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && o("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function St(e) {
|
|
561
|
+
{
|
|
562
|
+
for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
|
|
563
|
+
var l = r[s];
|
|
564
|
+
if (l !== "children" && l !== "key") {
|
|
565
|
+
re(e), o("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), re(null);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
e.ref !== null && (re(e), o("Invalid attribute `ref` supplied to `React.Fragment`."), re(null));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
var Ke = {};
|
|
573
|
+
function He(e, r, s, l, S, R) {
|
|
574
|
+
{
|
|
575
|
+
var j = ne(e);
|
|
576
|
+
if (!j) {
|
|
577
|
+
var y = "";
|
|
578
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (y += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
579
|
+
var B = Nt();
|
|
580
|
+
B ? y += B : y += Ue();
|
|
581
|
+
var k;
|
|
582
|
+
e === null ? k = "null" : Pe(e) ? k = "array" : e !== void 0 && e.$$typeof === f ? (k = "<" + (P(e.type) || "Unknown") + " />", y = " Did you accidentally export a JSX literal instead of a component?") : k = typeof e, o("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, y);
|
|
583
|
+
}
|
|
584
|
+
var z = jt(e, r, s, S, R);
|
|
585
|
+
if (z == null)
|
|
586
|
+
return z;
|
|
587
|
+
if (j) {
|
|
588
|
+
var V = r.children;
|
|
589
|
+
if (V !== void 0)
|
|
590
|
+
if (l)
|
|
591
|
+
if (Pe(V)) {
|
|
592
|
+
for (var se = 0; se < V.length; se++)
|
|
593
|
+
Xe(V[se], e);
|
|
594
|
+
Object.freeze && Object.freeze(V);
|
|
595
|
+
} else
|
|
596
|
+
o("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
|
+
else
|
|
598
|
+
Xe(V, e);
|
|
599
|
+
}
|
|
600
|
+
if (le.call(r, "key")) {
|
|
601
|
+
var Q = P(e), Y = Object.keys(r).filter(function(kt) {
|
|
602
|
+
return kt !== "key";
|
|
603
|
+
}), Ie = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
+
if (!Ke[Q + Ie]) {
|
|
605
|
+
var Tt = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
+
o(`A props object containing a "key" prop is being spread into JSX:
|
|
607
|
+
let props = %s;
|
|
608
|
+
<%s {...props} />
|
|
609
|
+
React keys must be passed directly to JSX without using spread:
|
|
610
|
+
let props = %s;
|
|
611
|
+
<%s key={someKey} {...props} />`, Ie, Q, Tt, Q), Ke[Q + Ie] = !0;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return e === u ? St(z) : Et(z), z;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function Rt(e, r, s) {
|
|
618
|
+
return He(e, r, s, !0);
|
|
619
|
+
}
|
|
620
|
+
function _t(e, r, s) {
|
|
621
|
+
return He(e, r, s, !1);
|
|
622
|
+
}
|
|
623
|
+
var Pt = _t, Ot = Rt;
|
|
624
|
+
de.Fragment = u, de.jsx = Pt, de.jsxs = Ot;
|
|
625
|
+
}()), de;
|
|
626
|
+
}
|
|
627
|
+
var et;
|
|
628
|
+
function Wt() {
|
|
629
|
+
return et || (et = 1, process.env.NODE_ENV === "production" ? we.exports = Mt() : we.exports = $t()), we.exports;
|
|
630
|
+
}
|
|
631
|
+
var t = Wt();
|
|
632
|
+
/**
|
|
633
|
+
* @license lucide-react v0.474.0 - ISC
|
|
634
|
+
*
|
|
635
|
+
* This source code is licensed under the ISC license.
|
|
636
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
637
|
+
*/
|
|
638
|
+
const Bt = (i) => i.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), st = (...i) => i.filter((f, d, u) => !!f && f.trim() !== "" && u.indexOf(f) === d).join(" ").trim();
|
|
639
|
+
/**
|
|
640
|
+
* @license lucide-react v0.474.0 - ISC
|
|
641
|
+
*
|
|
642
|
+
* This source code is licensed under the ISC license.
|
|
643
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
644
|
+
*/
|
|
645
|
+
var Yt = {
|
|
646
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
647
|
+
width: 24,
|
|
648
|
+
height: 24,
|
|
649
|
+
viewBox: "0 0 24 24",
|
|
650
|
+
fill: "none",
|
|
651
|
+
stroke: "currentColor",
|
|
652
|
+
strokeWidth: 2,
|
|
653
|
+
strokeLinecap: "round",
|
|
654
|
+
strokeLinejoin: "round"
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* @license lucide-react v0.474.0 - ISC
|
|
658
|
+
*
|
|
659
|
+
* This source code is licensed under the ISC license.
|
|
660
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
661
|
+
*/
|
|
662
|
+
const Vt = tt(
|
|
663
|
+
({
|
|
664
|
+
color: i = "currentColor",
|
|
665
|
+
size: f = 24,
|
|
666
|
+
strokeWidth: d = 2,
|
|
667
|
+
absoluteStrokeWidth: u,
|
|
668
|
+
className: w = "",
|
|
669
|
+
children: h,
|
|
670
|
+
iconNode: v,
|
|
671
|
+
...c
|
|
672
|
+
}, a) => Ae(
|
|
673
|
+
"svg",
|
|
674
|
+
{
|
|
675
|
+
ref: a,
|
|
676
|
+
...Yt,
|
|
677
|
+
width: f,
|
|
678
|
+
height: f,
|
|
679
|
+
stroke: i,
|
|
680
|
+
strokeWidth: u ? Number(d) * 24 / Number(f) : d,
|
|
681
|
+
className: st("lucide", w),
|
|
682
|
+
...c
|
|
683
|
+
},
|
|
684
|
+
[
|
|
685
|
+
...v.map(([N, g]) => Ae(N, g)),
|
|
686
|
+
...Array.isArray(h) ? h : [h]
|
|
687
|
+
]
|
|
688
|
+
)
|
|
689
|
+
);
|
|
690
|
+
/**
|
|
691
|
+
* @license lucide-react v0.474.0 - ISC
|
|
692
|
+
*
|
|
693
|
+
* This source code is licensed under the ISC license.
|
|
694
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
695
|
+
*/
|
|
696
|
+
const Ee = (i, f) => {
|
|
697
|
+
const d = tt(
|
|
698
|
+
({ className: u, ...w }, h) => Ae(Vt, {
|
|
699
|
+
ref: h,
|
|
700
|
+
iconNode: f,
|
|
701
|
+
className: st(`lucide-${Bt(i)}`, u),
|
|
702
|
+
...w
|
|
703
|
+
})
|
|
704
|
+
);
|
|
705
|
+
return d.displayName = `${i}`, d;
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* @license lucide-react v0.474.0 - ISC
|
|
709
|
+
*
|
|
710
|
+
* This source code is licensed under the ISC license.
|
|
711
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
712
|
+
*/
|
|
713
|
+
const qt = [
|
|
714
|
+
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
715
|
+
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
716
|
+
], he = Ee("ArrowLeft", qt);
|
|
717
|
+
/**
|
|
718
|
+
* @license lucide-react v0.474.0 - ISC
|
|
719
|
+
*
|
|
720
|
+
* This source code is licensed under the ISC license.
|
|
721
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
722
|
+
*/
|
|
723
|
+
const Ut = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Gt = Ee("ChevronDown", Ut);
|
|
724
|
+
/**
|
|
725
|
+
* @license lucide-react v0.474.0 - ISC
|
|
726
|
+
*
|
|
727
|
+
* This source code is licensed under the ISC license.
|
|
728
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
729
|
+
*/
|
|
730
|
+
const Jt = [
|
|
731
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
732
|
+
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
733
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
734
|
+
], at = Ee("CircleHelp", Jt);
|
|
735
|
+
/**
|
|
736
|
+
* @license lucide-react v0.474.0 - ISC
|
|
737
|
+
*
|
|
738
|
+
* This source code is licensed under the ISC license.
|
|
739
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
740
|
+
*/
|
|
741
|
+
const Xt = [
|
|
742
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
743
|
+
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
744
|
+
], Kt = Ee("Search", Xt), Ht = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, Zt = ({
|
|
745
|
+
email: i,
|
|
746
|
+
password: f,
|
|
747
|
+
loading: d,
|
|
748
|
+
enterPassword: u,
|
|
749
|
+
invalidPassword: w,
|
|
750
|
+
onEmailChange: h,
|
|
751
|
+
onPasswordChange: v,
|
|
752
|
+
onValidateEmail: c,
|
|
753
|
+
onSubmit: a,
|
|
754
|
+
onBack: N,
|
|
755
|
+
onForgotPassword: g
|
|
756
|
+
}) => {
|
|
757
|
+
const C = Ce({
|
|
758
|
+
defaultValues: {
|
|
759
|
+
email: i || "",
|
|
760
|
+
password: ""
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
return /* @__PURE__ */ t.jsxs(I, { direction: "column", children: [
|
|
764
|
+
u && /* @__PURE__ */ t.jsx(
|
|
765
|
+
A,
|
|
766
|
+
{
|
|
767
|
+
variant: "link",
|
|
768
|
+
leftIcon: /* @__PURE__ */ t.jsx(he, {}),
|
|
769
|
+
size: "large",
|
|
770
|
+
className: "self-start p-0 mb-6",
|
|
771
|
+
onClick: N,
|
|
772
|
+
children: "Back"
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ t.jsx(
|
|
776
|
+
"img",
|
|
777
|
+
{
|
|
778
|
+
src: "https://cdn.thewellnesscorner.com/twc-web-images/new-twc_logo.svg",
|
|
779
|
+
alt: "logo",
|
|
780
|
+
width: 176,
|
|
781
|
+
height: 40,
|
|
782
|
+
className: "lg:hidden block md:mb-10 mb-6 h-auto"
|
|
783
|
+
}
|
|
784
|
+
),
|
|
785
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "mb-2", children: "Hi, Welcome To The Wellness Corner!" }),
|
|
786
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "md:mb-8 mb-6 text-gray-400", children: u ? i : "Please enter email to get started." }),
|
|
787
|
+
/* @__PURE__ */ t.jsx(q, { className: "w-full", form: C, onSubmit: a, children: u ? /* @__PURE__ */ t.jsx(
|
|
788
|
+
er,
|
|
789
|
+
{
|
|
790
|
+
form: C,
|
|
791
|
+
onPasswordChange: v,
|
|
792
|
+
onForgotPassword: g,
|
|
793
|
+
onSubmit: a,
|
|
794
|
+
loading: d,
|
|
795
|
+
password: f,
|
|
796
|
+
invalidPassword: w
|
|
797
|
+
}
|
|
798
|
+
) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
799
|
+
/* @__PURE__ */ t.jsx(
|
|
800
|
+
Qt,
|
|
801
|
+
{
|
|
802
|
+
email: i,
|
|
803
|
+
form: C,
|
|
804
|
+
onEmailChange: h
|
|
805
|
+
}
|
|
806
|
+
),
|
|
807
|
+
/* @__PURE__ */ t.jsx(
|
|
808
|
+
A,
|
|
809
|
+
{
|
|
810
|
+
isFullWidth: !0,
|
|
811
|
+
variant: "primary",
|
|
812
|
+
loading: d,
|
|
813
|
+
className: "mt-3",
|
|
814
|
+
disabled: !Ht.test(i),
|
|
815
|
+
onClick: c,
|
|
816
|
+
children: "Continue"
|
|
817
|
+
}
|
|
818
|
+
)
|
|
819
|
+
] }) })
|
|
820
|
+
] });
|
|
821
|
+
}, Qt = ({ email: i, form: f, onEmailChange: d }) => /* @__PURE__ */ t.jsx(q.Item, { label: "Email", name: "email", children: /* @__PURE__ */ t.jsx(
|
|
822
|
+
me,
|
|
823
|
+
{
|
|
824
|
+
type: "email",
|
|
825
|
+
value: i,
|
|
826
|
+
size: "medium",
|
|
827
|
+
placeholder: "example@domain.com",
|
|
828
|
+
...f.register("email", {
|
|
829
|
+
onChange: (u) => {
|
|
830
|
+
d(u.target.value);
|
|
831
|
+
}
|
|
832
|
+
})
|
|
833
|
+
}
|
|
834
|
+
) }), er = ({
|
|
835
|
+
invalidPassword: i,
|
|
836
|
+
password: f,
|
|
837
|
+
form: d,
|
|
838
|
+
onPasswordChange: u,
|
|
839
|
+
onForgotPassword: w,
|
|
840
|
+
onSubmit: h,
|
|
841
|
+
loading: v
|
|
842
|
+
}) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
843
|
+
/* @__PURE__ */ t.jsx(
|
|
844
|
+
q.Item,
|
|
845
|
+
{
|
|
846
|
+
label: "Password",
|
|
847
|
+
name: "password",
|
|
848
|
+
description: /* @__PURE__ */ t.jsx(x, { type: "body", size: "small", className: "h-5 -mt-2", color: "text-utility-danger-main", children: i && "Incorrect password. Please try again." }),
|
|
849
|
+
children: /* @__PURE__ */ t.jsx(
|
|
850
|
+
Fe,
|
|
851
|
+
{
|
|
852
|
+
placeholder: "Enter your password",
|
|
853
|
+
value: f,
|
|
854
|
+
showStrengthIndicator: !1,
|
|
855
|
+
...d.register("password", {
|
|
856
|
+
onChange: (c) => {
|
|
857
|
+
u(c.target.value);
|
|
858
|
+
}
|
|
859
|
+
})
|
|
860
|
+
}
|
|
861
|
+
)
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ t.jsx(
|
|
865
|
+
A,
|
|
866
|
+
{
|
|
867
|
+
type: "button",
|
|
868
|
+
size: "small",
|
|
869
|
+
variant: "link",
|
|
870
|
+
className: "px-0 h-auto ml-auto block -mt-4",
|
|
871
|
+
onClick: w,
|
|
872
|
+
children: "Forgot Password?"
|
|
873
|
+
}
|
|
874
|
+
),
|
|
875
|
+
/* @__PURE__ */ t.jsx(
|
|
876
|
+
A,
|
|
877
|
+
{
|
|
878
|
+
isFullWidth: !0,
|
|
879
|
+
variant: "primary",
|
|
880
|
+
loading: v,
|
|
881
|
+
disabled: !f,
|
|
882
|
+
className: "mt-3",
|
|
883
|
+
type: "button",
|
|
884
|
+
onClick: h,
|
|
885
|
+
children: "Continue"
|
|
886
|
+
}
|
|
887
|
+
)
|
|
888
|
+
] }), tr = ({ loading: i, onBack: f, onSSOSearch: d, onSSOLogin: u }) => {
|
|
889
|
+
const [w, h] = E(""), [v, c] = E([]), [a, N] = E(!1), [g, C] = E(!1), [b, p] = E(void 0), [_, F] = E(!1), [n, m] = E(!1), o = () => {
|
|
890
|
+
if (!w || w.length < 3)
|
|
891
|
+
return c([]), !1;
|
|
892
|
+
w.trim().length > 2 ? (m(!1), F(!0), d(w, (O) => {
|
|
893
|
+
F(!1), O.length || m(!0), c(O);
|
|
894
|
+
})) : c([]);
|
|
895
|
+
}, D = (O, $) => {
|
|
896
|
+
const H = {
|
|
897
|
+
id: $.key,
|
|
898
|
+
name: $.value,
|
|
899
|
+
image: $.image,
|
|
900
|
+
key: $.key
|
|
901
|
+
};
|
|
902
|
+
p(H), c([]);
|
|
903
|
+
}, M = () => {
|
|
904
|
+
b && u(b.key, (O) => {
|
|
905
|
+
localStorage.setItem("clientId", b.key), window.location.href = O;
|
|
906
|
+
});
|
|
907
|
+
};
|
|
908
|
+
return K(() => {
|
|
909
|
+
c([]);
|
|
910
|
+
const O = setTimeout(o, 1e3);
|
|
911
|
+
return () => clearTimeout(O);
|
|
912
|
+
}, [w]), /* @__PURE__ */ t.jsx(t.Fragment, { children: g ? /* @__PURE__ */ t.jsxs(I, { direction: "column", className: "py-10", children: [
|
|
913
|
+
/* @__PURE__ */ t.jsx(
|
|
914
|
+
A,
|
|
915
|
+
{
|
|
916
|
+
variant: "link",
|
|
917
|
+
leftIcon: /* @__PURE__ */ t.jsx(he, {}),
|
|
918
|
+
className: "p-0 h-auto mt-10 mb-7",
|
|
919
|
+
onClick: () => C(!1),
|
|
920
|
+
children: "Back"
|
|
921
|
+
}
|
|
922
|
+
),
|
|
923
|
+
/* @__PURE__ */ t.jsx(
|
|
924
|
+
"img",
|
|
925
|
+
{
|
|
926
|
+
src: b == null ? void 0 : b.image,
|
|
927
|
+
width: 175,
|
|
928
|
+
height: 117,
|
|
929
|
+
className: "mx-auto mb-9",
|
|
930
|
+
alt: (b == null ? void 0 : b.name) || "Organization"
|
|
931
|
+
}
|
|
932
|
+
),
|
|
933
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "my-9", children: "Select how to sign-in" }),
|
|
934
|
+
/* @__PURE__ */ t.jsx(
|
|
935
|
+
A,
|
|
936
|
+
{
|
|
937
|
+
isFullWidth: !0,
|
|
938
|
+
variant: "primary",
|
|
939
|
+
onClick: M,
|
|
940
|
+
loading: i,
|
|
941
|
+
children: "Login with SSO"
|
|
942
|
+
}
|
|
943
|
+
),
|
|
944
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "mt-6 text-gray-600", children: "The above option is recommended for quick access" }),
|
|
945
|
+
/* @__PURE__ */ t.jsxs(I, { align: "center", className: "my-8", children: [
|
|
946
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex-1 border-t border-gray-300" }),
|
|
947
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "small", className: "text-gray-500 px-4", children: "OR" }),
|
|
948
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex-1 border-t border-gray-300" })
|
|
949
|
+
] }),
|
|
950
|
+
/* @__PURE__ */ t.jsx(
|
|
951
|
+
A,
|
|
952
|
+
{
|
|
953
|
+
isFullWidth: !0,
|
|
954
|
+
variant: "secondary",
|
|
955
|
+
onClick: f,
|
|
956
|
+
type: "button",
|
|
957
|
+
children: "Login with Email & Password"
|
|
958
|
+
}
|
|
959
|
+
)
|
|
960
|
+
] }) : /* @__PURE__ */ t.jsxs(I, { direction: "column", children: [
|
|
961
|
+
/* @__PURE__ */ t.jsx(
|
|
962
|
+
A,
|
|
963
|
+
{
|
|
964
|
+
size: "large",
|
|
965
|
+
variant: "link",
|
|
966
|
+
leftIcon: /* @__PURE__ */ t.jsx(he, {}),
|
|
967
|
+
className: "p-0 h-auto",
|
|
968
|
+
onClick: f,
|
|
969
|
+
children: "Back"
|
|
970
|
+
}
|
|
971
|
+
),
|
|
972
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "my-9", children: "Search Organization" }),
|
|
973
|
+
/* @__PURE__ */ t.jsx(
|
|
974
|
+
It,
|
|
975
|
+
{
|
|
976
|
+
type: "text",
|
|
977
|
+
loading: _,
|
|
978
|
+
onSelect: D,
|
|
979
|
+
onFocus: () => N(!0),
|
|
980
|
+
onSearch: (O) => h(O.trimStart()),
|
|
981
|
+
placeholder: "Enter at least 3 characters",
|
|
982
|
+
debounceTimer: 300,
|
|
983
|
+
value: b ? b.name : w,
|
|
984
|
+
onChange: () => {
|
|
985
|
+
m(!1), p(void 0);
|
|
986
|
+
},
|
|
987
|
+
leftIcon: !1,
|
|
988
|
+
rightIcon: a && !b ? /* @__PURE__ */ t.jsx(Kt, { size: 20, className: "text-gray-600 flex" }) : /* @__PURE__ */ t.jsx(Gt, { size: 20, className: "text-gray-600 flex" }),
|
|
989
|
+
notFoundContent: n ? /* @__PURE__ */ t.jsx(I, { padding: "sm", className: "rounded-lg", children: /* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "text-gray-900", children: `No result found for "${w}"` }) }) : null,
|
|
990
|
+
options: v == null ? void 0 : v.map((O) => ({
|
|
991
|
+
key: O.id,
|
|
992
|
+
value: O.name,
|
|
993
|
+
image: O.image,
|
|
994
|
+
label: /* @__PURE__ */ t.jsxs(I, { align: "center", className: "gap-2", children: [
|
|
995
|
+
/* @__PURE__ */ t.jsx(
|
|
996
|
+
"img",
|
|
997
|
+
{
|
|
998
|
+
src: O.image,
|
|
999
|
+
width: 32,
|
|
1000
|
+
height: 32,
|
|
1001
|
+
className: "h-auto",
|
|
1002
|
+
alt: O.name
|
|
1003
|
+
}
|
|
1004
|
+
),
|
|
1005
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", children: O.name })
|
|
1006
|
+
] })
|
|
1007
|
+
}))
|
|
1008
|
+
}
|
|
1009
|
+
),
|
|
1010
|
+
/* @__PURE__ */ t.jsx(
|
|
1011
|
+
A,
|
|
1012
|
+
{
|
|
1013
|
+
isFullWidth: !0,
|
|
1014
|
+
variant: "primary",
|
|
1015
|
+
className: "mt-9 mb-9",
|
|
1016
|
+
style: {
|
|
1017
|
+
marginTop: "18px"
|
|
1018
|
+
},
|
|
1019
|
+
disabled: !b,
|
|
1020
|
+
onClick: () => C(!0),
|
|
1021
|
+
children: "Continue"
|
|
1022
|
+
}
|
|
1023
|
+
)
|
|
1024
|
+
] }) });
|
|
1025
|
+
}, rr = ({
|
|
1026
|
+
show: i,
|
|
1027
|
+
hide: f,
|
|
1028
|
+
email: d,
|
|
1029
|
+
onOTPRequest: u,
|
|
1030
|
+
onOTPVerify: w,
|
|
1031
|
+
onSuccess: h
|
|
1032
|
+
}) => {
|
|
1033
|
+
const [v, c] = E(""), [a, N] = E(""), g = ({ mobileNo: p, countryCode: _ }) => {
|
|
1034
|
+
if (_ !== "91") {
|
|
1035
|
+
alert("Login with OTP feature is only available for Indian phone numbers");
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
N(p), u(d, (F) => {
|
|
1039
|
+
F && c("otp_requested");
|
|
1040
|
+
});
|
|
1041
|
+
}, C = () => {
|
|
1042
|
+
c(""), N("");
|
|
1043
|
+
}, b = () => {
|
|
1044
|
+
C(), f();
|
|
1045
|
+
};
|
|
1046
|
+
return /* @__PURE__ */ t.jsx(
|
|
1047
|
+
At,
|
|
1048
|
+
{
|
|
1049
|
+
title: "",
|
|
1050
|
+
size: "sm",
|
|
1051
|
+
open: i,
|
|
1052
|
+
onOpenChange: b,
|
|
1053
|
+
footer: null,
|
|
1054
|
+
showCloseButton: !1,
|
|
1055
|
+
top: 200,
|
|
1056
|
+
children: /* @__PURE__ */ t.jsxs(I, { direction: "column", children: [
|
|
1057
|
+
!v && /* @__PURE__ */ t.jsx(
|
|
1058
|
+
sr,
|
|
1059
|
+
{
|
|
1060
|
+
title: "Sign In With Mobile",
|
|
1061
|
+
subtitle: "Enter your registered mobile number to generate a One-Time Password (OTP)",
|
|
1062
|
+
onSubmit: g,
|
|
1063
|
+
onClose: b
|
|
1064
|
+
}
|
|
1065
|
+
),
|
|
1066
|
+
v && /* @__PURE__ */ t.jsx(
|
|
1067
|
+
ar,
|
|
1068
|
+
{
|
|
1069
|
+
mobileNo: a,
|
|
1070
|
+
email: d,
|
|
1071
|
+
onOTPVerify: w,
|
|
1072
|
+
onOTPRequest: u,
|
|
1073
|
+
onSuccess: h,
|
|
1074
|
+
onBack: C
|
|
1075
|
+
}
|
|
1076
|
+
)
|
|
1077
|
+
] })
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
}, sr = ({
|
|
1081
|
+
title: i,
|
|
1082
|
+
subtitle: f,
|
|
1083
|
+
onSubmit: d,
|
|
1084
|
+
onClose: u
|
|
1085
|
+
}) => {
|
|
1086
|
+
const w = Ce({
|
|
1087
|
+
defaultValues: {
|
|
1088
|
+
mobileNo: "",
|
|
1089
|
+
countryCode: "91"
|
|
1090
|
+
}
|
|
1091
|
+
}), [h, v] = E(""), c = (a) => {
|
|
1092
|
+
a.preventDefault(), h.length === 10 && d({ mobileNo: h, countryCode: "91" });
|
|
1093
|
+
};
|
|
1094
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1095
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h6", className: "mb-2 text-center", children: i }),
|
|
1096
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", className: "mb-6 text-gray-400 text-center", children: f }),
|
|
1097
|
+
/* @__PURE__ */ t.jsxs(q, { form: w, onSubmit: c, children: [
|
|
1098
|
+
/* @__PURE__ */ t.jsx(q.Item, { label: "Mobile Number", name: "mobileNo", children: /* @__PURE__ */ t.jsxs("div", { className: "flex", children: [
|
|
1099
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex items-center px-3 border border-r-0 border-gray-300 rounded-l-md bg-gray-50", children: /* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", children: "+91" }) }),
|
|
1100
|
+
/* @__PURE__ */ t.jsx(
|
|
1101
|
+
me,
|
|
1102
|
+
{
|
|
1103
|
+
type: "tel",
|
|
1104
|
+
value: h,
|
|
1105
|
+
onChange: (a) => v(a.target.value.replace(/\D/g, "").slice(0, 10)),
|
|
1106
|
+
placeholder: "Enter mobile number",
|
|
1107
|
+
className: "rounded-l-none border-l-0",
|
|
1108
|
+
maxLength: 10
|
|
1109
|
+
}
|
|
1110
|
+
)
|
|
1111
|
+
] }) }),
|
|
1112
|
+
/* @__PURE__ */ t.jsxs(I, { justify: "between", className: "mt-6 gap-3", children: [
|
|
1113
|
+
/* @__PURE__ */ t.jsx(
|
|
1114
|
+
A,
|
|
1115
|
+
{
|
|
1116
|
+
type: "button",
|
|
1117
|
+
variant: "secondary",
|
|
1118
|
+
onClick: u,
|
|
1119
|
+
className: "flex-1",
|
|
1120
|
+
children: "Cancel"
|
|
1121
|
+
}
|
|
1122
|
+
),
|
|
1123
|
+
/* @__PURE__ */ t.jsx(
|
|
1124
|
+
A,
|
|
1125
|
+
{
|
|
1126
|
+
type: "submit",
|
|
1127
|
+
variant: "primary",
|
|
1128
|
+
disabled: h.length !== 10,
|
|
1129
|
+
className: "flex-1",
|
|
1130
|
+
children: "Send OTP"
|
|
1131
|
+
}
|
|
1132
|
+
)
|
|
1133
|
+
] })
|
|
1134
|
+
] })
|
|
1135
|
+
] });
|
|
1136
|
+
}, ar = ({
|
|
1137
|
+
mobileNo: i,
|
|
1138
|
+
email: f,
|
|
1139
|
+
onOTPVerify: d,
|
|
1140
|
+
onOTPRequest: u,
|
|
1141
|
+
onSuccess: w,
|
|
1142
|
+
onBack: h
|
|
1143
|
+
}) => {
|
|
1144
|
+
const [v, c] = E(""), [a, N] = E(!1), [g, C] = E(180), [b, p] = E(""), [_, F] = E(!1);
|
|
1145
|
+
K(() => {
|
|
1146
|
+
if (!g) return;
|
|
1147
|
+
const o = setInterval(() => {
|
|
1148
|
+
const D = Math.floor(g / 60), M = g % 60, O = `${D < 10 ? "0" : ""}${D}:${M < 10 ? "0" : ""}${M}`;
|
|
1149
|
+
p(O), C(($) => $ - 1);
|
|
1150
|
+
}, 1e3);
|
|
1151
|
+
return () => clearInterval(o);
|
|
1152
|
+
}, [g]);
|
|
1153
|
+
const n = () => {
|
|
1154
|
+
c(""), u(f, (o) => {
|
|
1155
|
+
});
|
|
1156
|
+
}, m = () => {
|
|
1157
|
+
F(!0), N(!1), d(f, v, (o, D) => {
|
|
1158
|
+
F(!1), o && D ? w(D) : N(!0);
|
|
1159
|
+
});
|
|
1160
|
+
};
|
|
1161
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1162
|
+
/* @__PURE__ */ t.jsx(
|
|
1163
|
+
A,
|
|
1164
|
+
{
|
|
1165
|
+
variant: "link",
|
|
1166
|
+
onClick: h,
|
|
1167
|
+
className: "self-start p-0 mb-4",
|
|
1168
|
+
children: "← Back"
|
|
1169
|
+
}
|
|
1170
|
+
),
|
|
1171
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h6", className: "mb-2 text-center", children: "Sign In With Mobile" }),
|
|
1172
|
+
/* @__PURE__ */ t.jsxs(x, { type: "body", size: "large", className: "mb-6 text-gray-400 text-center", children: [
|
|
1173
|
+
"OTP sent to",
|
|
1174
|
+
" ",
|
|
1175
|
+
/* @__PURE__ */ t.jsxs(x, { type: "utility", size: "large", color: "text-secondary-dark", className: "inline", children: [
|
|
1176
|
+
"XXXXXXX",
|
|
1177
|
+
i.slice(-3)
|
|
1178
|
+
] })
|
|
1179
|
+
] }),
|
|
1180
|
+
/* @__PURE__ */ t.jsx(
|
|
1181
|
+
Ft,
|
|
1182
|
+
{
|
|
1183
|
+
value: v,
|
|
1184
|
+
onChange: (o) => c(o),
|
|
1185
|
+
maxLength: 6,
|
|
1186
|
+
className: `!w-auto ${a ? "!border-red-500" : ""}`
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
a && /* @__PURE__ */ t.jsx(x, { type: "utility", size: "medium", className: "text-left mt-1", color: "text-utility-danger-main", children: "Please enter the correct OTP." }),
|
|
1190
|
+
g < 60 ? /* @__PURE__ */ t.jsxs(I, { justify: "between", align: "center", className: "mb-6", children: [
|
|
1191
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", className: "font-semibold", color: "text-gray-400", children: "Didn't receive OTP?" }),
|
|
1192
|
+
/* @__PURE__ */ t.jsx(
|
|
1193
|
+
A,
|
|
1194
|
+
{
|
|
1195
|
+
type: "button",
|
|
1196
|
+
variant: "link",
|
|
1197
|
+
size: "small",
|
|
1198
|
+
className: "px-0",
|
|
1199
|
+
onClick: () => {
|
|
1200
|
+
C(180), N(!1), n();
|
|
1201
|
+
},
|
|
1202
|
+
children: "Resend Code"
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
] }) : /* @__PURE__ */ t.jsxs(x, { type: "body", size: "medium", className: "p-0 font-semibold text-gray-400 py-6 text-center", children: [
|
|
1206
|
+
"Resend Code in ",
|
|
1207
|
+
b
|
|
1208
|
+
] }),
|
|
1209
|
+
/* @__PURE__ */ t.jsx(
|
|
1210
|
+
A,
|
|
1211
|
+
{
|
|
1212
|
+
variant: "primary",
|
|
1213
|
+
type: "button",
|
|
1214
|
+
onClick: m,
|
|
1215
|
+
isFullWidth: !0,
|
|
1216
|
+
disabled: (v == null ? void 0 : v.length) !== 6,
|
|
1217
|
+
loading: _,
|
|
1218
|
+
children: "Continue"
|
|
1219
|
+
}
|
|
1220
|
+
)
|
|
1221
|
+
] });
|
|
1222
|
+
}, je = "https://cdn.thewellnesscorner.com/twc-web-images", nt = () => /* @__PURE__ */ t.jsxs(I, { direction: "column", justify: "center", className: "h-screen", children: [
|
|
1223
|
+
/* @__PURE__ */ t.jsx(
|
|
1224
|
+
"img",
|
|
1225
|
+
{
|
|
1226
|
+
src: `${je}/new-twc_logo.svg`,
|
|
1227
|
+
alt: "logo",
|
|
1228
|
+
width: 154,
|
|
1229
|
+
height: 31,
|
|
1230
|
+
className: "mb-5 mx-auto z-10 h-7"
|
|
1231
|
+
}
|
|
1232
|
+
),
|
|
1233
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h6", className: "mx-auto z-10 text-gray-800", children: "A Peek into" }),
|
|
1234
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "mb-2 mx-auto z-10 text-gray-800", children: "Platform Excellence" }),
|
|
1235
|
+
/* @__PURE__ */ t.jsx(
|
|
1236
|
+
Dt,
|
|
1237
|
+
{
|
|
1238
|
+
className: "w-auto",
|
|
1239
|
+
arrows: !1,
|
|
1240
|
+
autoplay: !0,
|
|
1241
|
+
infinite: !0,
|
|
1242
|
+
data: [
|
|
1243
|
+
{
|
|
1244
|
+
image: `${je}/home/platform-excellence-screen2.png`,
|
|
1245
|
+
title: "Benefits",
|
|
1246
|
+
description: "Explore exclusive sponsored and discounted health benefits."
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
image: `${je}/home/platform-excellence-screen1.png`,
|
|
1250
|
+
title: "Community",
|
|
1251
|
+
description: "Connect, share and thrive together."
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
image: `${je}/home/platform-excellence-screen3.png`,
|
|
1255
|
+
title: "Engagement",
|
|
1256
|
+
description: "Interact, inspire and lead a healthy lifestyle together."
|
|
1257
|
+
}
|
|
1258
|
+
],
|
|
1259
|
+
dots: !0,
|
|
1260
|
+
sliderItems: (i) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1261
|
+
/* @__PURE__ */ t.jsx(I, { children: /* @__PURE__ */ t.jsx(
|
|
1262
|
+
"img",
|
|
1263
|
+
{
|
|
1264
|
+
src: i.image,
|
|
1265
|
+
alt: i.title,
|
|
1266
|
+
width: 154,
|
|
1267
|
+
height: 312,
|
|
1268
|
+
className: "block mx-auto mb-0 h-auto",
|
|
1269
|
+
style: { width: "10vw" }
|
|
1270
|
+
}
|
|
1271
|
+
) }),
|
|
1272
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h6", className: "text-center mt-4 text-gray-800", children: i.title }),
|
|
1273
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "px-2 mb-2 text-gray-300 text-center", children: i.description })
|
|
1274
|
+
] }),
|
|
1275
|
+
slidesToShow: 1
|
|
1276
|
+
}
|
|
1277
|
+
)
|
|
1278
|
+
] }), ue = {
|
|
1279
|
+
EMAIL_ENTRY: "EMAIL_ENTRY",
|
|
1280
|
+
SSO_LOGIN: "SSO_LOGIN"
|
|
1281
|
+
}, Ne = {
|
|
1282
|
+
PERSONAL_DETAILS: "PERSONAL_DETAILS",
|
|
1283
|
+
PASSWORD_CREATION: "PASSWORD_CREATION"
|
|
1284
|
+
}, cr = ({
|
|
1285
|
+
onEmailExists: i,
|
|
1286
|
+
onLogin: f,
|
|
1287
|
+
onSuccess: d,
|
|
1288
|
+
onError: u,
|
|
1289
|
+
onSSOSearch: w,
|
|
1290
|
+
onSSOLogin: h,
|
|
1291
|
+
onOTPRequest: v,
|
|
1292
|
+
onOTPVerify: c,
|
|
1293
|
+
// onPasswordResetRequest, // TODO: Implement password reset
|
|
1294
|
+
// onPasswordResetVerify, // TODO: Implement password reset
|
|
1295
|
+
makeRequest: a,
|
|
1296
|
+
initialEmail: N = "",
|
|
1297
|
+
className: g = ""
|
|
1298
|
+
}) => {
|
|
1299
|
+
const [C, b] = E(ue.EMAIL_ENTRY), [p, _] = E(N), [F, n] = E(""), [m, o] = E(!1), [D, M] = E(!1), [O, $] = E(!1), [H, Z] = E(!1);
|
|
1300
|
+
K(() => {
|
|
1301
|
+
N && _(N);
|
|
1302
|
+
}, [N]);
|
|
1303
|
+
const ee = (L) => {
|
|
1304
|
+
L.preventDefault(), o(!0), a({
|
|
1305
|
+
url: "/auth/email-exists",
|
|
1306
|
+
method: "POST",
|
|
1307
|
+
data: { email: p },
|
|
1308
|
+
onSuccess: () => {
|
|
1309
|
+
o(!1), M(!0), i(p);
|
|
1310
|
+
},
|
|
1311
|
+
onError: (G) => {
|
|
1312
|
+
var oe, ie;
|
|
1313
|
+
o(!1), ((ie = (oe = G == null ? void 0 : G.response) == null ? void 0 : oe.request) == null ? void 0 : ie.status) === 404 ? u && u({
|
|
1314
|
+
type: "USER_NOT_FOUND",
|
|
1315
|
+
message: "User not found. Please register first.",
|
|
1316
|
+
redirectToRegistration: !0,
|
|
1317
|
+
email: p
|
|
1318
|
+
}) : u && u(G);
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
1321
|
+
}, ne = (L) => {
|
|
1322
|
+
L.preventDefault(), o(!0), $(!1), f(p, F);
|
|
1323
|
+
}, te = (L) => {
|
|
1324
|
+
o(!1), d(L);
|
|
1325
|
+
}, T = (L) => {
|
|
1326
|
+
var G;
|
|
1327
|
+
o(!1), ((G = L == null ? void 0 : L.response) == null ? void 0 : G.status) === 400 && $(!0), u && u(L);
|
|
1328
|
+
};
|
|
1329
|
+
K(() => (typeof window < "u" && (window.authLoginHandlers = {
|
|
1330
|
+
handleLoginSuccess: te,
|
|
1331
|
+
handleLoginError: T
|
|
1332
|
+
}), () => {
|
|
1333
|
+
typeof window < "u" && delete window.authLoginHandlers;
|
|
1334
|
+
}), []);
|
|
1335
|
+
const P = () => {
|
|
1336
|
+
M(!1), n(""), $(!1);
|
|
1337
|
+
}, W = () => {
|
|
1338
|
+
M(!1), b(ue.EMAIL_ENTRY), _("");
|
|
1339
|
+
}, U = () => {
|
|
1340
|
+
console.log("Forgot password triggered for:", p);
|
|
1341
|
+
}, X = (L) => {
|
|
1342
|
+
_(L);
|
|
1343
|
+
}, ge = (L) => {
|
|
1344
|
+
n((typeof L == "string" ? L : "").replace(/\s/g, "")), $(!1);
|
|
1345
|
+
}, pe = (L) => {
|
|
1346
|
+
Z(!1), d(L);
|
|
1347
|
+
};
|
|
1348
|
+
return /* @__PURE__ */ t.jsx(rt, { maxWidth: "fluid", className: `lg:px-0 h-screen ${g}`, children: /* @__PURE__ */ t.jsxs(fe, { justify: "center", align: "middle", children: [
|
|
1349
|
+
/* @__PURE__ */ t.jsxs(J, { md: 10, className: "relative h-full lg:block hidden", children: [
|
|
1350
|
+
/* @__PURE__ */ t.jsx(
|
|
1351
|
+
"img",
|
|
1352
|
+
{
|
|
1353
|
+
src: "https://cdn.thewellnesscorner.com/twc-web-images/login/login-left-bg.jpg",
|
|
1354
|
+
className: "absolute inset-0 w-full h-full object-cover",
|
|
1355
|
+
alt: "Login Background"
|
|
1356
|
+
}
|
|
1357
|
+
),
|
|
1358
|
+
/* @__PURE__ */ t.jsx(nt, {})
|
|
1359
|
+
] }),
|
|
1360
|
+
/* @__PURE__ */ t.jsx(J, { md: 14, span: 24, className: "lg:overflow-y-auto lg:h-screen my-auto", style: {
|
|
1361
|
+
padding: "60px 100px"
|
|
1362
|
+
}, children: /* @__PURE__ */ t.jsxs(
|
|
1363
|
+
I,
|
|
1364
|
+
{
|
|
1365
|
+
direction: "column",
|
|
1366
|
+
justify: "center",
|
|
1367
|
+
className: `lg:w-[70%] lg:h-screen mx-auto h-full my-10 ${C === ue.SSO_LOGIN ? "lg:my-0" : ""}`,
|
|
1368
|
+
children: [
|
|
1369
|
+
C === ue.SSO_LOGIN ? /* @__PURE__ */ t.jsx(
|
|
1370
|
+
tr,
|
|
1371
|
+
{
|
|
1372
|
+
loading: m,
|
|
1373
|
+
onBack: W,
|
|
1374
|
+
onSSOSearch: w,
|
|
1375
|
+
onSSOLogin: h
|
|
1376
|
+
}
|
|
1377
|
+
) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1378
|
+
/* @__PURE__ */ t.jsx(
|
|
1379
|
+
Zt,
|
|
1380
|
+
{
|
|
1381
|
+
email: p,
|
|
1382
|
+
password: F,
|
|
1383
|
+
loading: m,
|
|
1384
|
+
enterPassword: D,
|
|
1385
|
+
invalidPassword: O,
|
|
1386
|
+
onEmailChange: X,
|
|
1387
|
+
onPasswordChange: ge,
|
|
1388
|
+
onValidateEmail: ee,
|
|
1389
|
+
onSubmit: ne,
|
|
1390
|
+
onBack: P,
|
|
1391
|
+
onForgotPassword: U
|
|
1392
|
+
}
|
|
1393
|
+
),
|
|
1394
|
+
!D && /* @__PURE__ */ t.jsx(
|
|
1395
|
+
A,
|
|
1396
|
+
{
|
|
1397
|
+
isFullWidth: !0,
|
|
1398
|
+
type: "button",
|
|
1399
|
+
variant: "secondary",
|
|
1400
|
+
className: "mt-6 flex-none",
|
|
1401
|
+
onClick: () => b(ue.SSO_LOGIN),
|
|
1402
|
+
children: "Sign In with SSO"
|
|
1403
|
+
}
|
|
1404
|
+
),
|
|
1405
|
+
/* @__PURE__ */ t.jsx("br", {}),
|
|
1406
|
+
D ? /* @__PURE__ */ t.jsx(
|
|
1407
|
+
A,
|
|
1408
|
+
{
|
|
1409
|
+
isFullWidth: !0,
|
|
1410
|
+
type: "button",
|
|
1411
|
+
variant: "secondary",
|
|
1412
|
+
className: "flex-none",
|
|
1413
|
+
onClick: () => Z(!0),
|
|
1414
|
+
children: "Sign In with OTP"
|
|
1415
|
+
}
|
|
1416
|
+
) : /* @__PURE__ */ t.jsx(t.Fragment, {}),
|
|
1417
|
+
/* @__PURE__ */ t.jsxs(I, { padding: "sm", className: "rounded-lg bg-gray-100 md:mt-8 mt-6 gap-3", children: [
|
|
1418
|
+
/* @__PURE__ */ t.jsx(at, { size: 20, className: "min-w-5 text-primary" }),
|
|
1419
|
+
/* @__PURE__ */ t.jsxs(x, { type: "body", size: "small", children: [
|
|
1420
|
+
"For any customer support related queries, please write to us on",
|
|
1421
|
+
" ",
|
|
1422
|
+
/* @__PURE__ */ t.jsx("a", { href: "mailto:support@thewellnesscorner.com", className: "text-primary", children: /* @__PURE__ */ t.jsx("u", { children: "support@thewellnesscorner.com" }) })
|
|
1423
|
+
] })
|
|
1424
|
+
] })
|
|
1425
|
+
] }),
|
|
1426
|
+
/* @__PURE__ */ t.jsx(
|
|
1427
|
+
rr,
|
|
1428
|
+
{
|
|
1429
|
+
show: H,
|
|
1430
|
+
hide: () => Z(!1),
|
|
1431
|
+
email: p,
|
|
1432
|
+
onOTPRequest: v,
|
|
1433
|
+
onOTPVerify: c,
|
|
1434
|
+
onSuccess: pe
|
|
1435
|
+
}
|
|
1436
|
+
)
|
|
1437
|
+
]
|
|
1438
|
+
}
|
|
1439
|
+
) })
|
|
1440
|
+
] }) });
|
|
1441
|
+
}, nr = ({
|
|
1442
|
+
personalDetails: i,
|
|
1443
|
+
loading: f,
|
|
1444
|
+
onPersonalDetailsChange: d,
|
|
1445
|
+
onSubmit: u,
|
|
1446
|
+
onBack: w
|
|
1447
|
+
}) => {
|
|
1448
|
+
const h = Ce({
|
|
1449
|
+
defaultValues: {
|
|
1450
|
+
firstName: i.firstName || "",
|
|
1451
|
+
lastName: i.lastName || "",
|
|
1452
|
+
gender: i.gender || "M",
|
|
1453
|
+
dateOfBirth: i.dateOfBirth || "",
|
|
1454
|
+
phoneNumber: i.phoneNumber || "",
|
|
1455
|
+
referralCode: i.referralCode || "",
|
|
1456
|
+
termsAndConditions: i.termsAndConditions || !1
|
|
1457
|
+
}
|
|
1458
|
+
}), { watch: v } = h, c = v();
|
|
1459
|
+
ae.useEffect(() => {
|
|
1460
|
+
d(c);
|
|
1461
|
+
}, [c, d]);
|
|
1462
|
+
const [a, N] = ae.useState({
|
|
1463
|
+
day: "",
|
|
1464
|
+
month: "",
|
|
1465
|
+
year: ""
|
|
1466
|
+
});
|
|
1467
|
+
ae.useEffect(() => {
|
|
1468
|
+
if (c.dateOfBirth) {
|
|
1469
|
+
const n = c.dateOfBirth.split("/");
|
|
1470
|
+
n.length === 3 && N({
|
|
1471
|
+
day: n[0],
|
|
1472
|
+
month: n[1],
|
|
1473
|
+
year: n[2]
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
}, []), ae.useEffect(() => {
|
|
1477
|
+
if (a.day && a.month && a.year) {
|
|
1478
|
+
const n = `${a.day}/${a.month}/${a.year}`;
|
|
1479
|
+
h.setValue("dateOfBirth", n);
|
|
1480
|
+
} else
|
|
1481
|
+
h.setValue("dateOfBirth", "");
|
|
1482
|
+
}, [a, h]);
|
|
1483
|
+
const g = (n, m) => {
|
|
1484
|
+
N((o) => ({
|
|
1485
|
+
...o,
|
|
1486
|
+
[n]: m
|
|
1487
|
+
}));
|
|
1488
|
+
}, C = c.firstName && c.lastName && c.gender && a.day && a.month && a.year && c.termsAndConditions, b = [
|
|
1489
|
+
{ label: "Male", value: "M" },
|
|
1490
|
+
{ label: "Female", value: "F" }
|
|
1491
|
+
], p = () => Array.from({ length: 31 }, (n, m) => (m + 1).toString().padStart(2, "0")), _ = () => [
|
|
1492
|
+
"January",
|
|
1493
|
+
"February",
|
|
1494
|
+
"March",
|
|
1495
|
+
"April",
|
|
1496
|
+
"May",
|
|
1497
|
+
"June",
|
|
1498
|
+
"July",
|
|
1499
|
+
"August",
|
|
1500
|
+
"September",
|
|
1501
|
+
"October",
|
|
1502
|
+
"November",
|
|
1503
|
+
"December"
|
|
1504
|
+
], F = () => {
|
|
1505
|
+
const n = (/* @__PURE__ */ new Date()).getFullYear(), m = n - 100, o = n - 13;
|
|
1506
|
+
return Array.from({ length: o - m + 1 }, (D, M) => (o - M).toString());
|
|
1507
|
+
};
|
|
1508
|
+
return /* @__PURE__ */ t.jsxs(I, { direction: "column", className: "px-12", children: [
|
|
1509
|
+
/* @__PURE__ */ t.jsx(
|
|
1510
|
+
A,
|
|
1511
|
+
{
|
|
1512
|
+
variant: "link",
|
|
1513
|
+
leftIcon: /* @__PURE__ */ t.jsx(he, {}),
|
|
1514
|
+
className: "p-0 h-auto mb-7",
|
|
1515
|
+
onClick: w,
|
|
1516
|
+
children: "Back"
|
|
1517
|
+
}
|
|
1518
|
+
),
|
|
1519
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "mb-2", children: "Looks like you're new here!" }),
|
|
1520
|
+
/* @__PURE__ */ t.jsx(
|
|
1521
|
+
x,
|
|
1522
|
+
{
|
|
1523
|
+
type: "body",
|
|
1524
|
+
size: "large",
|
|
1525
|
+
color: "text-gray-400",
|
|
1526
|
+
children: "Tell us more about you so we can set up your account."
|
|
1527
|
+
}
|
|
1528
|
+
),
|
|
1529
|
+
/* @__PURE__ */ t.jsxs(q, { className: "w-full p-0 m-0", form: h, onSubmit: (n) => {
|
|
1530
|
+
const m = new Event("submit");
|
|
1531
|
+
m.preventDefault = () => {
|
|
1532
|
+
}, u(m);
|
|
1533
|
+
}, children: [
|
|
1534
|
+
/* @__PURE__ */ t.jsxs(fe, { gutter: 18, className: "py-0 my-0", children: [
|
|
1535
|
+
/* @__PURE__ */ t.jsx(J, { xs: 24, md: 12, children: /* @__PURE__ */ t.jsx(
|
|
1536
|
+
q.Item,
|
|
1537
|
+
{
|
|
1538
|
+
name: "firstName",
|
|
1539
|
+
label: "First Name",
|
|
1540
|
+
className: "mt-5",
|
|
1541
|
+
rules: [
|
|
1542
|
+
{ required: !0, message: "Please enter your first name" },
|
|
1543
|
+
{
|
|
1544
|
+
pattern: /^[a-zA-Z\s]+$/,
|
|
1545
|
+
message: "Name can only contain letters"
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
validator: async (n, m) => {
|
|
1549
|
+
if (m && m.length < 2)
|
|
1550
|
+
throw new Error("Name must be at least 2 characters");
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
],
|
|
1554
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1555
|
+
me,
|
|
1556
|
+
{
|
|
1557
|
+
placeholder: "Enter your first name",
|
|
1558
|
+
maxLength: 50
|
|
1559
|
+
}
|
|
1560
|
+
)
|
|
1561
|
+
}
|
|
1562
|
+
) }),
|
|
1563
|
+
/* @__PURE__ */ t.jsx(J, { xs: 24, md: 12, children: /* @__PURE__ */ t.jsx(
|
|
1564
|
+
q.Item,
|
|
1565
|
+
{
|
|
1566
|
+
name: "lastName",
|
|
1567
|
+
label: "Last Name",
|
|
1568
|
+
className: "mt-5",
|
|
1569
|
+
rules: [
|
|
1570
|
+
{ required: !0, message: "Please enter your last name" },
|
|
1571
|
+
{
|
|
1572
|
+
pattern: /^[a-zA-Z\s]+$/,
|
|
1573
|
+
message: "Name can only contain letters"
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
validator: async (n, m) => {
|
|
1577
|
+
if (m && m.length < 2)
|
|
1578
|
+
throw new Error("Name must be at least 2 characters");
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
],
|
|
1582
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1583
|
+
me,
|
|
1584
|
+
{
|
|
1585
|
+
placeholder: "Enter your last name",
|
|
1586
|
+
maxLength: 50
|
|
1587
|
+
}
|
|
1588
|
+
)
|
|
1589
|
+
}
|
|
1590
|
+
) })
|
|
1591
|
+
] }),
|
|
1592
|
+
/* @__PURE__ */ t.jsxs(fe, { gutter: 18, className: "py-0 mt-5 relative", children: [
|
|
1593
|
+
/* @__PURE__ */ t.jsx(J, { xs: 18, md: 19, children: /* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "text-gray-700", children: "Your biological sex at the time of birth" }) }),
|
|
1594
|
+
/* @__PURE__ */ t.jsxs(J, { xs: 6, md: 5, className: "flex justify-end group", children: [
|
|
1595
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "text-primary cursor-pointer whitespace-nowrap", children: "Know More" }),
|
|
1596
|
+
/* @__PURE__ */ t.jsxs(I, { className: "hidden group-hover:block w-full absolute left-2 top-6 rounded-md p-4 z-10 text-gray-950 bg-white shadow-[0_0_10px_0_rgba(0,0,0,0.3)]", children: [
|
|
1597
|
+
/* @__PURE__ */ t.jsxs(I, { className: "p-0 mb-3 gap-3", children: [
|
|
1598
|
+
/* @__PURE__ */ t.jsx(
|
|
1599
|
+
"img",
|
|
1600
|
+
{
|
|
1601
|
+
src: "https://cdn.thewellnesscorner.com/twc-web-images/registration/gender-diversity.svg",
|
|
1602
|
+
alt: "gender diversity",
|
|
1603
|
+
width: 44,
|
|
1604
|
+
height: 44,
|
|
1605
|
+
className: "h-auto"
|
|
1606
|
+
}
|
|
1607
|
+
),
|
|
1608
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "text-gray-800", children: "The Wellness Corner respects Gender Diversity & Inclusion!" })
|
|
1609
|
+
] }),
|
|
1610
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "small", className: "text-gray-500", children: "The Wellness Corner aims to provide you with a personalized wellness experience. This requires us to incorporate certain algorithms based on protocols provided by established health & medical institutions around the world. These protocols are based on your biological sex at birth." })
|
|
1611
|
+
] })
|
|
1612
|
+
] })
|
|
1613
|
+
] }),
|
|
1614
|
+
/* @__PURE__ */ t.jsx(
|
|
1615
|
+
q.Item,
|
|
1616
|
+
{
|
|
1617
|
+
name: "gender",
|
|
1618
|
+
className: "mt-3",
|
|
1619
|
+
rules: [{ required: !0, message: "Please select your gender" }],
|
|
1620
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1621
|
+
Lt,
|
|
1622
|
+
{
|
|
1623
|
+
options: b,
|
|
1624
|
+
orientation: "horizontal"
|
|
1625
|
+
}
|
|
1626
|
+
)
|
|
1627
|
+
}
|
|
1628
|
+
),
|
|
1629
|
+
/* @__PURE__ */ t.jsx(
|
|
1630
|
+
q.Item,
|
|
1631
|
+
{
|
|
1632
|
+
name: "dateOfBirth",
|
|
1633
|
+
label: "Date of Birth",
|
|
1634
|
+
className: "mt-5",
|
|
1635
|
+
rules: [{ required: !0, message: "Please select your date of birth" }],
|
|
1636
|
+
children: /* @__PURE__ */ t.jsxs(fe, { gutter: 12, children: [
|
|
1637
|
+
/* @__PURE__ */ t.jsx(J, { xs: 8, children: /* @__PURE__ */ t.jsxs(
|
|
1638
|
+
"select",
|
|
1639
|
+
{
|
|
1640
|
+
value: a.day,
|
|
1641
|
+
onChange: (n) => g("day", n.target.value),
|
|
1642
|
+
className: "w-full h-10 px-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
1643
|
+
children: [
|
|
1644
|
+
/* @__PURE__ */ t.jsx("option", { value: "", children: "Day" }),
|
|
1645
|
+
p().map((n) => /* @__PURE__ */ t.jsx("option", { value: n, children: n }, n))
|
|
1646
|
+
]
|
|
1647
|
+
}
|
|
1648
|
+
) }),
|
|
1649
|
+
/* @__PURE__ */ t.jsx(J, { xs: 8, children: /* @__PURE__ */ t.jsxs(
|
|
1650
|
+
"select",
|
|
1651
|
+
{
|
|
1652
|
+
value: a.month,
|
|
1653
|
+
onChange: (n) => g("month", n.target.value),
|
|
1654
|
+
className: "w-full h-10 px-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
1655
|
+
children: [
|
|
1656
|
+
/* @__PURE__ */ t.jsx("option", { value: "", children: "Month" }),
|
|
1657
|
+
_().map((n, m) => /* @__PURE__ */ t.jsx("option", { value: (m + 1).toString().padStart(2, "0"), children: n }, n))
|
|
1658
|
+
]
|
|
1659
|
+
}
|
|
1660
|
+
) }),
|
|
1661
|
+
/* @__PURE__ */ t.jsx(J, { xs: 8, children: /* @__PURE__ */ t.jsxs(
|
|
1662
|
+
"select",
|
|
1663
|
+
{
|
|
1664
|
+
value: a.year,
|
|
1665
|
+
onChange: (n) => g("year", n.target.value),
|
|
1666
|
+
className: "w-full h-10 px-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",
|
|
1667
|
+
children: [
|
|
1668
|
+
/* @__PURE__ */ t.jsx("option", { value: "", children: "Year" }),
|
|
1669
|
+
F().map((n) => /* @__PURE__ */ t.jsx("option", { value: n, children: n }, n))
|
|
1670
|
+
]
|
|
1671
|
+
}
|
|
1672
|
+
) })
|
|
1673
|
+
] })
|
|
1674
|
+
}
|
|
1675
|
+
),
|
|
1676
|
+
/* @__PURE__ */ t.jsx(
|
|
1677
|
+
q.Item,
|
|
1678
|
+
{
|
|
1679
|
+
name: "referralCode",
|
|
1680
|
+
label: "Referral Code (Optional)",
|
|
1681
|
+
className: "mt-5",
|
|
1682
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1683
|
+
me,
|
|
1684
|
+
{
|
|
1685
|
+
placeholder: "Enter referral code if you have one",
|
|
1686
|
+
maxLength: 20
|
|
1687
|
+
}
|
|
1688
|
+
)
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
/* @__PURE__ */ t.jsx(
|
|
1692
|
+
q.Item,
|
|
1693
|
+
{
|
|
1694
|
+
name: "termsAndConditions",
|
|
1695
|
+
className: "mt-6",
|
|
1696
|
+
rules: [
|
|
1697
|
+
{
|
|
1698
|
+
validator: async (n, m) => {
|
|
1699
|
+
if (!m)
|
|
1700
|
+
throw new Error("You must accept the terms and conditions");
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
],
|
|
1704
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1705
|
+
zt,
|
|
1706
|
+
{
|
|
1707
|
+
value: c.termsAndConditions ? "true" : "false",
|
|
1708
|
+
checked: c.termsAndConditions,
|
|
1709
|
+
onClick: () => {
|
|
1710
|
+
h.setValue("termsAndConditions", !c.termsAndConditions);
|
|
1711
|
+
},
|
|
1712
|
+
label: /* @__PURE__ */ t.jsxs(x, { type: "body", size: "medium", className: "ml-2", children: [
|
|
1713
|
+
"I accept the",
|
|
1714
|
+
/* @__PURE__ */ t.jsx(
|
|
1715
|
+
"a",
|
|
1716
|
+
{
|
|
1717
|
+
href: "/privacy-policy",
|
|
1718
|
+
target: "_blank",
|
|
1719
|
+
rel: "noopener noreferrer",
|
|
1720
|
+
className: "text-primary underline",
|
|
1721
|
+
children: "Terms & Conditions"
|
|
1722
|
+
}
|
|
1723
|
+
),
|
|
1724
|
+
" ",
|
|
1725
|
+
" listed on The Wellness Corner"
|
|
1726
|
+
] })
|
|
1727
|
+
}
|
|
1728
|
+
)
|
|
1729
|
+
}
|
|
1730
|
+
),
|
|
1731
|
+
/* @__PURE__ */ t.jsx(
|
|
1732
|
+
A,
|
|
1733
|
+
{
|
|
1734
|
+
isFullWidth: !0,
|
|
1735
|
+
variant: "primary",
|
|
1736
|
+
loading: f,
|
|
1737
|
+
disabled: !C,
|
|
1738
|
+
className: "mt-6",
|
|
1739
|
+
type: "button",
|
|
1740
|
+
onClick: () => {
|
|
1741
|
+
const n = new Event("submit");
|
|
1742
|
+
n.preventDefault = () => {
|
|
1743
|
+
}, u(n);
|
|
1744
|
+
},
|
|
1745
|
+
children: "Continue"
|
|
1746
|
+
}
|
|
1747
|
+
)
|
|
1748
|
+
] })
|
|
1749
|
+
] });
|
|
1750
|
+
}, or = ({
|
|
1751
|
+
password: i,
|
|
1752
|
+
// Not used - we manage state internally
|
|
1753
|
+
confirmPassword: f,
|
|
1754
|
+
// Not used - we manage state internally
|
|
1755
|
+
loading: d,
|
|
1756
|
+
passwordErrors: u,
|
|
1757
|
+
// Not used - PasswordInput handles validation
|
|
1758
|
+
onPasswordChange: w,
|
|
1759
|
+
onConfirmPasswordChange: h,
|
|
1760
|
+
onSubmit: v,
|
|
1761
|
+
onBack: c
|
|
1762
|
+
}) => {
|
|
1763
|
+
const a = Ce({
|
|
1764
|
+
liveValidation: !0,
|
|
1765
|
+
defaultValues: {
|
|
1766
|
+
password: "",
|
|
1767
|
+
confirmPassword: ""
|
|
1768
|
+
}
|
|
1769
|
+
}), [N, g] = E(!1), [C, b] = E(!1), p = a.watch("password"), _ = a.watch("confirmPassword");
|
|
1770
|
+
K(() => {
|
|
1771
|
+
w(p || "");
|
|
1772
|
+
}, [p]), K(() => {
|
|
1773
|
+
h(_ || "");
|
|
1774
|
+
}, [_]), K(() => {
|
|
1775
|
+
(() => {
|
|
1776
|
+
g(C && p === _ && !!(p && _));
|
|
1777
|
+
})();
|
|
1778
|
+
}, [p, _, C]);
|
|
1779
|
+
const F = (o) => {
|
|
1780
|
+
console.log("🔥 PasswordForm handleSubmit called with values:", o);
|
|
1781
|
+
const D = {
|
|
1782
|
+
preventDefault: () => {
|
|
1783
|
+
},
|
|
1784
|
+
stopPropagation: () => {
|
|
1785
|
+
}
|
|
1786
|
+
};
|
|
1787
|
+
console.log("🔥 Calling onSubmit from PasswordForm"), v(D);
|
|
1788
|
+
}, n = (o) => {
|
|
1789
|
+
b(o);
|
|
1790
|
+
}, m = [
|
|
1791
|
+
{ regex: /.{6,}/, text: "At least 6 characters" },
|
|
1792
|
+
{ regex: /[0-9]/, text: "At least 1 number" },
|
|
1793
|
+
{ regex: /[a-z]/, text: "At least 1 lowercase letter" },
|
|
1794
|
+
{ regex: /[A-Z]/, text: "At least 1 uppercase letter" },
|
|
1795
|
+
{ regex: /[!@#$%^&*()_+]/, text: "At least 1 special character" }
|
|
1796
|
+
];
|
|
1797
|
+
return /* @__PURE__ */ t.jsxs(I, { direction: "column", children: [
|
|
1798
|
+
/* @__PURE__ */ t.jsx(
|
|
1799
|
+
A,
|
|
1800
|
+
{
|
|
1801
|
+
variant: "link",
|
|
1802
|
+
leftIcon: /* @__PURE__ */ t.jsx(he, {}),
|
|
1803
|
+
size: "large",
|
|
1804
|
+
className: "self-start p-0 mb-6",
|
|
1805
|
+
onClick: c,
|
|
1806
|
+
children: "Back"
|
|
1807
|
+
}
|
|
1808
|
+
),
|
|
1809
|
+
/* @__PURE__ */ t.jsx(
|
|
1810
|
+
"img",
|
|
1811
|
+
{
|
|
1812
|
+
src: "https://cdn.thewellnesscorner.com/twc-web-images/new-twc_logo.svg",
|
|
1813
|
+
alt: "logo",
|
|
1814
|
+
width: 176,
|
|
1815
|
+
height: 40,
|
|
1816
|
+
className: "lg:hidden block md:mb-10 mb-6 h-auto"
|
|
1817
|
+
}
|
|
1818
|
+
),
|
|
1819
|
+
/* @__PURE__ */ t.jsx(x, { type: "heading", size: "h5", className: "mb-2", children: "Create your Password" }),
|
|
1820
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "md:mb-8 mb-6 text-gray-400", children: "Use a password that's easy to remember and fulfills all the requirements listed below." }),
|
|
1821
|
+
/* @__PURE__ */ t.jsxs("div", { className: "w-full", children: [
|
|
1822
|
+
/* @__PURE__ */ t.jsxs("div", { className: "mb-4", children: [
|
|
1823
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", className: "mb-2 text-gray-700", children: "Password" }),
|
|
1824
|
+
/* @__PURE__ */ t.jsx(
|
|
1825
|
+
Fe,
|
|
1826
|
+
{
|
|
1827
|
+
requirements: m,
|
|
1828
|
+
placeholder: "Enter your password",
|
|
1829
|
+
value: p,
|
|
1830
|
+
onChange: (o) => a.setValue("password", o),
|
|
1831
|
+
onAllRequirementsMet: n
|
|
1832
|
+
}
|
|
1833
|
+
)
|
|
1834
|
+
] }),
|
|
1835
|
+
/* @__PURE__ */ t.jsxs("div", { className: "mb-6", children: [
|
|
1836
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "medium", className: "mb-2 text-gray-700", children: "Confirm Password" }),
|
|
1837
|
+
/* @__PURE__ */ t.jsx(
|
|
1838
|
+
Fe,
|
|
1839
|
+
{
|
|
1840
|
+
requirements: m,
|
|
1841
|
+
showStrengthIndicator: !1,
|
|
1842
|
+
placeholder: "Confirm your password",
|
|
1843
|
+
value: _,
|
|
1844
|
+
onChange: (o) => a.setValue("confirmPassword", o)
|
|
1845
|
+
}
|
|
1846
|
+
),
|
|
1847
|
+
_ && p !== _ && /* @__PURE__ */ t.jsx(x, { type: "body", size: "small", className: "text-red-500 mt-1", children: "Passwords don't match" })
|
|
1848
|
+
] }),
|
|
1849
|
+
/* @__PURE__ */ t.jsx(
|
|
1850
|
+
A,
|
|
1851
|
+
{
|
|
1852
|
+
disabled: !N,
|
|
1853
|
+
isFullWidth: !0,
|
|
1854
|
+
variant: "primary",
|
|
1855
|
+
type: "button",
|
|
1856
|
+
loading: d,
|
|
1857
|
+
className: "hover:border-none mt-6",
|
|
1858
|
+
onClick: (o) => {
|
|
1859
|
+
o.preventDefault(), o.stopPropagation(), console.log("🔥 Button onClick triggered"), F({ password: p, confirmPassword: _ });
|
|
1860
|
+
},
|
|
1861
|
+
children: "Continue"
|
|
1862
|
+
}
|
|
1863
|
+
)
|
|
1864
|
+
] })
|
|
1865
|
+
] });
|
|
1866
|
+
}, dr = ({
|
|
1867
|
+
onRegister: i,
|
|
1868
|
+
onSuccess: f,
|
|
1869
|
+
onError: d,
|
|
1870
|
+
onPasswordValidation: u,
|
|
1871
|
+
// onMobileVerification, // Not implemented yet
|
|
1872
|
+
// makeRequest, // Not used in current implementation
|
|
1873
|
+
initialEmail: w = "",
|
|
1874
|
+
className: h = "",
|
|
1875
|
+
onLoginRedirect: v
|
|
1876
|
+
}) => {
|
|
1877
|
+
const [c, a] = E(Ne.PERSONAL_DETAILS), [N, g] = E(!1), [C, b] = E(w), [p, _] = E({
|
|
1878
|
+
firstName: "",
|
|
1879
|
+
lastName: "",
|
|
1880
|
+
gender: "M",
|
|
1881
|
+
dateOfBirth: "",
|
|
1882
|
+
phoneNumber: "",
|
|
1883
|
+
referralCode: "",
|
|
1884
|
+
termsAndConditions: !1
|
|
1885
|
+
}), [F, n] = E(""), [m, o] = E(""), [D, M] = E([]);
|
|
1886
|
+
K(() => {
|
|
1887
|
+
if (typeof window < "u") {
|
|
1888
|
+
const P = new URLSearchParams(window.location.search).get("email");
|
|
1889
|
+
P && b(P);
|
|
1890
|
+
}
|
|
1891
|
+
}, []);
|
|
1892
|
+
const O = (T) => {
|
|
1893
|
+
if (T.preventDefault(), !p.firstName || !p.lastName || !p.gender || !p.dateOfBirth) {
|
|
1894
|
+
d && d({
|
|
1895
|
+
type: "REGISTRATION_ERROR",
|
|
1896
|
+
message: "Please fill in all required fields"
|
|
1897
|
+
});
|
|
1898
|
+
return;
|
|
1899
|
+
}
|
|
1900
|
+
a(Ne.PASSWORD_CREATION);
|
|
1901
|
+
}, $ = (T) => {
|
|
1902
|
+
if (u)
|
|
1903
|
+
u(T, (P, W) => {
|
|
1904
|
+
M(W);
|
|
1905
|
+
});
|
|
1906
|
+
else {
|
|
1907
|
+
const P = [];
|
|
1908
|
+
T.length < 8 && P.push("Password must be at least 8 characters"), /[A-Z]/.test(T) || P.push("Password must contain at least one uppercase letter"), /[a-z]/.test(T) || P.push("Password must contain at least one lowercase letter"), /[0-9]/.test(T) || P.push("Password must contain at least one number"), /[!@#$%^&*]/.test(T) || P.push("Password must contain at least one special character"), M(P);
|
|
1909
|
+
}
|
|
1910
|
+
}, H = (T) => {
|
|
1911
|
+
n(T), $(T);
|
|
1912
|
+
}, Z = (T) => {
|
|
1913
|
+
o(T);
|
|
1914
|
+
}, ee = (T) => {
|
|
1915
|
+
if (console.log("🔥 handlePasswordSubmit called"), T.preventDefault(), D.length > 0) {
|
|
1916
|
+
d && d({
|
|
1917
|
+
type: "REGISTRATION_ERROR",
|
|
1918
|
+
message: "Please fix password requirements"
|
|
1919
|
+
});
|
|
1920
|
+
return;
|
|
1921
|
+
}
|
|
1922
|
+
if (F !== m) {
|
|
1923
|
+
d && d({
|
|
1924
|
+
type: "REGISTRATION_ERROR",
|
|
1925
|
+
message: "Passwords do not match"
|
|
1926
|
+
});
|
|
1927
|
+
return;
|
|
1928
|
+
}
|
|
1929
|
+
const P = {
|
|
1930
|
+
...p,
|
|
1931
|
+
email: C,
|
|
1932
|
+
password: F
|
|
1933
|
+
};
|
|
1934
|
+
console.log("=== REGISTRATION DATA DEBUG ==="), console.log("personalDetails:", p), console.log("registrationData:", P), console.log("gender:", P.gender), console.log("referralCode:", P.referralCode), console.log("================================"), g(!0), i(P, (W, U, X) => {
|
|
1935
|
+
console.log("🔄 Registration callback received:", { success: W, error: U, token: X ? "present" : "missing" }), g(!1), W && X ? (console.log("✅ Registration successful, calling onSuccess with token:", X), f(X), console.log("✅ onSuccess called")) : (console.log("❌ Registration failed or no token:", { success: W, error: U, token: X }), d && d(U || {
|
|
1936
|
+
type: "REGISTRATION_ERROR",
|
|
1937
|
+
message: "Registration failed. Please try again."
|
|
1938
|
+
}));
|
|
1939
|
+
});
|
|
1940
|
+
}, ne = () => {
|
|
1941
|
+
a(Ne.PERSONAL_DETAILS);
|
|
1942
|
+
}, te = () => {
|
|
1943
|
+
v ? v() : typeof window < "u" && (window.location.href = "/login");
|
|
1944
|
+
};
|
|
1945
|
+
return /* @__PURE__ */ t.jsx(rt, { maxWidth: "fluid", className: `p-0 h-screen overflow-hidden ${h}`, children: /* @__PURE__ */ t.jsxs(fe, { className: "h-full", children: [
|
|
1946
|
+
/* @__PURE__ */ t.jsxs(J, { lg: 10, className: "hidden lg:block relative h-full", children: [
|
|
1947
|
+
/* @__PURE__ */ t.jsx(
|
|
1948
|
+
"img",
|
|
1949
|
+
{
|
|
1950
|
+
src: "https://cdn.thewellnesscorner.com/twc-web-images/login/login-left-bg.jpg",
|
|
1951
|
+
className: "absolute w-full h-full object-cover",
|
|
1952
|
+
alt: "Registration Background"
|
|
1953
|
+
}
|
|
1954
|
+
),
|
|
1955
|
+
/* @__PURE__ */ t.jsx(nt, {})
|
|
1956
|
+
] }),
|
|
1957
|
+
/* @__PURE__ */ t.jsx(J, { xs: 24, lg: 14, className: "overflow-y-auto h-screen", style: {
|
|
1958
|
+
padding: "100px 80px 60px 80px"
|
|
1959
|
+
}, children: /* @__PURE__ */ t.jsxs(
|
|
1960
|
+
I,
|
|
1961
|
+
{
|
|
1962
|
+
direction: "column",
|
|
1963
|
+
className: "w-[90%] md:w-[70%] p-0 my-[35px] md:my-[56px] h-full md:justify-center mx-auto",
|
|
1964
|
+
align: "center",
|
|
1965
|
+
children: [
|
|
1966
|
+
c === Ne.PERSONAL_DETAILS ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1967
|
+
/* @__PURE__ */ t.jsx(I, { direction: "column", className: "p-0", children: /* @__PURE__ */ t.jsx(
|
|
1968
|
+
nr,
|
|
1969
|
+
{
|
|
1970
|
+
personalDetails: p,
|
|
1971
|
+
loading: N,
|
|
1972
|
+
onPersonalDetailsChange: _,
|
|
1973
|
+
onSubmit: O,
|
|
1974
|
+
onBack: te
|
|
1975
|
+
}
|
|
1976
|
+
) }),
|
|
1977
|
+
/* @__PURE__ */ t.jsxs(I, { align: "center", className: "p-0 mt-4 px-12", children: [
|
|
1978
|
+
/* @__PURE__ */ t.jsx(x, { type: "body", size: "large", className: "text-gray-700", children: "Already have an account?" }),
|
|
1979
|
+
/* @__PURE__ */ t.jsx(
|
|
1980
|
+
A,
|
|
1981
|
+
{
|
|
1982
|
+
variant: "link",
|
|
1983
|
+
size: "medium",
|
|
1984
|
+
className: "ml-2 h-auto px-0",
|
|
1985
|
+
onClick: te,
|
|
1986
|
+
children: "Sign-In"
|
|
1987
|
+
}
|
|
1988
|
+
)
|
|
1989
|
+
] })
|
|
1990
|
+
] }) : /* @__PURE__ */ t.jsx(
|
|
1991
|
+
or,
|
|
1992
|
+
{
|
|
1993
|
+
password: F,
|
|
1994
|
+
confirmPassword: m,
|
|
1995
|
+
loading: N,
|
|
1996
|
+
passwordErrors: D,
|
|
1997
|
+
onPasswordChange: H,
|
|
1998
|
+
onConfirmPasswordChange: Z,
|
|
1999
|
+
onSubmit: ee,
|
|
2000
|
+
onBack: ne
|
|
2001
|
+
}
|
|
2002
|
+
),
|
|
2003
|
+
/* @__PURE__ */ t.jsx("div", { className: "px-12", children: /* @__PURE__ */ t.jsxs(I, { padding: "sm", className: "rounded-lg bg-gray-100 md:mt-8 mt-6 gap-3", children: [
|
|
2004
|
+
/* @__PURE__ */ t.jsx(at, { size: 20, className: "min-w-5 text-primary" }),
|
|
2005
|
+
/* @__PURE__ */ t.jsxs(x, { type: "body", size: "small", children: [
|
|
2006
|
+
"For any customer support related queries, please write to us on",
|
|
2007
|
+
" ",
|
|
2008
|
+
/* @__PURE__ */ t.jsx("a", { href: "mailto:support@thewellnesscorner.com", className: "text-primary", children: /* @__PURE__ */ t.jsx("u", { children: "support@thewellnesscorner.com" }) })
|
|
2009
|
+
] })
|
|
2010
|
+
] }) })
|
|
2011
|
+
]
|
|
2012
|
+
}
|
|
2013
|
+
) })
|
|
2014
|
+
] }) });
|
|
2015
|
+
};
|
|
2016
|
+
export {
|
|
2017
|
+
cr as AuthLogin,
|
|
2018
|
+
dr as AuthRegister,
|
|
2019
|
+
Zt as LoginForm,
|
|
2020
|
+
rr as MobileSignIn,
|
|
2021
|
+
or as PasswordForm,
|
|
2022
|
+
nt as PeekExcellenceCarousel,
|
|
2023
|
+
nr as RegistrationForm,
|
|
2024
|
+
tr as SSOLogin,
|
|
2025
|
+
cr as default
|
|
2026
|
+
};
|