import { Fragment as I, attr as t, aria as c, html as f, on as o, Empty as p, emitValue as i } from "@tempots/dom";
import { I as x } from "./input-container-DhUiLmXE.js";
const C = ({
  autocomplete: n,
  autofocus: a,
  classes: e,
  disabled: u,
  name: l,
  placeholder: r,
  id: m,
  required: d,
  tabIndex: b,
  hasError: s
}) => I(
  t.autocomplete(n),
  t.autofocus(a),
  t.class(e?.input),
  t.disabled(u),
  t.name(l ?? m),
  t.placeholder(r),
  t.id(m),
  c.required(d),
  t.tabindex(b),
  s != null ? c.invalid(
    s ?? !1
  ) : null
), v = (n) => {
  const { value: a, onBlur: e, onChange: u, onInput: l, type: r } = n;
  return x({
    ...n,
    input: f.input(
      t.type(r ?? "text"),
      C(n),
      t.value(a),
      t.class("bc-input"),
      e != null ? o.blur(i(e)) : p,
      u != null ? o.change(i(u)) : p,
      l != null ? o.input(i(l)) : p
    )
  });
};
export {
  C,
  v as T
};
