@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
172 lines (170 loc) • 5.36 kB
JavaScript
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401515326
* BUILD_DATE: Mon Nov 17 2025 17:45:15 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { h as M, a as t, R as g, j as s, x as I, y as N, P as j, z as E, Y as y, Z as F, _ as f, k as n, B as D, D as V, E as R, f as k, c as p, $ as P, a0 as T, J as z, K as q, M as B, N as O, m as L, V as w, o as K } from "../sheerid.js";
const W = ({ verificationService: e }) => {
const o = e.viewModel, { fieldValidationErrors: d } = e, r = e.verificationResponse, b = M(r), u = N(), m = t("memberId")?.requireIfOptional, h = o.localeChoice.value, l = (a, C) => {
const i = K(
o,
(x) => {
x[a] = C;
}
);
e.updateViewModel(i);
};
return g.useEffect(() => {
m ? e.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : e.updateViewModel(
{ fieldsToSkipValidation: ["memberId"] },
{ partial: !0 }
);
}, [m]), /* @__PURE__ */ s.jsxs(
I,
{
verificationService: e,
step: r.currentStep,
children: [
/* @__PURE__ */ s.jsx(
j,
{
verificationService: e,
classNameIdentifier: "member-personal-info"
}
),
/* @__PURE__ */ s.jsx(E, { verificationService: e }),
/* @__PURE__ */ s.jsx(
y,
{
verificationService: e,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ s.jsx(
F,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: t("organization")?.disabled,
onChange: (a) => {
f(a, e), n("organization", a, e);
}
}
),
/* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ s.jsx(
D,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: t("firstName")?.disabled,
onChange: (a) => {
l("firstName", a), n("firstName", a, e);
}
}
),
/* @__PURE__ */ s.jsx(
V,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: t("lastName")?.disabled,
onChange: (a) => {
l("lastName", a), n("lastName", a, e);
}
}
)
] }),
/* @__PURE__ */ s.jsx(
R,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ s.jsx(p, { id: "emailExplanation", defaultMessage: " " }),
onChange: (a) => {
l("email", a), n("email", a, e);
},
onKeyDown: (a) => k(a),
disabled: t("email")?.disabled
}
),
/* @__PURE__ */ s.jsx(
P,
{
errorId: d.birthDate,
locale: h,
isRequired: t("birthDate")?.requireIfOptional,
onChange: (a) => {
l("birthDate", a), n("birthDate", a, e);
},
value: o.birthDate,
disabled: t("birthDate")?.disabled
}
),
/* @__PURE__ */ s.jsx(
T,
{
value: o.memberId,
isErrored: !!d.memberId,
isRequired: m,
disabled: t("memberId")?.disabled,
onChange: (a) => {
l("memberId", a), n("memberId", a, e);
}
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
z,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (a) => {
l("phoneNumber", a), n("phoneNumber", a, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: t("phoneNumber")?.disabled
}
) : null,
u.customFormFields.map((a) => /* @__PURE__ */ s.jsx(q, { config: a, verificationService: e })),
/* @__PURE__ */ s.jsx(
B,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (a) => {
l("metadata", {
...e.viewModel.metadata,
marketConsentValue: a
}), n("marketConsentValue", a, e);
},
viewModel: o,
disabled: t("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ s.jsx(O, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ s.jsx(
L,
{
step: w.collectMemberPersonalInfo,
verificationService: e,
viewModel: o,
failedInstantMatch: b,
buttonText: /* @__PURE__ */ s.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Membership Status"
}
)
}
)
]
}
);
}, A = W;
export {
A as default
};