"use client";
import { jsxs as o, jsx as e } from "react/jsx-runtime";
import { Navigation as v } from "swiper/modules";
import { Swiper as C, SwiperSlide as R } from "swiper/react";
/* empty css                                                                       */
/* empty css                                                                                   */
/* empty css                                                                                   */
import { useSwiper as w } from "../../utils/useSwiper/useSwiper.es.js";
import i from "../../modules/Testimonial/testimonial.module.css";
import { RatingStars as m } from "../../components/RatingStars/RatingStars.es.js";
import { Typography as x } from "../../components/Typography/Typography.es.js";
import { HighlightedTitle as y } from "../../components/HighlightedTitle/HighlightedTitle.es.js";
import { ProgressButton as h } from "../../components/ProgressButton/ProgressButton.es.js";
import { VideoCard as B } from "./components/VideoCard/VideoCard.es.js";
import { TextCard as E } from "./components/TextCard/TextCard.es.js";
const z = [v], W = ({ title: p, rating: a, reviews: g }) => {
  const {
    activeIndex: b,
    isEnd: s,
    isBeginning: n,
    hideNav: l,
    handleSlideChange: N,
    handlePrevClick: t,
    handleNextClick: d,
    onSwiperInit: u,
    handleSwiperResize: S,
    handleReachEnd: f,
    handleReachBeginning: k
  } = w();
  return /* @__PURE__ */ o("section", { className: i.root, children: [
    /* @__PURE__ */ o("div", { className: i.headerContainer, children: [
      a && /* @__PURE__ */ o("div", { className: i.ratingContainer, children: [
        !!a.stars && /* @__PURE__ */ e("div", { className: i.desktop, children: /* @__PURE__ */ e(m, { rating: a.stars, size: "lg" }) }),
        !!a.stars && /* @__PURE__ */ e("div", { className: i.mobile, children: /* @__PURE__ */ e(m, { rating: a.stars, size: "sm" }) }),
        !!a.totalReviews && /* @__PURE__ */ o(
          x,
          {
            as: "p",
            defaultVariant: "labelLg",
            mobileVariant: "labelSm",
            emphasis: !0,
            weight: "regular",
            children: [
              a.totalReviews,
              "+ member reviews"
            ]
          }
        )
      ] }),
      /* @__PURE__ */ o("div", { className: i.headerRow, children: [
        /* @__PURE__ */ e(y, { title: p, colorScheme: "light" }),
        !l && /* @__PURE__ */ e("div", { className: i.desktopNavigation, children: /* @__PURE__ */ e(
          h,
          {
            left: {
              disabled: n,
              onClick: t
            },
            right: {
              disabled: s,
              onClick: d
            }
          }
        ) })
      ] })
    ] }),
    /* @__PURE__ */ e("div", { className: i.content, children: /* @__PURE__ */ e(
      C,
      {
        onSwiper: u,
        onResize: S,
        onSlideChange: N,
        onReachEnd: f,
        onReachBeginning: k,
        modules: z,
        spaceBetween: 0,
        slidesPerView: "auto",
        className: i.swiper,
        children: g.map((r, c) => /* @__PURE__ */ e(R, { className: i.swiperSlide, children: r.background.type === "video" ? /* @__PURE__ */ e(
          B,
          {
            ...r,
            background: r.background,
            isActive: b === c
          }
        ) : /* @__PURE__ */ e(E, { ...r, background: r.background }) }, `${r.background.type}_${c}`))
      }
    ) }),
    !l && /* @__PURE__ */ e("div", { className: i.mobileNavigation, children: /* @__PURE__ */ e(
      h,
      {
        left: {
          disabled: n,
          onClick: t
        },
        right: {
          disabled: s,
          onClick: d
        }
      }
    ) })
  ] });
};
export {
  W as Testimonial
};
