@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
177 lines (175 loc) • 5.89 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.113.0-alpha.0
* BUILD_TIMESTAMP: 1750184650058
* BUILD_DATE: Tue Jun 17 2025 18:24:10 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88
*/
import { h as R, g as t, R as T, j as a, t as P, v as k, P as q, w as z, Q as O, T as w, U as B, u as n, x as L, y as W, E as H, e as K, b as j, W as A, X as G, D as Q, G as U, M as X, H as J, f as Y, V as Z, m as _ } from "../_mysheerid-preview.js";
const $ = ({ verificationService: e }) => {
var p, b, u, h, C, i, x, g, M, I, N;
const o = e.viewModel, { fieldValidationErrors: d } = e, r = e.verificationResponse, E = R(r), y = k(), m = (p = t("memberId")) == null ? void 0 : p.requireIfOptional, F = o.localeChoice.value, l = (s, f) => {
const D = _(
o,
(V) => {
V[s] = f;
}
);
e.updateViewModel(D);
};
return T.useEffect(() => {
m ? e.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : e.updateViewModel(
{ fieldsToSkipValidation: ["memberId"] },
{ partial: !0 }
);
}, [m]), /* @__PURE__ */ a.jsxs(
P,
{
verificationService: e,
step: r.currentStep,
children: [
/* @__PURE__ */ a.jsx(
q,
{
verificationService: e,
classNameIdentifier: "member-personal-info"
}
),
/* @__PURE__ */ a.jsx(z, { verificationService: e }),
/* @__PURE__ */ a.jsx(
O,
{
verificationService: e,
disabled: (b = t("country")) == null ? void 0 : b.disabled
}
),
/* @__PURE__ */ a.jsx(
w,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: (u = t("organization")) == null ? void 0 : u.disabled,
onChange: (s) => {
B(s, e), n("organization", s, e);
}
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
L,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: (h = t("firstName")) == null ? void 0 : h.disabled,
onChange: (s) => {
l("firstName", s), n("firstName", s, e);
}
}
),
/* @__PURE__ */ a.jsx(
W,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: (C = t("lastName")) == null ? void 0 : C.disabled,
onChange: (s) => {
l("lastName", s), n("lastName", s, e);
}
}
)
] }),
/* @__PURE__ */ a.jsx(
H,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ a.jsx(j, { id: "emailExplanation", defaultMessage: " " }),
onChange: (s) => {
l("email", s), n("email", s, e);
},
onKeyDown: (s) => K(s),
disabled: (i = t("email")) == null ? void 0 : i.disabled
}
),
/* @__PURE__ */ a.jsx(
A,
{
errorId: d.birthDate,
locale: F,
isRequired: (x = t("birthDate")) == null ? void 0 : x.requireIfOptional,
onChange: (s) => {
l("birthDate", s), n("birthDate", s, e);
},
value: o.birthDate,
disabled: (g = t("birthDate")) == null ? void 0 : g.disabled
}
),
/* @__PURE__ */ a.jsx(
G,
{
value: o.memberId,
isErrored: !!d.memberId,
isRequired: m,
disabled: (M = t("memberId")) == null ? void 0 : M.disabled,
onChange: (s) => {
l("memberId", s), n("memberId", s, e);
}
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
Q,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (s) => {
l("phoneNumber", s), n("phoneNumber", s, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: (I = t("phoneNumber")) == null ? void 0 : I.disabled
}
) : null,
y.customFormFields.map((s) => /* @__PURE__ */ a.jsx(U, { config: s, verificationService: e })),
/* @__PURE__ */ a.jsx(
X,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (s) => {
l("metadata", {
...e.viewModel.metadata,
marketConsentValue: s
}), n("marketConsentValue", s, e);
},
viewModel: o,
disabled: (N = t("marketConsentValue")) == null ? void 0 : N.disabled
}
),
/* @__PURE__ */ a.jsx(J, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
Y,
{
step: Z.collectMemberPersonalInfo,
verificationService: e,
viewModel: o,
failedInstantMatch: E,
buttonText: /* @__PURE__ */ a.jsx(
j,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Membership Status"
}
)
}
)
]
}
);
}, c = $;
export {
c as default
};