import { jsx as a, jsxs as h } from "react/jsx-runtime";
import { s as I, f as n } from "./index-T-3isYi5.js";
import { A as C } from "./AppCard-JgJMoBtw.js";
import { u as f } from "./useIsAppEnabled-SudDKIHz.js";
const T = function({
  app: s,
  eventType: o,
  onAppInstallSuccess: c
}) {
  var i;
  const { getAppData: r, setAppData: p, disabled: t } = I(), d = r("SITE_ID"), l = r("SCRIPT_URL"), { enabled: u, updateEnabled: m } = f(s);
  return /* @__PURE__ */ a(
    C,
    {
      onAppInstallSuccess: c,
      app: s,
      switchOnClick: (e) => {
        m(e);
      },
      switchChecked: u,
      teamId: ((i = o.team) == null ? void 0 : i.id) || void 0,
      children: /* @__PURE__ */ h("fieldset", { className: "stack-y-2", disabled: t, children: [
        /* @__PURE__ */ a(
          n,
          {
            disabled: t,
            name: "Script URL",
            value: l,
            defaultValue: "https://us.umami.is/script.js",
            placeholder: "Enter the script source URL",
            onChange: (e) => {
              p("SCRIPT_URL", e.target.value);
            }
          }
        ),
        /* @__PURE__ */ a(
          n,
          {
            disabled: t,
            name: "Site ID",
            value: d,
            placeholder: "Enter your Site ID",
            onChange: (e) => {
              p("SITE_ID", e.target.value);
            }
          }
        )
      ] })
    }
  );
};
export {
  T as default
};
