@levo-so/studio 0.1.64 → 0.1.65
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/dist/{Beams-I4aWHPVY.js → Beams-BRf_EHmR.js} +1 -1
- package/dist/BillingStep-3JMxE22F.js +203 -0
- package/dist/{Dots-CUmk_uHm.js → Dots-DHyk4_u7.js} +1 -1
- package/dist/{Gradient-ClJiEr54.js → Gradient-MU2Wz9xb.js} +1 -1
- package/dist/{Grid-BgVIobRt.js → Grid-Di1JssWH.js} +1 -1
- package/dist/{MessageCard-CiE4ZR7i.js → MessageCard-D2lLp4eE.js} +1 -1
- package/dist/{Waves-B8-qCWtJ.js → Waves-CnzNxaRY.js} +1 -1
- package/dist/components/bookingCard/BillingStep.d.ts +35 -0
- package/dist/components/bookingCard/BillingStep.d.ts.map +1 -0
- package/dist/components/bookingCard/BookingCard.d.ts +20 -0
- package/dist/components/bookingCard/BookingCard.d.ts.map +1 -1
- package/dist/components/bookingCard/index.d.ts +1 -0
- package/dist/components/bookingCard/index.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingConfirmation.d.ts +4 -0
- package/dist/components/bookingModal/BookingConfirmation.d.ts.map +1 -1
- package/dist/components/bookingModal/BookingModal.d.ts.map +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts +1 -1
- package/dist/components/registerModal/AttendeeForm.d.ts.map +1 -1
- package/dist/components/registerModal/RegisterModal.d.ts.map +1 -1
- package/dist/components/registerModal/RegistrationConfirmationModal.d.ts.map +1 -1
- package/dist/contentEngine/useContentEngine.d.ts.map +1 -1
- package/dist/contentEngine/useContextEngine.d.ts.map +1 -1
- package/dist/core/AccessManager/index.d.ts.map +1 -1
- package/dist/elements/Form.d.ts.map +1 -1
- package/dist/elements/Heading.d.ts.map +1 -1
- package/dist/elements/forum/categoryFilter/CategoryFilter.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comment.d.ts.map +1 -1
- package/dist/elements/forum/comments/Comments.d.ts.map +1 -1
- package/dist/elements/forum/comments/ReplyBox.d.ts.map +1 -1
- package/dist/elements/forum/comments/commentUtility.d.ts.map +1 -1
- package/dist/elements/forum/createForumPost/CreateForumPostModal.d.ts.map +1 -1
- package/dist/elements/forum/utility/index.d.ts.map +1 -1
- package/dist/{elements-C0sYbYML.js → elements-CQPyQ41m.js} +1 -1
- package/dist/{index-BqEvx8Yg.js → index-Bm3Ox5Ky.js} +167 -167
- package/dist/{index-Ccv1uVOU.js → index-BoVbOwhL.js} +2 -2
- package/dist/{index-Cf4jJOnE.js → index-CaY6J1im.js} +236 -160
- package/dist/{index-D_r8laYN.js → index-Cwq8c9bh.js} +2711 -2672
- package/dist/{index-DJS7RFvk.js → index-DJ7HthbO.js} +1 -1
- package/dist/{index-DtRAKt_V.js → index-eeE2Aq54.js} +2 -2
- package/dist/{index-BUgkYYcp.js → index-sUzBLq7s.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as l, Fragment as q } from "react/jsx-runtime";
|
|
3
|
-
import { useLevo as Q, LevoOAuth as I, successToast as
|
|
3
|
+
import { useLevo as Q, useLevoInsights as X, LevoOAuth as I, successToast as Z, errorHandler as ee } from "@levo-so/react";
|
|
4
4
|
import { useState as _, useEffect as G, useRef as R, useMemo as F } from "react";
|
|
5
|
-
import { h as $, A as
|
|
5
|
+
import { h as $, A as te } from "./index-Cwq8c9bh.js";
|
|
6
6
|
import { getLevoError as B } from "@levo-so/core";
|
|
7
7
|
import { useFormik as A } from "formik";
|
|
8
|
-
import { parsePhoneNumberWithError as
|
|
8
|
+
import { parsePhoneNumberWithError as ne } from "libphonenumber-js";
|
|
9
9
|
import * as k from "yup";
|
|
10
|
-
import
|
|
11
|
-
import { ChevronDown as
|
|
12
|
-
import { Popover as
|
|
13
|
-
import { usePhoneInput as
|
|
10
|
+
import re from "react-otp-input";
|
|
11
|
+
import { ChevronDown as oe } from "lucide-react";
|
|
12
|
+
import { Popover as O } from "radix-ui";
|
|
13
|
+
import { usePhoneInput as ie, defaultCountries as P, parseCountry as M, FlagImage as j } from "react-international-phone";
|
|
14
14
|
const z = k.string().required("Email is required").email("Please enter a valid email address").trim(), H = k.string().required("Please enter the verification code").length(4, "Verification code must be 4 digits").matches(/^\d+$/, "Verification code must contain only numbers"), U = k.string().required("Phone number is required").test("phone", "The phone number has incorrect format", (r) => {
|
|
15
15
|
if (!r) return !1;
|
|
16
16
|
try {
|
|
17
|
-
return
|
|
17
|
+
return ne(r)?.isValid() ?? !1;
|
|
18
18
|
} catch {
|
|
19
19
|
return !1;
|
|
20
20
|
}
|
|
21
21
|
}), K = k.object({
|
|
22
22
|
email: z
|
|
23
|
-
}),
|
|
23
|
+
}), se = k.object({
|
|
24
24
|
email: z,
|
|
25
25
|
otp: H
|
|
26
|
-
}), se = k.object({
|
|
27
|
-
phone: U
|
|
28
26
|
}), ae = k.object({
|
|
27
|
+
phone: U
|
|
28
|
+
}), le = k.object({
|
|
29
29
|
phone: U,
|
|
30
30
|
otp: H
|
|
31
|
-
}),
|
|
32
|
-
button:
|
|
33
|
-
content:
|
|
34
|
-
icon:
|
|
35
|
-
spinner:
|
|
36
|
-
iconEnter:
|
|
37
|
-
text:
|
|
31
|
+
}), ce = K, de = "_button_1je4h_2", ue = "_content_1je4h_70", me = "_icon_1je4h_77", pe = "_spinner_1je4h_89", he = "_iconEnter_1je4h_103", fe = "_text_1je4h_119", N = {
|
|
32
|
+
button: de,
|
|
33
|
+
content: ue,
|
|
34
|
+
icon: me,
|
|
35
|
+
spinner: pe,
|
|
36
|
+
iconEnter: he,
|
|
37
|
+
text: fe
|
|
38
38
|
}, E = ({
|
|
39
39
|
className: r,
|
|
40
40
|
children: c,
|
|
41
|
-
isLoading:
|
|
41
|
+
isLoading: t = !1,
|
|
42
42
|
isError: a = !1,
|
|
43
43
|
loadingText: m = "Loading...",
|
|
44
44
|
successText: s = "Success!",
|
|
45
45
|
errorText: o = "Error!",
|
|
46
46
|
variant: h = "default",
|
|
47
47
|
size: u = "default",
|
|
48
|
-
disabled:
|
|
48
|
+
disabled: n,
|
|
49
49
|
...y
|
|
50
50
|
}) => {
|
|
51
|
-
const [v, i] = _(!1), [g, C] = _(!1), [S, p] = _(
|
|
51
|
+
const [v, i] = _(!1), [g, C] = _(!1), [S, p] = _(t);
|
|
52
52
|
G(() => {
|
|
53
|
-
if (S && !
|
|
53
|
+
if (S && !t)
|
|
54
54
|
if (a) {
|
|
55
55
|
C(!0);
|
|
56
56
|
const T = setTimeout(() => {
|
|
@@ -64,9 +64,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
64
64
|
}, 2e3);
|
|
65
65
|
return () => clearTimeout(T);
|
|
66
66
|
}
|
|
67
|
-
p(
|
|
68
|
-
}, [
|
|
69
|
-
const f = () =>
|
|
67
|
+
p(t);
|
|
68
|
+
}, [t, S, a]);
|
|
69
|
+
const f = () => t ? m : v ? s : g ? o : c, V = () => g ? "destructive" : v ? "success" : h, w = () => t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ e("svg", { className: N.spinner, viewBox: "0 0 24 24", children: /* @__PURE__ */ e(
|
|
70
70
|
"circle",
|
|
71
71
|
{
|
|
72
72
|
cx: "12",
|
|
@@ -78,7 +78,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
78
78
|
strokeDasharray: "32",
|
|
79
79
|
strokeDashoffset: "32"
|
|
80
80
|
}
|
|
81
|
-
) }) }) : v && !
|
|
81
|
+
) }) }) : v && !t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", children: [
|
|
82
82
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10", fill: "currentColor" }),
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
84
|
"path",
|
|
@@ -91,7 +91,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
91
91
|
strokeLinejoin: "round"
|
|
92
92
|
}
|
|
93
93
|
)
|
|
94
|
-
] }) }) : g && !
|
|
94
|
+
] }) }) : g && !t ? /* @__PURE__ */ e("div", { className: `${N.icon} ${N.iconEnter}`, children: /* @__PURE__ */ l(
|
|
95
95
|
"svg",
|
|
96
96
|
{
|
|
97
97
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -116,7 +116,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
116
116
|
className: `${N.button} ${r || ""}`,
|
|
117
117
|
"data-variant": V(),
|
|
118
118
|
"data-size": u,
|
|
119
|
-
disabled:
|
|
119
|
+
disabled: n || t,
|
|
120
120
|
...y,
|
|
121
121
|
children: /* @__PURE__ */ l("div", { className: N.content, children: [
|
|
122
122
|
w(),
|
|
@@ -124,13 +124,13 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
124
124
|
] })
|
|
125
125
|
}
|
|
126
126
|
);
|
|
127
|
-
},
|
|
128
|
-
container:
|
|
129
|
-
label:
|
|
130
|
-
inputWrapper:
|
|
131
|
-
input:
|
|
132
|
-
editButton:
|
|
133
|
-
}, Y = ({ email: r, setEmail: c, otpSent:
|
|
127
|
+
}, ge = "_container_wx5fd_1", _e = "_label_wx5fd_5", ve = "_inputWrapper_wx5fd_13", be = "_input_wx5fd_13", ye = "_editButton_wx5fd_38", W = {
|
|
128
|
+
container: ge,
|
|
129
|
+
label: _e,
|
|
130
|
+
inputWrapper: ve,
|
|
131
|
+
input: be,
|
|
132
|
+
editButton: ye
|
|
133
|
+
}, Y = ({ email: r, setEmail: c, otpSent: t, handleReset: a }) => /* @__PURE__ */ l("div", { className: W.container, children: [
|
|
134
134
|
/* @__PURE__ */ e("label", { className: W.label, children: "Email" }),
|
|
135
135
|
/* @__PURE__ */ l("div", { className: W.inputWrapper, children: [
|
|
136
136
|
/* @__PURE__ */ e(
|
|
@@ -141,10 +141,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
141
141
|
onChange: (m) => c(m.target.value),
|
|
142
142
|
className: W.input,
|
|
143
143
|
placeholder: "Enter your email",
|
|
144
|
-
disabled:
|
|
144
|
+
disabled: t
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
|
-
|
|
147
|
+
t && /* @__PURE__ */ e(
|
|
148
148
|
E,
|
|
149
149
|
{
|
|
150
150
|
variant: "outline",
|
|
@@ -154,17 +154,17 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
154
154
|
}
|
|
155
155
|
)
|
|
156
156
|
] })
|
|
157
|
-
] }),
|
|
158
|
-
container:
|
|
159
|
-
iconWrapper:
|
|
160
|
-
icon:
|
|
161
|
-
content:
|
|
162
|
-
title:
|
|
163
|
-
message:
|
|
164
|
-
submessage:
|
|
165
|
-
actions:
|
|
166
|
-
resetButton:
|
|
167
|
-
},
|
|
157
|
+
] }), Ne = "_container_x1dec_1", Se = "_iconWrapper_x1dec_9", xe = "_icon_x1dec_9", Ce = "_content_x1dec_26", we = "_title_x1dec_30", Ee = "_message_x1dec_37", Te = "_submessage_x1dec_49", ke = "_actions_x1dec_55", Be = "_resetButton_x1dec_59", x = {
|
|
158
|
+
container: Ne,
|
|
159
|
+
iconWrapper: Se,
|
|
160
|
+
icon: xe,
|
|
161
|
+
content: Ce,
|
|
162
|
+
title: we,
|
|
163
|
+
message: Ee,
|
|
164
|
+
submessage: Te,
|
|
165
|
+
actions: ke,
|
|
166
|
+
resetButton: Be
|
|
167
|
+
}, We = ({ email: r, onReset: c }) => /* @__PURE__ */ l("div", { className: x.container, children: [
|
|
168
168
|
/* @__PURE__ */ e("div", { className: x.iconWrapper, children: /* @__PURE__ */ e("svg", { className: x.icon, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
169
169
|
"path",
|
|
170
170
|
{
|
|
@@ -183,42 +183,42 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
183
183
|
/* @__PURE__ */ e("p", { className: x.submessage, children: "Click the link in your email to sign in. The link will expire in 15 minutes." })
|
|
184
184
|
] }),
|
|
185
185
|
/* @__PURE__ */ e("div", { className: x.actions, children: /* @__PURE__ */ e(E, { variant: "outline", onClick: c, className: x.resetButton, children: "Use a different email" }) })
|
|
186
|
-
] }),
|
|
187
|
-
container:
|
|
186
|
+
] }), Le = "_container_1mfd3_1", Oe = "_errorContainer_1mfd3_5", Ie = "_divider_1mfd3_9", $e = "_dividerLine_1mfd3_15", Ve = "_dividerText_1mfd3_21", Ae = "_formSection_1mfd3_27", De = "_buttonWrapper_1mfd3_33", Re = "_fullWidthButton_1mfd3_36", Fe = "_oauthContainer_1mfd3_41", Pe = "_googleButton_1mfd3_54", Me = "_googleIcon_1mfd3_78", je = "_errorContent_1mfd3_90", qe = "_errorText_1mfd3_107", Ge = "_errorTitle_1mfd3_112", ze = "_errorMessage_1mfd3_119", He = "_errorDismiss_1mfd3_125", d = {
|
|
187
|
+
container: Le,
|
|
188
188
|
errorContainer: Oe,
|
|
189
|
-
divider:
|
|
190
|
-
dividerLine:
|
|
191
|
-
dividerText:
|
|
192
|
-
formSection:
|
|
193
|
-
buttonWrapper:
|
|
194
|
-
fullWidthButton:
|
|
195
|
-
oauthContainer:
|
|
196
|
-
googleButton:
|
|
197
|
-
googleIcon:
|
|
198
|
-
errorContent:
|
|
199
|
-
errorText:
|
|
200
|
-
errorTitle:
|
|
201
|
-
errorMessage:
|
|
202
|
-
errorDismiss:
|
|
189
|
+
divider: Ie,
|
|
190
|
+
dividerLine: $e,
|
|
191
|
+
dividerText: Ve,
|
|
192
|
+
formSection: Ae,
|
|
193
|
+
buttonWrapper: De,
|
|
194
|
+
fullWidthButton: Re,
|
|
195
|
+
oauthContainer: Fe,
|
|
196
|
+
googleButton: Pe,
|
|
197
|
+
googleIcon: Me,
|
|
198
|
+
errorContent: je,
|
|
199
|
+
errorText: qe,
|
|
200
|
+
errorTitle: Ge,
|
|
201
|
+
errorMessage: ze,
|
|
202
|
+
errorDismiss: He
|
|
203
203
|
}, D = ({ error: r, onDismiss: c }) => /* @__PURE__ */ e("div", { className: d.errorContainer, children: /* @__PURE__ */ l("div", { className: d.errorContent, children: [
|
|
204
204
|
/* @__PURE__ */ l("div", { className: d.errorText, children: [
|
|
205
205
|
r.title && /* @__PURE__ */ e("div", { className: d.errorTitle, children: r.title }),
|
|
206
206
|
/* @__PURE__ */ e("div", { className: d.errorMessage, children: r.message || "An unexpected error occurred" })
|
|
207
207
|
] }),
|
|
208
208
|
c && /* @__PURE__ */ e("button", { onClick: c, className: d.errorDismiss, "aria-label": "Dismiss error", children: "×" })
|
|
209
|
-
] }) }),
|
|
210
|
-
const { sendMagicLink: c } = $(), [
|
|
209
|
+
] }) }), Ue = ({ onMagicLinkSent: r }) => {
|
|
210
|
+
const { sendMagicLink: c } = $(), [t, a] = _(!1), [m, s] = _(null);
|
|
211
211
|
G(() => {
|
|
212
|
-
r?.(
|
|
213
|
-
}, [
|
|
212
|
+
r?.(t);
|
|
213
|
+
}, [t, r]);
|
|
214
214
|
const o = A({
|
|
215
215
|
initialValues: {
|
|
216
216
|
email: ""
|
|
217
217
|
},
|
|
218
|
-
validationSchema:
|
|
218
|
+
validationSchema: ce,
|
|
219
219
|
validateOnChange: !1,
|
|
220
220
|
validateOnBlur: !1,
|
|
221
|
-
onSubmit: async (u, { setSubmitting:
|
|
221
|
+
onSubmit: async (u, { setSubmitting: n, setFieldError: y }) => {
|
|
222
222
|
try {
|
|
223
223
|
s(null), await c(u.email), a(!0);
|
|
224
224
|
} catch (v) {
|
|
@@ -227,13 +227,13 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
227
227
|
y(g.param, g.message);
|
|
228
228
|
}) : s(i);
|
|
229
229
|
} finally {
|
|
230
|
-
|
|
230
|
+
n(!1);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
}), h = () => {
|
|
234
234
|
a(!1), o.resetForm(), s(null);
|
|
235
235
|
};
|
|
236
|
-
return
|
|
236
|
+
return t ? /* @__PURE__ */ e(We, { email: o.values.email, onReset: h }) : /* @__PURE__ */ l(
|
|
237
237
|
"form",
|
|
238
238
|
{
|
|
239
239
|
onSubmit: o.handleSubmit,
|
|
@@ -269,16 +269,16 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
);
|
|
272
|
-
},
|
|
273
|
-
container:
|
|
274
|
-
label:
|
|
275
|
-
inputGroup:
|
|
276
|
-
input:
|
|
277
|
-
resendButton:
|
|
272
|
+
}, Ke = "_container_1c9qn_1", Ye = "_label_1c9qn_5", Je = "_inputGroup_1c9qn_13", Qe = "_input_1c9qn_13", Xe = "_resendButton_1c9qn_36", L = {
|
|
273
|
+
container: Ke,
|
|
274
|
+
label: Ye,
|
|
275
|
+
inputGroup: Je,
|
|
276
|
+
input: Qe,
|
|
277
|
+
resendButton: Xe
|
|
278
278
|
}, J = ({
|
|
279
279
|
otpSent: r,
|
|
280
280
|
isResendingOtp: c,
|
|
281
|
-
otp:
|
|
281
|
+
otp: t,
|
|
282
282
|
resendOTP: a,
|
|
283
283
|
setOtp: m
|
|
284
284
|
}) => {
|
|
@@ -286,16 +286,16 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
286
286
|
a(() => {
|
|
287
287
|
o(30);
|
|
288
288
|
const u = setInterval(() => {
|
|
289
|
-
o((
|
|
289
|
+
o((n) => n <= 1 ? (clearInterval(u), 0) : n - 1);
|
|
290
290
|
}, 1e3);
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
|
-
return r ? /* @__PURE__ */ l("div", { className:
|
|
294
|
-
/* @__PURE__ */ e("label", { className:
|
|
295
|
-
/* @__PURE__ */ e("div", { className:
|
|
296
|
-
|
|
293
|
+
return r ? /* @__PURE__ */ l("div", { className: L.container, children: [
|
|
294
|
+
/* @__PURE__ */ e("label", { className: L.label, children: "Verification Code" }),
|
|
295
|
+
/* @__PURE__ */ e("div", { className: L.inputGroup, children: /* @__PURE__ */ e(
|
|
296
|
+
re,
|
|
297
297
|
{
|
|
298
|
-
value:
|
|
298
|
+
value: t,
|
|
299
299
|
onChange: m,
|
|
300
300
|
numInputs: 4,
|
|
301
301
|
inputStyle: {
|
|
@@ -303,7 +303,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
303
303
|
},
|
|
304
304
|
inputType: "tel",
|
|
305
305
|
skipDefaultStyles: !0,
|
|
306
|
-
renderInput: ({ className: u, ...
|
|
306
|
+
renderInput: ({ className: u, ...n }) => /* @__PURE__ */ e("input", { className: `${L.input} ${u}`, ...n })
|
|
307
307
|
}
|
|
308
308
|
) }),
|
|
309
309
|
/* @__PURE__ */ e(
|
|
@@ -311,18 +311,18 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
311
311
|
{
|
|
312
312
|
onClick: h,
|
|
313
313
|
disabled: c || s > 0,
|
|
314
|
-
className:
|
|
314
|
+
className: L.resendButton,
|
|
315
315
|
children: c ? "Resending..." : s > 0 ? `Resend in ${s}s` : "Resend Code"
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
] }) : null;
|
|
319
|
-
},
|
|
320
|
-
const { sendOTP: r, verifyOTP: c, resendOTP:
|
|
319
|
+
}, Ze = () => {
|
|
320
|
+
const { sendOTP: r, verifyOTP: c, resendOTP: t } = $(), [a, m] = _(!1), [s, o] = _(null), [h, u] = _(!1), n = A({
|
|
321
321
|
initialValues: {
|
|
322
322
|
email: "",
|
|
323
323
|
otp: ""
|
|
324
324
|
},
|
|
325
|
-
validationSchema: a ?
|
|
325
|
+
validationSchema: a ? se : K,
|
|
326
326
|
validateOnChange: !1,
|
|
327
327
|
validateOnBlur: !1,
|
|
328
328
|
onSubmit: async (i, { setSubmitting: g, setFieldError: C }) => {
|
|
@@ -338,10 +338,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}), y = () => {
|
|
341
|
-
m(!1),
|
|
341
|
+
m(!1), n.resetForm(), o(null);
|
|
342
342
|
}, v = async () => {
|
|
343
343
|
try {
|
|
344
|
-
u(!0), o(null), await
|
|
344
|
+
u(!0), o(null), await t({ email: n.values.email });
|
|
345
345
|
} catch (i) {
|
|
346
346
|
const g = B(i);
|
|
347
347
|
o(g);
|
|
@@ -352,7 +352,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
352
352
|
return /* @__PURE__ */ l(
|
|
353
353
|
"form",
|
|
354
354
|
{
|
|
355
|
-
onSubmit:
|
|
355
|
+
onSubmit: n.handleSubmit,
|
|
356
356
|
style: {
|
|
357
357
|
display: "flex",
|
|
358
358
|
flexDirection: "column",
|
|
@@ -362,8 +362,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
362
362
|
/* @__PURE__ */ e(
|
|
363
363
|
Y,
|
|
364
364
|
{
|
|
365
|
-
email:
|
|
366
|
-
setEmail: (i) =>
|
|
365
|
+
email: n.values.email,
|
|
366
|
+
setEmail: (i) => n.setFieldValue("email", i),
|
|
367
367
|
otpSent: a,
|
|
368
368
|
handleReset: y
|
|
369
369
|
}
|
|
@@ -372,8 +372,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
372
372
|
J,
|
|
373
373
|
{
|
|
374
374
|
otpSent: a,
|
|
375
|
-
otp:
|
|
376
|
-
setOtp: (i) =>
|
|
375
|
+
otp: n.values.otp,
|
|
376
|
+
setOtp: (i) => n.setFieldValue("otp", i),
|
|
377
377
|
isResendingOtp: h,
|
|
378
378
|
resendOTP: v
|
|
379
379
|
}
|
|
@@ -382,9 +382,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
382
382
|
E,
|
|
383
383
|
{
|
|
384
384
|
type: "submit",
|
|
385
|
-
isLoading:
|
|
385
|
+
isLoading: n.isSubmitting,
|
|
386
386
|
isError: !!s,
|
|
387
|
-
disabled:
|
|
387
|
+
disabled: n.isSubmitting,
|
|
388
388
|
className: d.fullWidthButton,
|
|
389
389
|
loadingText: "Verifying...",
|
|
390
390
|
errorText: "Verification Failed",
|
|
@@ -394,9 +394,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
394
394
|
E,
|
|
395
395
|
{
|
|
396
396
|
type: "submit",
|
|
397
|
-
isLoading:
|
|
397
|
+
isLoading: n.isSubmitting,
|
|
398
398
|
isError: !!s,
|
|
399
|
-
disabled:
|
|
399
|
+
disabled: n.isSubmitting,
|
|
400
400
|
className: d.fullWidthButton,
|
|
401
401
|
loadingText: "Sending Code...",
|
|
402
402
|
errorText: "Failed to Send",
|
|
@@ -407,20 +407,20 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
407
407
|
]
|
|
408
408
|
}
|
|
409
409
|
);
|
|
410
|
-
},
|
|
411
|
-
label:
|
|
412
|
-
inputWrapper:
|
|
413
|
-
phoneInputWrapper:
|
|
414
|
-
input:
|
|
415
|
-
selector:
|
|
416
|
-
editButton:
|
|
417
|
-
dropdownContent:
|
|
418
|
-
countryItem:
|
|
419
|
-
flag:
|
|
420
|
-
countryName:
|
|
421
|
-
dialCode:
|
|
422
|
-
},
|
|
423
|
-
const [m, s] = _(!1), [o, h] = _(""), u = R(null),
|
|
410
|
+
}, et = "_label_1fvbo_1", tt = "_inputWrapper_1fvbo_9", nt = "_phoneInputWrapper_1fvbo_14", rt = "_input_1fvbo_9", ot = "_selector_1fvbo_41", it = "_editButton_1fvbo_69", st = "_dropdownContent_1fvbo_73", at = "_countryItem_1fvbo_89", lt = "_flag_1fvbo_111", ct = "_countryName_1fvbo_118", dt = "_dialCode_1fvbo_125", b = {
|
|
411
|
+
label: et,
|
|
412
|
+
inputWrapper: tt,
|
|
413
|
+
phoneInputWrapper: nt,
|
|
414
|
+
input: rt,
|
|
415
|
+
selector: ot,
|
|
416
|
+
editButton: it,
|
|
417
|
+
dropdownContent: st,
|
|
418
|
+
countryItem: at,
|
|
419
|
+
flag: lt,
|
|
420
|
+
countryName: ct,
|
|
421
|
+
dialCode: dt
|
|
422
|
+
}, ut = ({ phone: r, setPhone: c, otpSent: t, handleReset: a }) => {
|
|
423
|
+
const [m, s] = _(!1), [o, h] = _(""), u = R(null), n = R(null), { inputValue: y, handlePhoneValueChange: v, inputRef: i, country: g, setCountry: C } = ie({
|
|
424
424
|
defaultCountry: "in",
|
|
425
425
|
value: r,
|
|
426
426
|
countries: P,
|
|
@@ -437,26 +437,26 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
437
437
|
/* @__PURE__ */ e("label", { className: b.label, children: "Phone Number" }),
|
|
438
438
|
/* @__PURE__ */ l("div", { className: b.inputWrapper, children: [
|
|
439
439
|
/* @__PURE__ */ l("div", { className: b.phoneInputWrapper, children: [
|
|
440
|
-
/* @__PURE__ */ l(
|
|
441
|
-
/* @__PURE__ */ e(
|
|
440
|
+
/* @__PURE__ */ l(O.Root, { open: m, onOpenChange: s, children: [
|
|
441
|
+
/* @__PURE__ */ e(O.Trigger, { asChild: !0, disabled: t, children: /* @__PURE__ */ l("button", { type: "button", className: b.selector, disabled: t, children: [
|
|
442
442
|
/* @__PURE__ */ e(j, { iso2: g.iso2, style: { width: "24px", height: "16px" } }),
|
|
443
|
-
/* @__PURE__ */ e(
|
|
443
|
+
/* @__PURE__ */ e(oe, { size: 16, style: { marginLeft: "4px", opacity: 0.5 } })
|
|
444
444
|
] }) }),
|
|
445
|
-
/* @__PURE__ */ e(
|
|
446
|
-
|
|
445
|
+
/* @__PURE__ */ e(O.Portal, { children: /* @__PURE__ */ l(
|
|
446
|
+
O.Content,
|
|
447
447
|
{
|
|
448
448
|
className: b.dropdownContent,
|
|
449
449
|
align: "start",
|
|
450
450
|
side: "bottom",
|
|
451
451
|
sideOffset: 4,
|
|
452
452
|
onOpenAutoFocus: (p) => {
|
|
453
|
-
p.preventDefault(),
|
|
453
|
+
p.preventDefault(), n.current?.focus();
|
|
454
454
|
},
|
|
455
455
|
children: [
|
|
456
456
|
/* @__PURE__ */ e("div", { style: { padding: "0.5rem" }, children: /* @__PURE__ */ e(
|
|
457
457
|
"input",
|
|
458
458
|
{
|
|
459
|
-
ref:
|
|
459
|
+
ref: n,
|
|
460
460
|
type: "text",
|
|
461
461
|
placeholder: "Search country...",
|
|
462
462
|
value: o,
|
|
@@ -489,7 +489,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
489
489
|
else if (w.key === "ArrowUp") {
|
|
490
490
|
w.preventDefault();
|
|
491
491
|
const T = w.currentTarget.previousElementSibling;
|
|
492
|
-
T ? T.focus() :
|
|
492
|
+
T ? T.focus() : n.current?.focus();
|
|
493
493
|
}
|
|
494
494
|
},
|
|
495
495
|
children: [
|
|
@@ -529,11 +529,11 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
529
529
|
value: y,
|
|
530
530
|
onChange: v,
|
|
531
531
|
className: b.input,
|
|
532
|
-
disabled:
|
|
532
|
+
disabled: t
|
|
533
533
|
}
|
|
534
534
|
)
|
|
535
535
|
] }),
|
|
536
|
-
|
|
536
|
+
t && /* @__PURE__ */ e(
|
|
537
537
|
E,
|
|
538
538
|
{
|
|
539
539
|
variant: "outline",
|
|
@@ -544,13 +544,13 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
544
544
|
)
|
|
545
545
|
] })
|
|
546
546
|
] });
|
|
547
|
-
},
|
|
548
|
-
const { sendOTP: r, verifyOTP: c, resendOTP:
|
|
547
|
+
}, mt = () => {
|
|
548
|
+
const { sendOTP: r, verifyOTP: c, resendOTP: t } = $(), [a, m] = _(!1), [s, o] = _(null), [h, u] = _(!1), n = A({
|
|
549
549
|
initialValues: {
|
|
550
550
|
phone: "",
|
|
551
551
|
otp: ""
|
|
552
552
|
},
|
|
553
|
-
validationSchema: a ?
|
|
553
|
+
validationSchema: a ? le : ae,
|
|
554
554
|
validateOnChange: !1,
|
|
555
555
|
validateOnBlur: !1,
|
|
556
556
|
onSubmit: async (i, { setSubmitting: g, setFieldError: C }) => {
|
|
@@ -566,10 +566,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
}), y = () => {
|
|
569
|
-
m(!1),
|
|
569
|
+
m(!1), n.resetForm(), o(null);
|
|
570
570
|
}, v = async () => {
|
|
571
571
|
try {
|
|
572
|
-
u(!0), o(null), await
|
|
572
|
+
u(!0), o(null), await t({ phone: n.values.phone, medium: "whatsapp" });
|
|
573
573
|
} catch (i) {
|
|
574
574
|
const g = B(i);
|
|
575
575
|
o(g);
|
|
@@ -580,7 +580,7 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
580
580
|
return /* @__PURE__ */ l(
|
|
581
581
|
"form",
|
|
582
582
|
{
|
|
583
|
-
onSubmit:
|
|
583
|
+
onSubmit: n.handleSubmit,
|
|
584
584
|
style: {
|
|
585
585
|
display: "flex",
|
|
586
586
|
flexDirection: "column",
|
|
@@ -588,10 +588,10 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
588
588
|
},
|
|
589
589
|
children: [
|
|
590
590
|
/* @__PURE__ */ e(
|
|
591
|
-
|
|
591
|
+
ut,
|
|
592
592
|
{
|
|
593
|
-
phone:
|
|
594
|
-
setPhone: (i) =>
|
|
593
|
+
phone: n.values.phone,
|
|
594
|
+
setPhone: (i) => n.setFieldValue("phone", i),
|
|
595
595
|
otpSent: a,
|
|
596
596
|
handleReset: y
|
|
597
597
|
}
|
|
@@ -600,8 +600,8 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
600
600
|
J,
|
|
601
601
|
{
|
|
602
602
|
otpSent: a,
|
|
603
|
-
otp:
|
|
604
|
-
setOtp: (i) =>
|
|
603
|
+
otp: n.values.otp,
|
|
604
|
+
setOtp: (i) => n.setFieldValue("otp", i),
|
|
605
605
|
isResendingOtp: h,
|
|
606
606
|
resendOTP: v
|
|
607
607
|
}
|
|
@@ -610,9 +610,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
610
610
|
E,
|
|
611
611
|
{
|
|
612
612
|
type: "submit",
|
|
613
|
-
isLoading:
|
|
613
|
+
isLoading: n.isSubmitting,
|
|
614
614
|
isError: !!s,
|
|
615
|
-
disabled:
|
|
615
|
+
disabled: n.isSubmitting,
|
|
616
616
|
className: d.fullWidthButton,
|
|
617
617
|
loadingText: "Verifying...",
|
|
618
618
|
errorText: "Verification Failed",
|
|
@@ -622,9 +622,9 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
622
622
|
E,
|
|
623
623
|
{
|
|
624
624
|
type: "submit",
|
|
625
|
-
isLoading:
|
|
625
|
+
isLoading: n.isSubmitting,
|
|
626
626
|
isError: !!s,
|
|
627
|
-
disabled:
|
|
627
|
+
disabled: n.isSubmitting,
|
|
628
628
|
className: d.fullWidthButton,
|
|
629
629
|
loadingText: "Sending Code...",
|
|
630
630
|
errorText: "Failed to Send",
|
|
@@ -635,21 +635,21 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
635
635
|
]
|
|
636
636
|
}
|
|
637
637
|
);
|
|
638
|
-
},
|
|
638
|
+
}, pt = ({
|
|
639
639
|
method: r,
|
|
640
640
|
onMagicLinkSent: c
|
|
641
641
|
}) => {
|
|
642
642
|
switch (r) {
|
|
643
643
|
case "otp":
|
|
644
|
-
return /* @__PURE__ */ e(
|
|
644
|
+
return /* @__PURE__ */ e(Ze, {});
|
|
645
645
|
case "whatsapp":
|
|
646
|
-
return /* @__PURE__ */ e(
|
|
646
|
+
return /* @__PURE__ */ e(mt, {});
|
|
647
647
|
case "magiclink":
|
|
648
|
-
return /* @__PURE__ */ e(
|
|
648
|
+
return /* @__PURE__ */ e(Ue, { onMagicLinkSent: c });
|
|
649
649
|
default:
|
|
650
650
|
return null;
|
|
651
651
|
}
|
|
652
|
-
},
|
|
652
|
+
}, ht = ({ method: r }) => {
|
|
653
653
|
switch (r) {
|
|
654
654
|
case "google":
|
|
655
655
|
return /* @__PURE__ */ e(I.Button, { provider: "google", children: /* @__PURE__ */ l("button", { className: d.googleButton, children: [
|
|
@@ -670,65 +670,65 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
670
670
|
default:
|
|
671
671
|
return /* @__PURE__ */ e(q, {});
|
|
672
672
|
}
|
|
673
|
-
},
|
|
673
|
+
}, ft = ({
|
|
674
674
|
otpSent: r,
|
|
675
675
|
oAuthTitle: c,
|
|
676
|
-
onOAuthSuccess:
|
|
676
|
+
onOAuthSuccess: t,
|
|
677
677
|
onOAuthError: a,
|
|
678
678
|
oAuthMethods: m
|
|
679
679
|
}) => {
|
|
680
|
-
const {
|
|
680
|
+
const { logger: s } = Q(), o = X();
|
|
681
681
|
return /* @__PURE__ */ e("div", { className: d.oauthContainer, children: !r && /* @__PURE__ */ e(
|
|
682
682
|
I.Container,
|
|
683
683
|
{
|
|
684
684
|
title: c,
|
|
685
685
|
onSuccess: () => {
|
|
686
|
-
|
|
686
|
+
Z("You are logged in successfully", "Login Successful", {
|
|
687
687
|
position: "top-right"
|
|
688
|
-
}), o?.identify(),
|
|
688
|
+
}), o?.identify(), t && t();
|
|
689
689
|
},
|
|
690
|
-
onError: (
|
|
691
|
-
const
|
|
692
|
-
|
|
690
|
+
onError: (h) => {
|
|
691
|
+
const u = B(h);
|
|
692
|
+
s?.error("OAuth login failed", u.message), a && a(u);
|
|
693
693
|
},
|
|
694
|
-
children: m?.map((
|
|
694
|
+
children: m?.map((h) => /* @__PURE__ */ e(ht, { method: h }, h))
|
|
695
695
|
}
|
|
696
696
|
) });
|
|
697
|
-
},
|
|
697
|
+
}, gt = ({
|
|
698
698
|
oAuthMethods: r,
|
|
699
699
|
oAuthTitle: c = "Studio",
|
|
700
|
-
showDivider:
|
|
700
|
+
showDivider: t,
|
|
701
701
|
dividerText: a,
|
|
702
702
|
onOAuthSuccess: m,
|
|
703
703
|
onOAuthError: s
|
|
704
704
|
}) => /* @__PURE__ */ l(q, { children: [
|
|
705
705
|
/* @__PURE__ */ e(
|
|
706
|
-
|
|
706
|
+
ft,
|
|
707
707
|
{
|
|
708
|
-
otpSent: !
|
|
708
|
+
otpSent: !t,
|
|
709
709
|
oAuthTitle: c,
|
|
710
710
|
onOAuthSuccess: m,
|
|
711
711
|
onOAuthError: s,
|
|
712
712
|
oAuthMethods: r
|
|
713
713
|
}
|
|
714
714
|
),
|
|
715
|
-
|
|
715
|
+
t && /* @__PURE__ */ l("div", { className: d.divider, children: [
|
|
716
716
|
/* @__PURE__ */ e("div", { className: d.dividerLine }),
|
|
717
717
|
/* @__PURE__ */ e("div", { className: d.dividerText, children: a }),
|
|
718
718
|
/* @__PURE__ */ e("div", { className: d.dividerLine })
|
|
719
719
|
] })
|
|
720
|
-
] }),
|
|
720
|
+
] }), kt = ({
|
|
721
721
|
className: r,
|
|
722
722
|
oAuthTitle: c = "Studio",
|
|
723
|
-
page:
|
|
723
|
+
page: t,
|
|
724
724
|
magicLinkSent: a,
|
|
725
725
|
setMagicLinkSent: m,
|
|
726
726
|
oAuthMethods: s
|
|
727
727
|
}) => {
|
|
728
|
-
const { refetchLoginStatus: o } = $(), h = F(() =>
|
|
728
|
+
const { refetchLoginStatus: o } = $(), h = F(() => t?.access?.[0]?.kind === "authentication" && t?.access?.[0]?.options?.primary_method || "otp", [t?.access]), u = F(() => s || (t?.access?.[0]?.kind === "authentication" ? t?.access?.[0]?.options?.methods?.filter((i) => te.includes(i)) || [] : []), [t?.access, s]), n = () => {
|
|
729
729
|
o();
|
|
730
730
|
}, y = (i) => {
|
|
731
|
-
|
|
731
|
+
ee(i);
|
|
732
732
|
}, v = () => {
|
|
733
733
|
switch (h) {
|
|
734
734
|
case "whatsapp":
|
|
@@ -741,18 +741,18 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
741
741
|
};
|
|
742
742
|
return /* @__PURE__ */ l("div", { className: `${d.container} ${r || ""}`, children: [
|
|
743
743
|
u.length > 0 && !a && /* @__PURE__ */ e(
|
|
744
|
-
|
|
744
|
+
gt,
|
|
745
745
|
{
|
|
746
746
|
oAuthMethods: u,
|
|
747
747
|
oAuthTitle: c,
|
|
748
748
|
showDivider: !0,
|
|
749
749
|
dividerText: v(),
|
|
750
|
-
onOAuthSuccess:
|
|
750
|
+
onOAuthSuccess: n,
|
|
751
751
|
onOAuthError: y
|
|
752
752
|
}
|
|
753
753
|
),
|
|
754
754
|
/* @__PURE__ */ e("div", { className: d.formSection, children: /* @__PURE__ */ e(
|
|
755
|
-
|
|
755
|
+
pt,
|
|
756
756
|
{
|
|
757
757
|
method: h,
|
|
758
758
|
onMagicLinkSent: m
|
|
@@ -761,5 +761,5 @@ const z = k.string().required("Email is required").email("Please enter a valid e
|
|
|
761
761
|
] });
|
|
762
762
|
};
|
|
763
763
|
export {
|
|
764
|
-
|
|
764
|
+
kt as L
|
|
765
765
|
};
|