@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
203 lines (201 loc) • 6.55 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 { i as N, h as j, j as o, x as F, e as m, y as M, P as I, z, Y as y, a as t, a9 as R, aa as D, ab as P, k as d, ac as T, ad as k, ae as B, o as b, B as L, D as O, $ as V, E as f, f as H, c as g, J as K, H as W, K as q, M as w, N as A, m as J, V as Y } from "../sheerid.js";
const $ = ({
intl: C,
verificationService: s
}) => {
const e = s.viewModel, { fieldValidationErrors: n } = s, p = s.verificationResponse, i = j(p), h = M(), x = e.localeChoice.value, l = (a, u) => {
const r = b(
e,
(E) => {
E[a] = u;
}
);
s.updateViewModel(r);
};
return /* @__PURE__ */ o.jsxs(
F,
{
verificationService: s,
step: p.currentStep,
children: [
/* @__PURE__ */ o.jsx(
I,
{
verificationService: s,
classNameIdentifier: "first-responder"
}
),
/* @__PURE__ */ o.jsx(z, { verificationService: s }),
/* @__PURE__ */ o.jsx(
y,
{
verificationService: s,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ o.jsx(
R,
{
segmentId: "first-responder",
value: {
value: e.status,
label: P(C, e.status, T)
},
isErrored: !!n.status,
errorId: "invalidFirstResponderStatus",
disabled: t("status")?.disabled,
options: D(C, p.availableStatuses),
onChange: (a) => {
l("status", a ? a.value : ""), d(
"status",
a ? a.value : "",
s
);
}
}
),
/* @__PURE__ */ o.jsx(
k,
{
isErrored: !!n.organization,
onChange: (a = B.organization) => {
const u = b(e, (r) => {
r.organization = {
id: a.id,
idExtended: a.idExtended,
name: a.name,
source: a.source
}, e.organization && e.organization.source !== void 0 && (r.organization.source = e.organization.source), m(() => s.programTheme.openOrgSearchEnabled) && m(() => a.id) === 0 && m(() => a.name, "").length > 0 ? r.postalCode = e.postalCode ? e.postalCode : "" : (e.postalCode || e.postalCode === "") && delete r.postalCode;
});
s.updateViewModel(u), d("organization", a, s);
},
value: s.viewModel.organization,
verificationService: s,
disabled: t("organization")?.disabled
}
),
/* @__PURE__ */ o.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ o.jsx(
L,
{
value: e.firstName,
isErrored: !!n.firstName,
disabled: t("firstName")?.disabled,
onChange: (a) => {
l("firstName", a), d("firstName", a, s);
}
}
),
/* @__PURE__ */ o.jsx(
O,
{
value: e.lastName,
isErrored: !!n.lastName,
disabled: t("lastName")?.disabled,
onChange: (a) => {
l("lastName", a), d("lastName", a, s);
}
}
)
] }),
/* @__PURE__ */ o.jsx(
V,
{
errorId: n.birthDate,
locale: x,
onChange: (a) => {
l("birthDate", a), d("birthDate", a, s);
},
value: e.birthDate,
disabled: t("birthDate")?.disabled
}
),
/* @__PURE__ */ o.jsx(
f,
{
value: e.email,
isErrored: !!n.email,
explanation: /* @__PURE__ */ o.jsx(
g,
{
id: "emailExplanation",
defaultMessage: "Needed to send you your unique code"
}
),
onChange: (a) => {
l("email", a), d("email", a, s);
},
onKeyDown: (a) => H(a),
disabled: t("email")?.disabled
}
),
s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled ? /* @__PURE__ */ o.jsx(
K,
{
isRequired: !!s.programTheme.smsLoopEnabled,
value: e.phoneNumber,
isErrored: !!n.phoneNumber,
onChange: (a) => {
l("phoneNumber", a), d("phoneNumber", a, s);
},
selectedCountryCode: e.countryChoice && e.countryChoice.value,
disabled: t("phoneNumber")?.disabled
}
) : null,
m(() => s.programTheme.openOrgSearchEnabled) && m(() => e.organization.id) === 0 && m(() => e.organization.name, "").length > 0 && /* @__PURE__ */ o.jsx(
W,
{
isErrored: !!n.postalCode,
onChange: (a) => {
l("postalCode", a), d("postalCode", a, s);
},
value: e.postalCode,
disabled: t("postalCode")?.disabled
}
),
h.customFormFields.map((a) => /* @__PURE__ */ o.jsx(q, { config: a, verificationService: s })),
/* @__PURE__ */ o.jsx(
w,
{
verificationService: s,
isErrored: !!n.marketConsentValue,
onChange: (a) => {
l("metadata", {
...s.viewModel.metadata,
marketConsentValue: a
}), d("marketConsentValue", a, s);
},
viewModel: e,
disabled: t("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ o.jsx(A, { verificationService: s, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ o.jsx(
J,
{
step: Y.collectFirstResponderPersonalInfo,
verificationService: s,
viewModel: e,
failedInstantMatch: i,
buttonText: /* @__PURE__ */ o.jsx(
g,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My First Responder Status"
}
)
}
)
]
}
);
}, Q = N($);
export {
Q as default
};