import { jsx as f } from "react/jsx-runtime";
import * as i from "react";
import "react-dom";
import { c as _ } from "./index-DLcqcWxM.mjs";
import { c as v } from "./bind-CU-R61T-.mjs";
var C = /* @__PURE__ */ Symbol.for("react.lazy"), c = i[" use ".trim().toString()];
function E(r) {
  return typeof r == "object" && r !== null && "then" in r;
}
function m(r) {
  return r != null && typeof r == "object" && "$$typeof" in r && r.$$typeof === C && "_payload" in r && E(r._payload);
}
// @__NO_SIDE_EFFECTS__
function S(r) {
  const e = /* @__PURE__ */ R(r), t = i.forwardRef((o, n) => {
    let { children: l, ...s } = o;
    m(l) && typeof c == "function" && (l = c(l._payload));
    const a = i.Children.toArray(l), u = a.find(P);
    if (u) {
      const p = u.props.children, g = a.map((y) => y === u ? i.Children.count(p) > 1 ? i.Children.only(null) : i.isValidElement(p) ? p.props.children : null : y);
      return /* @__PURE__ */ f(e, { ...s, ref: n, children: i.isValidElement(p) ? i.cloneElement(p, void 0, g) : null });
    }
    return /* @__PURE__ */ f(e, { ...s, ref: n, children: l });
  });
  return t.displayName = `${r}.Slot`, t;
}
// @__NO_SIDE_EFFECTS__
function R(r) {
  const e = i.forwardRef((t, o) => {
    let { children: n, ...l } = t;
    if (m(n) && typeof c == "function" && (n = c(n._payload)), i.isValidElement(n)) {
      const s = x(n), a = w(l, n.props);
      return n.type !== i.Fragment && (a.ref = o ? _(o, s) : s), i.cloneElement(n, a);
    }
    return i.Children.count(n) > 1 ? i.Children.only(null) : null;
  });
  return e.displayName = `${r}.SlotClone`, e;
}
var h = /* @__PURE__ */ Symbol("radix.slottable");
function P(r) {
  return i.isValidElement(r) && typeof r.type == "function" && "__radixId" in r.type && r.type.__radixId === h;
}
function w(r, e) {
  const t = { ...e };
  for (const o in e) {
    const n = r[o], l = e[o];
    /^on[A-Z]/.test(o) ? n && l ? t[o] = (...a) => {
      const u = l(...a);
      return n(...a), u;
    } : n && (t[o] = n) : o === "style" ? t[o] = { ...n, ...l } : o === "className" && (t[o] = [n, l].filter(Boolean).join(" "));
  }
  return { ...r, ...t };
}
function x(r) {
  let e = Object.getOwnPropertyDescriptor(r.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
  return t ? r.ref : (e = Object.getOwnPropertyDescriptor(r, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? r.props.ref : r.props.ref || r.ref);
}
var N = [
  "a",
  "button",
  "div",
  "form",
  "h2",
  "h3",
  "img",
  "input",
  "label",
  "li",
  "nav",
  "ol",
  "p",
  "select",
  "span",
  "svg",
  "ul"
], $ = N.reduce((r, e) => {
  const t = /* @__PURE__ */ S(`Primitive.${e}`), o = i.forwardRef((n, l) => {
    const { asChild: s, ...a } = n, u = s ? t : e;
    return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...a, ref: l });
  });
  return o.displayName = `Primitive.${e}`, { ...r, [e]: o };
}, {}), L = "Label", b = i.forwardRef((r, e) => /* @__PURE__ */ f(
  $.label,
  {
    ...r,
    ref: e,
    onMouseDown: (t) => {
      t.target.closest("button, input, select, textarea") || (r.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
    }
  }
));
b.displayName = L;
var A = b;
const D = {
  "purpur-label": "_purpur-label_1x80u_1",
  "purpur-label--negative": "_purpur-label--negative_1x80u_8",
  "purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
}, j = v.bind(D), d = "purpur-label", W = ({
  children: r,
  className: e,
  disabled: t,
  negative: o = !1,
  ...n
}) => {
  const l = j(e, d, {
    [`${d}--disabled`]: t,
    [`${d}--negative`]: o
  });
  return /* @__PURE__ */ f(A, { className: l, ...n, children: r });
};
export {
  W as L
};
//# sourceMappingURL=label-7sJe5-pX.mjs.map
