UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

218 lines (216 loc) • 6.86 kB
/** * 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 g, j as a, x, y, P as i, z as j, Y as E, a as t, ah as u, ai as N, _ as M, k as n, B as I, D as T, G as F, c as p, a7 as k, aj as P, ak as V, H as f, E as z, f as A, J as B, K as R, M as D, N as L, m as q, V as w, o as H } from "../sheerid.js"; const K = ({ intl: C, verificationService: e }) => { const o = e.viewModel, { fieldValidationErrors: d } = e, h = y(), m = (s, r) => { const l = H( o, (b) => { b[s] = r; } ); e.updateViewModel(l); }; return /* @__PURE__ */ a.jsxs( x, { verificationService: e, step: e.verificationResponse.currentStep, children: [ /* @__PURE__ */ a.jsx( i, { verificationService: e, classNameIdentifier: "employment" } ), /* @__PURE__ */ a.jsx(j, { verificationService: e }), /* @__PURE__ */ a.jsx( E, { verificationService: e, disabled: t("country")?.disabled, viewModelDraftDecorator: (s, r) => { const l = s; l.shouldCollectAddress = u( r, e.programTheme.config.countries ), l.shouldCollectAddress ? l.fieldsToSkipValidation = void 0 : (l.address1 = "", l.city = "", l.state = "", l.postalCode = "", l.fieldsToSkipValidation = ["address1", "city", "state", "postalCode"]); } } ), /* @__PURE__ */ a.jsx( N, { value: e.viewModel.organization, verificationService: e, isErrored: !!d.organization, disabled: t("organization")?.disabled, onChange: (s) => { M(s, e), n("organization", s, e); } } ), /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ a.jsx( I, { value: o.firstName, isErrored: !!d.firstName, disabled: t("firstName")?.disabled, onChange: (s) => { m("firstName", s), n("firstName", s, e); } } ), /* @__PURE__ */ a.jsx( T, { value: o.lastName, isErrored: !!d.lastName, disabled: t("lastName")?.disabled, onChange: (s) => { m("lastName", s), n("lastName", s, e); } } ) ] }), u( o.countryChoice, e.programTheme.config.countries ) ? /* @__PURE__ */ a.jsx( F, { isErrored: !!d.address1, errorId: d.address1, onChange: (s) => { m("address1", s), n("address1", s, e); }, isRequired: !0, value: o.address1, disabled: t("address1")?.disabled, explanation: /* @__PURE__ */ a.jsx(p, { id: "addressExplanation", defaultMessage: "Use your home address" }) } ) : null, u( o.countryChoice, e.programTheme.config.countries ) ? /* @__PURE__ */ a.jsxs("div", { className: "sid-thirds", children: [ /* @__PURE__ */ a.jsx( k, { isErrored: !!d.city, errorId: d.city, onChange: (s) => { m("city", s), n("city", s, e); }, value: o.city, isRequired: !0, disabled: t("city")?.disabled } ), /* @__PURE__ */ a.jsx( P, { isRequired: !0, options: V(e.programTheme, C), value: o.state || void 0, isErrored: !!d.state, onChange: async (s) => { const r = s ? s.value : void 0; m("state", r), n("state", r, e); }, label: /* @__PURE__ */ a.jsx(p, { id: "state", defaultMessage: "State" }), disabled: t("state")?.disabled } ), /* @__PURE__ */ a.jsx( f, { isErrored: !!d.postalCode, onChange: (s) => { m("postalCode", s), n("postalCode", s, e); }, value: o.postalCode, disabled: t("postalCode")?.disabled } ) ] }) : null, /* @__PURE__ */ a.jsx( z, { value: o.email, isErrored: !!d.email, explanation: /* @__PURE__ */ a.jsx( p, { id: "emailExplanation", defaultMessage: "Use your work email if you have one" } ), onChange: (s) => { m("email", s), n("email", s, e); }, onKeyDown: (s) => A(s), disabled: t("email")?.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( B, { isRequired: !!e.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!d.phoneNumber, onChange: (s) => { m("phoneNumber", s), n("phoneNumber", s, e); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: t("phoneNumber")?.disabled } ) : null, h.customFormFields.map((s) => /* @__PURE__ */ a.jsx(R, { config: s, verificationService: e })), /* @__PURE__ */ a.jsx( D, { verificationService: e, isErrored: !!d.marketConsentValue, onChange: (s) => { m("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), n("marketConsentValue", s, e); }, viewModel: o, disabled: t("marketConsentValue")?.disabled } ), /* @__PURE__ */ a.jsx(L, { verificationService: e, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( q, { step: w.collectEmployeePersonalInfo, verificationService: e, viewModel: o, buttonText: /* @__PURE__ */ a.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Employment Status" } ) } ) ] } ); }, W = g(K); export { W as default };