import { a as be, $ as Ae, S as we, i as Me, s as ve, f as k, b as Pe, n as N, d as B, c as H, e as p, g as _e, h as xe, j as Q, o as ke, k as Ie, l as j, m as re, p as a, q as C, r as c, t as d, u as O, v as T, w as Ce, x as q, y as W, z as Y, A as Fe, B as Le, C as Ee, D as Be } from "./PlayerAccountControllerNd-CkpwTACY.js";
import "../stencil/ui-skeleton-fEyshHrf.js";
import "../lazy/general-logout-C5ff8JCi.js";
function $(n, e) {
  be(n, e);
}
function He(n) {
  Ae.set(n);
}
const ee = {
  en: {
    title: "My Account"
  },
  "zh-hk": {
    title: "我的帳戶"
  },
  fr: {
    title: "Mon compte"
  },
  tr: {
    title: "Hesabım"
  },
  ro: {
    title: "Contul meu"
  },
  es: {
    title: "Mi Cuenta"
  },
  pt: {
    title: "Minha Conta"
  },
  hr: {
    title: "Moj račun"
  },
  "pt-br": {
    title: "Minha conta"
  },
  "es-mx": {
    title: "Mi cuenta"
  },
  "en-us": {
    title: "My Account"
  }
};
function We(n) {
  Pe(n, "svelte-j26xf8", '.PlayerAccountMenuContainer{background:var(--emw--color-primary, #184026);color:var(--emw--pam-typography-color-nav-bg, var(--emw--color-contrast, #FFFFFF));position:relative;height:100vh;display:flex;flex-direction:column;padding:0 15px;animation-name:fadeIn;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.3s}.PlayerAccountMenuContainer .PlayerAccountMenuItemWrapper{margin:0;word-break:break-all;display:flex;align-items:center}.PlayerAccountMenuContainer .PlayerAccountMenuItemWrapper span{display:flex;align-items:center}.PlayerAccountMenuContainer .skeletonLogOut{width:100%;border-radius:10px;overflow:hidden}.PlayerAccountMenuHeader{color:var(--emw--pam-typography-color-nav-bg, var(--emw--color-contrast, #FFFFFF));flex-grow:0;padding:30px 20px}.PlayerAccountMenuHeader .PlayerAccountMenuUser{margin-bottom:5px;font-size:var(--emw--font-size-large, 20px);color:var(--emw--pam-color-secondary, var(--emw--color-secondary, #E98B10))}.PlayerAccountMenuHeader .PlayerAccountMenuEmail{font-size:var(--emw--font-size-small, 14px);text-overflow:ellipsis;overflow:hidden}.PlayerAccountMenuHeader p{font-weight:300}.PlayerAccountMenuHeaderMobile{color:var(--emw--pam-typography-color-nav-bg, var(--emw--color-contrast, #FFFFFF))}.PlayerAccountMenuItemBox{padding:14px 20px;margin:2px 0;font-size:var(--emw--font-size-medium, 16px);line-height:16px;display:inline-flex;width:100%;box-sizing:border-box;align-items:center;border-radius:var(--emw--border-radius-medium, 10px);border:2px solid transparent;cursor:pointer;transition:all 0.3s linear}.PlayerAccountMenuItemBox:hover{transition:all 0.3s linear;background:rgba(35, 176, 78, 0.3);border:2px solid var(--emw--pam-color-primary, var(--emw--color-primary, #23B04E));border-radius:var(--emw--border-radius-medium, 10px);color:var(--emw--color-white, #FFFFFF)}.PlayerAccountMenuItemBox .PlayerAccountMenuItemTitle{margin-left:20px}.PlayerAccountMenuItemBox .PlayerAccountMenuItemIcon{width:20px;height:20px;padding-top:unset}.PlayerAccountMenuItemBox .PlayerAccountMenuItemIconMobile{width:30px;height:30px;padding-top:15px}.PlayerAccountMenuList::-webkit-scrollbar{width:6px}.PlayerAccountMenuList::-webkit-scrollbar-track{background:var(--emw--color-gray-300, #58586B)}.PlayerAccountMenuList::-webkit-scrollbar-thumb{background:var(--emw--color-gray-100, #E6E6E6)}.PlayerAccountItemWrap{display:flex;gap:20px;padding:16px 20px}.PlayerAccountItemWrap.PlayerAccountItemWrapMobile{padding:5px;width:100%;box-sizing:border-box}.PlayerAccountItemWrap ui-skeleton:last-child{flex:1}.PlayerAccountLogOutArea{background-color:rgba(253, 40, 57, 0.3);color:var(--emw--color-white, #FFFFFF);border-radius:var(--emw--border-radius-medium, 10px);width:100%;flex-grow:0}.PlayerAccountMenuActiveItemBox{background:rgba(35, 176, 78, 0.3);color:var(--emw--pam-color-primary, var(--emw--color-primary, #23B04E));border:2px solid var(--emw--pam-color-primary, var(--emw--color-primary, #23B04E));border-radius:var(--emw--border-radius-medium, 10px);transition:all 0.3s linear}.PlayerAccountMobileContainer{height:unset;padding:0}.PlayerAccountMobileContainer .PlayerAccountMenuCategoryWrapper{display:flex;align-items:center;gap:10px;margin-bottom:18px}.PlayerAccountMobileContainer .PlayerAccountMenuCategoryTitle{margin:0;font-weight:600}.PlayerAccountMobileContainer .PlayerAccountMenuItemTitle{margin-left:0;text-transform:capitalize;line-height:14px}.PlayerAccountMobileContainer .PlayerAccountMenuEmail{margin:0}.PlayerAccountMobileContainer .PlayerAccountMenuList{display:flex;flex-direction:column;align-items:flex-start;margin:0px 15px;min-height:900px}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemBox{background:rgba(35, 176, 78, 0.3);color:var(--emw--pam-color-primary, var(--emw--color-primary, #23B04E));border:2px solid var(--emw--pam-color-primary, var(--emw--color-primary, #23B04E));border-radius:var(--emw--border-radius-medium, 10px);height:60px;margin:5px 0;align-items:flex-start;position:relative}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemBox.PlayerAccountMenuActiveItemBox{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemBox .PlayerAccountMenuItemIcon{width:20px;padding:0 10px 0 15px}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemBox::after{content:"";display:inline-block;width:15px;height:15px;background-image:url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2215%22 height=%2215%22 viewBox=%220 0 15 15%22%3E%3Cdefs%3E%3Cstyle%3E.aaa%7Bfill:var(--emw--color-white,%20%23FFFFFF);%7D%3C/style%3E%3C/defs%3E%3Cg transform=%22translate(-20%20-158)%22%3E%3Cg transform=%22translate(20%20158)%22%3E%3Cpath class=%22aaa%22 d=%22M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z%22 transform=%22translate(15%2015)%20rotate(180)%22%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E");background-size:contain;transform:scaleX(-1);background-repeat:no-repeat;position:absolute;right:15px;top:22px}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemWrapper{display:flex;justify-items:center;align-items:center;flex-flow:row;gap:6px;position:absolute;top:0;bottom:0;left:0;right:0}.PlayerAccountMobileContainer .PlayerAccountMenuList .PlayerAccountMenuItemWrapper .PlayerAccountMenuItemTitle{font-size:var(--emw--font-size-medium, 16px);line-height:16px;font-weight:400;word-break:break-word;text-align:left;color:var(--emw--pam-typography-color-nav-bg, var(--emw--color-contrast, #FFFFFF))}.PlayerAccountMobileContainer .PlayerAccountLogOutArea{position:absolute;right:18px;top:56px;bottom:unset;background:transparent;width:48px;border-top:0}@keyframes fadeIn{0%{opacity:0.01}1%{opacity:0}50%{opacity:0}100%{opacity:1}}');
}
function te(n, e, t) {
  const i = n.slice();
  return i[45] = e[t], i;
}
function ne(n, e, t) {
  const i = n.slice();
  return i[42] = e[t], i;
}
function ze(n) {
  let e, t, i, r, s = (
    /*showaliasasusername*/
    (n[5] === "true" ? (
      /*profileAlias*/
      n[12]
    ) : (
      /*profileUsername*/
      n[10]
    )) + ""
  ), u, A, h, P, v, M, b, f, o = (
    /*isMobile*/
    n[14] && Se(n)
  ), y = (
    /*isMobile*/
    n[14] && je(n)
  ), m = j(
    /*menuItems*/
    n[8]
  ), w = [];
  for (let g = 0; g < m.length; g += 1)
    w[g] = le(te(n, m, g));
  let E = !/*isMobile*/
  n[14] && Oe(n);
  return {
    c() {
      e = p("div"), t = p("div"), o && o.c(), i = C(), r = p("p"), u = T(s), A = C(), h = p("p"), P = T(
        /*profileEmail*/
        n[11]
      ), v = C(), y && y.c(), M = C(), b = p("div");
      for (let g = 0; g < w.length; g += 1)
        w[g].c();
      f = C(), E && E.c(), d(r, "class", "PlayerAccountMenuUser"), d(r, "translate", "no"), d(h, "class", "PlayerAccountMenuEmail"), d(h, "translate", "no"), d(t, "class", "PlayerAccountMenuHeader " + /*isMobile*/
      (n[14] ? "PlayerAccountMenuHeaderMobile" : "")), d(b, "class", "PlayerAccountMenuList"), d(e, "class", "PlayerAccountMenuContainer " + /*isMobile*/
      (n[14] ? "PlayerAccountMobileContainer" : ""));
    },
    m(g, F) {
      H(g, e, F), a(e, t), o && o.m(t, null), a(t, i), a(t, r), a(r, u), a(t, A), a(t, h), a(h, P), a(t, v), y && y.m(t, null), a(e, M), a(e, b);
      for (let _ = 0; _ < w.length; _ += 1)
        w[_] && w[_].m(b, null);
      a(e, f), E && E.m(e, null);
    },
    p(g, F) {
      if (
        /*isMobile*/
        g[14] && o.p(g, F), F[0] & /*showaliasasusername, profileAlias, profileUsername*/
        5152 && s !== (s = /*showaliasasusername*/
        (g[5] === "true" ? (
          /*profileAlias*/
          g[12]
        ) : (
          /*profileUsername*/
          g[10]
        )) + "") && O(u, s), F[0] & /*profileEmail*/
        2048 && O(
          P,
          /*profileEmail*/
          g[11]
        ), /*isMobile*/
        g[14] && y.p(g, F), F[0] & /*selectedItem, menuItems, isMobile, openAccountSection*/
        49920
      ) {
        m = j(
          /*menuItems*/
          g[8]
        );
        let _;
        for (_ = 0; _ < m.length; _ += 1) {
          const L = te(g, m, _);
          w[_] ? w[_].p(L, F) : (w[_] = le(L), w[_].c(), w[_].m(b, null));
        }
        for (; _ < w.length; _ += 1)
          w[_].d(1);
        w.length = m.length;
      }
      /*isMobile*/
      g[14] || E.p(g, F);
    },
    d(g) {
      g && B(e), o && o.d(), y && y.d(), re(w, g), E && E.d();
    }
  };
}
function Te(n) {
  let e, t, i, r, s, u, A, h, P, v, M = (
    /*isMobile*/
    n[14] && Ue()
  ), b = j(Array(18)), f = [];
  for (let o = 0; o < b.length; o += 1)
    f[o] = ie(ne(n, b, o));
  return {
    c() {
      e = p("div"), t = p("div"), M && M.c(), i = C(), r = p("ui-skeleton"), s = C(), u = p("ui-skeleton"), A = C(), h = p("div");
      for (let o = 0; o < f.length; o += 1)
        f[o].c();
      P = C(), v = p("div"), v.innerHTML = '<ui-skeleton structure="rectangle" width="auto" height="60px"></ui-skeleton>', c(r, "structure", "title"), c(r, "width", "100px"), c(r, "height", "20px"), c(r, "margin-top", "20px"), c(u, "structure", "text"), c(u, "width", "200px"), c(u, "height", "20px"), d(t, "class", "PlayerAccountMenuHeader " + /*isMobile*/
      (n[14] ? "PlayerAccountMenuHeaderMobile" : "")), d(h, "class", "PlayerAccountMenuList"), d(v, "class", "skeletonLogOut"), d(e, "class", "PlayerAccountMenuContainer " + /*isMobile*/
      (n[14] ? "PlayerAccountMobileContainer" : ""));
    },
    m(o, y) {
      H(o, e, y), a(e, t), M && M.m(t, null), a(t, i), a(t, r), a(t, s), a(t, u), a(e, A), a(e, h);
      for (let m = 0; m < f.length; m += 1)
        f[m] && f[m].m(h, null);
      a(e, P), a(e, v);
    },
    p(o, y) {
      if (y[0] & /*isMobile*/
      16384) {
        b = j(Array(18));
        let m;
        for (m = 0; m < b.length; m += 1) {
          const w = ne(o, b, m);
          f[m] ? f[m].p(w, y) : (f[m] = ie(w), f[m].c(), f[m].m(h, null));
        }
        for (; m < f.length; m += 1)
          f[m].d(1);
        f.length = b.length;
      }
    },
    d(o) {
      o && B(e), M && M.d(), re(f, o);
    }
  };
}
function Se(n) {
  let e, t, i, r, s, u, A, h, P, v, M = (
    /*$_*/
    n[13]("title") + ""
  ), b, f, o;
  return {
    c() {
      e = p("div"), t = W("svg"), i = W("defs"), r = W("style"), s = T(".aaa{fill:var(--emw--color-white, #FFFFFF);}"), u = W("g"), A = W("g"), h = W("path"), P = C(), v = p("h3"), b = T(M), d(h, "class", "aaa"), d(h, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), d(h, "transform", "translate(15 15) rotate(180)"), d(A, "transform", "translate(20 158)"), d(u, "transform", "translate(-20 -158)"), d(t, "xmlns", "http://www.w3.org/2000/svg"), d(t, "width", "15"), d(t, "height", "15"), d(t, "viewBox", "0 0 15 15"), d(v, "class", "PlayerAccountMenuCategoryTitle"), d(e, "class", "PlayerAccountMenuCategoryWrapper");
    },
    m(y, m) {
      H(y, e, m), a(e, t), a(t, i), a(i, r), a(r, s), a(t, u), a(u, A), a(A, h), a(e, P), a(e, v), a(v, b), f || (o = [
        q(
          t,
          "click",
          /*goToHome*/
          n[16]
        ),
        q(
          v,
          "click",
          /*goToHome*/
          n[16]
        )
      ], f = !0);
    },
    p(y, m) {
      m[0] & /*$_*/
      8192 && M !== (M = /*$_*/
      y[13]("title") + "") && O(b, M);
    },
    d(y) {
      y && B(e), f = !1, Ce(o);
    }
  };
}
function je(n) {
  let e, t;
  return {
    c() {
      e = p("div"), t = p("general-logout"), c(
        t,
        "endpoint",
        /*endpoint*/
        n[1]
      ), c(
        t,
        "session",
        /*session*/
        n[0]
      ), c(t, "buttonlocation", "PlayerAccountMenu"), c(
        t,
        "clientstyling",
        /*clientstyling*/
        n[2]
      ), c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        n[3]
      ), c(
        t,
        "mbsource",
        /*mbsource*/
        n[4]
      ), d(e, "class", "PlayerAccountLogOutArea");
    },
    m(i, r) {
      H(i, e, r), a(e, t);
    },
    p(i, r) {
      r[0] & /*endpoint*/
      2 && c(
        t,
        "endpoint",
        /*endpoint*/
        i[1]
      ), r[0] & /*session*/
      1 && c(
        t,
        "session",
        /*session*/
        i[0]
      ), r[0] & /*clientstyling*/
      4 && c(
        t,
        "clientstyling",
        /*clientstyling*/
        i[2]
      ), r[0] & /*clientstylingurl*/
      8 && c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        i[3]
      ), r[0] & /*mbsource*/
      16 && c(
        t,
        "mbsource",
        /*mbsource*/
        i[4]
      );
    },
    d(i) {
      i && B(e);
    }
  };
}
function le(n) {
  let e, t, i, r, s, u, A = (
    /*menuItem*/
    n[45].label + ""
  ), h, P, v, M, b;
  function f() {
    return (
      /*click_handler*/
      n[28](
        /*menuItem*/
        n[45]
      )
    );
  }
  return {
    c() {
      e = p("div"), t = p("p"), i = p("img"), s = C(), u = p("span"), h = T(A), P = C(), d(i, "class", "PlayerAccountMenuItemIcon " + /*isMobile*/
      (n[14] ? "PlayerAccountMenuItemIconMobile" : "")), Y(i.src, r = /*menuItem*/
      n[45].img) || d(i, "src", r), d(u, "class", "PlayerAccountMenuItemTitle"), d(t, "class", "PlayerAccountMenuItemWrapper"), d(e, "class", v = "PlayerAccountMenuItemBox " + /*selectedItem*/
      (n[9] === /*menuItem*/
      n[45].id && !/*isMobile*/
      n[14] ? "PlayerAccountMenuActiveItemBox" : ""));
    },
    m(o, y) {
      H(o, e, y), a(e, t), a(t, i), a(t, s), a(t, u), a(u, h), a(e, P), M || (b = q(e, "click", f), M = !0);
    },
    p(o, y) {
      n = o, y[0] & /*menuItems*/
      256 && !Y(i.src, r = /*menuItem*/
      n[45].img) && d(i, "src", r), y[0] & /*menuItems*/
      256 && A !== (A = /*menuItem*/
      n[45].label + "") && O(h, A), y[0] & /*selectedItem, menuItems*/
      768 && v !== (v = "PlayerAccountMenuItemBox " + /*selectedItem*/
      (n[9] === /*menuItem*/
      n[45].id && !/*isMobile*/
      n[14] ? "PlayerAccountMenuActiveItemBox" : "")) && d(e, "class", v);
    },
    d(o) {
      o && B(e), M = !1, b();
    }
  };
}
function Oe(n) {
  let e, t;
  return {
    c() {
      e = p("div"), t = p("general-logout"), c(
        t,
        "endpoint",
        /*endpoint*/
        n[1]
      ), c(
        t,
        "session",
        /*session*/
        n[0]
      ), c(t, "buttonlocation", "PlayerAccountMenu"), c(
        t,
        "clientstyling",
        /*clientstyling*/
        n[2]
      ), c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        n[3]
      ), c(
        t,
        "mbsource",
        /*mbsource*/
        n[4]
      ), d(e, "class", "PlayerAccountLogOutArea");
    },
    m(i, r) {
      H(i, e, r), a(e, t);
    },
    p(i, r) {
      r[0] & /*endpoint*/
      2 && c(
        t,
        "endpoint",
        /*endpoint*/
        i[1]
      ), r[0] & /*session*/
      1 && c(
        t,
        "session",
        /*session*/
        i[0]
      ), r[0] & /*clientstyling*/
      4 && c(
        t,
        "clientstyling",
        /*clientstyling*/
        i[2]
      ), r[0] & /*clientstylingurl*/
      8 && c(
        t,
        "clientstylingurl",
        /*clientstylingurl*/
        i[3]
      ), r[0] & /*mbsource*/
      16 && c(
        t,
        "mbsource",
        /*mbsource*/
        i[4]
      );
    },
    d(i) {
      i && B(e);
    }
  };
}
function Ue(n) {
  let e;
  return {
    c() {
      e = p("div"), e.innerHTML = '<ui-skeleton structure="title" width="30px" height="40px"></ui-skeleton> <ui-skeleton structure="text" width="150px" height="40px"></ui-skeleton>', d(e, "class", "PlayerAccountMenuCategoryWrapper");
    },
    m(t, i) {
      H(t, e, i);
    },
    d(t) {
      t && B(e);
    }
  };
}
function De(n) {
  let e;
  return {
    c() {
      e = p("ui-skeleton"), c(e, "structure", "circle"), c(e, "size", "20px");
    },
    m(t, i) {
      H(t, e, i);
    },
    d(t) {
      t && B(e);
    }
  };
}
function ie(n) {
  let e, t, i, r, s = !/*isMobile*/
  n[14] && De();
  return {
    c() {
      e = p("div"), s && s.c(), t = C(), i = p("ui-skeleton"), r = C(), c(i, "structure", "rectangle"), c(i, "width", "100%"), c(
        i,
        "height",
        /*isMobile*/
        n[14] ? "60px" : "20px"
      ), d(e, "class", "PlayerAccountItemWrap " + /*isMobile*/
      (n[14] ? "PlayerAccountItemWrapMobile" : ""));
    },
    m(u, A) {
      H(u, e, A), s && s.m(e, null), a(e, t), a(e, i), a(e, r);
    },
    p: N,
    d(u) {
      u && B(e), s && s.d();
    }
  };
}
function Re(n) {
  let e;
  function t(s, u) {
    return (
      /*skeletonLoading*/
      s[7] ? Te : ze
    );
  }
  let i = t(n), r = i(n);
  return {
    c() {
      e = p("div"), r.c();
    },
    m(s, u) {
      H(s, e, u), r.m(e, null), n[29](e);
    },
    p(s, u) {
      i === (i = t(s)) && r ? r.p(s, u) : (r.d(1), r = i(s), r && (r.c(), r.m(e, null)));
    },
    i: N,
    o: N,
    d(s) {
      s && B(e), r.d(), n[29](null);
    }
  };
}
function Ne(n, e, t) {
  let i;
  _e(n, xe, (l) => t(13, i = l));
  let { endpoint: r = "" } = e, { cmsendpoint: s = "" } = e, { env: u = "" } = e, { session: A = "" } = e, { playerid: h = "" } = e, { lang: P = "en" } = e, { selecteditem: v = "" } = e, { userroles: M = "" } = e, { clientstyling: b = "" } = e, { clientstylingurl: f = "" } = e, { mbsource: o } = e, { translationurl: y = "" } = e, { activemenuitem: m = "" } = e, { showaliasasusername: w = "false" } = e, { statementenabled: E } = e, g = !1, F = !1, _ = !0, L, ae, U = [], D, G = window.navigator.userAgent, oe = Q(G) !== "PC", V = "", X = "", R = "";
  const se = [
    "/transaction-history",
    "/external-transactions-history",
    "/sport/betting-history",
    "/gaming-history",
    "/bonus-history"
  ];
  window.matchMedia("(min-width: 768px)");
  const ce = () => {
    fetch(y).then((I) => I.json()).then((I) => {
      Object.keys(I).forEach((x) => {
        $(x, I[x]);
      });
    }).catch((I) => {
      console.error(I);
    });
  };
  Object.keys(ee).forEach((l) => {
    $(l, ee[l]);
  });
  const Z = (l) => {
    if (l.data)
      switch (l.data.type) {
        case "AccountMenuDetails":
          availableMenuItemsArray = l.data.accountMenuInfo;
          break;
        case "UserSessionID":
          t(0, A = l.data.session);
          break;
        case "AliasUpdated":
          w === "true" && l.data.alias && t(12, R = l.data.alias);
          break;
      }
  }, ue = () => {
    let l = Q(G);
    if (l)
      return l === "PC" ? "dk" : "mtWeb";
  }, me = () => {
    const l = new URL(`${s}/${P}/profile-menu?env=${u}`);
    l.searchParams.append("device", ue()), fetch(l.href).then((I) => I.json()).then((I) => {
      let x = [...I];
      if (E === "true") {
        x = x.filter((z) => !se.includes(z.path));
        const S = x.findIndex((z) => z.path === "/statement");
        if (S !== -1) {
          const [z] = x.splice(S, 1);
          x.splice(6, 0, z);
        }
      } else
        x = x.filter((S) => S.path !== "/statement");
      t(8, U = x), K();
    }).catch((I) => {
      console.error("Error getting menu items", I);
    }).finally(() => {
      t(26, g = !0);
    });
  }, de = () => {
    let l = new URL(`${r}/v1/player/${h}/profile`);
    l.searchParams.append("userRoles", M);
    let I = {
      method: "GET",
      headers: { "X-SessionID": A }
    };
    fetch(l.href, I).then((x) => x.json()).then(
      (x) => {
        t(10, V = x.username), t(11, X = x.email), w === "true" && t(12, R = x.alias || "");
      },
      (x) => {
        console.error(x);
      }
    ).finally(() => {
      t(27, F = !0);
    });
  }, J = (l) => {
    window.postMessage({ type: "ChangeAccountPage", page: l }, window.location.href), t(9, D = l.id);
  }, K = () => {
    t(9, D = U.find((l) => l.path.includes(m))?.id);
  }, ge = () => {
    window.postMessage({ type: "GoToHomepage" }, window.location.href);
  }, fe = () => {
    He(P);
  }, ye = () => {
    de();
  };
  ke(() => (window.addEventListener("message", Z, !1), () => {
    window.removeEventListener("message", Z);
  }));
  const he = (l) => J(l);
  function pe(l) {
    Ie[l ? "unshift" : "push"](() => {
      L = l, t(6, L);
    });
  }
  return n.$$set = (l) => {
    "endpoint" in l && t(1, r = l.endpoint), "cmsendpoint" in l && t(17, s = l.cmsendpoint), "env" in l && t(18, u = l.env), "session" in l && t(0, A = l.session), "playerid" in l && t(19, h = l.playerid), "lang" in l && t(20, P = l.lang), "selecteditem" in l && t(21, v = l.selecteditem), "userroles" in l && t(22, M = l.userroles), "clientstyling" in l && t(2, b = l.clientstyling), "clientstylingurl" in l && t(3, f = l.clientstylingurl), "mbsource" in l && t(4, o = l.mbsource), "translationurl" in l && t(23, y = l.translationurl), "activemenuitem" in l && t(24, m = l.activemenuitem), "showaliasasusername" in l && t(5, w = l.showaliasasusername), "statementenabled" in l && t(25, E = l.statementenabled);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*menuLoaded, playerInfoLoaded*/
    201326592 && t(7, _ = !g || !F), n.$$.dirty[0] & /*lang*/
    1048576 && P && fe(), n.$$.dirty[0] & /*endpoint, session, playerid, lang*/
    1572867 && r && A && h && P && ye(), n.$$.dirty[0] & /*cmsendpoint, lang, env*/
    1441792 && s && P && u && me(), n.$$.dirty[0] & /*activemenuitem*/
    16777216 && m && K(), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    68 && b && L && Fe(L, b), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    72 && f && L && Le(L, f), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
    80 && o && L && Ee(L, `${o}.Style`, ae), n.$$.dirty[0] & /*translationurl*/
    8388608 && y && ce();
  }, [
    A,
    r,
    b,
    f,
    o,
    w,
    L,
    _,
    U,
    D,
    V,
    X,
    R,
    i,
    oe,
    J,
    ge,
    s,
    u,
    h,
    P,
    v,
    M,
    y,
    m,
    E,
    g,
    F,
    he,
    pe
  ];
}
class qe extends we {
  constructor(e) {
    super(), Me(
      this,
      e,
      Ne,
      Re,
      ve,
      {
        endpoint: 1,
        cmsendpoint: 17,
        env: 18,
        session: 0,
        playerid: 19,
        lang: 20,
        selecteditem: 21,
        userroles: 22,
        clientstyling: 2,
        clientstylingurl: 3,
        mbsource: 4,
        translationurl: 23,
        activemenuitem: 24,
        showaliasasusername: 5,
        statementenabled: 25
      },
      We,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[1];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), k();
  }
  get cmsendpoint() {
    return this.$$.ctx[17];
  }
  set cmsendpoint(e) {
    this.$$set({ cmsendpoint: e }), k();
  }
  get env() {
    return this.$$.ctx[18];
  }
  set env(e) {
    this.$$set({ env: e }), k();
  }
  get session() {
    return this.$$.ctx[0];
  }
  set session(e) {
    this.$$set({ session: e }), k();
  }
  get playerid() {
    return this.$$.ctx[19];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), k();
  }
  get lang() {
    return this.$$.ctx[20];
  }
  set lang(e) {
    this.$$set({ lang: e }), k();
  }
  get selecteditem() {
    return this.$$.ctx[21];
  }
  set selecteditem(e) {
    this.$$set({ selecteditem: e }), k();
  }
  get userroles() {
    return this.$$.ctx[22];
  }
  set userroles(e) {
    this.$$set({ userroles: e }), k();
  }
  get clientstyling() {
    return this.$$.ctx[2];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), k();
  }
  get clientstylingurl() {
    return this.$$.ctx[3];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), k();
  }
  get mbsource() {
    return this.$$.ctx[4];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), k();
  }
  get translationurl() {
    return this.$$.ctx[23];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), k();
  }
  get activemenuitem() {
    return this.$$.ctx[24];
  }
  set activemenuitem(e) {
    this.$$set({ activemenuitem: e }), k();
  }
  get showaliasasusername() {
    return this.$$.ctx[5];
  }
  set showaliasasusername(e) {
    this.$$set({ showaliasasusername: e }), k();
  }
  get statementenabled() {
    return this.$$.ctx[25];
  }
  set statementenabled(e) {
    this.$$set({ statementenabled: e }), k();
  }
}
Be(qe, { endpoint: {}, cmsendpoint: {}, env: {}, session: {}, playerid: {}, lang: {}, selecteditem: {}, userroles: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, activemenuitem: {}, showaliasasusername: {}, statementenabled: {} }, [], [], !0);
export {
  qe as default
};
