import x from "./AccountPageLayout-5b93ec96.mjs";
import { a as N } from "./AccountUtils-1a8a81d7.mjs";
import { k as s, l as u, n as A, g as t, U as d, o as v } from "./index-162fd1aa.mjs";
import e from "react";
import { withRouter as w, Switch as D, Route as r, Redirect as l } from "react-router-dom";
import "./reactSlick-cb4a2d39.mjs";
import "./dateFns-2367ee5b.mjs";
import "./reactPlayer-2f69f369.mjs";
import "./NavItemPlaceholder-0cfc6c3b.mjs";
import "./SuccessFlatIcon-54f5f907.mjs";
import "./MockVars-1cf2eb0a.mjs";
import "./validator-61879ab7.mjs";
const H = e.lazy(() => import("./AccountDeletionPage-a75a8508.mjs")), O = e.lazy(() => import("./AccountHistoryPage-fc1dcf3b.mjs")), R = e.lazy(() => import("./ChangePasswordPage-0f2b4d4b.mjs")), C = e.lazy(() => import("./LinkedAccountsPage-78e9dfac.mjs")), b = e.lazy(() => import("./NotificationPreferencesPage-60829589.mjs")), U = e.lazy(() => import("./OrderHistoryDetailPage-e9e52c04.mjs")), I = e.lazy(() => import("./OrderHistoryPage-c89f5bbc.mjs")), S = e.lazy(() => import("./AccountOverviewPage-f29f79f5.mjs")), B = e.lazy(() => import("./PaymentMethodsPage-ed75bb49.mjs")), M = e.lazy(() => import("./PersonalDataPage-392e626c.mjs")), L = e.lazy(() => import("./PrivacyRecordsPage-58d67855.mjs")), V = e.lazy(() => import("./ProfilePage-ed9c351f.mjs")), W = e.lazy(() => import("./PurchasedItemsPage-1b8f8284.mjs")), _ = e.lazy(() => import("./RedeemCodePage-0dca7caa.mjs"));
class $ extends e.Component {
  constructor(c) {
    super(c);
  }
  async componentDidMount() {
    s.updateBackground(`url(${u})`);
  }
  componentWillUnmount() {
    s.updateBackground(null);
  }
  render() {
    const {
      accountOverview: c,
      profile: i,
      changePassword: p,
      purchasedItems: P,
      orderHistory: m,
      paymentMethods: g,
      redeemCode: h,
      notification: y,
      privacyRecords: E,
      personalData: k,
      deleteAccount: f,
      linkedAccounts: z
    } = v;
    return /* @__PURE__ */ e.createElement(x, { accountPageNav: A, backgroundImageUrl: u, ...this.props }, /* @__PURE__ */ e.createElement(D, null, c() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.Overview.link, render: () => /* @__PURE__ */ e.createElement(S, null) }), P() && /* @__PURE__ */ e.createElement(r, { path: t.PurchasedItems.link, render: () => /* @__PURE__ */ e.createElement(W, null) }), g() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.PaymentMethods.link, render: () => /* @__PURE__ */ e.createElement(B, null) }), p() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.ChangePassword.link, render: () => /* @__PURE__ */ e.createElement(R, null) }), h() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.RedeemCode.link, render: () => /* @__PURE__ */ e.createElement(_, null) }), m() && /* @__PURE__ */ e.createElement(
      r,
      {
        key: "OrderHistoryPage",
        exact: !0,
        path: t.OrderHistory.link,
        render: (n) => {
          const a = Number(d.silentSearchParamsBuilder(n.location.search).get("page")), o = !Number.isNaN(a) && a >= 1;
          return o ? o && /* @__PURE__ */ e.createElement(I, { page: a }) : /* @__PURE__ */ e.createElement(l, { to: t.OrderHistory.withSearchParams({ page: 1 }) });
        }
      }
    ), m() && /* @__PURE__ */ e.createElement(
      r,
      {
        key: "OrderHistoryDetailPage",
        path: t.OrderHistoryDetail.link,
        render: (n) => /* @__PURE__ */ e.createElement(U, { orderNo: n.match.params.orderNo })
      }
    ), i() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.Profile.link, render: () => /* @__PURE__ */ e.createElement(V, null) }), i() && /* @__PURE__ */ e.createElement(r, { path: t.ProfileHistory.link, render: () => /* @__PURE__ */ e.createElement(O, null) }), z() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.LinkedAccounts.link, render: () => /* @__PURE__ */ e.createElement(C, null) }), k() && /* @__PURE__ */ e.createElement(
      r,
      {
        exact: !0,
        path: t.PersonalData.link,
        render: (n) => {
          const a = Number(d.silentSearchParamsBuilder(n.location.search).get("page")), o = !Number.isNaN(a) && a >= 1;
          return o ? o && /* @__PURE__ */ e.createElement(M, { page: a }) : /* @__PURE__ */ e.createElement(l, { to: t.PersonalData.withSearchParams({ page: 1 }) });
        }
      }
    ), f() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.AccountDeletion.link, render: () => /* @__PURE__ */ e.createElement(H, null) }), y() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.NotificationPreferences.link, render: () => /* @__PURE__ */ e.createElement(b, null) }), E() && /* @__PURE__ */ e.createElement(r, { exact: !0, path: t.PrivacyRecords.link, render: () => /* @__PURE__ */ e.createElement(L, null) }), /* @__PURE__ */ e.createElement(l, { from: "/**", to: N() })));
  }
}
const re = w($);
export {
  re as default
};
