
/**
 *   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 { S as o, i as u, g as S, j as i, c as m, F as l } from "../_mysheerid-preview.js";
import { F as g } from "./FormFieldText-BEmRFdkH.js";
const t = (s, e, r) => `${s.slice(0, r)}${e}${s.slice(r)}`, f = (s) => {
  let e;
  try {
    if (e = s.toString(), !e) throw new Error();
  } catch {
    return "";
  }
  return e = e.replace(/[^\d]/g, ""), e = t(e, "-", 3), e = t(e, "-", 6), e = e.replace("--", "").replace(/-$/, ""), e;
}, N = (s) => s.replace(/-/g, "").slice(0, o), p = ({
  value: s,
  isErrored: e,
  onChange: r,
  intl: d,
  placeholder: a = "",
  disabled: n = !1
}) => S("socialSecurityNumber")?.hidden ? null : /* @__PURE__ */ i.jsx(
  g,
  {
    fieldId: "ssn",
    className: "sid-ssn__input",
    refId: m.socialSecurityNumber,
    value: f(s),
    onChange: (c) => r(N(c)),
    placeholder: a || d.formatHTMLMessage({ id: "ssnPlaceholder", defaultMessage: "000-00-0000" }),
    label: /* @__PURE__ */ i.jsx(l, { id: "ssn", defaultMessage: "Social Security Number" }),
    errorMessage: e && /* @__PURE__ */ i.jsx(
      l,
      {
        id: "errorId.invalidSocialSecurityNumber",
        defaultMessage: "Invalid SSN"
      }
    ),
    showPlaceholderAndHideLabel: !!a,
    required: !0,
    disabled: n
  }
), M = u(p);
export {
  M as S
};
