@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
322 lines (320 loc) • 11 kB
JavaScript
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694684677
* BUILD_DATE: Wed May 13 2026 17:51:24 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { m as D, R as h, ab as E, V as m, f, l as x, X as N, j as t, P as F, g as o, o as d, a2 as P, _ as R, n as T, F as y, Y as V, U as q, i as B, p as O, e as k, ac as A } from "../sheerid.js";
import { F as L, L as z, P as w, a as U, M as W, C as H } from "./CaptchaComponent-SmUa6m52.js";
import { E as K, P as X } from "./PersonalInfoStepSubmitButton-j44RdZDq.js";
import { B as Y, u as _ } from "./militaryStepHelpers-0OUuQpBw.js";
import { S as $ } from "./StatusComponent-C6J1B7Tl.js";
import { B as G, A as J, D as Q } from "./ActiveDutyStartDateComponent-CF9c-0bL.js";
import { C as Z } from "./CountryComponentWrapper-Ceq-eink.js";
import { C as S } from "./ChangeLocaleComponent-DUnfgQuX.js";
import { P as v } from "./PersonalInfoStepWrapper-PV06WMKL.js";
import { C as aa } from "./City-yVVnZQTP.js";
import { A as sa } from "./AddressComponent-AiyIPiCz.js";
import { P as ta } from "./PostalCodeComponent-DrCcV90W.js";
import { S as ea } from "./StateSelectComponent-CChSqKXz.js";
const oa = ({
intl: p,
verificationService: s
}) => {
const e = s.viewModel, g = s.previousViewModel, { fieldValidationErrors: l } = s, u = s.verificationResponse, I = D(u), [i, M] = h.useState([]), C = E(s, p), b = e.localeChoice.value, c = k(), n = (a, r) => {
s.updateViewModel(
_(a, r, s, C)
);
}, j = () => {
const a = O(e, () => {
});
x.info("StepMilitaryStatusComponent submitting form"), s.submitStep(
m.collectMilitaryStatus,
a,
s.previousVerificationResponse || s.verificationResponse
);
};
return (e.status && g && g.status !== e.status || e.status && s.verificationResponse.currentStep === m.collectMilitaryStatus) && j(), h.useEffect(() => {
(async () => {
if (s.verificationResponse.currentStep === m.collectInactiveMilitaryPersonalInfo && e.countryChoice?.value === "US")
try {
const a = await f(
u.verificationId,
m.collectInactiveMilitaryPersonalInfo,
e
);
M(a?.fieldsToCollect?.optional?.map((r) => r.key));
} catch (a) {
x.error(
`Failed to determine fields to collect: ${a}`,
m.collectInactiveMilitaryPersonalInfo
);
}
})();
}, [s.verificationResponse.currentStep, e.countryChoice]), h.useEffect(() => {
e.countryChoice?.value !== "US" && M([]);
}, [e.countryChoice]), N(), /* @__PURE__ */ t.jsxs(
v,
{
verificationService: s,
step: u.currentStep,
className: "sid-military-personal-info-container",
children: [
/* @__PURE__ */ t.jsx(
F,
{
verificationService: s,
classNameIdentifier: "inactive-military-personal-info"
}
),
/* @__PURE__ */ t.jsxs(t.Fragment, { children: [
/* @__PURE__ */ t.jsx(S, { verificationService: s }),
/* @__PURE__ */ t.jsx(
Z,
{
verificationService: s,
disabled: o("country")?.disabled
}
),
C ? /* @__PURE__ */ t.jsx(
$,
{
segmentId: "military",
value: {
value: e.status,
label: P(p, e.status, A)
},
isErrored: !!l.status,
errorId: "invalidMilitaryStatus",
options: C,
disabled: o("status")?.disabled,
onChange: (a) => {
n("status", a ? a.value : ""), d(
"status",
a ? a.value : "",
s
);
}
}
) : null,
/* @__PURE__ */ t.jsx(
G,
{
isErrored: !!l.organization,
onChange: (a) => {
R(a, s), d("organization", a, s);
},
value: {
value: s.viewModel.organization.id,
label: s.viewModel.organization.name
},
verificationService: s,
disabled: o("organization")?.disabled
}
),
/* @__PURE__ */ t.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ t.jsx(
L,
{
value: e.firstName,
isErrored: !!l.firstName,
disabled: o("firstName")?.disabled,
onChange: (a) => {
n("firstName", a), d("firstName", a, s);
}
}
),
/* @__PURE__ */ t.jsx(
z,
{
value: e.lastName,
isErrored: !!l.lastName,
disabled: o("lastName")?.disabled,
onChange: (a) => {
n("lastName", a), d("lastName", a, s);
}
}
)
] }),
/* @__PURE__ */ t.jsx(
Y,
{
errorId: l.birthDate,
locale: b,
onChange: (a) => {
n("birthDate", a), d("birthDate", a, s);
},
value: e.birthDate,
disabled: o("birthDate")?.disabled
}
),
s.programTheme.strictMilitaryValidationEnabled && /* @__PURE__ */ t.jsx(
J,
{
errorId: l.activeDutyStartDate,
locale: b,
onChange: (a) => {
n("activeDutyStartDate", a), d(
"activeDutyStartDate",
a,
s
);
},
value: e.activeDutyStartDate,
disabled: o("activeDutyStartDate")?.disabled
}
),
/* @__PURE__ */ t.jsx(
Q,
{
mode: s.programTheme.transitionalMilitaryValidityDays ? "date" : "month",
errorId: l.dischargeDate,
onChange: (a) => {
n("dischargeDate", a), d("dischargeDate", a, s);
},
value: e.dischargeDate,
locale: b,
disabled: o("dischargeDate")?.disabled
}
),
/* @__PURE__ */ t.jsx(
K,
{
value: e.email,
isErrored: !!l.email,
explanation: /* @__PURE__ */ t.jsx(
y,
{
id: "emailExplanation",
defaultMessage: "Personal email address is recommended"
}
),
onChange: (a) => {
n("email", a), d("email", a, s);
},
onKeyDown: (a) => T(a),
disabled: o("email")?.disabled
}
),
s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled ? /* @__PURE__ */ t.jsx(
w,
{
isRequired: !!s.programTheme.smsLoopEnabled,
value: e.phoneNumber,
isErrored: !!l.phoneNumber,
onChange: (a) => {
n("phoneNumber", a), d("phoneNumber", a, s);
},
selectedCountryCode: e.countryChoice && e.countryChoice.value,
disabled: o("phoneNumber")?.disabled
}
) : null,
i.includes("address1") && /* @__PURE__ */ t.jsx(
sa,
{
value: e.address1,
isErrored: !!l.address1,
errorId: l.address1,
disabled: o("address1")?.disabled,
onChange: (a) => {
n("address1", a), d("address1", a, s);
},
isRequired: o("address1")?.requireIfOptional
}
),
i.includes("city") && /* @__PURE__ */ t.jsx(
aa,
{
value: e.city,
isErrored: !!l.city,
errorId: l.city,
disabled: o("city")?.disabled,
onChange: (a) => {
n("city", a), d("city", a, s);
},
isRequired: o("city")?.requireIfOptional
}
),
i.includes("state") && /* @__PURE__ */ t.jsx(
ea,
{
options: V(s.programTheme, p),
value: e.state || void 0,
isErrored: !!l.state,
onChange: async (a) => {
const r = a ? a.value : void 0;
n("state", r), d("state", r, s);
},
label: /* @__PURE__ */ t.jsx(y, { id: "state", defaultMessage: "State" }),
disabled: o("state")?.disabled,
isRequired: o("state")?.requireIfOptional
}
),
i.includes("postalCode") && /* @__PURE__ */ t.jsx(
ta,
{
required: o("postalCode")?.requireIfOptional,
isErrored: !!l.postalCode,
onChange: (a) => {
n("postalCode", a), d("postalCode", a, s);
},
value: e.postalCode,
disabled: o("postalCode")?.disabled
}
),
c.customFormFields.map((a) => /* @__PURE__ */ t.jsx(U, { config: a, verificationService: s })),
/* @__PURE__ */ t.jsx(
W,
{
verificationService: s,
isErrored: !!l.marketConsentValue,
onChange: (a) => {
n("metadata", {
...s.viewModel.metadata,
marketConsentValue: a
}), d(
"marketConsentValue",
a,
s
);
},
viewModel: e,
disabled: o("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ t.jsx(q, { verificationService: s, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ t.jsx(
H,
{
verificationService: s,
isErrored: !!l.captchaToken
}
),
/* @__PURE__ */ t.jsx(
X,
{
step: m.collectInactiveMilitaryPersonalInfo,
verificationService: s,
viewModel: e,
failedInstantMatch: I,
buttonText: /* @__PURE__ */ t.jsx(
y,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Military Status"
}
)
}
)
] })
]
}
);
}, Ma = B(
oa
);
export {
oa as StepInactiveMilitaryPersonalInfo,
Ma as StepInactiveMilitaryPersonalInfoComponent,
Ma as default
};