import { jsxs as c, jsx as t } from "react/jsx-runtime";
import { gap1 as p, dFlex as g } from "./index-general.module.js";
import { classNames as i } from "./index-classNames.js";
import { GalleryMediaItem as h } from "./index-GalleryMediaItem.js";
import { IconNames as u } from "./index-IconNames.js";
import { ModalService as v } from "./index-ModalService.js";
import { Render as I } from "./index-Render.js";
import { Text as S } from "./index-Text.js";
import "react";
import l from "./index-GallerySummary.module.scss.js";
const s = 3, C = (d) => {
  const {
    mediaItems: r
  } = d;
  if (!r || r.length === 0)
    return null;
  const f = r.slice(0, s), a = r.length - s, y = [{
    text: "Preview",
    icon: u.visibility,
    callback: (o) => {
      const e = r.filter((m) => {
        var n;
        return !(((n = m == null ? void 0 : m.settings) == null ? void 0 : n.toBeDeleted) ?? !1);
      });
      v.openPhotoGalleryModal(e, o);
    }
  }];
  return c("div", {
    className: i(l.gallerySummaryContainer, g, p),
    children: [f.map((o, e) => t("div", {
      className: i(l.gallerySummaryItem, e > 0 ? l.stacked : ""),
      style: {
        zIndex: s - e
      },
      children: t("div", {
        className: i(l.gallerySummaryImage),
        children: t(h, {
          mediaItem: o,
          width: 144,
          height: 144,
          actions: e === 0 ? y : void 0
        })
      })
    }, e)), t(I, {
      if: a > 0,
      children: t("div", {
        className: i(l.gallerySummaryMore),
        children: c(S, {
          color: "--fn-fg-lightest",
          children: ["+", a]
        })
      })
    })]
  });
};
export {
  C as GallerySummary
};
