
/**
 *   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, _ as j, j as a, P as y, u as n, g as l, e as N, F as p, $ as E, Y as I, V as M, i as P, k as F, b as f } from "../_mysheerid-preview.js";
import { F as R, L as D, P as T, B as k, a as B, M as L, C as q } from "./CaptchaComponent-D-uHsjvA.js";
import { E as A, P as V } from "./PersonalInfoStepSubmitButton-Z9sp6sjQ.js";
import { A as G } from "./AddressComponent-DUqzTLlm.js";
import { C as H } from "./City-ZWfRdxoz.js";
import { P as K } from "./PostalCodeComponent-CAw364H-.js";
import { S as O } from "./StateSelectComponent-DJIfavwM.js";
import { C as W } from "./ChangeLocaleComponent-B5F9Azun.js";
import { P as Y } from "./PersonalInfoStepWrapper-DgSuVlBj.js";
const _ = ({
  intl: u,
  verificationService: e
}) => {
  const t = e.viewModel, { fieldValidationErrors: o } = e, m = e.verificationResponse, C = g(m), i = f(), h = t.localeChoice.value, d = (s, r) => {
    const b = F(
      t,
      (x) => {
        x[s] = r;
      }
    );
    e.updateViewModel(b);
  };
  return j(), /* @__PURE__ */ a.jsxs(
    Y,
    {
      verificationService: e,
      step: m.currentStep,
      children: [
        /* @__PURE__ */ a.jsx(
          y,
          {
            verificationService: e,
            classNameIdentifier: "general-identity"
          }
        ),
        /* @__PURE__ */ a.jsx(W, { verificationService: e }),
        /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ a.jsx(
            R,
            {
              value: t.firstName,
              isErrored: !!o.firstName,
              disabled: l("firstName")?.disabled,
              onChange: (s) => {
                d("firstName", s), n("firstName", s, e);
              }
            }
          ),
          /* @__PURE__ */ a.jsx(
            D,
            {
              value: t.lastName,
              isErrored: !!o.lastName,
              disabled: l("lastName")?.disabled,
              onChange: (s) => {
                d("lastName", s), n("lastName", s, e);
              }
            }
          )
        ] }),
        /* @__PURE__ */ a.jsx(
          A,
          {
            value: t.email,
            isErrored: !!o.email,
            explanation: /* @__PURE__ */ a.jsx(
              p,
              {
                id: "emailExplanation",
                defaultMessage: "Personal email address is recommended"
              }
            ),
            onChange: (s) => {
              d("email", s), n("email", s, e);
            },
            onKeyDown: (s) => N(s),
            disabled: l("email")?.disabled
          }
        ),
        e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
          T,
          {
            isRequired: !!e.programTheme.smsLoopEnabled,
            value: t.phoneNumber,
            isErrored: !!o.phoneNumber,
            onChange: (s) => {
              d("phoneNumber", s), n("phoneNumber", s, e);
            },
            selectedCountryCode: t.countryChoice && t.countryChoice.value,
            disabled: l("phoneNumber")?.disabled
          }
        ) : null,
        /* @__PURE__ */ a.jsx(
          k,
          {
            errorId: o.birthDate,
            locale: h,
            onChange: (s) => {
              d("birthDate", s), n("birthDate", s, e);
            },
            value: t.birthDate,
            disabled: l("birthDate")?.disabled
          }
        ),
        /* @__PURE__ */ a.jsx(
          G,
          {
            isErrored: !!o.address1,
            errorId: o.address1,
            onChange: (s) => {
              d("address1", s), n("address1", s, e);
            },
            value: t.address1,
            isRequired: !0,
            disabled: l("address1")?.disabled
          }
        ),
        /* @__PURE__ */ a.jsxs("div", { className: "sid-extra-address-inputs sid-thirds", children: [
          /* @__PURE__ */ a.jsx(
            H,
            {
              isErrored: !!o.city,
              errorId: o.city,
              onChange: (s) => {
                d("city", s), n("city", s, e);
              },
              value: t.city,
              isRequired: !0,
              disabled: l("city")?.disabled
            }
          ),
          /* @__PURE__ */ a.jsx(
            O,
            {
              isRequired: !0,
              options: E(e.programTheme, u),
              value: t.state || void 0,
              isErrored: !!o.state,
              disabled: l("state")?.disabled,
              onChange: async (s) => {
                const r = s ? s.value : void 0;
                d("state", r), n("state", r, e);
              }
            }
          ),
          /* @__PURE__ */ a.jsx(
            K,
            {
              isErrored: !!o.postalCode,
              onChange: (s) => {
                d("postalCode", s), n("postalCode", s, e);
              },
              value: t.postalCode,
              isRequired: !0,
              disabled: l("postalCode")?.disabled
            }
          )
        ] }),
        i.customFormFields.map((s) => /* @__PURE__ */ a.jsx(B, { config: s, verificationService: e })),
        /* @__PURE__ */ a.jsx(
          L,
          {
            verificationService: e,
            isErrored: !!o.marketConsentValue,
            onChange: (s) => {
              d("metadata", {
                ...e.viewModel.metadata,
                marketConsentValue: s
              }), n("marketConsentValue", s, e);
            },
            viewModel: t,
            disabled: l("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ a.jsx(I, { verificationService: e, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ a.jsx(
          q,
          {
            verificationService: e,
            isErrored: !!o.captchaToken
          }
        ),
        /* @__PURE__ */ a.jsx(
          V,
          {
            step: M.collectGeneralIdentityPersonalInfo,
            verificationService: e,
            viewModel: t,
            failedInstantMatch: C,
            buttonText: /* @__PURE__ */ a.jsx(
              p,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Identity"
              }
            )
          }
        )
      ]
    }
  );
}, S = P(_);
export {
  _ as StepGeneralIdentityPersonalInfo,
  S as StepGeneralIdentityPersonalInfoComponent,
  S as default
};
