import E from "./accelbyte-widgets44.mjs";
import { Ctx as r } from "./accelbyte-widgets33.mjs";
import { AccPath as a } from "./accelbyte-widgets34.mjs";
import { LoginPath as h } from "./accelbyte-widgets35.mjs";
import { FeUtils as s } from "./accelbyte-widgets45.mjs";
import { IamUserAuthorizationClient as k, IamHelper as u } from "@accelbyte/sdk-iam";
import { LegalHelper as A } from "@accelbyte/sdk-legal";
import e from "react";
import { Route as t, Redirect as y } from "react-router-dom";
import L from "./accelbyte-widgets46.mjs";
import U from "./accelbyte-widgets47.mjs";
import x from "./accelbyte-widgets48.mjs";
import T from "./accelbyte-widgets49.mjs";
import C from "./accelbyte-widgets50.mjs";
import { TwitchDropPageContainer as D } from "./accelbyte-widgets51.mjs";
import F from "./accelbyte-widgets52.mjs";
import w from "./accelbyte-widgets53.mjs";
import S from "./accelbyte-widgets54.mjs";
import H from "./accelbyte-widgets55.mjs";
import { TwitchPath as V } from "./accelbyte-widgets56.mjs";
import { FeatureFlags as I } from "./accelbyte-widgets57.mjs";
const re = () => {
  const g = r.getUserManager(), p = r.getLegalManager(), P = r.getGdprManager(), { user: n, errorFetchingUser: f, mfaData: o } = g.state, { eligibilities: d } = p.state, { gdprDeletionStatus: c } = P.state, i = r.getAppState(), { appHistory: l } = i.state, m = s.getSearchParamsObject(l).get("error");
  return m ? (s.redirectToErrorPage(l, k.deduceLoginError(m)), null) : [
    /* @__PURE__ */ e.createElement(t, { exact: !0, key: "LinkPlatformAccountPage", path: a.LinkPlatformAccount.link, render: () => /* @__PURE__ */ e.createElement(w, null) }),
    /* @__PURE__ */ e.createElement(
      t,
      {
        exact: !0,
        key: "LinkAccountWithOneTimeCodePage",
        path: a.LinkAccountWithOneTimeCode.link,
        render: () => /* @__PURE__ */ e.createElement(H, null)
      }
    ),
    /* @__PURE__ */ e.createElement(t, { exact: !0, key: "VerifyUserPage", path: h.VerifyUser.link, render: () => /* @__PURE__ */ e.createElement(S, null) }),
    /* @__PURE__ */ e.createElement(
      t,
      {
        exact: !0,
        key: "AccountDeletionSuccessPage",
        path: a.AccountDeletionSuccess.link,
        render: () => /* @__PURE__ */ e.createElement(L, null)
      }
    ),
    /* @__PURE__ */ e.createElement(
      t,
      {
        exact: !0,
        key: "TwitchLink",
        path: a.TwitchLinking.link,
        render: () => r.hasFeature(I.isTwitchDropEnabled) ? /* @__PURE__ */ e.createElement(y, { to: V.twitchDropPage.link }) : /* @__PURE__ */ e.createElement(D, null)
      }
    ),
    !!f && /* @__PURE__ */ e.createElement(t, { key: "FetchUserErrorPage", render: () => /* @__PURE__ */ e.createElement(C, null) }),
    u.currentUserIsHeadlessAccount(n) && /* @__PURE__ */ e.createElement(t, { exact: !0, key: "UpgradeHeadlessAccountPage", render: () => /* @__PURE__ */ e.createElement(T, null) }),
    !n && (o == null ? void 0 : o.mfaToken) && /* @__PURE__ */ e.createElement(t, { exact: !0, key: "TwoFactorAuthentication", render: () => /* @__PURE__ */ e.createElement(F, null) }),
    A.currentUserIsBlockedByLegal(d) && /* @__PURE__ */ e.createElement(t, { key: "PromptLegalPage", render: () => /* @__PURE__ */ e.createElement(E, null) }),
    n && c && c.DeletionStatus && /* @__PURE__ */ e.createElement(t, { exact: !0, key: "AccountDeletionNoticePage", render: () => /* @__PURE__ */ e.createElement(U, { appState: i }) }),
    u.currentUserNeedsVerification(n) && /* @__PURE__ */ e.createElement(t, { key: "EmailVerificationPage", render: () => /* @__PURE__ */ e.createElement(x, null) })
  ];
};
export {
  re as AccountInterceptorsWidget
};
