import { ItemImageTag as d } from "./accelbyte-widgets192.mjs";
import { Ctx as p } from "./accelbyte-widgets33.mjs";
import { UniversalMediaType as o } from "./accelbyte-widgets149.mjs";
import { ItemHelper as g } from "./accelbyte-widgets398.mjs";
import { UrlUtils as u } from "./accelbyte-widgets90.mjs";
import E from "./accelbyte-widgets399.mjs";
import v from "classnames";
import e from "react";
import N from "react-player";
import s from "./accelbyte-widgets400.mjs";
const b = (t) => {
  switch (t.type) {
    case o.YOUTUBE_VIDEO:
    case o.URL_VIDEO:
      return /* @__PURE__ */ e.createElement("div", { className: "banner-video-wrapper" }, /* @__PURE__ */ e.createElement(
        N,
        {
          key: t.content,
          className: "media react-player",
          controls: !1,
          url: t.content,
          playing: !0,
          loop: !0,
          volume: 0
        }
      ));
    default:
      return /* @__PURE__ */ e.createElement("img", { key: t.content, alt: t.content, src: t.content, className: "media", loading: "lazy" });
  }
}, D = (t) => {
  const { item: n, itemPublishingContent: a, isPreviewMode: i, children: r } = t, l = n.title, m = n.description || "", c = p.getAppState().isSingleGame() || i;
  return /* @__PURE__ */ e.createElement("div", { className: s.catalogItemBanner }, a && a.mainBackground && a.mainBackground.content && u.isValidUrl(a.mainBackground.content) ? b(a.mainBackground) : /* @__PURE__ */ e.createElement(
    "img",
    {
      className: "media",
      src: g.getFilteredImageUrlByTag(n.images, d.productBanner) || E,
      alt: ""
    }
  ), /* @__PURE__ */ e.createElement(
    "div",
    {
      className: "media overlay",
      style: {
        backgroundImage: "radial-gradient(736.50px at 50% 50%, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.73) 100%)",
        backgroundSize: "cover",
        backgroundPosition: "center"
      }
    },
    !c && /* @__PURE__ */ e.createElement("div", { className: "bannerContainer" }, /* @__PURE__ */ e.createElement("div", { className: "bannerUpperSpace" }, r), /* @__PURE__ */ e.createElement("div", { className: "bannerContent" }, /* @__PURE__ */ e.createElement("h1", { className: "bannerTitle" }, l), /* @__PURE__ */ e.createElement("div", { className: "bannerDescription" }, m), /* @__PURE__ */ e.createElement("div", { className: v(s.separator) }))),
    c && /* @__PURE__ */ e.createElement("div", { className: "bannerContainer", style: { justifyContent: "center" } }, /* @__PURE__ */ e.createElement("div", { className: "bannerContent" }, /* @__PURE__ */ e.createElement("h1", { className: "bannerTitle" }, l), /* @__PURE__ */ e.createElement("div", { className: "bannerDescription" }, m), /* @__PURE__ */ e.createElement("div", null, r)))
  ));
};
export {
  D as CatalogItemBanner
};
