import { getCurrentInstance as N, inject as V, ref as v, computed as y, unref as l } from "vue";
const p = "aplus", B = "is-", c = (a, r, t, $, o) => {
  let u = `${a}-${r}`;
  return t && (u += `-${t}`), $ && (u += `__${$}`), o && (u += `--${o}`), u;
}, C = /* @__PURE__ */ Symbol("namespaceContextKey"), _ = (a) => {
  const r = a || (N() ? V(C, v(p)) : v(p));
  return y(() => l(r) || p);
}, w = (a, r) => {
  const t = _(r);
  return {
    namespace: t,
    b: (s = "") => c(t.value, a, s, "", ""),
    e: (s) => s ? c(t.value, a, "", s, "") : "",
    m: (s) => s ? c(t.value, a, "", "", s) : "",
    be: (s, e) => s && e ? c(t.value, a, s, e, "") : "",
    em: (s, e) => s && e ? c(t.value, a, "", s, e) : "",
    bm: (s, e) => s && e ? c(t.value, a, s, "", e) : "",
    bem: (s, e, n) => s && e && n ? c(t.value, a, s, e, n) : "",
    is: (s, ...e) => {
      const n = e.length >= 1 ? e[0] : !0;
      return s && n ? `${B}${s}` : "";
    },
    cssVar: (s, e = !0) => {
      const n = {};
      for (const m in s)
        s[m] && (n[`--${e ? t.value + "-" : ""}${a}-${m}`] = s[m]);
      return n;
    },
    cssVarName: (s) => `--${t.value}-${s}`,
    cssVarBlock: (s) => {
      const e = {};
      for (const n in s)
        s[n] && (e[`--${t.value}-${a}-${n}`] = s[n]);
      return e;
    },
    cssVarBlockName: (s) => `--${t.value}-${a}-${s}`
  };
};
export {
  p as defaultNamespace,
  C as namespaceContextKey,
  _ as useGetDerivedNamespace,
  w as useNamespace
};
