import { jsxs as T, jsx as s } from "react/jsx-runtime";
import { useMemo as N } from "react";
import { MAX_DEFAULT_VALUE_LENGTH as U } from "../../constants/index.js";
import { Classes as j } from "../../constants/selectors.js";
import { cn as F } from "../../utils/cn.js";
import { ParamHead as g } from "./param-head.js";
const h = "Navigate to header", y = "default", O = "required", R = "deprecated", k = ({
  name: n,
  type: i,
  location: c,
  hidden: m,
  default: t,
  required: p,
  deprecated: d,
  children: r,
  id: l,
  pre: E,
  post: a,
  className: A,
  onMount: f,
  navigateToHeaderAriaLabel: L = h,
  defaultLabel: _ = y,
  requiredLabel: u = O,
  deprecatedLabel: b = R
}) => {
  const D = N(() => {
    if (t !== null && typeof t == "object" && Object.values(t).some(
      (o) => o !== null && typeof o == "object"
    ))
      return null;
    try {
      const e = JSON.stringify(t);
      if (e && e.length > 0 && e.length < U)
        return e;
    } catch {
      return null;
    }
    return null;
  }, [t]);
  return m ? null : /* @__PURE__ */ T(
    "div",
    {
      className: F(
        j.Field,
        "my-2.5 border-stone-50 border-b pt-2.5 pb-5 dark:border-stone-800/50",
        A
      ),
      children: [
        /* @__PURE__ */ s(
          g,
          {
            default: D,
            defaultLabel: _,
            deprecated: d,
            deprecatedLabel: b,
            id: l,
            location: c,
            name: n,
            navigateToHeaderAriaLabel: L,
            onMount: f,
            post: a,
            pre: E,
            required: p,
            requiredLabel: u,
            type: i
          }
        ),
        r && /* @__PURE__ */ s(
          "div",
          {
            className: "prose-sm prose-stone dark:prose-invert mt-4 [&_.prose>p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0",
            "data-component-part": "field-content",
            children: r
          }
        )
      ]
    }
  );
};
export {
  k as Property
};
