import "../../assets/index.css";
import { jsx as r, jsxs as s, Fragment as v } from "react/jsx-runtime";
import { useState as N } from "react";
import x from "../Icons.js";
import { cn as o } from "../../utils/functions.js";
import { RenderIf as d } from "../../utils/components/RenderIf.js";
import { cardTitleVariants as b, cardFooterVariants as y, cardVariants as w } from "./variants.js";
const g = "_accordion__body_cwdh9_1", F = {
  accordion__body: g
}, _ = ({ children: a, variant: e, className: c, onClick: i }) => /* @__PURE__ */ r("div", { onClick: i, className: o(b(e), c), children: a }), I = ({ letter: a, title: e }) => /* @__PURE__ */ s("div", { className: " cs3__center__wrapper _gap-2 _font-secondary", children: [
  /* @__PURE__ */ r(d, { condition: !!a, children: /* @__PURE__ */ r("span", { className: "cs3__center__wrapper _h-8 _w-8 _rounded-[50px] _bg-primary _text-maximun _font-semibold _text-white", children: a }) }),
  /* @__PURE__ */ r("p", { className: "_text-common", children: e })
] }), T = ({ children: a, className: e, variant: c }) => /* @__PURE__ */ r("div", { className: o(y(c), e), children: a }), V = ({
  children: a,
  variant: e,
  className: c,
  titleToShow: i,
  defaultOpen: m = !0,
  canCloseContent: n = !1,
  contentClassName: l,
  accordionClassName: p,
  ...h
}) => {
  const [t, f] = N(m), u = () => {
    n && f(!t);
  };
  return /* @__PURE__ */ s("div", { className: o(w(e), c), ...h, children: [
    /* @__PURE__ */ r(
      _,
      {
        onClick: u,
        className: o({ "_cursor-pointer": n, "_border-transparent": n && !t }),
        variant: { variant: "govco" },
        children: /* @__PURE__ */ s(v, { children: [
          i,
          /* @__PURE__ */ r(d, { condition: n, children: /* @__PURE__ */ r(x.ArrowSlim, { className: o({ "_rotate-180": t }) }) })
        ] })
      }
    ),
    /* @__PURE__ */ r("div", { className: o(F.accordion__body, p), "data-active": `${t}`, children: /* @__PURE__ */ r("div", { className: o(t ? l : ""), children: a }) })
  ] });
}, B = {
  Wrapper: V,
  Footer: T,
  Header: _,
  Tilte: I
};
export {
  V as Card,
  B as default
};
