import { j as t } from "./jsx-runtime-C5mzlN2N.js";
import { az as v, T as C, H as N, v as d, aA as T, aB as A, aC as L, aD as _, aE as w, aF as E, aG as F, aH as H, aI as I, aJ as M, aK as k, aL as z, aM as O } from "./main-mGfIFfsW.js";
import { x as V, C as s, p as q } from "./css-BUXMI9PB.js";
import "./eraser-BcLVtorx.js";
import "react";
import "react-dom";
const G = (a) => /* @__PURE__ */ t.jsx(v, { inputType: "checkbox", ...a }), j = ({
  className: a,
  variant: r,
  ...e
}) => /* @__PURE__ */ t.jsx(
  C,
  {
    className: s(s.B("input-help-text"), a),
    color: 8,
    status: V.removeVariants(r, "success"),
    level: "small",
    ...e
  }
), b = ({
  className: a,
  required: r = !1,
  children: e,
  ...l
}) => /* @__PURE__ */ t.jsxs("label", { className: s(s.B("input-label"), a), ...l, children: [
  e,
  " ",
  r && /* @__PURE__ */ t.jsx("span", { className: s.B("required-indicator"), children: "*" })
] }), J = (a, r = "y") => a ?? (q.construct(r) === "y" ? "stretch" : "center"), K = ({
  label: a,
  showLabel: r = !0,
  helpText: e,
  direction: l,
  x: o,
  y: u,
  className: m,
  children: i,
  required: x,
  align: f,
  gap: h = "small",
  padHelpText: c = !1,
  status: n,
  showHelpText: y = !0,
  ...D
}) => {
  const p = N(l, o, u, !1);
  let g;
  const S = y && e != null && e.length > 0, B = r && a != null && a.length > 0;
  return !S && !B ? /* @__PURE__ */ t.jsx(t.Fragment, { children: i }) : (p === "x" ? g = /* @__PURE__ */ t.jsxs(d, { y: !0, gap: "small", children: [
    i,
    y && (c || e != null && e.length > 0) && /* @__PURE__ */ t.jsx(j, { variant: n, children: e })
  ] }) : g = /* @__PURE__ */ t.jsxs(d, { y: !0, gap: 1 / 3, align: "stretch", children: [
    i,
    (c || e != null && e.length > 0) && /* @__PURE__ */ t.jsx(j, { variant: n, children: e })
  ] }), /* @__PURE__ */ t.jsxs(
    d,
    {
      className: s(s.BE("input", "item"), m),
      direction: p,
      gap: h,
      align: J(f, p),
      ...D,
      children: [
        B && /* @__PURE__ */ t.jsx(b, { required: x, children: a }),
        g
      ]
    }
  ));
}, P = ({
  ref: a,
  value: r,
  style: e,
  onChange: l,
  className: o,
  onFocus: u,
  selectOnFocus: m = !1,
  variant: i = "outlined",
  sharp: x = !1,
  children: f,
  wrap: h,
  ...c
}) => /* @__PURE__ */ t.jsx(
  "textarea",
  {
    style: e,
    className: s(
      s.B("textarea"),
      s.BM("textarea", i),
      s.sharp(x),
      o
    ),
    ref: a,
    value: r,
    onChange: (n) => l(n.target.value.replace(/\n/g, "")),
    onFocus: (n) => {
      m && n.target.select(), u?.(n);
    },
    ...c
  }
), Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Calendar: T,
  Checkbox: G,
  Date: A,
  DateTime: L,
  DragButton: _,
  HelpText: j,
  Item: K,
  Label: b,
  Numeric: w,
  Switch: E,
  Text: F,
  TextArea: P,
  Time: H,
  TimeSelector: I,
  combineDateAndTimeValue: M,
  createTimeList: k,
  useDate: z,
  useTime: O
}, Symbol.toStringTag, { value: "Module" }));
export {
  K as I,
  Y as e
};
