UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

172 lines (170 loc) 5.55 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 { e as m, h as x, r as E, j as e, x as N, y as j, P as T, z as M, Y as i, a as n, a1 as y, _ as I, k as l, B as k, D, $ as F, E as P, f as z, c as p, J as V, H as O, K as f, M as B, N as L, m as A, V as R } from "../sheerid.js"; const H = (a, o) => m(() => a.openOrgSearchEnabled) && m(() => o.organization.id) === 0 && m(() => o.organization.name, "").length > 0, K = ({ verificationService: a }) => { const { viewModel: o } = a, { fieldValidationErrors: d } = a, r = a.verificationResponse, h = x(r), u = j(), C = o.localeChoice.value, t = (s, b) => { const g = { [s]: b }; a.updateViewModel(g, { partial: !0 }); }; return E.useEffect(() => { a.programTheme.idCheckAddOnEnabled ? t("fieldsToSkipValidation", []) : (t("birthDate", ""), t("fieldsToSkipValidation", ["birthDate"])); }, [a.programTheme.idCheckAddOnEnabled]), /* @__PURE__ */ e.jsxs( N, { verificationService: a, step: r.currentStep, children: [ /* @__PURE__ */ e.jsx( T, { verificationService: a, classNameIdentifier: "teacher-personal-info" } ), /* @__PURE__ */ e.jsx(M, { verificationService: a }), /* @__PURE__ */ e.jsx( i, { verificationService: a, disabled: n("country")?.disabled } ), /* @__PURE__ */ e.jsx( y, { value: a.viewModel.organization, verificationService: a, isErrored: !!d.organization, disabled: n("organization")?.disabled, onChange: (s) => { I(s, a), l("organization", s, a); } } ), /* @__PURE__ */ e.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ e.jsx( k, { value: o.firstName, isErrored: !!d.firstName, disabled: n("firstName")?.disabled, onChange: (s) => { t("firstName", s), l("firstName", s, a); } } ), /* @__PURE__ */ e.jsx( D, { value: o.lastName, isErrored: !!d.lastName, disabled: n("lastName")?.disabled, onChange: (s) => { t("lastName", s), l("lastName", s, a); } } ) ] }), a.programTheme.idCheckAddOnEnabled ? /* @__PURE__ */ e.jsx( F, { errorId: d.birthDate, locale: C, disabled: n("birthDate")?.disabled, onChange: (s) => { t("birthDate", s), l("birthDate", s, a); }, value: o.birthDate } ) : null, /* @__PURE__ */ e.jsx( P, { value: o.email, isErrored: !!d.email, explanation: /* @__PURE__ */ e.jsx( p, { id: "emailExplanation", defaultMessage: "Must be your school-issued email address" } ), onChange: (s) => { t("email", s), l("email", s, a); }, onKeyDown: (s) => z(s), disabled: n("email")?.disabled } ), a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ e.jsx( V, { isRequired: !!a.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!d.phoneNumber, onChange: (s) => { t("phoneNumber", s), l("phoneNumber", s, a); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: n("phoneNumber")?.disabled } ) : null, H(a.programTheme, o) ? /* @__PURE__ */ e.jsx( O, { isErrored: !!d.postalCode, onChange: (s) => { t("postalCode", s), l("postalCode", s, a); }, value: o.postalCode, disabled: n("postalCode")?.disabled } ) : null, u.customFormFields.map((s) => /* @__PURE__ */ e.jsx(f, { config: s, verificationService: a })), /* @__PURE__ */ e.jsx( B, { verificationService: a, isErrored: !!d.marketConsentValue, onChange: (s) => { t("metadata", { ...a.viewModel.metadata, marketConsentValue: s }), l("marketConsentValue", s, a); }, viewModel: o, disabled: n("marketConsentValue")?.disabled } ), /* @__PURE__ */ e.jsx(L, { verificationService: a, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ e.jsx( A, { step: R.collectTeacherPersonalInfo, verificationService: a, viewModel: o, failedInstantMatch: h, buttonText: /* @__PURE__ */ e.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Teacher Status" } ) } ) ] } ); }, q = K; export { q as default };