
/**
 *   VERSION: 2.240.0-alpha.1
 *   BUILD_TIMESTAMP: 1780360168537
 *   BUILD_DATE: Tue Jun 02 2026 00:29:28 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 758cedd37e00f49a728d704d9ed36884f0f12d79
 */
import { S as o, i as u, g as S, j as i, h as m, F as l } from "../sheerid.js";
import { F as g } from "./FormFieldText-CPwStdCx.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
  }
), I = u(p);
export {
  I as S
};
