import { jsx as o } from "../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { Alert as f } from "../../../../../internal/Alert/Alert.js";
import { AlertTypeOption as d } from "../../../../../internal/Alert/types.js";
import k from "./Fields/StoreField.js";
import { useMemo as a } from "../../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { useWizardFormContext as S } from "../../../../../../hooks/form/wizard/WizardFormContext.js";
/* empty css               */
import g from "../../../../../../core/Context/preact/useCoreContext.js";
import { useConfigContext as F } from "../../../../../../core/ConfigContext/preact/context.js";
const b = ({ setShowTermsAndConditions: i, settingsData: s, storesData: c, selectItems: m, termsAndConditionsProvisioned: r }) => {
  const { i18n: t } = g(), { savePayByLinkSettings: p } = F().endpoints, { getValues: l } = S(), e = !!p, u = l("store"), n = a(() => {
    if (!r)
      return e ? "payByLink.creation.storeForm.alerts.tcSetupRequired" : "payByLink.creation.storeForm.alerts.tcSetupRequiredWithoutPermissions";
  }, [r, e]), y = a(() => e ? [
    {
      label: t.get("payByLink.creation.storeForm.alerts.tcSetupRequiredAction"),
      onClick: () => {
        i(!0);
      }
    }
  ] : [], [e, i, t]);
  return /* @__PURE__ */ o("div", { className: "adyen-pe-payment-link-creation-form__fields-container", children: [
    /* @__PURE__ */ o(k, { items: m }),
    s && c && u && !r && /* @__PURE__ */ o(
      f,
      {
        className: "adyen-pe-payment-link-creation-form__tc-alert",
        title: t.get("payByLink.creation.storeForm.alerts.tcSetupRequiredTitle"),
        type: d.WARNING,
        description: n && t.get(n),
        actions: y
      }
    )
  ] });
};
export {
  b as StoreForm
};
