import { C as A, S as B, D as N, R, v as f, f as j, r as D, a9 as w, a8 as m, B as q, i as F, F as L, t as H, N as P, o as U, m as S, d as V, ab as X, z as G, A as I, e as v, s as _, g as y, h as C, V as J, W as K, X as O, n as Q } from "./PlayerAccountControllerNd-D1zDXBBo.js";
function M(e, { delay: t = 0, duration: n = 400, easing: i = A } = {}) {
  const s = +getComputedStyle(e).opacity;
  return {
    delay: t,
    duration: n,
    easing: i,
    css: (o) => `opacity: ${o * s}`
  };
}
function T(e) {
  j(e, "svelte-126fglp", "*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}.ModalWindow{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:300;top:0;left:0}");
}
function k(e) {
  let t, n, i, s, o;
  const d = (
    /*#slots*/
    e[9].default
  ), r = U(
    d,
    e,
    /*$$scope*/
    e[8],
    null
  );
  return {
    c() {
      t = _("div"), n = _("div"), i = _("div"), r && r.c(), y(i, "class", "ModalContainer"), y(n, "class", "ModalWindow"), y(n, "id", "Modal");
    },
    m(a, u) {
      L(a, t, u), v(t, n), v(n, i), r && r.m(i, null), e[10](n), e[11](t), o = !0;
    },
    p(a, u) {
      e = a, r && r.p && (!o || u & /*$$scope*/
      256) && X(
        r,
        d,
        e,
        /*$$scope*/
        e[8],
        o ? I(
          d,
          /*$$scope*/
          e[8],
          u,
          null
        ) : G(
          /*$$scope*/
          e[8]
        ),
        null
      );
    },
    i(a) {
      o || (m(r, a), a && V(() => {
        o && (s || (s = S(n, M, { transitionDuration: (
          /*duration*/
          e[1]
        ) }, !0)), s.run(1));
      }), o = !0);
    },
    o(a) {
      w(r, a), a && (s || (s = S(n, M, { transitionDuration: (
        /*duration*/
        e[1]
      ) }, !1)), s.run(0)), o = !1;
    },
    d(a) {
      a && D(t), r && r.d(a), e[10](null), a && s && s.end(), e[11](null);
    }
  };
}
function Y(e) {
  let t, n, i = (
    /*show*/
    e[0] && k(e)
  );
  return {
    c() {
      i && i.c(), t = H();
    },
    m(s, o) {
      i && i.m(s, o), L(s, t, o), n = !0;
    },
    p(s, [o]) {
      /*show*/
      s[0] ? i ? (i.p(s, o), o & /*show*/
      1 && m(i, 1)) : (i = k(s), i.c(), m(i, 1), i.m(t.parentNode, t)) : i && (q(), w(i, 1, 1, () => {
        i = null;
      }), F());
    },
    i(s) {
      n || (m(i), n = !0);
    },
    o(s) {
      w(i), n = !1;
    },
    d(s) {
      s && D(t), i && i.d(s);
    }
  };
}
function Z(e, t, n) {
  let { $$slots: i = {}, $$scope: s } = t, { show: o = !1 } = t, { duration: d = 350 } = t, { clientstyling: r = "" } = t, { clientstylingurl: a = "" } = t, { mbsource: u } = t, { showmodaleventname: g = "ShowLimitsConfirmationModal" } = t, c, z, h;
  const b = (l) => {
    switch (l.data.type) {
      case "ModalClosed":
        n(0, o = !1);
        break;
      case g:
        n(0, o = !0), window.postMessage({ type: "DisableScroll" }, window.location.href);
        break;
    }
  };
  P(() => (window.addEventListener("message", b, !1), () => {
    window.removeEventListener("message", b);
  }));
  function E(l) {
    C[l ? "unshift" : "push"](() => {
      h = l, n(3, h);
    });
  }
  function W(l) {
    C[l ? "unshift" : "push"](() => {
      c = l, n(2, c);
    });
  }
  return e.$$set = (l) => {
    "show" in l && n(0, o = l.show), "duration" in l && n(1, d = l.duration), "clientstyling" in l && n(4, r = l.clientstyling), "clientstylingurl" in l && n(5, a = l.clientstylingurl), "mbsource" in l && n(6, u = l.mbsource), "showmodaleventname" in l && n(7, g = l.showmodaleventname), "$$scope" in l && n(8, s = l.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*clientstyling, customStylingContainer*/
    20 && r && c && J(c, r), e.$$.dirty & /*clientstylingurl, customStylingContainer*/
    36 && a && c && K(c, a), e.$$.dirty & /*mbsource, customStylingContainer*/
    68 && u && c && O(c, `${u}.Style`, z);
  }, [
    o,
    d,
    c,
    h,
    r,
    a,
    u,
    g,
    s,
    i,
    E,
    W
  ];
}
class p extends B {
  constructor(t) {
    super(), N(
      this,
      t,
      Z,
      Y,
      R,
      {
        show: 0,
        duration: 1,
        clientstyling: 4,
        clientstylingurl: 5,
        mbsource: 6,
        showmodaleventname: 7
      },
      T
    );
  }
  get show() {
    return this.$$.ctx[0];
  }
  set show(t) {
    this.$$set({ show: t }), f();
  }
  get duration() {
    return this.$$.ctx[1];
  }
  set duration(t) {
    this.$$set({ duration: t }), f();
  }
  get clientstyling() {
    return this.$$.ctx[4];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), f();
  }
  get clientstylingurl() {
    return this.$$.ctx[5];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), f();
  }
  get mbsource() {
    return this.$$.ctx[6];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), f();
  }
  get showmodaleventname() {
    return this.$$.ctx[7];
  }
  set showmodaleventname(t) {
    this.$$set({ showmodaleventname: t }), f();
  }
}
Q(p, { show: { type: "Boolean" }, duration: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, showmodaleventname: {} }, ["default"], [], !0);
export {
  p as default
};
