import { S as Q, D as X, R as Y, v as y, f as Z, K as M, r as k, F as x, s as g, y as B, N as G, h as J, u as S, q, e as m, g as s, a1 as C, a2 as H, Z as O, a0 as F, a4 as $, Y as P, V as ee, W as te, X as ie, n as ne } from "./PlayerAccountControllerNd-D1zDXBBo.js";
import "../stencil/ui-skeleton-Dd7tqzYw.js";
function oe(a) {
  Z(a, "svelte-1b8j2p", ':host{padding:0;margin:0;font-family:inherit}.PlayerAccountNotificationsContainer{padding:0 5px;display:grid;grid-gap:20px;animation-name:fadeIn;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.3s;container-type:inline-size;container-name:notifications-container}.PlayerAccountNotificationBox{background:var(--emw--color-pale, var(--emw--color-gray-50, #f1f1f1));display:block;padding:20px;border-radius:var(--emw--border-radius-medium, 10px);width:100%;color:var(--emw--color-black, #000);box-sizing:border-box;text-decoration:none;word-break:break-word;word-wrap:break-word;overflow-wrap:anywhere;white-space:normal}.PlayerAccountNotificationBoxHeader{display:grid;width:100%;grid-template-areas:"nav  main  aside";grid-template-rows:auto;grid-template-columns:34px calc(100% - 34px);align-items:center}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationIcon{width:24px;margin-right:10px;flex:1}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationTitle{font-size:16px;flex:2}.PlayerAccountNotificationText{margin:0;font-size:14px;font-weight:300}.PlayerAccountNotificationText a{text-decoration:none;color:var(--emw--color-white, #FFFFFF)}.PlayerAccountNotificationsMobileContainer{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px;padding:20px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationBoxHeader{grid-template-columns:40px calc(100% - 40px)}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationTitle{font-size:14px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationIcon{width:30px;margin-right:10px}.skeletonContainer{container-type:inline-size}.skeletonContainer .skeletonWrapper{animation:fadeIn ease 0.3s}@container (max-width: 768px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@container (max-width: 425px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));grid-gap:20px;padding:0px 10px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@keyframes fadeIn{0%{opacity:0.01}1%{opacity:0}50%{opacity:0}100%{opacity:1}}');
}
function L(a, e, n) {
  const t = a.slice();
  return t[24] = e[n], t;
}
function z(a, e, n) {
  const t = a.slice();
  return t[21] = e[n], t;
}
function le(a) {
  let e, n = S(
    /*notificationsData*/
    a[1]
  ), t = [];
  for (let i = 0; i < n.length; i += 1)
    t[i] = I(L(a, n, i));
  return {
    c() {
      e = g("div");
      for (let i = 0; i < t.length; i += 1)
        t[i].c();
      s(e, "class", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : "")), s(e, "part", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : ""));
    },
    m(i, o) {
      x(i, e, o);
      for (let l = 0; l < t.length; l += 1)
        t[l] && t[l].m(e, null);
    },
    p(i, o) {
      if (o & /*notificationsData*/
      2) {
        n = S(
          /*notificationsData*/
          i[1]
        );
        let l;
        for (l = 0; l < n.length; l += 1) {
          const r = L(i, n, l);
          t[l] ? t[l].p(r, o) : (t[l] = I(r), t[l].c(), t[l].m(e, null));
        }
        for (; l < t.length; l += 1)
          t[l].d(1);
        t.length = n.length;
      }
    },
    d(i) {
      i && k(e), q(t, i);
    }
  };
}
function ae(a) {
  let e, n, t = S({ length: 3 }), i = [];
  for (let o = 0; o < t.length; o += 1)
    i[o] = R(z(a, t, o));
  return {
    c() {
      e = g("div"), n = g("div");
      for (let o = 0; o < i.length; o += 1)
        i[o].c();
      s(n, "class", "skeletonWrapper"), s(e, "class", "skeletonContainer");
    },
    m(o, l) {
      x(o, e, l), m(e, n);
      for (let r = 0; r < i.length; r += 1)
        i[r] && i[r].m(n, null);
    },
    p(o, l) {
      if (l & /*isMobile, mediaQuery*/
      24) {
        t = S({ length: 3 });
        let r;
        for (r = 0; r < t.length; r += 1) {
          const f = z(o, t, r);
          i[r] ? i[r].p(f, l) : (i[r] = R(f), i[r].c(), i[r].m(n, null));
        }
        for (; r < i.length; r += 1)
          i[r].d(1);
        i.length = t.length;
      }
    },
    d(o) {
      o && k(e), q(i, o);
    }
  };
}
function I(a) {
  let e, n, t, i, o, l, r, f = (
    /*notification*/
    a[24].title + ""
  ), p, _, u, w = (
    /*notification*/
    a[24].description + ""
  ), N;
  return {
    c() {
      e = g("div"), n = g("div"), t = g("img"), l = C(), r = g("p"), p = $(f), _ = C(), u = g("p"), N = C(), s(t, "class", "PlayerAccountNotificationIcon"), s(t, "width", "24px"), s(t, "height", "24px"), H(t.src, i = /*notification*/
      a[24].icon) || s(t, "src", i), s(t, "alt", o = /*notification*/
      a[24].title), s(r, "class", "PlayerAccountNotificationTitle"), s(n, "class", "PlayerAccountNotificationBoxHeader"), s(u, "class", "PlayerAccountNotificationText"), s(e, "class", "PlayerAccountNotificationBox"), F(
        e,
        "background",
        /*notification*/
        a[24].backgroundColor
      );
    },
    m(d, h) {
      x(d, e, h), m(e, n), m(n, t), m(n, l), m(n, r), m(r, p), m(e, _), m(e, u), u.innerHTML = w, m(e, N);
    },
    p(d, h) {
      h & /*notificationsData*/
      2 && !H(t.src, i = /*notification*/
      d[24].icon) && s(t, "src", i), h & /*notificationsData*/
      2 && o !== (o = /*notification*/
      d[24].title) && s(t, "alt", o), h & /*notificationsData*/
      2 && f !== (f = /*notification*/
      d[24].title + "") && O(p, f), h & /*notificationsData*/
      2 && w !== (w = /*notification*/
      d[24].description + "") && (u.innerHTML = w), h & /*notificationsData*/
      2 && F(
        e,
        "background",
        /*notification*/
        d[24].backgroundColor
      );
    },
    d(d) {
      d && k(e);
    }
  };
}
function re(a) {
  let e;
  return {
    c() {
      e = g("ui-skeleton"), P(e, "structure", "rectangle"), P(e, "width", "auto"), P(
        e,
        "height",
        /*isMobile*/
        a[3] && /*mediaQuery*/
        a[4].matches ? "250px" : "400px"
      );
    },
    m(n, t) {
      x(n, e, t);
    },
    p: M,
    d(n) {
      n && k(e);
    }
  };
}
function ce(a) {
  let e;
  return {
    c() {
      e = g("ui-skeleton"), e.innerHTML = "", P(e, "structure", "rectangle"), P(e, "width", "auto"), P(e, "height", "130px");
    },
    m(n, t) {
      x(n, e, t);
    },
    p: M,
    d(n) {
      n && k(e);
    }
  };
}
function R(a) {
  let e, n;
  function t(l, r) {
    return (
      /*isMobile*/
      l[3] ? re : ce
    );
  }
  let o = t(a)(a);
  return {
    c() {
      e = g("div"), o.c(), n = C(), s(e, "class", "skeletonNotification");
    },
    m(l, r) {
      x(l, e, r), o.m(e, null), m(e, n);
    },
    p(l, r) {
      o.p(l, r);
    },
    d(l) {
      l && k(e), o.d();
    }
  };
}
function se(a) {
  let e;
  function n(o, l) {
    var r;
    if (
      /*skeletonLoading*/
      o[2]
    )
      return ae;
    if (
      /*notificationsData*/
      (r = o[1]) != null && r.length
    )
      return le;
  }
  let t = n(a), i = t && t(a);
  return {
    c() {
      e = g("div"), i && i.c();
    },
    m(o, l) {
      x(o, e, l), i && i.m(e, null), a[13](e);
    },
    p(o, [l]) {
      t === (t = n(o)) && i ? i.p(o, l) : (i && i.d(1), i = t && t(o), i && (i.c(), i.m(e, null)));
    },
    i: M,
    o: M,
    d(o) {
      o && k(e), i && i.d(), a[13](null);
    }
  };
}
function ue(a, e, n) {
  let { lang: t = "" } = e, { cmsendpoint: i = "" } = e, { env: o = "" } = e, { userroles: l = "" } = e, { customnotif: r = "" } = e, { clientstyling: f = "" } = e, { clientstylingurl: p = "" } = e, { mbsource: _ } = e, u, w, N = !0, d = window.navigator.userAgent, h = B(d) !== "PC", v = [], A = [], D = U();
  const j = window.matchMedia("(min-width: 768px)");
  function U() {
    const c = B(d);
    if (c)
      return c === "PC" ? "dk" : "mtWeb";
  }
  const V = () => {
    const c = new URL(`${i}/${t}/support-information`);
    c.searchParams.append("env", o), c.searchParams.append("userRoles", l), c.searchParams.append("device", D), fetch(c.href).then((b) => b.json()).then((b) => {
      var W;
      b.length && (n(1, v = (W = b[0].children) != null ? W : b), v == null || v.forEach((K) => {
        A.length && (K.backgroundColor = A[0], A.shift());
      }));
    }).catch((b) => {
      console.error(b);
    }).finally(() => {
      setTimeout(
        () => {
          n(2, N = !1);
        },
        1e3
      );
    });
  }, T = () => {
    r.replace(" ", ""), A = r.split(",");
  };
  G(() => () => {
  });
  function E(c) {
    J[c ? "unshift" : "push"](() => {
      u = c, n(0, u);
    });
  }
  return a.$$set = (c) => {
    "lang" in c && n(5, t = c.lang), "cmsendpoint" in c && n(6, i = c.cmsendpoint), "env" in c && n(7, o = c.env), "userroles" in c && n(8, l = c.userroles), "customnotif" in c && n(9, r = c.customnotif), "clientstyling" in c && n(10, f = c.clientstyling), "clientstylingurl" in c && n(11, p = c.clientstylingurl), "mbsource" in c && n(12, _ = c.mbsource);
  }, a.$$.update = () => {
    a.$$.dirty & /*customnotif*/
    512 && r && T(), a.$$.dirty & /*notificationsData*/
    2 && v && T(), a.$$.dirty & /*userroles, cmsendpoint, env, lang*/
    480 && l && i && o && t && V(), a.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && f && u && ee(u, f), a.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && p && u && te(u, p), a.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && _ && u && ie(u, `${_}.Style`, w);
  }, [
    u,
    v,
    N,
    h,
    j,
    t,
    i,
    o,
    l,
    r,
    f,
    p,
    _,
    E
  ];
}
class fe extends Q {
  constructor(e) {
    super(), X(
      this,
      e,
      ue,
      se,
      Y,
      {
        lang: 5,
        cmsendpoint: 6,
        env: 7,
        userroles: 8,
        customnotif: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12
      },
      oe
    );
  }
  get lang() {
    return this.$$.ctx[5];
  }
  set lang(e) {
    this.$$set({ lang: e }), y();
  }
  get cmsendpoint() {
    return this.$$.ctx[6];
  }
  set cmsendpoint(e) {
    this.$$set({ cmsendpoint: e }), y();
  }
  get env() {
    return this.$$.ctx[7];
  }
  set env(e) {
    this.$$set({ env: e }), y();
  }
  get userroles() {
    return this.$$.ctx[8];
  }
  set userroles(e) {
    this.$$set({ userroles: e }), y();
  }
  get customnotif() {
    return this.$$.ctx[9];
  }
  set customnotif(e) {
    this.$$set({ customnotif: e }), y();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), y();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), y();
  }
}
ne(fe, { lang: {}, cmsendpoint: {}, env: {}, userroles: {}, customnotif: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {} }, [], [], !0);
export {
  fe as default
};
