import { jsxs as O, jsx as a } from "react/jsx-runtime";
import { useMemo as P } from "react";
import { t as n } from "../global.module.js";
import { c as T, f as $, s as j, p as k, b as B, a as E } from "../tools/tools.js";
const K = function(h) {
  const {
    as: i = "input",
    children: c,
    className: d,
    color: m,
    dropOldClass: p,
    endContent: e,
    isInvalid: f,
    isValid: u,
    nativeColor: y,
    nativeSize: x,
    onRef: I,
    readonlyPlainText: v,
    size: l,
    startContent: o,
    startEndContentClasses: S,
    style: C,
    type: s,
    variables: b,
    ...N
  } = h, r = P(() => {
    const t = T(
      !p && $(
        ["form-check-input", s === "checkbox" || s === "radio"],
        ["form-control-plaintext", v],
        ["form-range", s === "range"],
        ["form-control", !0]
      ),
      m && "form-control-color",
      l && `form-control-${l}`,
      u && "is-valid",
      f && "is-invalid",
      d
    ), g = j((V, z) => ({ tKey: E(z) }), b, C);
    return {
      className: t,
      color: y,
      size: x,
      style: g,
      type: s
    };
  }, [
    d,
    m,
    p,
    f,
    u,
    y,
    x,
    v,
    l,
    C,
    s,
    b
  ]);
  if (o || e) {
    const t = k(S, {
      component: B(
        null,
        r.className,
        o && n.brlPs9,
        e && n.brlPe9
      ),
      container: "d-inline-flex align-items-center position-relative",
      end: `position-absolute top-50 translate-middle-y ${n.brlEnd3}`,
      start: `position-absolute top-50 translate-middle-y ${n.brlStart3}`
    });
    return /* @__PURE__ */ O("div", { className: t.container, "data-slot-container": "", children: [
      o && /* @__PURE__ */ a("div", { className: t.start, "data-slot-prefix": "", children: o }),
      /* @__PURE__ */ a(i, { ...N, ...r, className: t.component, "data-slot-component": "", children: c }),
      e && /* @__PURE__ */ a("div", { className: t.end, "data-slot-suffix": "", children: e })
    ] });
  }
  return /* @__PURE__ */ a(i, { ...N, ...r, ref: I, children: c });
};
K.displayName = "BRL.Input";
export {
  K as I
};
//# sourceMappingURL=input.js.map
