var E = (t, e, n) => new Promise((s, d) => {
  var l = (i) => {
    try {
      c(n.next(i));
    } catch (a) {
      d(a);
    }
  }, o = (i) => {
    try {
      c(n.throw(i));
    } catch (a) {
      d(a);
    }
  }, c = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(l, o);
  c((n = n.apply(t, e)).next());
});
import { a as K, E as V, $ as G, S as J, i as P, f as y, s as Q, x as X, b as Y, n as v, d as p, e as b, g as _, h as k, j as m, k as H, m as Z, o as $, p as ee, A as S, B as te, u as ne, c as ie, z as W, l as se, t as le, D as u, y as ae } from "./CasinoCoinroyaleContainer-CKINd4su.js";
import { s as oe, a as re, b as ce } from "./CasinoCoinroyaleDetails-BQEMYX5s.js";
if (typeof window != "undefined") {
  let t = function(e) {
    return function(...n) {
      try {
        return e.apply(this, n);
      } catch (s) {
        if (s instanceof DOMException && s.message.includes("has already been used with this registry") || s.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw s;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CasinoMysteryChestContainer-CcO2lsI3.js").then(({ default: e }) => {
    !customElements.get("casino-mystery-chest-container") && customElements.define("casino-mystery-chest-container", e.element);
  });
}
if (typeof window != "undefined") {
  let t = function(e) {
    return function(...n) {
      try {
        return e.apply(this, n);
      } catch (s) {
        if (s instanceof DOMException && s.message.includes("has already been used with this registry") || s.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw s;
      }
    };
  };
  customElements.define = t(customElements.define), import("./CasinoCoinroyaleContainer-CKINd4su.js").then((e) => e.K).then(({ default: e }) => {
    !customElements.get("casino-coinroyale-container") && customElements.define("casino-coinroyale-container", e.element);
  });
}
var f = /* @__PURE__ */ ((t) => (t.MysteryChest = "Mystery Chests", t.FlipCoin = "FlipCoin", t.LuckyWheel = "Lucky Wheel", t.Dices = "Dices", t))(f || {}), D = /* @__PURE__ */ ((t) => (t.Showed = "Showed", t.Hiden = "Hiden", t))(D || {});
const A = {
  en: {
    MysteryChest: "Mystery Chests",
    LuckyWheel: "Lucky Wheel",
    Dices: "Dices",
    FlipCoin: "Flip Coin"
  }
};
function F(t, e) {
  K(t, e);
}
function de(t) {
  V({
    fallbackLocale: "en"
  }), G.set(t);
}
function ue(t) {
  Y(t, "svelte-dp9rm6", "*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.container{padding:0 16.5%}.container.mobile{padding:0 28px}.container.mobile .header{padding:16px 0 13px}.container.mobile .header .slider__container{gap:16px;justify-content:space-between;padding:0 24px}.container.mobile .header .slider__container__tab{font-size:var(--emw--font-size-2x-small, 10px)}.header{background:linear-gradient(89.94deg, var(--emw--color-background, #003e5c) 0.05%, var(--emw--color-background-secondary, #113b21) 87.69%);padding:23px 0 17px;border-radius:12px}.header .slider__container{display:flex;position:relative;gap:60px;justify-content:center}.header .slider__tab{padding:8px 0 13px;font-weight:var(--emw--font-weight-bold, 700);color:var(--emw--color-gray-300, #729787);cursor:pointer;text-align:center;background:transparent;border:none;font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.header .slider__tab.active{color:var(--emw--color-typography, #fff);border-bottom:2px solid var(--emw--button-border-color, #00b74f);margin-bottom:-2px}");
}
function O(t, e, n) {
  const s = t.slice();
  return s[20] = e[n], s;
}
function j(t) {
  let e, n, s, d = S(
    /*tabs*/
    t[4].split(",")
  ), l = [];
  for (let o = 0; o < d.length; o += 1)
    l[o] = z(O(t, d, o));
  return {
    c() {
      e = m("div"), n = m("div"), s = m("div");
      for (let o = 0; o < l.length; o += 1)
        l[o].c();
      b(s, "class", "slider__container"), b(n, "class", "slider"), b(e, "class", "header");
    },
    m(o, c) {
      _(o, e, c), k(e, n), k(n, s);
      for (let i = 0; i < l.length; i += 1)
        l[i] && l[i].m(s, null);
    },
    p(o, c) {
      if (c & /*tabs, activeTab, handleTabChange, $_*/
      2448) {
        d = S(
          /*tabs*/
          o[4].split(",")
        );
        let i;
        for (i = 0; i < d.length; i += 1) {
          const a = O(o, d, i);
          l[i] ? l[i].p(a, c) : (l[i] = z(a), l[i].c(), l[i].m(s, null));
        }
        for (; i < l.length; i += 1)
          l[i].d(1);
        l.length = d.length;
      }
    },
    d(o) {
      o && p(e), te(l, o);
    }
  };
}
function z(t) {
  let e, n = (
    /*$_*/
    t[8](
      /*tab*/
      t[20]
    ) + ""
  ), s, d, l, o, c;
  return {
    c() {
      e = m("button"), s = le(n), d = H(), b(e, "data-index", l = f[
        /*tab*/
        t[20]
      ]), b(e, "class", "slider__tab"), W(
        e,
        "active",
        /*activeTab*/
        t[7] === f[
          /*tab*/
          t[20]
        ]
      );
    },
    m(i, a) {
      _(i, e, a), k(e, s), k(e, d), o || (c = se(
        e,
        "click",
        /*handleTabChange*/
        t[11]
      ), o = !0);
    },
    p(i, a) {
      a & /*$_, tabs*/
      272 && n !== (n = /*$_*/
      i[8](
        /*tab*/
        i[20]
      ) + "") && ie(s, n), a & /*tabs*/
      16 && l !== (l = f[
        /*tab*/
        i[20]
      ]) && b(e, "data-index", l), a & /*activeTab, tabs*/
      144 && W(
        e,
        "active",
        /*activeTab*/
        i[7] === f[
          /*tab*/
          i[20]
        ]
      );
    },
    d(i) {
      i && p(e), o = !1, c();
    }
  };
}
function fe(t) {
  let e;
  return {
    c() {
      e = m("div"), e.textContent = "Comming soon";
    },
    m(n, s) {
      _(n, e, s);
    },
    p: v,
    d(n) {
      n && p(e);
    }
  };
}
function he(t) {
  let e;
  return {
    c() {
      e = m("casino-coinroyale-container"), u(
        e,
        "endpoint",
        /*endpoint*/
        t[1]
      ), u(
        e,
        "session",
        /*session*/
        t[2]
      ), u(
        e,
        "lang",
        /*lang*/
        t[3]
      ), u(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[0]
      ), u(e, "gameoverlay", D.Hiden), u(e, "openedbydefauls", !0), u(
        e,
        "clientstyling",
        /*coinroyaleDrawerStyles*/
        t[10] + this.clientstyling
      );
    },
    m(n, s) {
      _(n, e, s);
    },
    p(n, s) {
      s & /*endpoint*/
      2 && u(
        e,
        "endpoint",
        /*endpoint*/
        n[1]
      ), s & /*session*/
      4 && u(
        e,
        "session",
        /*session*/
        n[2]
      ), s & /*lang*/
      8 && u(
        e,
        "lang",
        /*lang*/
        n[3]
      ), s & /*clientstylingurl*/
      1 && u(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[0]
      );
    },
    d(n) {
      n && p(e);
    }
  };
}
function ge(t) {
  let e;
  return {
    c() {
      e = m("div"), e.textContent = "Comming soon";
    },
    m(n, s) {
      _(n, e, s);
    },
    p: v,
    d(n) {
      n && p(e);
    }
  };
}
function me(t) {
  let e;
  return {
    c() {
      e = m("casino-mystery-chest-container"), u(
        e,
        "endpoint",
        /*endpoint*/
        t[1]
      ), u(
        e,
        "session",
        /*session*/
        t[2]
      ), u(
        e,
        "lang",
        /*lang*/
        t[3]
      ), u(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[0]
      ), u(e, "gameoverlay", D.Hiden), u(e, "openedbydefauls", !0), u(
        e,
        "clientstyling",
        /*mysteryChestDrawerStyles*/
        t[9] + this.clientstyling
      );
    },
    m(n, s) {
      _(n, e, s);
    },
    p(n, s) {
      s & /*endpoint*/
      2 && u(
        e,
        "endpoint",
        /*endpoint*/
        n[1]
      ), s & /*session*/
      4 && u(
        e,
        "session",
        /*session*/
        n[2]
      ), s & /*lang*/
      8 && u(
        e,
        "lang",
        /*lang*/
        n[3]
      ), s & /*clientstylingurl*/
      1 && u(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[0]
      );
    },
    d(n) {
      n && p(e);
    }
  };
}
function ye(t) {
  let e, n = (
    /*tabs*/
    t[4].split(",").length >= 2
  ), s, d, l = n && j(t);
  function o(a, h) {
    if (
      /*activeTab*/
      a[7] === f.MysteryChest
    )
      return me;
    if (
      /*activeTab*/
      a[7] === f.LuckyWheel
    )
      return ge;
    if (
      /*activeTab*/
      a[7] === f.FlipCoin
    )
      return he;
    if (
      /*activeTab*/
      a[7] === f.Dices
    )
      return fe;
  }
  let c = o(t), i = c && c(t);
  return {
    c() {
      e = m("div"), l && l.c(), s = H(), i && i.c(), b(e, "class", d = "container " + /*mobileView*/
      (t[6] ? "mobile" : ""));
    },
    m(a, h) {
      _(a, e, h), l && l.m(e, null), k(e, s), i && i.m(e, null), t[15](e);
    },
    p(a, [h]) {
      h & /*tabs*/
      16 && (n = /*tabs*/
      a[4].split(",").length >= 2), n ? l ? l.p(a, h) : (l = j(a), l.c(), l.m(e, s)) : l && (l.d(1), l = null), c === (c = o(a)) && i ? i.p(a, h) : (i && i.d(1), i = c && c(a), i && (i.c(), i.m(e, null))), h & /*mobileView*/
      64 && d !== (d = "container " + /*mobileView*/
      (a[6] ? "mobile" : "")) && b(e, "class", d);
    },
    i: v,
    o: v,
    d(a) {
      a && p(e), l && l.d(), i && i.d(), t[15](null);
    }
  };
}
function be(t, e, n) {
  let s;
  Z(t, ae, (r) => n(8, s = r));
  let { clientstyling: d = "" } = e, { clientstylingurl: l = "" } = e, { translationurl: o = "" } = e, { mbsource: c } = e, { endpoint: i = "" } = e, { session: a = "" } = e, { lang: h = "en" } = e, { tabs: M = "MysteryChest,FlipCoin,LuckyWheel,Dices" } = e, x = !0, N = window.navigator.userAgent, g, w = f[M.split(",")[0]];
  const R = ".overlay { display: none; } .drawer { position: unset; transform: none; background: transparent; width: initial; height: initial; padding: 0; border-radius: 0; } .chests-header,.close,.chest-header__title { display: none } .mobile.drawer { padding: 0 } .back { height: 40px; width: 40px;} .chest-header {padding: 20px 0 0}", T = ".overlay { display: none; } .drawer { position: unset; transform: none; background: transparent; width: initial; height: initial; padding: 0; border-radius: 0; } .coins-header,.close,.coin-header__title { display: none } .mobile.drawer { padding: 0 } .back { height: 40px; width: 40px;} .coin-header {padding: 20px 0 0}", U = (r) => E(this, null, function* () {
    n(7, w = r.target.getAttribute("data-index")), w === f.MysteryChest && window.postMessage({ type: "OpenMysteryChestDrawer" }), w === f.FlipCoin && window.postMessage({ type: "OpenCoinRoyaleDrawer" }), w === f.LuckyWheel && window.postMessage({ type: "OpenLuckyWheelDrawer" });
  }), q = () => {
    de(h);
  }, B = () => {
    fetch(o).then((C) => C.json()).then((C) => {
      Object.keys(C).forEach((L) => {
        F(L, C[L]);
      });
    });
  };
  Object.keys(A).forEach((r) => {
    F(r, A[r]);
  }), $(() => (n(6, x = ee(N)), () => {
  }));
  function I(r) {
    ne[r ? "unshift" : "push"](() => {
      g = r, n(5, g);
    });
  }
  return t.$$set = (r) => {
    "clientstyling" in r && n(12, d = r.clientstyling), "clientstylingurl" in r && n(0, l = r.clientstylingurl), "translationurl" in r && n(13, o = r.translationurl), "mbsource" in r && n(14, c = r.mbsource), "endpoint" in r && n(1, i = r.endpoint), "session" in r && n(2, a = r.session), "lang" in r && n(3, h = r.lang), "tabs" in r && n(4, M = r.tabs);
  }, t.$$.update = () => {
    t.$$.dirty & /*lang*/
    8 && h && q(), t.$$.dirty & /*translationurl*/
    8192 && o && B(), t.$$.dirty & /*clientstyling, customStylingContainer*/
    4128 && d && g && oe(g, d), t.$$.dirty & /*clientstylingurl, customStylingContainer*/
    33 && l && g && re(g, l), t.$$.dirty & /*mbsource, customStylingContainer*/
    16416 && c && g && ce(g, `${c}.Style`);
  }, [
    l,
    i,
    a,
    h,
    M,
    g,
    x,
    w,
    s,
    R,
    T,
    U,
    d,
    o,
    c,
    I
  ];
}
class pe extends J {
  constructor(e) {
    super(), P(
      this,
      e,
      be,
      ye,
      Q,
      {
        clientstyling: 12,
        clientstylingurl: 0,
        translationurl: 13,
        mbsource: 14,
        endpoint: 1,
        session: 2,
        lang: 3,
        tabs: 4
      },
      ue
    );
  }
  get clientstyling() {
    return this.$$.ctx[12];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[0];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), y();
  }
  get translationurl() {
    return this.$$.ctx[13];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), y();
  }
  get mbsource() {
    return this.$$.ctx[14];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), y();
  }
  get endpoint() {
    return this.$$.ctx[1];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), y();
  }
  get session() {
    return this.$$.ctx[2];
  }
  set session(e) {
    this.$$set({ session: e }), y();
  }
  get lang() {
    return this.$$.ctx[3];
  }
  set lang(e) {
    this.$$set({ lang: e }), y();
  }
  get tabs() {
    return this.$$.ctx[4];
  }
  set tabs(e) {
    this.$$set({ tabs: e }), y();
  }
}
X(pe, { clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, endpoint: {}, session: {}, lang: {}, tabs: {} }, [], [], !0);
export {
  pe as default
};
