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