import { inject, getCurrentInstance, computed, unref } from "vue";
import { useGetDerivedNamespace as C } from "../use-namespace/index.mjs";
import "../../../../@vueuse/shared/index.mjs";
const r = {
  prefix: Math.floor(Math.random() * 1e4),
  current: 0
}, I = Symbol("elIdInjection"), a = () => getCurrentInstance() ? inject(I, r) : r, b = (n) => {
  const e = a();
  const o = C();
  return computed(() => unref(n) || `${o.value}-id-${e.prefix}-${e.current++}`);
};
export {
  I as ID_INJECTION_KEY,
  b as useId,
  a as useIdInjection
};
