"use strict";
exports.__esModule = true;
exports.Picture = exports.cnPicture = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./Picture.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var IconPlay_1 = require("../../icons/IconPlay/IconPlay");
var bem_1 = require("../../utils/bem");
var Button_1 = require("../Button/Button");
exports.cnPicture = (0, bem_1.cn)('Picture');
var Picture = function (props) {
    var _a, _b;
    var url = props.url, urlWebp = props.urlWebp, desktop = props.desktop, desktopWebp = props.desktopWebp, desktop2x = props.desktop2x, desktop2xWebp = props.desktop2xWebp, tablet = props.tablet, tabletWebp = props.tabletWebp, tablet2x = props.tablet2x, tablet2xWebp = props.tablet2xWebp, mobile = props.mobile, mobileWebp = props.mobileWebp, mobile2x = props.mobile2x, mobile2xWebp = props.mobile2xWebp, className = props.className, video = props.video, onClickPlay = props.onClickPlay, buttonSize = props.buttonSize, buttonIconSize = props.buttonIconSize, alt = props.alt, name = props.name, cover = props.cover, borderRadius = props.borderRadius;
    return (react_1["default"].createElement("div", { className: (0, exports.cnPicture)({ borderRadius: borderRadius, cover: cover }, [className]) },
        video && (react_1["default"].createElement(Button_1.Button, { view: "primary", form: "circle", iconRight: IconPlay_1.IconPlay, onlyIcon: true, className: (0, exports.cnPicture)('ButtonPlay'), onClick: onClickPlay, size: buttonSize, iconSize: buttonIconSize })),
        react_1["default"].createElement("picture", null,
            desktopWebp && (react_1["default"].createElement("source", { type: "image/webp", srcSet: "".concat(desktopWebp !== null && desktopWebp !== void 0 ? desktopWebp : urlWebp, " ").concat(desktop2xWebp ? "1x, ".concat(desktop2xWebp, " 2x") : ''), media: !mobile && !tablet ? '(min-width: 0px)' : '(min-width: 1200px)' })),
            react_1["default"].createElement("source", { srcSet: "".concat(desktop !== null && desktop !== void 0 ? desktop : url, " ").concat(desktop2x ? "1x, ".concat(desktop2x, " 2x") : ''), media: !mobile && !tablet ? '(min-width: 0px)' : '(min-width: 1200px)' }),
            tabletWebp && (react_1["default"].createElement("source", { type: "image/webp", srcSet: "".concat(tabletWebp, " 1x, ").concat(tablet2xWebp, " 2x"), media: "(min-width: 767px)" })),
            tablet && react_1["default"].createElement("source", { srcSet: "".concat(tablet, " 1x, ").concat(tablet2x, " 2x"), media: "(min-width: 767px)" }),
            mobileWebp && (react_1["default"].createElement("source", { type: "image/webp", srcSet: "".concat(mobileWebp, " 1x, ").concat(mobile2xWebp, " 2x"), media: "(min-width: 0)" })),
            mobile && react_1["default"].createElement("source", { srcSet: "".concat(mobile, " 1x, ").concat(mobile2x, " 2x"), media: "(min-width: 0)" }),
            react_1["default"].createElement("img", { src: (_b = (_a = desktop !== null && desktop !== void 0 ? desktop : tablet) !== null && _a !== void 0 ? _a : mobile) !== null && _b !== void 0 ? _b : url, alt: alt || name || 'Изображение' }))));
};
exports.Picture = Picture;
