import { jsxs as v, jsx as t } from "react/jsx-runtime";
import { useRef as O, useEffect as R, useCallback as w, useMemo as I } from "react";
import { I as h } from "../input/input.js";
import { L } from "../label/label.js";
import { c as S, s as j, p as B, b as E, a as K } from "../tools/tools.js";
const F = function(d) {
  const {
    as: o = "input",
    children: n,
    className: c,
    contentClasses: b,
    dropOldClass: a,
    id: s,
    indeterminate: r,
    inline: k,
    reverse: C,
    style: l,
    switch: x,
    variables: i,
    ...m
  } = d, p = O(null);
  R(() => {
    const e = p.current;
    r && e && (e.indeterminate = !0);
  }, [r]);
  const f = w((e) => p.current = e, []), u = I(() => {
    const e = S(!a && "form-check-input", c), y = j((T, N) => ({ tKey: K(N) }), i, l);
    return {
      className: e,
      style: y
    };
  }, [a, c, i, l]);
  if (n) {
    const e = B(b, {
      component: "form-check-input",
      container: E(
        null,
        "form-check",
        x && "form-switch",
        k && "form-check-inline",
        C && "form-check-reverse"
      ),
      label: "form-check-label"
    });
    return /* @__PURE__ */ v("div", { className: e.container, "data-slot-container": "", children: [
      /* @__PURE__ */ t(
        h,
        {
          ...m,
          ...u,
          as: o,
          className: e.component,
          "data-slot-component": "",
          dropOldClass: !0,
          id: s,
          onRef: f,
          type: "checkbox"
        }
      ),
      /* @__PURE__ */ t(L, { className: e.label, "data-slot-label": "", dropOldClass: !0, htmlFor: s, children: n })
    ] });
  }
  return /* @__PURE__ */ t(h, { ...m, ...u, as: o, id: s, onRef: f, type: "checkbox" });
};
F.displayName = "BRL.Checkbox";
export {
  F as C
};
//# sourceMappingURL=checkbox.js.map
