UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

223 lines (221 loc) • 7.37 kB
/** * 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.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000347595 * BUILD_DATE: Sat Sep 27 2025 19:12:27 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { i as k, j as a, v as P, w as V, P as f, x as z, T as A, g as t, a4 as u, a5 as B, W as R, f as n, y as w, z as D, B as L, b as p, a1 as q, a6 as W, a7 as H, D as O, E as K, e as U, G, H as J, M as Q, I as X, k as Y, V as Z, n as _ } from "../_mysheerid-preview.js"; const $ = ({ intl: I, verificationService: e }) => { var C, b, g, h, x, i, y, E, j, N, M; const o = e.viewModel, { fieldValidationErrors: d } = e, T = V(), m = (s, r) => { const l = _( o, (F) => { F[s] = r; } ); e.updateViewModel(l); }; return /* @__PURE__ */ a.jsxs( P, { verificationService: e, step: e.verificationResponse.currentStep, children: [ /* @__PURE__ */ a.jsx( f, { verificationService: e, classNameIdentifier: "employment" } ), /* @__PURE__ */ a.jsx(z, { verificationService: e }), /* @__PURE__ */ a.jsx( A, { verificationService: e, disabled: (C = t("country")) == null ? void 0 : C.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( B, { value: e.viewModel.organization, verificationService: e, isErrored: !!d.organization, disabled: (b = t("organization")) == null ? void 0 : b.disabled, onChange: (s) => { R(s, e), n("organization", s, e); } } ), /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ a.jsx( w, { value: o.firstName, isErrored: !!d.firstName, disabled: (g = t("firstName")) == null ? void 0 : g.disabled, onChange: (s) => { m("firstName", s), n("firstName", s, e); } } ), /* @__PURE__ */ a.jsx( D, { value: o.lastName, isErrored: !!d.lastName, disabled: (h = t("lastName")) == null ? void 0 : h.disabled, onChange: (s) => { m("lastName", s), n("lastName", s, e); } } ) ] }), u( o.countryChoice, e.programTheme.config.countries ) ? /* @__PURE__ */ a.jsx( L, { isErrored: !!d.address1, errorId: d.address1, onChange: (s) => { m("address1", s), n("address1", s, e); }, isRequired: !0, value: o.address1, disabled: (x = t("address1")) == null ? void 0 : x.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( q, { isErrored: !!d.city, errorId: d.city, onChange: (s) => { m("city", s), n("city", s, e); }, value: o.city, isRequired: !0, disabled: (i = t("city")) == null ? void 0 : i.disabled } ), /* @__PURE__ */ a.jsx( W, { isRequired: !0, options: H(e.programTheme, I), 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: (y = t("state")) == null ? void 0 : y.disabled } ), /* @__PURE__ */ a.jsx( O, { isErrored: !!d.postalCode, onChange: (s) => { m("postalCode", s), n("postalCode", s, e); }, value: o.postalCode, disabled: (E = t("postalCode")) == null ? void 0 : E.disabled } ) ] }) : null, /* @__PURE__ */ a.jsx( K, { 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) => U(s), disabled: (j = t("email")) == null ? void 0 : j.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( G, { 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: (N = t("phoneNumber")) == null ? void 0 : N.disabled } ) : null, T.customFormFields.map((s) => /* @__PURE__ */ a.jsx(J, { config: s, verificationService: e })), /* @__PURE__ */ a.jsx( Q, { verificationService: e, isErrored: !!d.marketConsentValue, onChange: (s) => { m("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), n("marketConsentValue", s, e); }, viewModel: o, disabled: (M = t("marketConsentValue")) == null ? void 0 : M.disabled } ), /* @__PURE__ */ a.jsx(X, { suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( Y, { step: Z.collectEmployeePersonalInfo, verificationService: e, viewModel: o, buttonText: /* @__PURE__ */ a.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Employment Status" } ) } ) ] } ); }, S = k($); export { S as default };