import { __awaiter } from '../node_modules/.pnpm/@rollup_plugin-typescript@12.1.4_rollup@4.46.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.mjs';
import { jsxs, jsx } from 'react/jsx-runtime';
import { getTranslations } from 'next-intl/server';
import { cn } from '@windrun-huaiin/lib/utils';
import Image from 'next/image';
import 'react';
import '@windrun-huaiin/base-ui/components/server';
import './nprogress-bar.mjs';
import '@windrun-huaiin/base-ui/ui';
import './rich-text-expert.mjs';
import 'next/navigation';
import { GalleryInteractive } from './gallery-interactive.mjs';
import '@clerk/nextjs';
import './money-price/money-price-types.mjs';
import 'next/link';
import { Swiper, SwiperSlide } from '../node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/swiper-react.mjs';
import Pagination from '../node_modules/.pnpm/swiper@12.0.3/node_modules/swiper/modules/pagination.mjs';
import { responsiveSection } from './section-layout.mjs';

function Gallery(_a) {
    return __awaiter(this, arguments, void 0, function* ({ locale, sectionClassName, button }) {
        const t = yield getTranslations({ locale, namespace: 'gallery' });
        const galleryItems = t.raw('prompts');
        const data = {
            titleL: t('titleL'),
            eyesOn: t('eyesOn'),
            titleR: t('titleR'),
            description: t('description'),
            items: galleryItems.map((item, index) => ({
                id: `gallery-item-${index}`,
                url: item.url,
                altMsg: item.altMsg
            })),
            defaultImgUrl: t.raw('defaultImgUrl'),
            downloadPrefix: t('downloadPrefix')
        };
        return (jsxs("section", { id: "gallery", className: cn(responsiveSection, sectionClassName), children: [jsxs("h2", { className: "text-3xl md:text-4xl font-bold text-center mb-6", children: [data.titleL, " ", jsx("span", { className: "text-purple-500", children: data.eyesOn }), " ", data.titleR] }), jsx("p", { className: "text-center max-w-2xl mx-auto mb-16", children: data.description }), jsx("div", { className: "block sm:hidden", children: jsx(Swiper, { modules: [Pagination], pagination: { clickable: true }, spaceBetween: 20, slidesPerView: 1, loop: true, className: "rounded-xl overflow-hidden", children: data.items.map((item, index) => (jsx(SwiperSlide, { children: jsxs("div", { className: "relative aspect-square bg-gray-100", children: [jsx(Image, { src: item.url, alt: item.altMsg, fill: true, className: "object-cover", "data-gallery-image": item.id }), jsx("button", { className: "absolute bottom-4 right-4 p-3 rounded-full bg-black/60 hover:bg-black/80 text-white transition-all z-10", "data-gallery-download": item.id, "aria-label": `Download ${item.altMsg}`, children: jsx("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) })] }) }, item.id))) }) }), jsx("div", { className: "hidden sm:grid sm:grid-cols-2 lg:grid-cols-3 gap-6", children: data.items.map((item, index) => (jsxs("div", { className: "group relative overflow-hidden rounded-xl", "data-gallery-item": item.id, "data-gallery-index": index, children: [jsx(Image, { src: item.url, alt: item.altMsg, width: 600, height: 600, className: "w-full h-80 object-cover transition duration-300 group-hover:scale-105", "data-gallery-image": item.id }), jsx("div", { className: "absolute inset-0 flex items-end justify-end p-4 opacity-0 group-hover:opacity-100 transition duration-300", children: jsx("button", { className: "p-2 rounded-full bg-black/50 hover:bg-black/70 text-white/80 hover:text-white transition-all duration-300", "data-gallery-download": item.id, "aria-label": `Download ${item.altMsg}`, children: jsx("svg", { className: "h-5 w-5 text-white", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }) })] }, item.id))) }), button && (jsx("div", { className: "text-center mt-12", children: button })), jsx(GalleryInteractive, { data: data })] }));
    });
}

export { Gallery };
