import { aM as p, aN as y, aO as g, aL as x, aK as e, aP as f } from "./index-GTnBs7av.js";
import { useMemo as S, useState as b } from "react";
import { A as v } from "./AppCard-Q28K7Yaw.js";
import C from "./EventTypeAppSettingsInterface-_ZPdsmrV.js";
const k = function({
  app: a,
  eventType: i,
  eventTypeFormMetadata: c
}) {
  const t = p.useSearchParams(), s = p.usePathname(), m = S(
    () => `${s}${t ? `?${t.toString()}` : ""}`,
    [s, t]
  ), { getAppData: n, setAppData: h, disabled: d } = y(), [o, l] = b(n("enabled")), u = g(c), { t: A } = x(), r = !o && u;
  return /* @__PURE__ */ e.jsx(
    v,
    {
      returnTo: f + m,
      app: a,
      switchChecked: o,
      switchOnClick: (P) => {
        l(P);
      },
      description: /* @__PURE__ */ e.jsx(e.Fragment, { children: "Add Paypal payment to your events" }),
      disableSwitch: r,
      switchTooltip: r ? A("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
        C,
        {
          eventType: i,
          slug: a.slug,
          disabled: d,
          getAppData: n,
          setAppData: h
        }
      ) })
    }
  );
};
export {
  k as default
};
