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