
/**
 *   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 { i as g, g as v, j as e, F as u, r as E, E as p, w as y, V as a, O as T, s as C, Q as x, T as F, q as L } from "../_mysheerid-preview.js";
import { F as h } from "./FormFieldText-BEmRFdkH.js";
import { u as N, C as S, a as w } from "./useMetrics-DpRhEEYu.js";
const _ = ({
  value: s,
  isErrored: t,
  onChange: o,
  explanation: r = "",
  intl: c,
  onKeyDown: d = () => {
  },
  onBlur: m = () => {
  },
  placeholder: n = "",
  disabled: b = !1
}) => v("email")?.hidden ? null : /* @__PURE__ */ e.jsx(
  h,
  {
    fieldId: "email",
    value: s,
    onChange: o,
    type: "email",
    autoComplete: "email",
    placeholder: n || c.formatHTMLMessage({ id: "emailAddressPlaceholder", defaultMessage: "Email" }),
    label: /* @__PURE__ */ e.jsx(u, { id: "emailAddress", defaultMessage: "Email address" }),
    errorMessage: t && /* @__PURE__ */ e.jsx(u, { id: "errorId.invalidEmail", defaultMessage: "Invalid email" }),
    explanation: r,
    showPlaceholderAndHideLabel: !!n,
    onKeyDown: (l) => d(l),
    onBlur: (l) => m(l),
    disabled: b
  }
), R = g(_), j = {
  collectStudentPersonalInfo: "sid-student--submit",
  collectSeniorPersonalInfo: "sid-senior-submit",
  collectTeacherPersonalInfo: "sid-teacher-submit",
  collectMoverPersonalInfo: "sid-mover-submit",
  collectInactiveMilitaryPersonalInfo: "sid-inactive-military-submit sid-military-submit",
  collectActiveMilitaryPersonalInfo: "sid-active-military-personal-submit sid-military-submit",
  collectMilitaryPersonalInfo: "sid-active-military-personal-submit sid-military-submit",
  collectMilitaryStatus: "",
  collectMemberPersonalInfo: "sid-member-submit",
  collectMedicalProfessionalPersonalInfo: "sid-medical-submit",
  collectLowIncomePersonalInfo: "sid-low-income-submit",
  collectLicensedProfessionalPersonalInfo: "sid-licensed-professional-submit",
  collectHybridIdentityPersonalInfo: "sid-hybrid-identity-submit",
  collectGeneralIdentityPersonalInfo: "sid-general-identity-submit",
  collectDriverLicensePersonalInfo: "sid-drivers-license-submit",
  collectFirstResponderPersonalInfo: "sid-first-responder-personal-info-submit",
  collectEmployeePersonalInfo: "sid-employment-submit",
  collectAgePersonalInfo: "sid-age-personal-info-submit",
  collectIdentifier: "sid-identifier-submit",
  collectPersonalInfo: "sid-personal-info-submit"
}, A = {
  collectStudentPersonalInfo: "sid-student-submit-btn",
  collectSeniorPersonalInfo: "sid-senior-submit-btn",
  collectTeacherPersonalInfo: "sid-teacher-submit-btn",
  collectMoverPersonalInfo: "sid-mover-submit-btn",
  collectInactiveMilitaryPersonalInfo: "sid-inactive-military-submit-btn sid-military-submit-btn",
  collectActiveMilitaryPersonalInfo: "sid-active-military-personal-submit-btn sid-military-submit-btn",
  collectMilitaryPersonalInfo: "sid-active-military-personal-submit-btn sid-military-submit-btn",
  collectMilitaryStatus: "",
  collectMemberPersonalInfo: "sid-member-submit-btn",
  collectMedicalProfessionalPersonalInfo: "sid-medical-submit-btn",
  collectLowIncomePersonalInfo: "sid-low-income-submit-btn",
  collectLicensedProfessionalPersonalInfo: "sid-licensed-professional-submit-btn",
  collectHybridIdentityPersonalInfo: "sid-hybrid-identity-submit-btn",
  collectGeneralIdentityPersonalInfo: "sid-general-identity-submit-btn",
  collectDriverLicensePersonalInfo: "sid-drivers-license-submit-btn",
  collectFirstResponderPersonalInfo: "sid-first-responder-submit-btn",
  collectEmployeePersonalInfo: "sid-employment-submit-btn",
  collectAgePersonalInfo: "sid-age-personal-info-btn",
  collectIdentifier: "sid-identifier-submit-btn",
  collectPersonalInfo: "sid-personal-info-submit-btn"
}, O = [
  a.collectMoverPersonalInfo,
  a.collectStudentPersonalInfo,
  a.collectEmployeePersonalInfo
], U = ({
  step: s,
  verificationService: t,
  viewModel: o,
  buttonText: r,
  failedInstantMatch: c = !1
}) => {
  const { userDidConvert: d, getTimeOnForm: m } = N({
    segment: t.verificationResponse.segment,
    programId: t.programId
  });
  E.useEffect(() => {
    const i = {
      eventName: p.COLLECT_STARTED,
      params: {}
    };
    y(i);
  }, []);
  const n = () => {
    try {
      const i = {
        eventName: p.COLLECT_SUBMITTED,
        params: {
          [F.EVENT_DURATION]: m().duration
        }
      };
      y(i);
    } catch {
      L.warn("Unable to measure time on form");
    }
    d(S, w);
  }, b = j[s], f = A[s], l = O.includes(s) ? "sid-submit-wrapper__collect-info" : "sid-submit-btn-collect-info", P = c ? /* @__PURE__ */ e.jsx(u, { id: "tryAgain", defaultMessage: "Try Again" }) : r, M = s === a.collectEmployeePersonalInfo ? { className: "sid-employment-submit-btn__text" } : {}, I = !T(o, t.formValidationOptions);
  return /* @__PURE__ */ e.jsx("div", { className: "sid-form-region sid-submit-wrapper sid-l-space-top-md", children: /* @__PURE__ */ e.jsx("div", { className: `${b} sid-submit`, children: /* @__PURE__ */ e.jsx(
    "button",
    {
      id: l,
      onClick: () => x(o, t, s, n),
      type: "submit",
      className: `sid-btn ${f} sid-btn--dark sid-l-full-width ${I ? "sid-btn--disabled-like" : ""}`,
      "aria-labelledby": "verify-status-text",
      ref: (i) => C("submitButton", i),
      "aria-disabled": I,
      "data-testid": "submit-button",
      children: /* @__PURE__ */ e.jsx("span", { id: "verify-status-text", ...M, children: P })
    }
  ) }) });
};
export {
  R as E,
  U as P
};
