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