@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
204 lines (202 loc) • 6.61 kB
JavaScript
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401626706
* BUILD_DATE: Mon Nov 17 2025 17:47:06 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { k as j, j as o, N, i as m, O as F, m as M, x as I, a2 as z, f as t, ae as y, af as R, ag as D, o as d, ah as T, ai as P, r as g, T as f, U as k, a5 as O, E as L, n as V, Y as B, X as W, Z as q, _ as w, $ as A, p as H, V as K, aj as U } from "./es6-OV3Jb0XZ.js";
import { injectIntl as X, FormattedHTMLMessage as b } from "react-intl";
const Y = ({
intl: C,
verificationService: s
}) => {
const e = s.viewModel, { fieldValidationErrors: n } = s, p = s.verificationResponse, i = j(p), h = F(), x = e.localeChoice.value, l = (a, u) => {
const r = g(
e,
(E) => {
E[a] = u;
}
);
s.updateViewModel(r);
};
return /* @__PURE__ */ o.jsxs(
N,
{
verificationService: s,
step: p.currentStep,
children: [
/* @__PURE__ */ o.jsx(
M,
{
verificationService: s,
classNameIdentifier: "first-responder"
}
),
/* @__PURE__ */ o.jsx(I, { verificationService: s }),
/* @__PURE__ */ o.jsx(
z,
{
verificationService: s,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ o.jsx(
y,
{
segmentId: "first-responder",
value: {
value: e.status,
label: D(C, e.status, U)
},
isErrored: !!n.status,
errorId: "invalidFirstResponderStatus",
disabled: t("status")?.disabled,
options: R(C, p.availableStatuses),
onChange: (a) => {
l("status", a ? a.value : ""), d(
"status",
a ? a.value : "",
s
);
}
}
),
/* @__PURE__ */ o.jsx(
T,
{
isErrored: !!n.organization,
onChange: (a = P.organization) => {
const u = g(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(
f,
{
value: e.firstName,
isErrored: !!n.firstName,
disabled: t("firstName")?.disabled,
onChange: (a) => {
l("firstName", a), d("firstName", a, s);
}
}
),
/* @__PURE__ */ o.jsx(
k,
{
value: e.lastName,
isErrored: !!n.lastName,
disabled: t("lastName")?.disabled,
onChange: (a) => {
l("lastName", a), d("lastName", a, s);
}
}
)
] }),
/* @__PURE__ */ o.jsx(
O,
{
errorId: n.birthDate,
locale: x,
onChange: (a) => {
l("birthDate", a), d("birthDate", a, s);
},
value: e.birthDate,
disabled: t("birthDate")?.disabled
}
),
/* @__PURE__ */ o.jsx(
L,
{
value: e.email,
isErrored: !!n.email,
explanation: /* @__PURE__ */ o.jsx(
b,
{
id: "emailExplanation",
defaultMessage: "Needed to send you your unique code"
}
),
onChange: (a) => {
l("email", a), d("email", a, s);
},
onKeyDown: (a) => V(a),
disabled: t("email")?.disabled
}
),
s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled ? /* @__PURE__ */ o.jsx(
B,
{
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(
H,
{
step: K.collectFirstResponderPersonalInfo,
verificationService: s,
viewModel: e,
failedInstantMatch: i,
buttonText: /* @__PURE__ */ o.jsx(
b,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My First Responder Status"
}
)
}
)
]
}
);
}, $ = X(Y);
export {
$ as default
};