import { a1 as u, G as h } from "./index-c65ca4a4.mjs";
const t = "ThemesResponseType", d = u({
  dataType: t,
  path: "/themes/"
}), r = h({
  method: "PUT",
  path: (e) => `/themes/${e}/activate/`,
  updateQueries: {
    dataType: t,
    update: (e, s) => ({
      ...s,
      themes: s.themes.map((a) => {
        const m = e.themes.find(({ name: o }) => o === a.name);
        return m || { ...a, active: !1 };
      })
    })
  }
}), c = h({
  method: "DELETE",
  path: (e) => `/themes/${e}/`,
  updateQueries: {
    dataType: t,
    update: (e, s, a) => ({
      ...s,
      themes: s.themes.filter((m) => m.name !== a)
    })
  }
}), T = h({
  method: "POST",
  path: () => "/themes/install/",
  searchParams: (e) => ({ source: "github", ref: e }),
  updateQueries: {
    dataType: t,
    // Assume that all invite queries should include this new one
    update: (e, s) => s && {
      ...s,
      themes: [
        ...s.themes,
        ...e.themes
      ]
    }
  }
}), l = h({
  method: "POST",
  path: () => "/themes/upload/",
  body: ({ file: e }) => {
    const s = new FormData();
    return s.append("file", e), s;
  },
  updateQueries: {
    dataType: t,
    // Assume that all invite queries should include this new one
    update: (e, s) => s && {
      ...s,
      themes: [
        ...s.themes,
        ...e.themes
      ]
    }
  }
});
function n(e) {
  return e.active;
}
function i(e) {
  return e.name === "casper";
}
function f(e) {
  return !i(e) && !n(e);
}
export {
  n as a,
  c as b,
  f as c,
  d,
  T as e,
  l as f,
  i,
  r as u
};
//# sourceMappingURL=themes-675c54fc.mjs.map
