import { jsx as u } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useWizardFormContext as d } from "../../../../../../../../hooks/form/wizard/WizardFormContext.js";
import { useCallback as N } from "../../../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { FormTextInput as b } from "../../../../../../../internal/FormWrappers/FormTextInput.js";
import { PAYMENT_LINK_CREATION_FIELD_LENGTHS as f } from "../../../../../constants.js";
import p from "../../../../../../../../core/Context/preact/useCoreContext.js";
const L = ({
  isSameAddress: e,
  isAddressFieldRequired: l,
  showBillingFirst: r = !1,
  isSameAddressCopyEnabled: i = !1
}) => {
  const { i18n: s } = p(), { setValue: o, fieldsConfig: m } = d(), a = N(
    (n) => {
      r && i && e && o("deliveryAddress.houseNumberOrName", n.currentTarget.value);
    },
    [e, o, r, i]
  ), t = m["billingAddress.houseNumberOrName"]?.required || l("billingAddress.houseNumberOrName");
  return /* @__PURE__ */ u(
    b,
    {
      maxLength: f.billingAddress.houseNumberOrName.max,
      fieldName: "billingAddress.houseNumberOrName",
      label: s.get("payByLink.creation.fields.billingAddress.houseNumberOrName.label"),
      onInput: a,
      className: "adyen-pe-payment-link-creation-form__billing-address-field--small",
      hideOptionalLabel: !0,
      isRequired: t
    }
  );
};
export {
  L as BillingHouseNumberField
};
