;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "351bfd04-5d35-442a-8100-0ed62549a951", e._sentryDebugIdIdentifier = "sentry-dbid-351bfd04-5d35-442a-8100-0ed62549a951");
  } catch (e) {
  }
}
;
import { useMutation } from "@tanstack/preact-query";
import { b as useApiContext, $ as httpPost } from "./StoreProvider-CqQrndhS.js";
const createLegalEntity = async (legalEntityId, baseUrl, data) => {
  return httpPost(
    {
      baseUrl,
      path: `legalEntities/${legalEntityId}/create`
    },
    data
  );
};
const useCreateLegalEntity = (options) => {
  const { rootLegalEntityId, baseUrl } = useApiContext();
  return useMutation({
    mutationFn: (payload) => {
      return createLegalEntity(rootLegalEntityId.value, baseUrl.value, payload);
    },
    ...options
  });
};
export {
  useCreateLegalEntity as u
};
