@cedros/login-react 0.0.40 → 0.0.41
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/{AuthenticationSettings-DUXpyiJ5.js → AuthenticationSettings-CSoFp-_2.js} +1 -1
- package/dist/{AuthenticationSettings-DUXpyiJ5.js.map → AuthenticationSettings-CSoFp-_2.js.map} +1 -1
- package/dist/{AuthenticationSettings-Dk1LX0CK.cjs → AuthenticationSettings-Cu5Z2mTC.cjs} +1 -1
- package/dist/{AuthenticationSettings-Dk1LX0CK.cjs.map → AuthenticationSettings-Cu5Z2mTC.cjs.map} +1 -1
- package/dist/{AuthenticationSettings-BF_7Ea6Z.js → AuthenticationSettings-D4ExU-2a.js} +1 -1
- package/dist/{AuthenticationSettings-BF_7Ea6Z.js.map → AuthenticationSettings-D4ExU-2a.js.map} +1 -1
- package/dist/{AuthenticationSettings-BMDrCVSf.cjs → AuthenticationSettings-DABzZHuI.cjs} +1 -1
- package/dist/{AuthenticationSettings-BMDrCVSf.cjs.map → AuthenticationSettings-DABzZHuI.cjs.map} +1 -1
- package/dist/AutosaveStatus-B1A1zORa.cjs +1 -0
- package/dist/AutosaveStatus-B1A1zORa.cjs.map +1 -0
- package/dist/{AutosaveStatus-CSZsp6w7.js → AutosaveStatus-DMjvXzP2.js} +526 -341
- package/dist/AutosaveStatus-DMjvXzP2.js.map +1 -0
- package/dist/CreditSystemSettings-BWuiRTtA.cjs +1 -0
- package/dist/CreditSystemSettings-BWuiRTtA.cjs.map +1 -0
- package/dist/{CreditSystemSettings-Cj21_Ug8.js → CreditSystemSettings-BjQdysRS.js} +1 -1
- package/dist/{CreditSystemSettings-Cj21_Ug8.js.map → CreditSystemSettings-BjQdysRS.js.map} +1 -1
- package/dist/{CreditSystemSettings-CLImarX-.cjs → CreditSystemSettings-DfSfQVE8.cjs} +1 -1
- package/dist/{CreditSystemSettings-CLImarX-.cjs.map → CreditSystemSettings-DfSfQVE8.cjs.map} +1 -1
- package/dist/{CreditSystemSettings-Buu7Y-7I.js → CreditSystemSettings-Du3ac0ID.js} +12 -7
- package/dist/CreditSystemSettings-Du3ac0ID.js.map +1 -0
- package/dist/EmailRegisterForm-CMXsa-_r.js +750 -0
- package/dist/EmailRegisterForm-CMXsa-_r.js.map +1 -0
- package/dist/EmailRegisterForm-i7f4St2N.cjs +1 -0
- package/dist/EmailRegisterForm-i7f4St2N.cjs.map +1 -0
- package/dist/EmailSettings-ASDHfI0K.js +86 -0
- package/dist/EmailSettings-ASDHfI0K.js.map +1 -0
- package/dist/EmailSettings-BcHo0cqk.cjs +1 -0
- package/dist/EmailSettings-BcHo0cqk.cjs.map +1 -0
- package/dist/{EmailSettings-CmxxnrA9.js → EmailSettings-CjngJwDS.js} +1 -1
- package/dist/{EmailSettings-CmxxnrA9.js.map → EmailSettings-CjngJwDS.js.map} +1 -1
- package/dist/{EmailSettings-9sdEAONl.cjs → EmailSettings-CswtKXhb.cjs} +1 -1
- package/dist/{EmailSettings-9sdEAONl.cjs.map → EmailSettings-CswtKXhb.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs → EmbeddedWalletSettings-BXlboZ9-.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-BuLN_Uqc.cjs.map → EmbeddedWalletSettings-BXlboZ9-.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs → EmbeddedWalletSettings-BkwIbTkL.cjs} +1 -1
- package/dist/{EmbeddedWalletSettings-DGq-kXbw.cjs.map → EmbeddedWalletSettings-BkwIbTkL.cjs.map} +1 -1
- package/dist/{EmbeddedWalletSettings-CHkkCjyR.js → EmbeddedWalletSettings-CPLbqlxJ.js} +1 -1
- package/dist/{EmbeddedWalletSettings-CHkkCjyR.js.map → EmbeddedWalletSettings-CPLbqlxJ.js.map} +1 -1
- package/dist/{EmbeddedWalletSettings-M-D5N0eY.js → EmbeddedWalletSettings-CUY_X7Vj.js} +1 -1
- package/dist/{EmbeddedWalletSettings-M-D5N0eY.js.map → EmbeddedWalletSettings-CUY_X7Vj.js.map} +1 -1
- package/dist/{PermissionsSection-DEMVp7X3.cjs → PermissionsSection-B-6DJnN8.cjs} +1 -1
- package/dist/{PermissionsSection-DEMVp7X3.cjs.map → PermissionsSection-B-6DJnN8.cjs.map} +1 -1
- package/dist/{PermissionsSection-DNzOL1xW.js → PermissionsSection-BeFhIgQy.js} +22 -18
- package/dist/{PermissionsSection-DNzOL1xW.js.map → PermissionsSection-BeFhIgQy.js.map} +1 -1
- package/dist/{ServerSettings-DQemMrNv.js → ServerSettings-B9PNMse1.js} +1 -1
- package/dist/{ServerSettings-DQemMrNv.js.map → ServerSettings-B9PNMse1.js.map} +1 -1
- package/dist/{ServerSettings-qxi8aZO7.js → ServerSettings-BLoWX7KG.js} +1 -1
- package/dist/{ServerSettings-qxi8aZO7.js.map → ServerSettings-BLoWX7KG.js.map} +1 -1
- package/dist/{ServerSettings-CMmH5pZv.cjs → ServerSettings-BygCxOTY.cjs} +1 -1
- package/dist/{ServerSettings-CMmH5pZv.cjs.map → ServerSettings-BygCxOTY.cjs.map} +1 -1
- package/dist/{ServerSettings-DfimU7ay.cjs → ServerSettings-CgBdYspU.cjs} +1 -1
- package/dist/{ServerSettings-DfimU7ay.cjs.map → ServerSettings-CgBdYspU.cjs.map} +1 -1
- package/dist/{TeamSection-DopbZClq.cjs → TeamSection-B1t1tU-_.cjs} +1 -1
- package/dist/{TeamSection-DopbZClq.cjs.map → TeamSection-B1t1tU-_.cjs.map} +1 -1
- package/dist/{TeamSection-CoMXyFtz.js → TeamSection-DbSYDRdI.js} +1 -1
- package/dist/{TeamSection-CoMXyFtz.js.map → TeamSection-DbSYDRdI.js.map} +1 -1
- package/dist/{WebhookSettings-B8hAwhZ2.js → WebhookSettings-C-7Yxueu.js} +1 -1
- package/dist/{WebhookSettings-B8hAwhZ2.js.map → WebhookSettings-C-7Yxueu.js.map} +1 -1
- package/dist/{WebhookSettings-8QAqvkkO.js → WebhookSettings-C923ZSKa.js} +1 -1
- package/dist/{WebhookSettings-8QAqvkkO.js.map → WebhookSettings-C923ZSKa.js.map} +1 -1
- package/dist/{WebhookSettings-0sgWRI3U.cjs → WebhookSettings-CbU3cfTJ.cjs} +1 -1
- package/dist/{WebhookSettings-0sgWRI3U.cjs.map → WebhookSettings-CbU3cfTJ.cjs.map} +1 -1
- package/dist/{WebhookSettings-B6Y3Tnjv.cjs → WebhookSettings-D19u9Uok.cjs} +1 -1
- package/dist/{WebhookSettings-B6Y3Tnjv.cjs.map → WebhookSettings-D19u9Uok.cjs.map} +1 -1
- package/dist/admin-only.cjs +1 -1
- package/dist/admin-only.js +1 -1
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.d.ts +1 -1
- package/dist/email-only.js +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3766 -3624
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/{plugin-C_NDZ2-D.js → plugin-BiftIhZe.js} +1 -1
- package/dist/{plugin-C_NDZ2-D.js.map → plugin-BiftIhZe.js.map} +1 -1
- package/dist/{plugin-CUxpAjL-.cjs → plugin-BtQdI_Ay.cjs} +1 -1
- package/dist/{plugin-CUxpAjL-.cjs.map → plugin-BtQdI_Ay.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/AutosaveStatus-BKsCIvPj.cjs +0 -1
- package/dist/AutosaveStatus-BKsCIvPj.cjs.map +0 -1
- package/dist/AutosaveStatus-CSZsp6w7.js.map +0 -1
- package/dist/CreditSystemSettings-Buu7Y-7I.js.map +0 -1
- package/dist/CreditSystemSettings-C2HkyMXy.cjs +0 -1
- package/dist/CreditSystemSettings-C2HkyMXy.cjs.map +0 -1
- package/dist/EmailRegisterForm-CNjYrqU6.cjs +0 -1
- package/dist/EmailRegisterForm-CNjYrqU6.cjs.map +0 -1
- package/dist/EmailRegisterForm-D2VaJouj.js +0 -750
- package/dist/EmailRegisterForm-D2VaJouj.js.map +0 -1
- package/dist/EmailSettings-DRfOF0Sf.js +0 -78
- package/dist/EmailSettings-DRfOF0Sf.js.map +0 -1
- package/dist/EmailSettings-eLlzzI5D.cjs +0 -1
- package/dist/EmailSettings-eLlzzI5D.cjs.map +0 -1
|
@@ -0,0 +1,750 @@
|
|
|
1
|
+
import { jsxs as f, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as F, useState as w, useCallback as E, useEffect as M, useMemo as z, useId as W } from "react";
|
|
3
|
+
import { L as O } from "./LoadingSpinner-6vml-zwr.js";
|
|
4
|
+
import { E as j } from "./ErrorMessage-CcEK0pYO.js";
|
|
5
|
+
import { u as U, A as H, h as P } from "./useCedrosLogin-CFfID-0i.js";
|
|
6
|
+
import { b as B, v as ce } from "./validation-B8kMV3BL.js";
|
|
7
|
+
import { s as ie } from "./sanitization-CQ-H1MSg.js";
|
|
8
|
+
function K(c = {}) {
|
|
9
|
+
const { maxAttempts: m = 5, windowMs: C = 6e4, showCountdown: p = !1 } = c, u = F([]), [o, v] = w(!1), [, b] = w(0), l = E(() => {
|
|
10
|
+
b((n) => n + 1);
|
|
11
|
+
}, []), i = E(() => {
|
|
12
|
+
const n = Date.now();
|
|
13
|
+
u.current = u.current.filter((e) => n - e < C);
|
|
14
|
+
}, [C]), g = E(() => {
|
|
15
|
+
i(), v((n) => u.current.length === 0 && n ? !1 : n);
|
|
16
|
+
}, [i]), a = E(() => (i(), Math.max(0, m - u.current.length)), [i, m]), h = E(() => {
|
|
17
|
+
if (i(), u.current.length === 0)
|
|
18
|
+
return 0;
|
|
19
|
+
const e = u.current[0] + C;
|
|
20
|
+
return Math.max(0, e - Date.now());
|
|
21
|
+
}, [i, C]), k = E(() => (i(), u.current.length < m), [i, m]), N = E(() => {
|
|
22
|
+
if (g(), u.current.length >= m) {
|
|
23
|
+
const n = h(), e = Math.ceil(n / 1e3);
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Too many attempts. Please wait ${e} second${e === 1 ? "" : "s"} before trying again.`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
u.current.push(Date.now()), v((n) => n || !0), l();
|
|
29
|
+
}, [g, m, h, l]), y = E(() => {
|
|
30
|
+
u.current = [], v((n) => n && !1), l();
|
|
31
|
+
}, [l]);
|
|
32
|
+
return M(() => {
|
|
33
|
+
if (!o || !p) return;
|
|
34
|
+
const n = window.setInterval(() => {
|
|
35
|
+
g(), l();
|
|
36
|
+
}, 1e3);
|
|
37
|
+
return () => {
|
|
38
|
+
window.clearInterval(n);
|
|
39
|
+
};
|
|
40
|
+
}, [o, p, l, g]), {
|
|
41
|
+
checkLimit: N,
|
|
42
|
+
isAllowed: k,
|
|
43
|
+
getRemainingAttempts: a,
|
|
44
|
+
getTimeUntilReset: h,
|
|
45
|
+
reset: y
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function le(c) {
|
|
49
|
+
return "mfaRequired" in c && c.mfaRequired === !0;
|
|
50
|
+
}
|
|
51
|
+
function Z() {
|
|
52
|
+
const { config: c, _internal: m } = U(), [C, p] = w(!1), [u, o] = w(null), {
|
|
53
|
+
checkLimit: v,
|
|
54
|
+
getRemainingAttempts: b,
|
|
55
|
+
getTimeUntilReset: l,
|
|
56
|
+
reset: i
|
|
57
|
+
} = K({ maxAttempts: 5, windowMs: 6e4 }), g = z(
|
|
58
|
+
() => new H({
|
|
59
|
+
baseUrl: c.serverUrl,
|
|
60
|
+
timeoutMs: c.requestTimeout,
|
|
61
|
+
retryAttempts: c.retryAttempts
|
|
62
|
+
}),
|
|
63
|
+
[c.serverUrl, c.requestTimeout, c.retryAttempts]
|
|
64
|
+
), a = c.callbacks, h = E(
|
|
65
|
+
async (y, n) => {
|
|
66
|
+
if (!B(y)) {
|
|
67
|
+
const e = {
|
|
68
|
+
code: "VALIDATION_ERROR",
|
|
69
|
+
message: "Please enter a valid email address"
|
|
70
|
+
};
|
|
71
|
+
throw o(e), e;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
v();
|
|
75
|
+
} catch (e) {
|
|
76
|
+
const r = {
|
|
77
|
+
code: "RATE_LIMITED",
|
|
78
|
+
message: e instanceof Error ? e.message : "Too many attempts"
|
|
79
|
+
};
|
|
80
|
+
throw o(r), r;
|
|
81
|
+
}
|
|
82
|
+
p(!0), o(null);
|
|
83
|
+
try {
|
|
84
|
+
const e = await g.post("/login", {
|
|
85
|
+
email: y,
|
|
86
|
+
password: n
|
|
87
|
+
});
|
|
88
|
+
if (le(e))
|
|
89
|
+
return {
|
|
90
|
+
mfaRequired: !0,
|
|
91
|
+
mfaToken: e.mfaToken,
|
|
92
|
+
email: y,
|
|
93
|
+
userId: e.userId
|
|
94
|
+
};
|
|
95
|
+
const r = e;
|
|
96
|
+
return a?.onLoginSuccess?.(r.user, "email"), m?.handleLoginSuccess(r.user, r.tokens), i(), {
|
|
97
|
+
mfaRequired: !1,
|
|
98
|
+
response: r
|
|
99
|
+
};
|
|
100
|
+
} catch (e) {
|
|
101
|
+
const r = P(e, "Unable to sign in. Please try again.");
|
|
102
|
+
throw o(r), r;
|
|
103
|
+
} finally {
|
|
104
|
+
p(!1);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
[g, a, m, v, i]
|
|
108
|
+
), k = E(
|
|
109
|
+
async (y, n, e, r) => {
|
|
110
|
+
if (!B(y)) {
|
|
111
|
+
const s = {
|
|
112
|
+
code: "VALIDATION_ERROR",
|
|
113
|
+
message: "Please enter a valid email address"
|
|
114
|
+
};
|
|
115
|
+
throw o(s), s;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
v();
|
|
119
|
+
} catch (s) {
|
|
120
|
+
const d = {
|
|
121
|
+
code: "RATE_LIMITED",
|
|
122
|
+
message: s instanceof Error ? s.message : "Too many attempts"
|
|
123
|
+
};
|
|
124
|
+
throw o(d), d;
|
|
125
|
+
}
|
|
126
|
+
p(!0), o(null);
|
|
127
|
+
try {
|
|
128
|
+
const s = await g.post("/register", { email: y, password: n, name: e, referral: r });
|
|
129
|
+
return a?.onLoginSuccess?.(s.user, "email"), m?.handleLoginSuccess(s.user, s.tokens), i(), s;
|
|
130
|
+
} catch (s) {
|
|
131
|
+
const d = P(s, "Unable to create your account. Please try again.");
|
|
132
|
+
throw o(d), d;
|
|
133
|
+
} finally {
|
|
134
|
+
p(!1);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
[g, a, m, v, i]
|
|
138
|
+
), N = E(() => o(null), []);
|
|
139
|
+
return {
|
|
140
|
+
login: h,
|
|
141
|
+
register: k,
|
|
142
|
+
isLoading: C,
|
|
143
|
+
error: u,
|
|
144
|
+
clearError: N,
|
|
145
|
+
// M-10: Point-in-time snapshots for UI display (see interface JSDoc)
|
|
146
|
+
remainingAttempts: b(),
|
|
147
|
+
timeUntilReset: l()
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
function q({
|
|
151
|
+
label: c = "Password",
|
|
152
|
+
labelAction: m,
|
|
153
|
+
showStrengthMeter: C = !1,
|
|
154
|
+
onValidationChange: p,
|
|
155
|
+
error: u,
|
|
156
|
+
className: o = "",
|
|
157
|
+
onChange: v,
|
|
158
|
+
value: b,
|
|
159
|
+
...l
|
|
160
|
+
}) {
|
|
161
|
+
const [i, g] = w(!1), [a, h] = w(null), k = W(), N = (n) => {
|
|
162
|
+
const e = n.target.value;
|
|
163
|
+
if (C || p) {
|
|
164
|
+
const r = ce(e);
|
|
165
|
+
h(r), p?.(r);
|
|
166
|
+
}
|
|
167
|
+
v?.(n);
|
|
168
|
+
}, y = {
|
|
169
|
+
weak: "var(--cedros-destructive, #ef4444)",
|
|
170
|
+
fair: "var(--cedros-warning, #f59e0b)",
|
|
171
|
+
good: "var(--cedros-success, #22c55e)",
|
|
172
|
+
strong: "var(--cedros-success, #22c55e)"
|
|
173
|
+
};
|
|
174
|
+
return /* @__PURE__ */ f("div", { className: `cedros-password-input ${o}`, children: [
|
|
175
|
+
/* @__PURE__ */ f("div", { className: "cedros-label-row", children: [
|
|
176
|
+
/* @__PURE__ */ t("label", { htmlFor: k, className: "cedros-label", children: c }),
|
|
177
|
+
m
|
|
178
|
+
] }),
|
|
179
|
+
/* @__PURE__ */ f("div", { className: "cedros-password-wrapper", children: [
|
|
180
|
+
/* @__PURE__ */ t(
|
|
181
|
+
"input",
|
|
182
|
+
{
|
|
183
|
+
id: k,
|
|
184
|
+
type: i ? "text" : "password",
|
|
185
|
+
className: "cedros-input",
|
|
186
|
+
onChange: N,
|
|
187
|
+
value: b,
|
|
188
|
+
"aria-invalid": u ? "true" : void 0,
|
|
189
|
+
"aria-describedby": u ? `${k}-error` : void 0,
|
|
190
|
+
...l
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ t(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
type: "button",
|
|
197
|
+
className: "cedros-password-toggle",
|
|
198
|
+
onClick: () => g(!i),
|
|
199
|
+
"aria-label": i ? "Hide password" : "Show password",
|
|
200
|
+
"aria-pressed": i,
|
|
201
|
+
children: i ? /* @__PURE__ */ f("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
202
|
+
/* @__PURE__ */ t(
|
|
203
|
+
"path",
|
|
204
|
+
{
|
|
205
|
+
d: "M2.5 10s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6-7.5-6-7.5-6z",
|
|
206
|
+
stroke: "currentColor",
|
|
207
|
+
strokeWidth: "1.5"
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ t("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
211
|
+
/* @__PURE__ */ t("path", { d: "M3 17L17 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
212
|
+
] }) : /* @__PURE__ */ f("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
213
|
+
/* @__PURE__ */ t(
|
|
214
|
+
"path",
|
|
215
|
+
{
|
|
216
|
+
d: "M2.5 10s3-6 7.5-6 7.5 6 7.5 6-3 6-7.5 6-7.5-6-7.5-6z",
|
|
217
|
+
stroke: "currentColor",
|
|
218
|
+
strokeWidth: "1.5"
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ t("circle", { cx: "10", cy: "10", r: "2.5", stroke: "currentColor", strokeWidth: "1.5" })
|
|
222
|
+
] })
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] }),
|
|
226
|
+
u && /* @__PURE__ */ t("p", { id: `${k}-error`, className: "cedros-input-error", children: u }),
|
|
227
|
+
C && a && b?.length > 0 && /* @__PURE__ */ f("div", { className: "cedros-password-strength", children: [
|
|
228
|
+
/* @__PURE__ */ t("div", { className: "cedros-strength-bar", children: /* @__PURE__ */ t(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
className: "cedros-strength-fill",
|
|
232
|
+
style: {
|
|
233
|
+
width: `${a.strength === "weak" ? 25 : a.strength === "fair" ? 50 : a.strength === "good" ? 75 : 100}%`,
|
|
234
|
+
backgroundColor: y[a.strength]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
) }),
|
|
238
|
+
/* @__PURE__ */ t("span", { className: "cedros-strength-label", children: a.strength })
|
|
239
|
+
] })
|
|
240
|
+
] });
|
|
241
|
+
}
|
|
242
|
+
function de() {
|
|
243
|
+
const { config: c, _internal: m } = U(), [C, p] = w("idle"), [u, o] = w(!1), [v, b] = w(null), {
|
|
244
|
+
checkLimit: l,
|
|
245
|
+
getRemainingAttempts: i,
|
|
246
|
+
getTimeUntilReset: g,
|
|
247
|
+
reset: a
|
|
248
|
+
} = K({ maxAttempts: 5, windowMs: 12e4 }), h = z(
|
|
249
|
+
() => new H({
|
|
250
|
+
baseUrl: c.serverUrl,
|
|
251
|
+
timeoutMs: c.requestTimeout,
|
|
252
|
+
retryAttempts: c.retryAttempts
|
|
253
|
+
}),
|
|
254
|
+
[c.serverUrl, c.requestTimeout, c.retryAttempts]
|
|
255
|
+
), k = E(
|
|
256
|
+
async (n, e) => {
|
|
257
|
+
const r = /^[A-Z0-9]{16}$/i.test(e) || /^[A-Z0-9]{4}(-[A-Z0-9]{4}){3}$/i.test(e);
|
|
258
|
+
if (!(/^\d{6}$/.test(e) || r)) {
|
|
259
|
+
const d = {
|
|
260
|
+
code: "VALIDATION_ERROR",
|
|
261
|
+
message: "Please enter a valid 6-digit code or recovery code"
|
|
262
|
+
};
|
|
263
|
+
throw b(d), d;
|
|
264
|
+
}
|
|
265
|
+
try {
|
|
266
|
+
l();
|
|
267
|
+
} catch (d) {
|
|
268
|
+
const L = {
|
|
269
|
+
code: "RATE_LIMITED",
|
|
270
|
+
message: d instanceof Error ? d.message : "Too many attempts"
|
|
271
|
+
};
|
|
272
|
+
throw b(L), L;
|
|
273
|
+
}
|
|
274
|
+
o(!0), b(null), p("verifying");
|
|
275
|
+
try {
|
|
276
|
+
const d = await h.post("/login/mfa", { mfaToken: n, code: e });
|
|
277
|
+
return p("success"), a(), m && d.user && d.tokens && m.handleLoginSuccess(d.user, d.tokens), d;
|
|
278
|
+
} catch (d) {
|
|
279
|
+
const L = P(d, "Incorrect verification code. Please check and try again.");
|
|
280
|
+
throw b(L), p("error"), L;
|
|
281
|
+
} finally {
|
|
282
|
+
o(!1);
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
[h, m, l, a]
|
|
286
|
+
), N = E(() => b(null), []), y = E(() => {
|
|
287
|
+
b(null), p("idle"), o(!1);
|
|
288
|
+
}, []);
|
|
289
|
+
return {
|
|
290
|
+
state: C,
|
|
291
|
+
isLoading: u,
|
|
292
|
+
error: v,
|
|
293
|
+
verifyTotp: k,
|
|
294
|
+
clearError: N,
|
|
295
|
+
reset: y,
|
|
296
|
+
// Point-in-time snapshots for UI display
|
|
297
|
+
remainingAttempts: i(),
|
|
298
|
+
timeUntilReset: g()
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const T = 6;
|
|
302
|
+
function ue({
|
|
303
|
+
value: c = "",
|
|
304
|
+
onChange: m,
|
|
305
|
+
onComplete: C,
|
|
306
|
+
disabled: p = !1,
|
|
307
|
+
error: u,
|
|
308
|
+
autoFocus: o = !1,
|
|
309
|
+
className: v = ""
|
|
310
|
+
}) {
|
|
311
|
+
const b = F([]), [l, i] = w(c.padEnd(T, "")), g = W();
|
|
312
|
+
M(() => {
|
|
313
|
+
i(c.padEnd(T, ""));
|
|
314
|
+
}, [c]);
|
|
315
|
+
const a = E((e) => {
|
|
316
|
+
e >= 0 && e < T && b.current[e]?.focus();
|
|
317
|
+
}, []), h = E(
|
|
318
|
+
(e) => {
|
|
319
|
+
const r = e.replace(/\D/g, "").slice(0, T);
|
|
320
|
+
i(r.padEnd(T, "")), m?.(r), r.length === T && C?.(r);
|
|
321
|
+
},
|
|
322
|
+
[m, C]
|
|
323
|
+
), k = E(
|
|
324
|
+
(e, r) => {
|
|
325
|
+
if (!/^\d?$/.test(r)) return;
|
|
326
|
+
const s = l.split("");
|
|
327
|
+
s[e] = r;
|
|
328
|
+
const d = s.join("").replace(/ /g, "");
|
|
329
|
+
h(d), r && e < T - 1 && a(e + 1);
|
|
330
|
+
},
|
|
331
|
+
[l, h, a]
|
|
332
|
+
), N = E(
|
|
333
|
+
(e, r) => {
|
|
334
|
+
if (r.key === "Backspace") {
|
|
335
|
+
r.preventDefault();
|
|
336
|
+
const s = l.split("");
|
|
337
|
+
s[e] && s[e] !== " " ? (s[e] = " ", h(s.join("").replace(/ /g, ""))) : e > 0 && (s[e - 1] = " ", h(s.join("").replace(/ /g, "")), a(e - 1));
|
|
338
|
+
} else r.key === "ArrowLeft" && e > 0 ? (r.preventDefault(), a(e - 1)) : r.key === "ArrowRight" && e < T - 1 && (r.preventDefault(), a(e + 1));
|
|
339
|
+
},
|
|
340
|
+
[l, h, a]
|
|
341
|
+
), y = E(
|
|
342
|
+
(e) => {
|
|
343
|
+
e.preventDefault();
|
|
344
|
+
const s = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, T);
|
|
345
|
+
s && (h(s), a(Math.min(s.length, T - 1)));
|
|
346
|
+
},
|
|
347
|
+
[h, a]
|
|
348
|
+
), n = E((e) => {
|
|
349
|
+
e.target.select();
|
|
350
|
+
}, []);
|
|
351
|
+
return M(() => {
|
|
352
|
+
o && !p && b.current[0]?.focus();
|
|
353
|
+
}, [o, p]), /* @__PURE__ */ f("div", { className: `cedros-otp-input ${v}`, children: [
|
|
354
|
+
/* @__PURE__ */ t("div", { className: "cedros-otp-slots", role: "group", "aria-label": "One-time password", children: Array.from({ length: T }).map((e, r) => /* @__PURE__ */ t(
|
|
355
|
+
"input",
|
|
356
|
+
{
|
|
357
|
+
ref: (s) => {
|
|
358
|
+
b.current[r] = s;
|
|
359
|
+
},
|
|
360
|
+
id: `${g}-${r}`,
|
|
361
|
+
type: "text",
|
|
362
|
+
inputMode: "numeric",
|
|
363
|
+
pattern: "[0-9]*",
|
|
364
|
+
maxLength: 1,
|
|
365
|
+
className: `cedros-otp-slot ${u ? "cedros-otp-slot-error" : ""}`,
|
|
366
|
+
value: l[r] === " " ? "" : l[r] || "",
|
|
367
|
+
onChange: (s) => k(r, s.target.value),
|
|
368
|
+
onKeyDown: (s) => N(r, s),
|
|
369
|
+
onPaste: y,
|
|
370
|
+
onFocus: n,
|
|
371
|
+
disabled: p,
|
|
372
|
+
autoComplete: "one-time-code",
|
|
373
|
+
"aria-label": `Digit ${r + 1}`,
|
|
374
|
+
"aria-invalid": u ? "true" : void 0
|
|
375
|
+
},
|
|
376
|
+
r
|
|
377
|
+
)) }),
|
|
378
|
+
u && /* @__PURE__ */ t("p", { className: "cedros-otp-error", role: "alert", children: u })
|
|
379
|
+
] });
|
|
380
|
+
}
|
|
381
|
+
function me({
|
|
382
|
+
mfaToken: c,
|
|
383
|
+
email: m,
|
|
384
|
+
onSuccess: C,
|
|
385
|
+
onBack: p,
|
|
386
|
+
className: u = ""
|
|
387
|
+
}) {
|
|
388
|
+
const { verifyTotp: o, isLoading: v, error: b, clearError: l } = de(), [i, g] = w(""), [a, h] = w(!1), [k, N] = w(""), y = async (r) => {
|
|
389
|
+
const s = r || (a ? k : i);
|
|
390
|
+
if (s)
|
|
391
|
+
try {
|
|
392
|
+
await o(c, s), C?.();
|
|
393
|
+
} catch {
|
|
394
|
+
a ? N("") : g("");
|
|
395
|
+
}
|
|
396
|
+
}, n = (r) => {
|
|
397
|
+
y(r);
|
|
398
|
+
}, e = () => {
|
|
399
|
+
h(!a), l(), g(""), N("");
|
|
400
|
+
};
|
|
401
|
+
return /* @__PURE__ */ f("div", { className: `cedros-totp-verify ${u}`, children: [
|
|
402
|
+
/* @__PURE__ */ f("div", { className: "cedros-totp-verify-header", children: [
|
|
403
|
+
/* @__PURE__ */ f(
|
|
404
|
+
"svg",
|
|
405
|
+
{
|
|
406
|
+
className: "cedros-totp-verify-icon",
|
|
407
|
+
width: "48",
|
|
408
|
+
height: "48",
|
|
409
|
+
viewBox: "0 0 48 48",
|
|
410
|
+
fill: "none",
|
|
411
|
+
"aria-hidden": "true",
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ t("rect", { x: "8", y: "20", width: "32", height: "24", rx: "4", stroke: "currentColor", strokeWidth: "2" }),
|
|
414
|
+
/* @__PURE__ */ t(
|
|
415
|
+
"path",
|
|
416
|
+
{
|
|
417
|
+
d: "M16 20V14a8 8 0 1 1 16 0v6",
|
|
418
|
+
stroke: "currentColor",
|
|
419
|
+
strokeWidth: "2",
|
|
420
|
+
strokeLinecap: "round"
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
/* @__PURE__ */ t("circle", { cx: "24", cy: "32", r: "3", fill: "currentColor" })
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
),
|
|
427
|
+
/* @__PURE__ */ t("h3", { className: "cedros-totp-title", children: "Two-factor authentication" }),
|
|
428
|
+
/* @__PURE__ */ t("p", { className: "cedros-totp-description", children: a ? "Enter one of your recovery codes to sign in." : "Enter the 6-digit code from your authenticator app." }),
|
|
429
|
+
m && /* @__PURE__ */ t("p", { className: "cedros-totp-email", children: m })
|
|
430
|
+
] }),
|
|
431
|
+
a ? /* @__PURE__ */ f("div", { className: "cedros-totp-backup-input", children: [
|
|
432
|
+
/* @__PURE__ */ t(
|
|
433
|
+
"input",
|
|
434
|
+
{
|
|
435
|
+
type: "text",
|
|
436
|
+
className: `cedros-input ${b ? "cedros-input-error" : ""}`,
|
|
437
|
+
placeholder: "Enter recovery code",
|
|
438
|
+
value: k,
|
|
439
|
+
onChange: (r) => {
|
|
440
|
+
N(r.target.value.toUpperCase()), l();
|
|
441
|
+
},
|
|
442
|
+
onKeyDown: (r) => {
|
|
443
|
+
r.key === "Enter" && k && y();
|
|
444
|
+
},
|
|
445
|
+
disabled: v,
|
|
446
|
+
autoFocus: !0,
|
|
447
|
+
autoComplete: "one-time-code"
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
b && /* @__PURE__ */ t("p", { className: "cedros-input-error", role: "alert", children: b.message })
|
|
451
|
+
] }) : /* @__PURE__ */ t(
|
|
452
|
+
ue,
|
|
453
|
+
{
|
|
454
|
+
value: i,
|
|
455
|
+
onChange: (r) => {
|
|
456
|
+
g(r), l();
|
|
457
|
+
},
|
|
458
|
+
onComplete: n,
|
|
459
|
+
disabled: v,
|
|
460
|
+
error: b?.message,
|
|
461
|
+
autoFocus: !0
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
/* @__PURE__ */ t(
|
|
465
|
+
"button",
|
|
466
|
+
{
|
|
467
|
+
type: "button",
|
|
468
|
+
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
469
|
+
onClick: () => y(),
|
|
470
|
+
disabled: v || (a ? !k : i.length !== 6),
|
|
471
|
+
children: v ? /* @__PURE__ */ f(R, { children: [
|
|
472
|
+
/* @__PURE__ */ t(O, { size: "sm" }),
|
|
473
|
+
/* @__PURE__ */ t("span", { children: "Verifying..." })
|
|
474
|
+
] }) : "Verify"
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ f("div", { className: "cedros-totp-verify-footer", children: [
|
|
478
|
+
/* @__PURE__ */ t(
|
|
479
|
+
"button",
|
|
480
|
+
{
|
|
481
|
+
type: "button",
|
|
482
|
+
className: "cedros-link cedros-link-sm",
|
|
483
|
+
onClick: e,
|
|
484
|
+
disabled: v,
|
|
485
|
+
children: a ? "Use authenticator app" : "Use a recovery code"
|
|
486
|
+
}
|
|
487
|
+
),
|
|
488
|
+
p && /* @__PURE__ */ f(R, { children: [
|
|
489
|
+
/* @__PURE__ */ t("span", { className: "cedros-totp-verify-divider", children: "•" }),
|
|
490
|
+
/* @__PURE__ */ t(
|
|
491
|
+
"button",
|
|
492
|
+
{
|
|
493
|
+
type: "button",
|
|
494
|
+
className: "cedros-link cedros-link-sm",
|
|
495
|
+
onClick: p,
|
|
496
|
+
disabled: v,
|
|
497
|
+
children: "Back to login"
|
|
498
|
+
}
|
|
499
|
+
)
|
|
500
|
+
] })
|
|
501
|
+
] })
|
|
502
|
+
] });
|
|
503
|
+
}
|
|
504
|
+
function ke({
|
|
505
|
+
onSuccess: c,
|
|
506
|
+
onSwitchToRegister: m,
|
|
507
|
+
onForgotPassword: C,
|
|
508
|
+
className: p = ""
|
|
509
|
+
}) {
|
|
510
|
+
const { login: u, isLoading: o, error: v, clearError: b } = Z(), [l, i] = w(""), [g, a] = w(""), [h, k] = w(null), [N, y] = w(""), n = async (s) => {
|
|
511
|
+
s.preventDefault();
|
|
512
|
+
try {
|
|
513
|
+
const d = await u(l, g);
|
|
514
|
+
d.mfaRequired ? (k(d.mfaToken), y(d.email)) : c?.();
|
|
515
|
+
} catch {
|
|
516
|
+
}
|
|
517
|
+
}, e = () => {
|
|
518
|
+
k(null), y(""), c?.();
|
|
519
|
+
}, r = () => {
|
|
520
|
+
k(null), y(""), a("");
|
|
521
|
+
};
|
|
522
|
+
return h ? /* @__PURE__ */ t(
|
|
523
|
+
me,
|
|
524
|
+
{
|
|
525
|
+
mfaToken: h,
|
|
526
|
+
email: N,
|
|
527
|
+
onSuccess: e,
|
|
528
|
+
onBack: r,
|
|
529
|
+
className: p
|
|
530
|
+
}
|
|
531
|
+
) : /* @__PURE__ */ f("form", { onSubmit: n, className: `cedros-form ${p}`, children: [
|
|
532
|
+
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
533
|
+
/* @__PURE__ */ t("label", { htmlFor: "email", className: "cedros-label", children: "Email" }),
|
|
534
|
+
/* @__PURE__ */ t(
|
|
535
|
+
"input",
|
|
536
|
+
{
|
|
537
|
+
id: "email",
|
|
538
|
+
type: "email",
|
|
539
|
+
className: "cedros-input",
|
|
540
|
+
value: l,
|
|
541
|
+
onChange: (s) => i(s.target.value),
|
|
542
|
+
placeholder: "you@example.com",
|
|
543
|
+
required: !0,
|
|
544
|
+
"aria-required": "true",
|
|
545
|
+
autoComplete: "email",
|
|
546
|
+
disabled: o
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
] }),
|
|
550
|
+
/* @__PURE__ */ t("div", { className: "cedros-form-field", children: /* @__PURE__ */ t(
|
|
551
|
+
q,
|
|
552
|
+
{
|
|
553
|
+
value: g,
|
|
554
|
+
onChange: (s) => a(s.target.value),
|
|
555
|
+
placeholder: "Enter your password",
|
|
556
|
+
required: !0,
|
|
557
|
+
autoComplete: "current-password",
|
|
558
|
+
disabled: o,
|
|
559
|
+
labelAction: C ? /* @__PURE__ */ t(
|
|
560
|
+
"button",
|
|
561
|
+
{
|
|
562
|
+
type: "button",
|
|
563
|
+
className: "cedros-link cedros-link-muted cedros-link-sm",
|
|
564
|
+
onClick: C,
|
|
565
|
+
children: "Forgot your password?"
|
|
566
|
+
}
|
|
567
|
+
) : void 0
|
|
568
|
+
}
|
|
569
|
+
) }),
|
|
570
|
+
/* @__PURE__ */ t(j, { error: v, onDismiss: b }),
|
|
571
|
+
/* @__PURE__ */ t(
|
|
572
|
+
"button",
|
|
573
|
+
{
|
|
574
|
+
type: "submit",
|
|
575
|
+
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
576
|
+
disabled: o || !l || !g,
|
|
577
|
+
"aria-busy": o,
|
|
578
|
+
children: o ? /* @__PURE__ */ f(R, { children: [
|
|
579
|
+
/* @__PURE__ */ t(O, { size: "sm", announce: !0, label: "Signing in" }),
|
|
580
|
+
/* @__PURE__ */ t("span", { children: "Signing in..." })
|
|
581
|
+
] }) : "Sign in"
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
m && /* @__PURE__ */ f("p", { className: "cedros-form-footer", children: [
|
|
585
|
+
"Don't have an account?",
|
|
586
|
+
" ",
|
|
587
|
+
/* @__PURE__ */ t("button", { type: "button", className: "cedros-link cedros-link-muted", onClick: m, children: "Sign up" })
|
|
588
|
+
] })
|
|
589
|
+
] });
|
|
590
|
+
}
|
|
591
|
+
function Ce({
|
|
592
|
+
onSuccess: c,
|
|
593
|
+
onSwitchToLogin: m,
|
|
594
|
+
className: C = ""
|
|
595
|
+
}) {
|
|
596
|
+
const { config: p } = U(), { register: u, isLoading: o, error: v, clearError: b } = Z(), [l, i] = w(""), [g, a] = w(""), [h, k] = w(""), [N, y] = w(""), [n, e] = w(null), [r, s] = w(null), d = p.forms?.termsOfService, L = p.forms?.emailOptIn, D = d?.show ?? !1, I = d?.required ?? !0, Y = d?.defaultChecked ?? !1, $ = d?.label ?? "I agree to the Terms of Service", G = d?.url, x = ie(G), J = L?.show ?? !1, Q = L?.defaultChecked ?? !1, X = L?.label ?? "Send me updates and news", [S, ee] = w(Y), [te, re] = w(Q), V = h === N, se = n?.isValid ?? !1, _ = g && h && N && V && se && (!D || !I || S) && !o, oe = async (A) => {
|
|
597
|
+
if (A.preventDefault(), s(null), D && I && !S) {
|
|
598
|
+
s({
|
|
599
|
+
code: "VALIDATION_ERROR",
|
|
600
|
+
message: "You must agree to the Terms of Service to continue"
|
|
601
|
+
});
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (_)
|
|
605
|
+
try {
|
|
606
|
+
await u(g, h, l || void 0), c?.();
|
|
607
|
+
} catch {
|
|
608
|
+
}
|
|
609
|
+
}, ae = v || r, ne = () => {
|
|
610
|
+
b(), s(null);
|
|
611
|
+
};
|
|
612
|
+
return /* @__PURE__ */ f("form", { onSubmit: oe, className: `cedros-form ${C}`, children: [
|
|
613
|
+
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
614
|
+
/* @__PURE__ */ f("label", { htmlFor: "name", className: "cedros-label", children: [
|
|
615
|
+
"Name ",
|
|
616
|
+
/* @__PURE__ */ t("span", { className: "cedros-optional", children: "(optional)" })
|
|
617
|
+
] }),
|
|
618
|
+
/* @__PURE__ */ t(
|
|
619
|
+
"input",
|
|
620
|
+
{
|
|
621
|
+
id: "name",
|
|
622
|
+
type: "text",
|
|
623
|
+
className: "cedros-input",
|
|
624
|
+
value: l,
|
|
625
|
+
onChange: (A) => i(A.target.value),
|
|
626
|
+
placeholder: "Your name",
|
|
627
|
+
autoComplete: "name",
|
|
628
|
+
disabled: o
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
] }),
|
|
632
|
+
/* @__PURE__ */ f("div", { className: "cedros-form-field", children: [
|
|
633
|
+
/* @__PURE__ */ t("label", { htmlFor: "register-email", className: "cedros-label", children: "Email" }),
|
|
634
|
+
/* @__PURE__ */ t(
|
|
635
|
+
"input",
|
|
636
|
+
{
|
|
637
|
+
id: "register-email",
|
|
638
|
+
type: "email",
|
|
639
|
+
className: "cedros-input",
|
|
640
|
+
value: g,
|
|
641
|
+
onChange: (A) => a(A.target.value),
|
|
642
|
+
placeholder: "you@example.com",
|
|
643
|
+
required: !0,
|
|
644
|
+
"aria-required": "true",
|
|
645
|
+
autoComplete: "email",
|
|
646
|
+
disabled: o
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
] }),
|
|
650
|
+
/* @__PURE__ */ t("div", { className: "cedros-form-field", children: /* @__PURE__ */ t(
|
|
651
|
+
q,
|
|
652
|
+
{
|
|
653
|
+
value: h,
|
|
654
|
+
onChange: (A) => k(A.target.value),
|
|
655
|
+
placeholder: "Create a password",
|
|
656
|
+
required: !0,
|
|
657
|
+
autoComplete: "new-password",
|
|
658
|
+
disabled: o,
|
|
659
|
+
showStrengthMeter: !0,
|
|
660
|
+
onValidationChange: e
|
|
661
|
+
}
|
|
662
|
+
) }),
|
|
663
|
+
/* @__PURE__ */ t("div", { className: "cedros-form-field", children: /* @__PURE__ */ t(
|
|
664
|
+
q,
|
|
665
|
+
{
|
|
666
|
+
label: "Confirm Password",
|
|
667
|
+
value: N,
|
|
668
|
+
onChange: (A) => y(A.target.value),
|
|
669
|
+
placeholder: "Confirm your password",
|
|
670
|
+
required: !0,
|
|
671
|
+
autoComplete: "new-password",
|
|
672
|
+
disabled: o,
|
|
673
|
+
"aria-invalid": N && !V ? "true" : void 0,
|
|
674
|
+
error: N && !V ? "Passwords do not match" : void 0
|
|
675
|
+
}
|
|
676
|
+
) }),
|
|
677
|
+
D && /* @__PURE__ */ t("div", { className: "cedros-form-field cedros-checkbox-field", children: /* @__PURE__ */ f("label", { className: "cedros-checkbox-label", children: [
|
|
678
|
+
/* @__PURE__ */ t(
|
|
679
|
+
"input",
|
|
680
|
+
{
|
|
681
|
+
type: "checkbox",
|
|
682
|
+
className: "cedros-checkbox",
|
|
683
|
+
checked: S,
|
|
684
|
+
onChange: (A) => ee(A.target.checked),
|
|
685
|
+
disabled: o,
|
|
686
|
+
"aria-required": I
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ f("span", { className: "cedros-checkbox-text", children: [
|
|
690
|
+
x ? /* @__PURE__ */ f(R, { children: [
|
|
691
|
+
$.replace("Terms of Service", "").trim() || "I agree to the",
|
|
692
|
+
" ",
|
|
693
|
+
/* @__PURE__ */ t(
|
|
694
|
+
"a",
|
|
695
|
+
{
|
|
696
|
+
href: x,
|
|
697
|
+
target: "_blank",
|
|
698
|
+
rel: "noopener noreferrer",
|
|
699
|
+
className: "cedros-link",
|
|
700
|
+
children: "Terms of Service"
|
|
701
|
+
}
|
|
702
|
+
)
|
|
703
|
+
] }) : $,
|
|
704
|
+
I && /* @__PURE__ */ t("span", { className: "cedros-required", children: "*" })
|
|
705
|
+
] })
|
|
706
|
+
] }) }),
|
|
707
|
+
J && /* @__PURE__ */ t("div", { className: "cedros-form-field cedros-checkbox-field", children: /* @__PURE__ */ f("label", { className: "cedros-checkbox-label", children: [
|
|
708
|
+
/* @__PURE__ */ t(
|
|
709
|
+
"input",
|
|
710
|
+
{
|
|
711
|
+
type: "checkbox",
|
|
712
|
+
className: "cedros-checkbox",
|
|
713
|
+
checked: te,
|
|
714
|
+
onChange: (A) => re(A.target.checked),
|
|
715
|
+
disabled: o
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
/* @__PURE__ */ t("span", { className: "cedros-checkbox-text", children: X })
|
|
719
|
+
] }) }),
|
|
720
|
+
/* @__PURE__ */ t(j, { error: ae, onDismiss: ne }),
|
|
721
|
+
/* @__PURE__ */ t(
|
|
722
|
+
"button",
|
|
723
|
+
{
|
|
724
|
+
type: "submit",
|
|
725
|
+
className: "cedros-button cedros-button-primary cedros-button-md cedros-button-full",
|
|
726
|
+
disabled: !_,
|
|
727
|
+
"aria-busy": o,
|
|
728
|
+
children: o ? /* @__PURE__ */ f(R, { children: [
|
|
729
|
+
/* @__PURE__ */ t(O, { size: "sm", announce: !0, label: "Creating account" }),
|
|
730
|
+
/* @__PURE__ */ t("span", { children: "Creating account..." })
|
|
731
|
+
] }) : "Create account"
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
m && /* @__PURE__ */ f("p", { className: "cedros-form-footer", children: [
|
|
735
|
+
"Already have an account?",
|
|
736
|
+
" ",
|
|
737
|
+
/* @__PURE__ */ t("button", { type: "button", className: "cedros-link cedros-link-muted", onClick: m, children: "Sign in" })
|
|
738
|
+
] })
|
|
739
|
+
] });
|
|
740
|
+
}
|
|
741
|
+
export {
|
|
742
|
+
ke as E,
|
|
743
|
+
ue as O,
|
|
744
|
+
q as P,
|
|
745
|
+
me as T,
|
|
746
|
+
Ce as a,
|
|
747
|
+
K as b,
|
|
748
|
+
de as c,
|
|
749
|
+
Z as u
|
|
750
|
+
};
|