import { Tabs as c, TabStyles as m } from "./accelbyte-widgets174.mjs";
import u from "./accelbyte-widgets210.mjs";
import o from "classnames";
import e from "react";
import { Trans as s } from "react-i18next";
import "./accelbyte-widgets433.mjs";
const d = (n) => {
  const { requirements: r } = n;
  return /* @__PURE__ */ e.createElement("div", { className: "requirementItemList" }, r.map((t, l) => /* @__PURE__ */ e.createElement("div", { key: `${l} ${t.label}` }, /* @__PURE__ */ e.createElement("div", { className: "itemLabel" }, t.label), /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.osVersion" }, "OS Version"),
      value: t.osVersion
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.processor" }, "Processor"),
      value: t.processor
    }
  ), /* @__PURE__ */ e.createElement(a, { title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.ram" }, "RAM"), value: t.ram }), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.graphics" }, "Graphics Card"),
      value: t.graphics
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.directXVersion" }, "Direct X Version"),
      value: t.directXVersion
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.diskSpace" }, "Disk Space"),
      value: t.diskSpace
    }
  ), /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.soundCard" }, "Sound Card"),
      value: t.soundCard
    }
  ), t.additionals && /* @__PURE__ */ e.createElement(
    a,
    {
      title: /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.requirements.additionals" }, "Additional Requirements"),
      value: t.additionals
    }
  )))));
}, a = (n) => {
  const { title: r, value: t } = n;
  return /* @__PURE__ */ e.createElement("li", { className: "requirementItem" }, /* @__PURE__ */ e.createElement("span", { className: "itemTitle" }, r), /* @__PURE__ */ e.createElement("span", { className: "itemContent" }, t || "-"));
}, K = u(
  class extends e.Component {
    constructor() {
      super(...arguments), this.state = {
        selectedRequirementKey: null
      };
    }
    componentDidMount() {
      const {
        additionalAppInfo: { platformRequirements: r }
      } = this.props;
      this.setState({
        selectedRequirementKey: Object.keys(r || {})[0] || null
      });
    }
    render() {
      const {
        additionalAppInfo: { platformRequirements: r }
      } = this.props;
      if (!r)
        return null;
      const t = Object.keys(r);
      if (!this.state.selectedRequirementKey)
        return null;
      const l = r[this.state.selectedRequirementKey];
      if (l)
        return /* @__PURE__ */ e.createElement("div", { className: o("gamePlatformRequirements", this.props.className) }, /* @__PURE__ */ e.createElement("h3", { className: "requirementTitle" }, /* @__PURE__ */ e.createElement(s, { i18nKey: "PlatformRequirements.systemRequirement" }, "System Requirements")), /* @__PURE__ */ e.createElement(c, null, t.map((i) => /* @__PURE__ */ e.createElement(
          "span",
          {
            className: o(m.tab, i === this.state.selectedRequirementKey && m.active),
            onClick: () => this.setState({
              selectedPlatformKey: i
            }),
            key: i
          },
          i
        ))), /* @__PURE__ */ e.createElement(d, { requirements: l }));
    }
  },
  (n, r) => n.additionalAppInfo !== r.additionalAppInfo
);
export {
  K as PlatformRequirements
};
