@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
252 lines (250 loc) • 8.49 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 { i as j, m as N, ab as E, V as u, X as I, j as s, P as f, g as o, o as n, a2 as P, _ as F, n as T, F as C, U as V, p as A, l as O, e as R, ac as _ } from "../sheerid.js";
import { C as z } from "./CountryComponentWrapper-Ceq-eink.js";
import { F as B, L, P as k, a as w, M as c, C as q } from "./CaptchaComponent-SmUa6m52.js";
import { E as W, P as H } from "./PersonalInfoStepSubmitButton-j44RdZDq.js";
import { B as K, u as S } from "./militaryStepHelpers-0OUuQpBw.js";
import { S as U } from "./StatusComponent-C6J1B7Tl.js";
import { B as X, D as $, A as G } from "./ActiveDutyStartDateComponent-CF9c-0bL.js";
import { C as J } from "./ChangeLocaleComponent-DUnfgQuX.js";
import { P as Q } from "./PersonalInfoStepWrapper-PV06WMKL.js";
const h = ({
intl: i,
verificationService: a
}) => {
const e = a.viewModel, b = a.previousViewModel, { fieldValidationErrors: l } = a, g = a.verificationResponse, y = N(g), r = E(a, i), m = e.localeChoice.value, M = R(), d = (t, D) => {
a.updateViewModel(
S(t, D, a, r)
);
}, x = () => {
const t = A(e, () => {
});
O.info("StepMilitaryStatusComponent submitting form"), a.submitStep(
u.collectMilitaryStatus,
t,
a.previousVerificationResponse || a.verificationResponse
);
};
return (e.status && b && b.status !== e.status || e.status && a.verificationResponse.currentStep === u.collectMilitaryStatus) && x(), I(), /* @__PURE__ */ s.jsxs(
Q,
{
verificationService: a,
step: g.currentStep,
className: "sid-military-personal-info-container",
children: [
/* @__PURE__ */ s.jsx(
f,
{
verificationService: a,
classNameIdentifier: "active-military-personal-info"
}
),
/* @__PURE__ */ s.jsxs(s.Fragment, { children: [
/* @__PURE__ */ s.jsx(J, { verificationService: a }),
/* @__PURE__ */ s.jsx(
z,
{
verificationService: a,
disabled: o("country")?.disabled
}
),
r ? /* @__PURE__ */ s.jsx(
U,
{
segmentId: "military",
value: {
value: e.status,
label: P(i, e.status, _)
},
isErrored: !!l.status,
errorId: "invalidMilitaryStatus",
options: r,
disabled: o("status")?.disabled,
onChange: (t) => {
d("status", t ? t.value : ""), n(
"status",
t ? t.value : "",
a
);
}
}
) : null,
/* @__PURE__ */ s.jsx(
X,
{
isErrored: !!l.organization,
onChange: (t) => {
F(t, a), n("organization", t, a);
},
value: {
value: a.viewModel.organization.id,
label: a.viewModel.organization.name
},
verificationService: a,
disabled: o("organization")?.disabled
}
),
/* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ s.jsx(
B,
{
value: e.firstName,
isErrored: !!l.firstName,
disabled: o("firstName")?.disabled,
onChange: (t) => {
d("firstName", t), n("firstName", t, a);
}
}
),
/* @__PURE__ */ s.jsx(
L,
{
value: e.lastName,
isErrored: !!l.lastName,
disabled: o("lastName")?.disabled,
onChange: (t) => {
d("lastName", t), n("lastName", t, a);
}
}
)
] }),
/* @__PURE__ */ s.jsx(
K,
{
errorId: l.birthDate,
locale: m,
onChange: (t) => {
d("birthDate", t), n("birthDate", t, a);
},
value: e.birthDate,
disabled: o("birthDate")?.disabled
}
),
!!a.programTheme.transitionalMilitaryValidityDays && /* @__PURE__ */ s.jsx(
$,
{
mode: "date",
errorId: l.dischargeDate,
onChange: (t) => {
d("dischargeDate", t), n("dischargeDate", t, a);
},
value: e.dischargeDate,
locale: m,
disabled: o("dischargeDate")?.disabled
}
),
a.programTheme.strictMilitaryValidationEnabled && /* @__PURE__ */ s.jsx(
G,
{
errorId: l.activeDutyStartDate,
locale: m,
onChange: (t) => {
d("activeDutyStartDate", t), n(
"activeDutyStartDate",
t,
a
);
},
value: e.activeDutyStartDate,
disabled: o("activeDutyStartDate")?.disabled,
isRequired: o("activeDutyStartDate")?.requireIfOptional
}
),
/* @__PURE__ */ s.jsx(
W,
{
value: e.email,
isErrored: !!l.email,
explanation: /* @__PURE__ */ s.jsx(
C,
{
id: "emailExplanation",
defaultMessage: "Personal email address is recommended"
}
),
onChange: (t) => {
d("email", t), n("email", t, a);
},
onKeyDown: (t) => T(t),
disabled: o("email")?.disabled
}
),
a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
k,
{
isRequired: !!a.programTheme.smsLoopEnabled,
value: e.phoneNumber,
isErrored: !!l.phoneNumber,
onChange: (t) => {
d("phoneNumber", t), n("phoneNumber", t, a);
},
selectedCountryCode: e.countryChoice && e.countryChoice.value,
disabled: o("phoneNumber")?.disabled
}
) : null,
M.customFormFields.map((t) => /* @__PURE__ */ s.jsx(w, { config: t, verificationService: a })),
/* @__PURE__ */ s.jsx(
c,
{
verificationService: a,
isErrored: !!l.marketConsentValue,
onChange: (t) => {
d("metadata", {
...a.viewModel.metadata,
marketConsentValue: t
}), n(
"marketConsentValue",
t,
a
);
},
viewModel: e,
disabled: o("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ s.jsx(V, { verificationService: a, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ s.jsx(
q,
{
verificationService: a,
isErrored: !!l.captchaToken
}
),
/* @__PURE__ */ s.jsx(
H,
{
step: u.collectActiveMilitaryPersonalInfo,
verificationService: a,
viewModel: e,
failedInstantMatch: y,
buttonText: /* @__PURE__ */ s.jsx(
C,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Military Status"
}
)
}
)
] })
]
}
);
}, p = j(h), na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
StepActiveMilitaryPersonalInfo: h,
StepActiveMilitaryPersonalInfoComponent: p,
default: p
}, Symbol.toStringTag, { value: "Module" })), da = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: p
}, Symbol.toStringTag, { value: "Module" }));
export {
na as S,
da as a
};