import { a as Ctx, v as LoginPath, T as Trans, f as Button, K as Env } from "./index.js";
import { b as brokenRocket } from "./brokenRocket.js";
import { s as starBgGradient } from "./starBgGradient.js";
import * as React from "react";
import "./ErrorPage.js";
import "./dateFns.js";
import "./validator.js";
import "./reactPlayer.js";
import "react-router-dom";
import "./reactSlick.js";
class ErrorFetchUserPage extends React.Component {
  constructor() {
    super(...arguments);
    this.logout = () => {
      Ctx.getAppState().state.appHistory.push(LoginPath.Logout.link);
    };
    this.reloadPage = () => window.location.reload();
  }
  render() {
    const contactSupportEmail = Env.CONTACT_SUPPORT_EMAIL;
    return /* @__PURE__ */ React.createElement("div", {
      className: "mainPageContainer"
    }, /* @__PURE__ */ React.createElement("div", {
      className: "errorPage",
      style: { backgroundImage: `url(${starBgGradient})` }
    }, /* @__PURE__ */ React.createElement("div", {
      className: "errorPageContentWrapper errorFetchUser"
    }, /* @__PURE__ */ React.createElement("div", {
      className: "errorPageContent"
    }, /* @__PURE__ */ React.createElement("img", {
      src: brokenRocket,
      alt: "space ship alien",
      loading: "lazy"
    }), /* @__PURE__ */ React.createElement("div", {
      className: "errorPageText"
    }, /* @__PURE__ */ React.createElement("h2", {
      className: "textHeading"
    }, /* @__PURE__ */ React.createElement(Trans, {
      i18nKey: "FetchUserErrorPage.title"
    }, "Internal Server Error")), /* @__PURE__ */ React.createElement("div", {
      className: "textContent"
    }, !!contactSupportEmail && /* @__PURE__ */ React.createElement(Trans, {
      i18nKey: "FetchUserErrorPage.textContentWithSupport"
    }, /* @__PURE__ */ React.createElement("p", null, "Oops.. Something went wrong. Try to refresh this page or log in again. If the problem persists, please contact our support at ", /* @__PURE__ */ React.createElement("a", {
      href: `mailto:${contactSupportEmail}`
    }, { contactSupportEmail }))), !contactSupportEmail && /* @__PURE__ */ React.createElement(Trans, {
      i18nKey: "FetchUserErrorPage.textContent"
    }, /* @__PURE__ */ React.createElement("p", null, "Don't worry, our team on Mars is working hard to fix this! For now let's retreat to our home page.")), /* @__PURE__ */ React.createElement("div", {
      className: "buttonWrapper"
    }, /* @__PURE__ */ React.createElement(Button, {
      className: "btn btn-primary",
      onClick: this.reloadPage
    }, /* @__PURE__ */ React.createElement(Trans, {
      i18nKey: "FetchUserErrorPage.refresh"
    }, "Refresh")), /* @__PURE__ */ React.createElement(Button, {
      className: "btn",
      onClick: this.logout
    }, /* @__PURE__ */ React.createElement(Trans, {
      i18nKey: "FetchUserErrorPage.logout"
    }, "Log out")))))))));
  }
}
export { ErrorFetchUserPage as default };
