;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "19467828-7bbb-4e78-9ec2-2b1cac9cc1b2", e._sentryDebugIdIdentifier = "sentry-dbid-19467828-7bbb-4e78-9ec2-2b1cac9cc1b2");
  } catch (e) {
  }
}
;
import { a0 as CountryCodes } from "./StoreProvider-CqQrndhS.js";
import { d as validateLegalCompanyName, a as validateNotEmptyOnBlur, e as validateLatinSpaceMarkPunctuationNumbersOnlyOnBlur } from "./patternValidators-Bv0Mmhgd.js";
import { jsx } from "preact/jsx-runtime";
import { F as Field } from "./Field-BL3Mh7gm.js";
import { K as KEYBOARD_KEYS } from "./Modal-1lLoobr9.js";
import { I as InputText } from "./InputText-DRSK56ma.js";
const defaultFieldMetadata = {
  label: "legalCompanyName",
  validators: validateNotEmptyOnBlur
};
const defaultFieldConfig = {
  [CountryCodes.Australia]: {
    label: "legalCompanyName",
    validators: validateNotEmptyOnBlur
  },
  [CountryCodes.HongKong]: {
    label: "legalCompanyName",
    validators: validateNotEmptyOnBlur
  },
  [CountryCodes.Netherlands]: {
    label: "legalCompanyName",
    validators: validateNotEmptyOnBlur
  },
  [CountryCodes.Singapore]: {
    label: "legalCompanyName",
    validators: validateNotEmptyOnBlur
  },
  [CountryCodes.UnitedStates]: {
    label: "legalCompanyName__US",
    validators: validateNotEmptyOnBlur
  }
};
const defaultFieldMetadataV4 = {
  label: "legalCompanyName",
  validators: validateLegalCompanyName
};
const defaultFieldConfigV4 = {
  [CountryCodes.Australia]: {
    label: "legalCompanyName",
    validators: validateLegalCompanyName
  },
  [CountryCodes.HongKong]: {
    label: "legalCompanyName",
    validators: validateLegalCompanyName
  },
  [CountryCodes.Netherlands]: {
    label: "legalCompanyName",
    validators: validateLegalCompanyName
  },
  [CountryCodes.Singapore]: {
    label: "legalCompanyName",
    validators: validateLegalCompanyName
  },
  [CountryCodes.UnitedStates]: {
    label: "legalCompanyName__US",
    validators: validateLegalCompanyName
  },
  [CountryCodes.Japan]: {
    label: "legalCompanyName__JP",
    validators: [...validateLegalCompanyName, validateLatinSpaceMarkPunctuationNumbersOnlyOnBlur]
  }
};
const getLegalCompanyNameHelperText = (t, { country }) => {
  switch (country) {
    case CountryCodes.Australia:
      return t(($) => $["legalCompanyName__helperText__AU"]);
    case CountryCodes.HongKong:
      return t(($) => $["legalCompanyName__helperText__HK"]);
    case CountryCodes.Netherlands:
      return t(($) => $["legalCompanyName__helperText__NL"]);
    case CountryCodes.Singapore:
      return t(($) => $["legalCompanyName__helperText__SG"]);
    case CountryCodes.UnitedStates:
      return t(($) => $["legalCompanyName__helperText__US"]);
    default:
      return t(($) => $["legalCompanyName__helperText"]);
  }
};
const LEGAL_COMPANY_NAME_FIELD = [
  "legalCompanyName"
];
function LegalCompanyNameField({
  data,
  valid,
  errors,
  labels,
  helperText,
  readonly,
  handleChangeFor
}) {
  const handleKeyDown = (e) => {
    if (e.key === KEYBOARD_KEYS.enter) {
      e.preventDefault();
    }
  };
  return /* @__PURE__ */ jsx(
    Field,
    {
      name: "legalCompanyName",
      label: labels.legalCompanyName,
      helper: helperText,
      errorMessage: errors.legalCompanyName,
      isValid: valid.legalCompanyName,
      children: (childProps) => /* @__PURE__ */ jsx(
        InputText,
        {
          ...childProps,
          "aria-required": true,
          "aria-invalid": !valid.legalCompanyName,
          name: "legalCompanyName",
          value: data.legalCompanyName,
          readonly,
          onInput: handleChangeFor("legalCompanyName", "input"),
          onBlur: handleChangeFor("legalCompanyName", "blur"),
          onKeyDown: handleKeyDown
        }
      )
    }
  );
}
export {
  LEGAL_COMPANY_NAME_FIELD as L,
  defaultFieldMetadata as a,
  defaultFieldConfigV4 as b,
  defaultFieldConfig as c,
  defaultFieldMetadataV4 as d,
  LegalCompanyNameField as e,
  getLegalCompanyNameHelperText as g
};
