
/**
 *   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.239.0-alpha.0
 *   BUILD_TIMESTAMP: 1780013005605
 *   BUILD_DATE: Fri May 29 2026 00:03:25 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 3344b6c0fd9fa858907db310cfb1ef5e0d224da2
 */
import { h as g, r as x, j as e, P as E, g as l, a1 as j, u as n, e as N, F as p, Y as T, V as i, b as M } from "../_mysheerid-preview.js";
import { s as P } from "./FormFieldTypeahead-BeJtNfmN.js";
import { F, L as I, B as f, P as k, a as y, M as D, C as V } from "./CaptchaComponent-D-uHsjvA.js";
import { C as B } from "./ChangeLocaleComponent-B5F9Azun.js";
import { C as L } from "./CountryComponentWrapper-CE7M9L4O.js";
import { E as O, P as z } from "./PersonalInfoStepSubmitButton-Z9sp6sjQ.js";
import { P as A } from "./PostalCodeComponent-CAw364H-.js";
import { T as R } from "./TeacherSchoolComponent-BJXOSJQY.js";
import { P as W } from "./PersonalInfoStepWrapper-DgSuVlBj.js";
const w = ({
  verificationService: a
}) => {
  const { viewModel: o } = a, { fieldValidationErrors: d } = a, r = a.verificationResponse, h = g(r), C = M(), u = o.localeChoice.value, t = (s, m) => {
    const b = {
      [s]: m
    };
    a.updateViewModel(b, { partial: !0 });
  };
  return x.useEffect(() => {
    const s = (a.viewModel?.fieldsToSkipValidation || []).filter(
      (m) => m !== "birthDate"
    );
    a.programTheme.idCheckAddOnEnabled ? t("fieldsToSkipValidation", s) : (t("birthDate", ""), t("fieldsToSkipValidation", [...s, "birthDate"]));
  }, [a.programTheme.idCheckAddOnEnabled]), /* @__PURE__ */ e.jsxs(
    W,
    {
      verificationService: a,
      step: r.currentStep,
      children: [
        /* @__PURE__ */ e.jsx(
          E,
          {
            verificationService: a,
            classNameIdentifier: "teacher-personal-info"
          }
        ),
        /* @__PURE__ */ e.jsx(B, { verificationService: a }),
        /* @__PURE__ */ e.jsx(
          L,
          {
            verificationService: a,
            disabled: l("country")?.disabled
          }
        ),
        /* @__PURE__ */ e.jsx(
          R,
          {
            value: a.viewModel.organization,
            verificationService: a,
            isErrored: !!d.organization,
            disabled: l("organization")?.disabled,
            onChange: (s) => {
              j(s, a), n("organization", s, a);
            }
          }
        ),
        /* @__PURE__ */ e.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ e.jsx(
            F,
            {
              value: o.firstName,
              isErrored: !!d.firstName,
              disabled: l("firstName")?.disabled,
              onChange: (s) => {
                t("firstName", s), n("firstName", s, a);
              }
            }
          ),
          /* @__PURE__ */ e.jsx(
            I,
            {
              value: o.lastName,
              isErrored: !!d.lastName,
              disabled: l("lastName")?.disabled,
              onChange: (s) => {
                t("lastName", s), n("lastName", s, a);
              }
            }
          )
        ] }),
        a.programTheme.idCheckAddOnEnabled ? /* @__PURE__ */ e.jsx(
          f,
          {
            errorId: d.birthDate,
            locale: u,
            disabled: l("birthDate")?.disabled,
            onChange: (s) => {
              t("birthDate", s), n("birthDate", s, a);
            },
            value: o.birthDate
          }
        ) : null,
        /* @__PURE__ */ e.jsx(
          O,
          {
            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), n("email", s, a);
            },
            onKeyDown: (s) => N(s),
            disabled: l("email")?.disabled
          }
        ),
        a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ e.jsx(
          k,
          {
            isRequired: !!a.programTheme.smsLoopEnabled,
            value: o.phoneNumber,
            isErrored: !!d.phoneNumber,
            onChange: (s) => {
              t("phoneNumber", s), n("phoneNumber", s, a);
            },
            selectedCountryCode: o.countryChoice && o.countryChoice.value,
            disabled: l("phoneNumber")?.disabled
          }
        ) : null,
        P(a.programTheme, o) ? /* @__PURE__ */ e.jsx(
          A,
          {
            isErrored: !!d.postalCode,
            onChange: (s) => {
              t("postalCode", s), n("postalCode", s, a);
            },
            value: o.postalCode,
            disabled: l("postalCode")?.disabled
          }
        ) : null,
        C.customFormFields.map((s) => /* @__PURE__ */ e.jsx(y, { config: s, verificationService: a })),
        /* @__PURE__ */ e.jsx(
          D,
          {
            verificationService: a,
            isErrored: !!d.marketConsentValue,
            onChange: (s) => {
              t("metadata", {
                ...a.viewModel.metadata,
                marketConsentValue: s
              }), n("marketConsentValue", s, a);
            },
            viewModel: o,
            disabled: l("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ e.jsx(T, { verificationService: a, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ e.jsx(
          V,
          {
            verificationService: a,
            isErrored: !!d.captchaToken
          }
        ),
        /* @__PURE__ */ e.jsx(
          z,
          {
            step: i.collectTeacherPersonalInfo,
            verificationService: a,
            viewModel: o,
            failedInstantMatch: h,
            buttonText: /* @__PURE__ */ e.jsx(
              p,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Teacher Status"
              }
            )
          }
        )
      ]
    }
  );
}, Z = w;
export {
  Z as default
};
