@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
274 lines (272 loc) • 8.74 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.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694697559
* BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { i as x, g as n, j as a, c as b, F as p, P as j, a8 as h, _ as E, o as r, Y as M, n as f, U as N, V as F, p as T, e as I } from "../_mysheerid-preview.js";
import { F as P, L as k, P as V, a as z, M as A, C as L } from "./CaptchaComponent-CnWyxiTy.js";
import { E as w, P as H } from "./PersonalInfoStepSubmitButton-v_kWLmEw.js";
import { A as R } from "./AddressComponent-DV2Wsw6k.js";
import { C as B } from "./City-BmrJpnS6.js";
import { S as O } from "./StateSelectComponent-CIpB-Rh1.js";
import { F as U } from "./FormFieldTypeahead-CyKKVK89.js";
import { P as q } from "./PostalCodeComponent-KXVfZkLx.js";
import { C as D } from "./CountryComponentWrapper--2UQ7mXP.js";
import { C as W } from "./ChangeLocaleComponent-Cu2DR-Q3.js";
import { P as K } from "./PersonalInfoStepWrapper-BOBNCgik.js";
const Y = ({
value: i,
isErrored: e,
onChange: o,
verificationService: d,
intl: C,
placeholder: l = "",
disabled: s = !1
}) => n("organization")?.hidden ? null : /* @__PURE__ */ a.jsx(
U,
{
fieldId: "company",
value: i,
verificationService: d,
onChange: (t) => o(t),
placeholder: l || C.formatHTMLMessage({ id: "companyPlaceholder", defaultMessage: "Company" }),
label: /* @__PURE__ */ a.jsx(p, { id: "company", defaultMessage: "Company" }),
errorMessage: e && /* @__PURE__ */ a.jsx(
p,
{
id: "errorId.invalidOrganization",
defaultMessage: "You must select an organization from the list"
}
),
orgSearchUrl: b(
d.viewModel,
d.programTheme
),
showPlaceholderAndHideLabel: !!l,
disabled: s
}
), _ = x(Y), c = ({
intl: i,
verificationService: e
}) => {
const o = e.viewModel, { fieldValidationErrors: d } = e, C = I(), l = (s, m) => {
const t = T(
o,
(u) => {
u[s] = m;
}
);
e.updateViewModel(t);
};
return /* @__PURE__ */ a.jsxs(
K,
{
verificationService: e,
step: e.verificationResponse.currentStep,
children: [
/* @__PURE__ */ a.jsx(
j,
{
verificationService: e,
classNameIdentifier: "employment"
}
),
/* @__PURE__ */ a.jsx(W, { verificationService: e }),
/* @__PURE__ */ a.jsx(
D,
{
verificationService: e,
disabled: n("country")?.disabled,
viewModelDraftDecorator: (s, m) => {
const t = s;
t.shouldCollectAddress = h(
m,
e.programTheme.config.countries
);
const u = ["address1", "city", "state", "postalCode"], g = (t.fieldsToSkipValidation || []).filter(
(y) => !u.includes(y)
);
t.shouldCollectAddress ? t.fieldsToSkipValidation = g.length ? g : void 0 : (t.address1 = "", t.city = "", t.state = "", t.postalCode = "", t.fieldsToSkipValidation = [...g, ...u]);
}
}
),
/* @__PURE__ */ a.jsx(
_,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: n("organization")?.disabled,
onChange: (s) => {
E(s, e), r("organization", s, e);
}
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
P,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: n("firstName")?.disabled,
onChange: (s) => {
l("firstName", s), r("firstName", s, e);
}
}
),
/* @__PURE__ */ a.jsx(
k,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: n("lastName")?.disabled,
onChange: (s) => {
l("lastName", s), r("lastName", s, e);
}
}
)
] }),
h(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsx(
R,
{
isErrored: !!d.address1,
errorId: d.address1,
onChange: (s) => {
l("address1", s), r("address1", s, e);
},
isRequired: !0,
value: o.address1,
disabled: n("address1")?.disabled,
explanation: /* @__PURE__ */ a.jsx(p, { id: "addressExplanation", defaultMessage: "Use your home address" })
}
) : null,
h(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsxs("div", { className: "sid-thirds", children: [
/* @__PURE__ */ a.jsx(
B,
{
isErrored: !!d.city,
errorId: d.city,
onChange: (s) => {
l("city", s), r("city", s, e);
},
value: o.city,
isRequired: !0,
disabled: n("city")?.disabled
}
),
/* @__PURE__ */ a.jsx(
O,
{
isRequired: !0,
options: M(e.programTheme, i),
value: o.state || void 0,
isErrored: !!d.state,
onChange: async (s) => {
const m = s ? s.value : void 0;
l("state", m), r("state", m, e);
},
label: /* @__PURE__ */ a.jsx(p, { id: "state", defaultMessage: "State" }),
disabled: n("state")?.disabled
}
),
/* @__PURE__ */ a.jsx(
q,
{
isErrored: !!d.postalCode,
onChange: (s) => {
l("postalCode", s), r("postalCode", s, e);
},
value: o.postalCode,
disabled: n("postalCode")?.disabled
}
)
] }) : null,
/* @__PURE__ */ a.jsx(
w,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ a.jsx(
p,
{
id: "emailExplanation",
defaultMessage: "Use your work email if you have one"
}
),
onChange: (s) => {
l("email", s), r("email", s, e);
},
onKeyDown: (s) => f(s),
disabled: n("email")?.disabled
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
V,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (s) => {
l("phoneNumber", s), r("phoneNumber", s, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: n("phoneNumber")?.disabled
}
) : null,
C.customFormFields.map((s) => /* @__PURE__ */ a.jsx(z, { config: s, verificationService: e })),
/* @__PURE__ */ a.jsx(
A,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (s) => {
l("metadata", {
...e.viewModel.metadata,
marketConsentValue: s
}), r("marketConsentValue", s, e);
},
viewModel: o,
disabled: n("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ a.jsx(N, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
L,
{
verificationService: e,
isErrored: !!d.captchaToken
}
),
/* @__PURE__ */ a.jsx(
H,
{
step: F.collectEmployeePersonalInfo,
verificationService: e,
viewModel: o,
buttonText: /* @__PURE__ */ a.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Employment Status"
}
)
}
)
]
}
);
}, os = x(c);
export {
os as default
};