import { S as G, i as J, s as K, f as y, b as O, n as M, d as k, c as x, e as g, h as H, o as X, j as Y, k as S, l as q, m, r as s, p as C, y as W, t as Z, E as z, u as $, q as P, z as tt, A as et, B as it, C as nt } from "./PlayerAccountController-CKaOyxPs.js";
import "../stencil/ui-skeleton-BKpwkQ2A.js";
function ot(r) {
  O(r, "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(r, t, n) {
  const e = r.slice();
  return e[24] = t[n], e;
}
function F(r, t, n) {
  const e = r.slice();
  return e[21] = t[n], e;
}
function lt(r) {
  let t, n = S(
    /*notificationsData*/
    r[1]
  ), e = [];
  for (let i = 0; i < n.length; i += 1)
    e[i] = I(L(r, n, i));
  return {
    c() {
      t = g("div");
      for (let i = 0; i < e.length; i += 1)
        e[i].c();
      s(t, "class", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (r[3] ? "PlayerAccountNotificationsMobileContainer" : "")), s(t, "part", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (r[3] ? "PlayerAccountNotificationsMobileContainer" : ""));
    },
    m(i, o) {
      x(i, t, o);
      for (let l = 0; l < e.length; l += 1)
        e[l] && e[l].m(t, null);
    },
    p(i, o) {
      if (o & /*notificationsData*/
      2) {
        n = S(
          /*notificationsData*/
          i[1]
        );
        let l;
        for (l = 0; l < n.length; l += 1) {
          const c = L(i, n, l);
          e[l] ? e[l].p(c, o) : (e[l] = I(c), e[l].c(), e[l].m(t, null));
        }
        for (; l < e.length; l += 1)
          e[l].d(1);
        e.length = n.length;
      }
    },
    d(i) {
      i && k(t), q(e, i);
    }
  };
}
function rt(r) {
  let t, n, e = S({ length: 3 }), i = [];
  for (let o = 0; o < e.length; o += 1)
    i[o] = j(F(r, e, o));
  return {
    c() {
      t = g("div"), n = g("div");
      for (let o = 0; o < i.length; o += 1)
        i[o].c();
      s(n, "class", "skeletonWrapper"), s(t, "class", "skeletonContainer");
    },
    m(o, l) {
      x(o, t, l), m(t, n);
      for (let c = 0; c < i.length; c += 1)
        i[c] && i[c].m(n, null);
    },
    p(o, l) {
      if (l & /*isMobile, mediaQuery*/
      24) {
        e = S({ length: 3 });
        let c;
        for (c = 0; c < e.length; c += 1) {
          const f = F(o, e, c);
          i[c] ? i[c].p(f, l) : (i[c] = j(f), i[c].c(), i[c].m(n, null));
        }
        for (; c < i.length; c += 1)
          i[c].d(1);
        i.length = e.length;
      }
    },
    d(o) {
      o && k(t), q(i, o);
    }
  };
}
function I(r) {
  let t, n, e, i, o, l, c, f = (
    /*notification*/
    r[24].title + ""
  ), p, _, u, w = (
    /*notification*/
    r[24].description + ""
  ), N;
  return {
    c() {
      t = g("div"), n = g("div"), e = g("img"), l = C(), c = g("p"), p = $(f), _ = C(), u = g("p"), N = C(), s(e, "class", "PlayerAccountNotificationIcon"), s(e, "width", "24px"), s(e, "height", "24px"), W(e.src, i = /*notification*/
      r[24].icon) || s(e, "src", i), s(e, "alt", o = /*notification*/
      r[24].title), s(c, "class", "PlayerAccountNotificationTitle"), s(n, "class", "PlayerAccountNotificationBoxHeader"), s(u, "class", "PlayerAccountNotificationText"), s(t, "class", "PlayerAccountNotificationBox"), z(
        t,
        "background",
        /*notification*/
        r[24].backgroundColor
      );
    },
    m(d, h) {
      x(d, t, h), m(t, n), m(n, e), m(n, l), m(n, c), m(c, p), m(t, _), m(t, u), u.innerHTML = w, m(t, N);
    },
    p(d, h) {
      h & /*notificationsData*/
      2 && !W(e.src, i = /*notification*/
      d[24].icon) && s(e, "src", i), h & /*notificationsData*/
      2 && o !== (o = /*notification*/
      d[24].title) && s(e, "alt", o), h & /*notificationsData*/
      2 && f !== (f = /*notification*/
      d[24].title + "") && Z(p, f), h & /*notificationsData*/
      2 && w !== (w = /*notification*/
      d[24].description + "") && (u.innerHTML = w), h & /*notificationsData*/
      2 && z(
        t,
        "background",
        /*notification*/
        d[24].backgroundColor
      );
    },
    d(d) {
      d && k(t);
    }
  };
}
function ct(r) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), P(t, "structure", "rectangle"), P(t, "width", "auto"), P(
        t,
        "height",
        /*isMobile*/
        r[3] && /*mediaQuery*/
        r[4].matches ? "250px" : "400px"
      );
    },
    m(n, e) {
      x(n, t, e);
    },
    p: M,
    d(n) {
      n && k(t);
    }
  };
}
function at(r) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), t.innerHTML = "", P(t, "structure", "rectangle"), P(t, "width", "auto"), P(t, "height", "130px");
    },
    m(n, e) {
      x(n, t, e);
    },
    p: M,
    d(n) {
      n && k(t);
    }
  };
}
function j(r) {
  let t, n;
  function e(l, c) {
    return (
      /*isMobile*/
      l[3] ? ct : at
    );
  }
  let o = e(r)(r);
  return {
    c() {
      t = g("div"), o.c(), n = C(), s(t, "class", "skeletonNotification");
    },
    m(l, c) {
      x(l, t, c), o.m(t, null), m(t, n);
    },
    p(l, c) {
      o.p(l, c);
    },
    d(l) {
      l && k(t), o.d();
    }
  };
}
function st(r) {
  let t;
  function n(o, l) {
    var c;
    if (
      /*skeletonLoading*/
      o[2]
    )
      return rt;
    if (
      /*notificationsData*/
      (c = o[1]) != null && c.length
    )
      return lt;
  }
  let e = n(r), i = e && e(r);
  return {
    c() {
      t = g("div"), i && i.c();
    },
    m(o, l) {
      x(o, t, l), i && i.m(t, null), r[13](t);
    },
    p(o, [l]) {
      e === (e = n(o)) && i ? i.p(o, l) : (i && i.d(1), i = e && e(o), i && (i.c(), i.m(t, null)));
    },
    i: M,
    o: M,
    d(o) {
      o && k(t), i && i.d(), r[13](null);
    }
  };
}
function ut(r, t, n) {
  let { lang: e = "" } = t, { cmsendpoint: i = "" } = t, { env: o = "" } = t, { userroles: l = "" } = t, { customnotif: c = "" } = t, { clientstyling: f = "" } = t, { clientstylingurl: p = "" } = t, { mbsource: _ } = t, u, w, N = !0, d = window.navigator.userAgent, h = H(d) !== "PC", v = [], A = [], R = E();
  const D = window.matchMedia("(min-width: 768px)");
  function E() {
    const a = H(d);
    if (a)
      return a === "PC" ? "dk" : "mtWeb";
  }
  const U = () => {
    const a = new URL(`${i}/${e}/support-information`);
    a.searchParams.append("env", o), a.searchParams.append("userRoles", l), a.searchParams.append("device", R), fetch(a.href).then((b) => b.json()).then((b) => {
      var B;
      b.length && (n(1, v = (B = b[0].children) != null ? B : b), v == null || v.forEach((V) => {
        A.length && (V.backgroundColor = A[0], A.shift());
      }));
    }).catch((b) => {
      console.error(b);
    }).finally(() => {
      setTimeout(
        () => {
          n(2, N = !1);
        },
        1e3
      );
    });
  }, T = () => {
    c.replace(" ", ""), A = c.split(",");
  };
  X(() => () => {
  });
  function Q(a) {
    Y[a ? "unshift" : "push"](() => {
      u = a, n(0, u);
    });
  }
  return r.$$set = (a) => {
    "lang" in a && n(5, e = a.lang), "cmsendpoint" in a && n(6, i = a.cmsendpoint), "env" in a && n(7, o = a.env), "userroles" in a && n(8, l = a.userroles), "customnotif" in a && n(9, c = a.customnotif), "clientstyling" in a && n(10, f = a.clientstyling), "clientstylingurl" in a && n(11, p = a.clientstylingurl), "mbsource" in a && n(12, _ = a.mbsource);
  }, r.$$.update = () => {
    r.$$.dirty & /*customnotif*/
    512 && c && T(), r.$$.dirty & /*notificationsData*/
    2 && v && T(), r.$$.dirty & /*userroles, cmsendpoint, env, lang*/
    480 && l && i && o && e && U(), r.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && f && u && tt(u, f), r.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && p && u && et(u, p), r.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && _ && u && it(u, `${_}.Style`, w);
  }, [
    u,
    v,
    N,
    h,
    D,
    e,
    i,
    o,
    l,
    c,
    f,
    p,
    _,
    Q
  ];
}
class ft extends G {
  constructor(t) {
    super(), J(
      this,
      t,
      ut,
      st,
      K,
      {
        lang: 5,
        cmsendpoint: 6,
        env: 7,
        userroles: 8,
        customnotif: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12
      },
      ot
    );
  }
  get lang() {
    return this.$$.ctx[5];
  }
  set lang(t) {
    this.$$set({ lang: t }), y();
  }
  get cmsendpoint() {
    return this.$$.ctx[6];
  }
  set cmsendpoint(t) {
    this.$$set({ cmsendpoint: t }), y();
  }
  get env() {
    return this.$$.ctx[7];
  }
  set env(t) {
    this.$$set({ env: t }), y();
  }
  get userroles() {
    return this.$$.ctx[8];
  }
  set userroles(t) {
    this.$$set({ userroles: t }), y();
  }
  get customnotif() {
    return this.$$.ctx[9];
  }
  set customnotif(t) {
    this.$$set({ customnotif: t }), y();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), y();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), y();
  }
}
nt(ft, { lang: {}, cmsendpoint: {}, env: {}, userroles: {}, customnotif: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {} }, [], [], !0);
export {
  ft as default
};
