var je = Object.defineProperty, Ue = Object.defineProperties;
var Ze = Object.getOwnPropertyDescriptors;
var be = Object.getOwnPropertySymbols;
var Ie = Object.prototype.hasOwnProperty, Ee = Object.prototype.propertyIsEnumerable;
var we = (t, e, o) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, me = (t, e) => {
  for (var o in e || (e = {}))
    Ie.call(e, o) && we(t, o, e[o]);
  if (be)
    for (var o of be(e))
      Ee.call(e, o) && we(t, o, e[o]);
  return t;
}, ve = (t, e) => Ue(t, Ze(e));
var Y = (t, e, o) => new Promise((l, i) => {
  var r = (g) => {
    try {
      a(o.next(g));
    } catch (m) {
      i(m);
    }
  }, n = (g) => {
    try {
      a(o.throw(g));
    } catch (m) {
      i(m);
    }
  }, a = (g) => g.done ? l(g.value) : Promise.resolve(g.value).then(r, n);
  a((o = o.apply(t, e)).next());
});
import { u as Ge, $ as Ne, S as Ye, i as We, s as qe, f as te, a as Ke, n as re, d as S, G as Ve, E as z, Q as se, b as R, l as s, m as J, j as u, c as b, F as L, k as c, w as Je, g as Qe, o as Xe, A as $e, O as Q, P as ce, e as ue, h as ye, p as ae, L as et, M as tt, N as it, q as ot, K as lt } from "./CasinoLobbyMiniGames-3e0oAKHr.js";
import "../stencil/ui-skeleton-xXZA3rYO.js";
import { a as nt } from "./LotteryProgramWof-CQ5tToK-.js";
const xe = (t) => window.postMessage(t, window.location.href), rt = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.5384%203.18261L14.3222%200.9673C13.3202%20-0.0332963%2011.7009%20-0.26734%209.75715%200.310586C7.83938%200.880634%205.79092%202.18711%203.98901%203.98902C2.18711%205.79092%200.88063%207.83939%200.310582%209.75716C-0.26688%2011.7%20-0.0337635%2013.3211%200.965442%2014.3194C0.980736%2014.3361%200.99742%2014.3491%201.01967%2014.362L3.1826%2016.5384C3.83422%2017.1891%204.73749%2017.4996%205.78675%2017.4996C8.0382%2017.4996%2010.9621%2016.0703%2013.5167%2013.5167C17.2605%209.77199%2018.5878%205.23292%2016.5384%203.18261ZM13.2979%205.31681C12.764%206.90692%2011.6378%208.61521%2010.127%2010.1261C8.6152%2011.6369%206.90738%2012.764%205.31681%2013.2979C3.8991%2013.7744%202.71173%2013.7188%202.14169%2013.1469C1.57118%2012.5768%201.5151%2011.3904%201.99153%209.9722C2.52589%208.38209%203.65254%206.67426%205.1634%205.16341C6.67426%203.65209%208.38255%202.52589%209.97312%201.99153C10.6118%201.77649%2011.2031%201.67036%2011.7129%201.67036C12.3349%201.67036%2012.8345%201.8284%2013.1478%202.14169C13.7178%202.7122%2013.7744%203.89911%2013.2979%205.31681ZM12.3423%2012.3414C9.09859%2015.5846%205.53231%2016.5375%204.35699%2015.3622L4.23696%2015.2426C6.4481%2014.9914%209.06753%2013.5343%2011.3014%2011.3014C13.5343%209.06754%2014.9914%206.4481%2015.2426%204.23696L15.3622%204.357C16.5365%205.53093%2015.5846%209.09859%2012.3423%2012.3414Z'%20fill='url(%23paint0_linear_875_137)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_875_137'%20x1='0'%20y1='8.7498'%20x2='17.5'%20y2='8.7498'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", ke = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.96967%203.96967C4.26256%203.67678%204.73744%203.67678%205.03033%203.96967L9%207.93934L12.9697%203.96967C13.2626%203.67678%2013.7374%203.67678%2014.0303%203.96967C14.3232%204.26256%2014.3232%204.73744%2014.0303%205.03033L10.0607%209L14.0303%2012.9697C14.3232%2013.2626%2014.3232%2013.7374%2014.0303%2014.0303C13.7374%2014.3232%2013.2626%2014.3232%2012.9697%2014.0303L9%2010.0607L5.03033%2014.0303C4.73744%2014.3232%204.26256%2014.3232%203.96967%2014.0303C3.67678%2013.7374%203.67678%2013.2626%203.96967%2012.9697L7.93934%209L3.96967%205.03033C3.67678%204.73744%203.67678%204.26256%203.96967%203.96967Z'%20fill='%23FF9B59'/%3e%3c/svg%3e", Ce = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.1724%204.72381C15.4708%205.02223%2015.4708%205.50607%2015.1724%205.80449L7.70071%2013.2762C7.40229%2013.5746%206.91846%2013.5746%206.62004%2013.2762L3.22381%209.87996C2.9254%209.58154%202.9254%209.09771%203.22381%208.79929C3.52223%208.50087%204.00607%208.50087%204.30449%208.79929L7.16038%2011.6552L14.0917%204.72381C14.3902%204.4254%2014.874%204.4254%2015.1724%204.72381Z'%20fill='%2358DB4A'/%3e%3c/svg%3e", st = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M10.9124%204.83736C11.1402%205.06516%2011.1402%205.43451%2010.9124%205.66232L7.41243%209.16232C7.18462%209.39012%206.81528%209.39012%206.58747%209.16232L3.08747%205.66232C2.85966%205.43451%202.85966%205.06516%203.08747%204.83736C3.31528%204.60955%203.68462%204.60955%203.91243%204.83736L6.99995%207.92488L10.0875%204.83736C10.3153%204.60955%2010.6846%204.60955%2010.9124%204.83736Z'%20fill='url(%23paint0_linear_738_1669)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_738_1669'%20x1='6.99995'%20y1='4.6665'%20x2='6.99995'%20y2='9.33317'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
var ne = /* @__PURE__ */ ((t) => (t.lotteries = "lotteries", t.outcome = "outcome", t.history = "history", t.draw = "draw", t))(ne || {}), le = /* @__PURE__ */ ((t) => (t.en = "en", t.default = "*", t))(le || {});
const at = (t) => Y(void 0, null, function* () {
  const { path: e, params: o = {}, options: l = {} } = t, i = new URL(e);
  return Object.keys(o).map((r) => {
    i.searchParams.append(r, o[r]);
  }), yield ct(i, l);
}), ct = (o, ...l) => Y(void 0, [o, ...l], function* (t, e = {}) {
  try {
    const r = yield (yield fetch(t, e)).text();
    return JSON.parse(r);
  } catch (i) {
    return i.message;
  }
}), fe = (t, e, o) => Y(void 0, null, function* () {
  const { session: l } = o, i = {
    headers: me({
      "Content-Type": "application/json",
      accept: "text/plain"
    }, l ? { "x-SessionId": l } : {})
  }, n = {
    [ne.lotteries]: () => ({
      path: "/wof/lotteries",
      params: {
        filter: "Types[]=flipCoin"
      },
      options: i
    }),
    [ne.history]: () => ({
      path: "/wof/lotteryHistory",
      options: i
    }),
    [ne.outcome]: () => {
      const { id: a } = o;
      return {
        path: `/wof/outcome/${a}`,
        params: {
          filter: "Types[]=flipCoin"
        },
        options: i
      };
    }
  }[t]();
  return n.path = e + "/v1" + n.path, yield at(n);
}), pe = {
  lotteries: (t, e) => Y(void 0, null, function* () {
    const o = yield fe(ne.lotteries, t, { session: e });
    return (o == null ? void 0 : o.items) || [];
  }),
  outcome: (t, e, o) => Y(void 0, null, function* () {
    return yield fe(ne.outcome, t, { session: e, id: o });
  }),
  history: (t, e) => Y(void 0, null, function* () {
    return yield fe(ne.history, t, { session: e });
  })
}, dt = (t) => {
  var e;
  return +((e = t == null ? void 0 : t.current) == null ? void 0 : e.remainingTimes) > 0;
};
function ze(t, e) {
  Ge(t, e);
}
function ut(t) {
  Ne.set(t);
}
const Le = {
  en: {
    headerTitle: "Coin Royales",
    infoTooltip: "Flip a virtual coin and take a chance to win!",
    play: "Play",
    history: "History",
    rules: "Rules",
    noCoinYet: "There are no available Coin Royale",
    noHistoryYet: "There is no history yet",
    more: "More",
    rulesDescription: "Coin Royale is a particularly interesting game, will bring you a lot of surprises; When you obtained the Coin Royale, means you got a chance to flip the Coin, and if you are lucky, you can get the surprise prize.",
    terms: "Terms&Conditions link",
    prizeAgenda: "Prize agenda",
    tournamentTicket: "Tournament ticket",
    freeSpins: "Free spins",
    bonusMoney: "Bonus Money",
    loyaltyPoints: "Loyalty Points&Coins",
    luckyWheel: "LuckyWheel",
    mysteryChest: "Mystery Chest",
    coinRoyale: "Coin Royale",
    customRewards: "Custom Rewards"
  }
};
function mt(t) {
  Ke(t, "svelte-1tv2sur", `.main::-webkit-scrollbar{width:0.25rem}.main::-webkit-scrollbar-track{background:#1e1e24}.main::-webkit-scrollbar-thumb{color:#93CAED}.mobile.drawer{width:100%;height:100%;border-top-left-radius:28px;border-top-right-radius:28px;padding:20px 28px}.mobile.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 135px)}.mobile .tooltip-backdrop{padding:60px 20px 0;border-top-left-radius:28px;border-top-right-radius:28px}.mobile .tooltip-backdrop .tooltip{padding:20px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .icon-button{width:24px;height:24px}.mobile .coins-header__title{font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500);line-height:14px}.mobile .coins-tabs{margin:20px 0}.mobile .coins-tabs__container{border-bottom:1px solid var(--emw--color-secondary, #729787)}.mobile .coins-tabs__tab{font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.mobile .coins-tabs__tab.active{border-bottom:1px solid}.mobile .coins-list{gap:16px}.mobile .coins-list__item{font-weight:var(--emw--font-weight-normal, 400);padding:20px;font-size:var(--emw--font-size-x-small, 12px);line-height:15px;border-radius:var(--emw--border-radius-large, 16px);height:56px}.mobile .coins-list__item__keys{gap:5px;font-size:var(--emw--font-size-medium, 16px)}.mobile .coins-loader{border-radius:var(--emw--border-radius-large, 16px);padding:20px;line-height:15px}.mobile .coins-rules{gap:24px}.mobile .coins-rules__description{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .coins-rules__terms{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px)}.mobile .coins-rules__prize-title{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .coins-rules__list{padding-inline-start:15px;margin:5px 0 0}.mobile .coins-rules__list__item{margin-bottom:5px;font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .coins-empty{margin-top:50px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .coins-history__title{font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .coins-history__list{margin-bottom:32px}.mobile .coins-history__list__item{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .coins-history__list__item .name img{width:14px;height:14px}.drawer{position:fixed;left:50%;transform:translateX(-50%);background:linear-gradient(180deg, var(--emw--color-background, #213841) 0%, var(--emw--color-background-secondary, #0c1a1c) 100%);box-sizing:border-box;z-index:100;bottom:0;width:60%;height:90%;border-top-left-radius:72px;border-top-right-radius:72px;padding:40px 80px}@container (max-width: 1300px){.drawer{padding:20px 40px}}@container (max-width: 992px){.drawer{width:70%}}@container (max-width: 768px){.drawer{width:80%}}@container (max-width: 576px){.drawer{width:90%}}.drawer .Skeleton{border-radius:var(--emw--border-radius-small, 12px);--emw-skeleton-primary-color:var(--emw--color-primary, #d9d9d9);--emw-skeleton-secondary-color:var(--emw--color-secondary, #999999)}.drawer .Skeleton.Text{width:var(--emw-skeleton-text-width-100, 155px)}.overlay{border:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));z-index:0;bottom:0;opacity:1;transition:opacity 0.5s ease-in-out}.icon-button{width:30px;height:30px;border:0px;cursor:pointer}.icon-button.help{background:center/100% no-repeat;background-image:url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.708 4.583a7.125 7.125 0 1 0 0 14.25 7.125 7.125 0 0 0 0-14.25ZM3 11.708a8.708 8.708 0 1 1 17.417 0 8.708 8.708 0 0 1-17.417 0Zm8.913-3.147a1.583 1.583 0 0 0-1.762 1.035.792.792 0 0 1-1.493-.525 3.167 3.167 0 0 1 6.154 1.055c0 1.211-.899 2.011-1.54 2.439a6.37 6.37 0 0 1-1.335.672l-.028.01-.008.002-.003.001h-.002l-.251-.75.25.751a.792.792 0 0 1-.5-1.502l.011-.004.06-.022a4.778 4.778 0 0 0 .928-.476c.545-.363.834-.75.834-1.122v-.001a1.583 1.583 0 0 0-1.315-1.563Zm-.996 7.106c0-.438.354-.792.791-.792h.008a.792.792 0 1 1 0 1.583h-.008a.792.792 0 0 1-.791-.791Z" fill="%23729787"/></svg>')}.icon-button.close{background:center/100% no-repeat;background-image:url('data:image/svg+xml,<svg width="24" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6 6 18M6 6l12 12" stroke="%23729787" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>')}.tooltip-backdrop{box-sizing:border-box;z-index:200;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5);padding:90px 30px 0;border-top-left-radius:72px;border-top-right-radius:72px}.tooltip-backdrop .tooltip{border:1px solid var(--emw--button-border-color, #75ffe9);background:var(--emw--color-background, #213841);border-radius:var(--emw--border-radius-large, 8px);line-height:24px;color:var(--emw--color-secondary, #bbb9c3);position:relative;padding:32px;font-size:var(--emw--font-size-medium, 16px)}.tooltip-backdrop .tooltip .icon-button{top:12px;right:12px;position:absolute}.coins-header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.coins-header__title{color:var(--emw--color-primary, #d3ffed);font-size:var(--emw--font-size-large, 22px);font-weight:var(--emw--font-weight-bold, 700);line-height:25px}.coins-loader{border-radius:var(--emw--border-radius-large, 28px);display:flex;padding:45px 48px;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);justify-content:space-between;line-height:35px;overflow:hidden;margin-bottom:24px}.coins-history-loader{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.coins-history-loader-body{display:flex;justify-content:space-between}.coins-history-loader-left{display:flex}.coins-history-dot .Skeleton{border-radius:var(--emw--border-radius-large, 50%);margin-right:10px}.coins-history-text .Skeleton{margin-right:20px}.coins-tabs{margin:28px 0}.coins-tabs__container{display:flex;position:relative;border-bottom:2px solid var(--emw--color-secondary, #729787)}.coins-tabs__tab{padding:8px 10px;font-weight:var(--emw--font-weight-bold, 700);color:var(--emw--color-gray-300, #729787);cursor:pointer;flex-grow:1;text-align:center;background:transparent;border:none;font-size:var(--emw--font-size-medium, 16px);line-height:18px}.coins-tabs__tab.active{color:var(--emw--color-typography, #fff);border-image-source:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);border-image-slice:1;margin-bottom:-1px;border-bottom:2px solid}.coins-list{max-height:85%;overflow:auto;gap:24px;display:flex;flex-wrap:wrap}.coins-list__item{font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-large, 22px);line-height:25px;padding:35px 48px;border-radius:var(--emw--border-radius-large, 28px);height:110px;color:var(--emw--color-primary, #d3ffed);width:100%;display:flex;justify-content:space-between;align-items:center;box-sizing:border-box;background:var(--emw--color-background-secondary, #233e42);border:1px solid var(--emw--button-border-color-secondary, #244346);cursor:pointer}.coins-list__item__keys{display:flex;align-items:center;font-weight:var(--emw--font-weight-bold, 700);background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;font-size:var(--emw--font-size-large, 22px);gap:7px}.coins-rules{display:flex;flex-flow:column;gap:40px;color:var(--emw--color-primary-variant, #a9ccbe)}.coins-rules__description{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:32px}.coins-rules__terms{display:flex;gap:5px;font-weight:var(--emw--font-weight-semibold, 500);font-size:var(--emw--font-size-medium, 16px);border:none;padding:0;cursor:pointer;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.coins-rules__terms .arrow-icon{width:14px;height:14px;background:center/100% no-repeat;background-image:url('data:image/svg+xml,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M4.41 7.744a.833.833 0 0 0 0 1.179l5 5a.833.833 0 0 0 1.18 0l5-5a.833.833 0 1 0-1.18-1.179L10 12.154l-4.41-4.41a.833.833 0 0 0-1.18 0Z" fill="url(%23a)"/><defs><linearGradient id="a" x1="10" y1="7.5" x2="10" y2="14.167" gradientUnits="userSpaceOnUse"><stop stop-color="%2375FFE9"/><stop offset="1" stop-color="%23B2FF6D"/></linearGradient></defs></svg>') no-repeat}.coins-rules__prize-title{color:#ffffff;font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.coins-rules__list{padding-inline-start:25px;margin:15px 0 0}.coins-rules__list__item{font-weight:var(--emw--font-weight-normal, 400);margin-bottom:12px;font-size:var(--emw--font-size-medium, 16px);line-height:32px}.coins-empty{text-align:center;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);line-height:24px;margin-top:75px;font-size:var(--emw--font-size-medium, 16px)}.coins-history__title{font-weight:var(--emw--font-weight-bold, 700);color:#ffffff;font-size:var(--emw--font-size-medium, 16px);line-height:18px;margin-bottom:16px}.coins-history__wrap{max-height:85%;overflow:auto;padding-right:10px;padding-bottom:50px}.coins-history__more{border:none;display:flex;gap:4px;padding:0;background:linear-gradient(90deg, var(--emw--button-border-color, #75ffe9) 0%, var(--emw--button-border-color-secondary, #b2ff6d) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;cursor:pointer;font-weight:var(--emw--font-weight-medium, 500);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.coins-history__list{margin-bottom:40px;overflow:auto;max-height:215px}.coins-history__list__item{display:flex;color:var(--emw--color-primary-variant, #a9ccbe);font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:16px;margin-bottom:16px}.coins-history__list__item .index{margin-right:20px}.coins-history__list__item .name{flex-grow:1;margin:0;display:flex;gap:6px}.coins-history__list__item .name img{width:18px;height:18px}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--emw--color-gray-105, #1b2e31)}::-webkit-scrollbar-thumb:hover{background:var(--emw--color-gray-290, #284044)}`);
}
function Te(t, e, o) {
  const l = t.slice();
  return l[43] = e[o], l;
}
function Me(t, e, o) {
  const l = t.slice();
  return l[46] = e[o], l[48] = o, l;
}
function Se(t, e, o) {
  const l = t.slice();
  return l[40] = e[o], l[42] = o, l;
}
function ft(t, e, o) {
  const l = t.slice();
  return l[33] = e[o], l;
}
function pt(t, e, o) {
  const l = t.slice();
  return l[33] = e[o], l;
}
function gt(t, e, o) {
  const l = t.slice();
  return l[33] = e[o], l;
}
function Re(t) {
  let e, o, l, i, r, n = (
    /*$_*/
    t[10]("infoTooltip") + ""
  ), a, g, m;
  return {
    c() {
      e = u("div"), o = u("div"), l = u("button"), i = b(), r = u("span"), a = L(n), c(l, "class", "icon-button close"), c(o, "class", "tooltip"), c(e, "class", "tooltip-backdrop");
    },
    m(p, w) {
      R(p, e, w), s(e, o), s(o, l), s(o, i), s(o, r), s(r, a), g || (m = J(
        l,
        "click",
        /*showHideToolip*/
        t[13]
      ), g = !0);
    },
    p(p, w) {
      w[0] & /*$_*/
      1024 && n !== (n = /*$_*/
      p[10]("infoTooltip") + "") && z(a, n);
    },
    d(p) {
      p && S(e), g = !1, m();
    }
  };
}
function ht(t) {
  let e, o, l = (
    /*$_*/
    t[10]("rulesDescription") + ""
  ), i, r, n, a, g, m = (
    /*$_*/
    t[10]("prizeAgenda") + ""
  ), p, w, f, x, h = (
    /*$_*/
    t[10]("tournamentTicket") + ""
  ), v, _, k, C = (
    /*$_*/
    t[10]("freeSpins") + ""
  ), P, Z, T, I = (
    /*$_*/
    t[10]("bonusMoney") + ""
  ), q, ie, j, E = (
    /*$_*/
    t[10]("loyaltyPoints") + ""
  ), K, X, W, V = (
    /*$_*/
    t[10]("luckyWheel") + ""
  ), F, $, G, A = (
    /*$_*/
    t[10]("mysteryChest") + ""
  ), y, d, O, B = (
    /*$_*/
    t[10]("coinRoyale") + ""
  ), ee, U, N, oe = (
    /*$_*/
    t[10]("customRewards") + ""
  ), de, D = (
    /*hasUrl*/
    t[8] && Fe(t)
  );
  return {
    c() {
      e = u("div"), o = u("span"), i = L(l), r = b(), D && D.c(), n = b(), a = u("section"), g = u("span"), p = L(m), w = b(), f = u("ul"), x = u("li"), v = L(h), _ = b(), k = u("li"), P = L(C), Z = b(), T = u("li"), q = L(I), ie = b(), j = u("li"), K = L(E), X = b(), W = u("li"), F = L(V), $ = b(), G = u("li"), y = L(A), d = b(), O = u("li"), ee = L(B), U = b(), N = u("li"), de = L(oe), c(o, "class", "coins-rules__description"), c(g, "class", "coins-rules__prize-title"), c(x, "class", "coins-rules__list__item"), c(k, "class", "coins-rules__list__item"), c(T, "class", "coins-rules__list__item"), c(j, "class", "coins-rules__list__item"), c(W, "class", "coins-rules__list__item"), c(G, "class", "coins-rules__list__item"), c(O, "class", "coins-rules__list__item"), c(N, "class", "coins-rules__list__item"), c(f, "class", "coins-rules__list"), c(e, "class", "coins-rules");
    },
    m(M, H) {
      R(M, e, H), s(e, o), s(o, i), s(e, r), D && D.m(e, null), s(e, n), s(e, a), s(a, g), s(g, p), s(a, w), s(a, f), s(f, x), s(x, v), s(f, _), s(f, k), s(k, P), s(f, Z), s(f, T), s(T, q), s(f, ie), s(f, j), s(j, K), s(f, X), s(f, W), s(W, F), s(f, $), s(f, G), s(G, y), s(f, d), s(f, O), s(O, ee), s(f, U), s(f, N), s(N, de);
    },
    p(M, H) {
      H[0] & /*$_*/
      1024 && l !== (l = /*$_*/
      M[10]("rulesDescription") + "") && z(i, l), /*hasUrl*/
      M[8] ? D ? D.p(M, H) : (D = Fe(M), D.c(), D.m(e, n)) : D && (D.d(1), D = null), H[0] & /*$_*/
      1024 && m !== (m = /*$_*/
      M[10]("prizeAgenda") + "") && z(p, m), H[0] & /*$_*/
      1024 && h !== (h = /*$_*/
      M[10]("tournamentTicket") + "") && z(v, h), H[0] & /*$_*/
      1024 && C !== (C = /*$_*/
      M[10]("freeSpins") + "") && z(P, C), H[0] & /*$_*/
      1024 && I !== (I = /*$_*/
      M[10]("bonusMoney") + "") && z(q, I), H[0] & /*$_*/
      1024 && E !== (E = /*$_*/
      M[10]("loyaltyPoints") + "") && z(K, E), H[0] & /*$_*/
      1024 && V !== (V = /*$_*/
      M[10]("luckyWheel") + "") && z(F, V), H[0] & /*$_*/
      1024 && A !== (A = /*$_*/
      M[10]("mysteryChest") + "") && z(y, A), H[0] & /*$_*/
      1024 && B !== (B = /*$_*/
      M[10]("coinRoyale") + "") && z(ee, B), H[0] & /*$_*/
      1024 && oe !== (oe = /*$_*/
      M[10]("customRewards") + "") && z(de, oe);
    },
    d(M) {
      M && S(e), D && D.d();
    }
  };
}
function _t(t) {
  let e;
  function o(r, n) {
    return (
      /*coinRoyalesHistory*/
      r[9].length > 0 ? xt : yt
    );
  }
  let l = o(t), i = l(t);
  return {
    c() {
      i.c(), e = ue();
    },
    m(r, n) {
      i.m(r, n), R(r, e, n);
    },
    p(r, n) {
      l === (l = o(r)) && i ? i.p(r, n) : (i.d(1), i = l(r), i && (i.c(), i.m(e.parentNode, e)));
    },
    d(r) {
      r && S(e), i.d(r);
    }
  };
}
function bt(t) {
  let e;
  function o(r, n) {
    return (
      /*coinRoyales*/
      r[6].length > 0 ? Lt : zt
    );
  }
  let l = o(t), i = l(t);
  return {
    c() {
      i.c(), e = ue();
    },
    m(r, n) {
      i.m(r, n), R(r, e, n);
    },
    p(r, n) {
      l === (l = o(r)) && i ? i.p(r, n) : (i.d(1), i = l(r), i && (i.c(), i.m(e.parentNode, e)));
    },
    d(r) {
      r && S(e), i.d(r);
    }
  };
}
function wt(t) {
  let e, o = Q([1, 2, 3]), l = [];
  for (let i = 0; i < 3; i += 1)
    l[i] = Mt(ft(t, o, i));
  return {
    c() {
      for (let i = 0; i < 3; i += 1)
        l[i].c();
      e = ue();
    },
    m(i, r) {
      for (let n = 0; n < 3; n += 1)
        l[n] && l[n].m(i, r);
      R(i, e, r);
    },
    p: re,
    d(i) {
      i && S(e), ce(l, i);
    }
  };
}
function vt(t) {
  let e, o = Q([1, 2, 3, 4, 5, 6, 7]), l = [];
  for (let i = 0; i < 7; i += 1)
    l[i] = St(gt(t, o, i));
  return {
    c() {
      for (let i = 0; i < 7; i += 1)
        l[i].c();
      e = ue();
    },
    m(i, r) {
      for (let n = 0; n < 7; n += 1)
        l[n] && l[n].m(i, r);
      R(i, e, r);
    },
    p: re,
    d(i) {
      i && S(e), ce(l, i);
    }
  };
}
function Fe(t) {
  let e, o, l = (
    /*$_*/
    t[10]("terms") + ""
  ), i, r, n;
  return {
    c() {
      e = u("a"), o = u("span"), i = L(l), r = b(), n = u("span"), c(n, "class", "arrow-icon"), c(e, "class", "coins-rules__terms"), c(
        e,
        "href",
        /*terms*/
        t[0]
      ), c(e, "target", "_blank");
    },
    m(a, g) {
      R(a, e, g), s(e, o), s(o, i), s(e, r), s(e, n);
    },
    p(a, g) {
      g[0] & /*$_*/
      1024 && l !== (l = /*$_*/
      a[10]("terms") + "") && z(i, l), g[0] & /*terms*/
      1 && c(
        e,
        "href",
        /*terms*/
        a[0]
      );
    },
    d(a) {
      a && S(e);
    }
  };
}
function yt(t) {
  let e, o = (
    /*$_*/
    t[10]("noHistoryYet") + ""
  ), l;
  return {
    c() {
      e = u("div"), l = L(o), c(e, "class", "coins-empty");
    },
    m(i, r) {
      R(i, e, r), s(e, l);
    },
    p(i, r) {
      r[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      i[10]("noHistoryYet") + "") && z(l, o);
    },
    d(i) {
      i && S(e);
    }
  };
}
function xt(t) {
  let e, o = Q(
    /*coinRoyalesHistory*/
    t[9]
  ), l = [];
  for (let i = 0; i < o.length; i += 1)
    l[i] = Oe(Te(t, o, i));
  return {
    c() {
      e = u("div");
      for (let i = 0; i < l.length; i += 1)
        l[i].c();
      c(e, "class", "coins-history__wrap");
    },
    m(i, r) {
      R(i, e, r);
      for (let n = 0; n < l.length; n += 1)
        l[n] && l[n].m(e, null);
    },
    p(i, r) {
      if (r[0] & /*showMore, coinRoyalesHistory, $_*/
      17920) {
        o = Q(
          /*coinRoyalesHistory*/
          i[9]
        );
        let n;
        for (n = 0; n < o.length; n += 1) {
          const a = Te(i, o, n);
          l[n] ? l[n].p(a, r) : (l[n] = Oe(a), l[n].c(), l[n].m(e, null));
        }
        for (; n < l.length; n += 1)
          l[n].d(1);
        l.length = o.length;
      }
    },
    d(i) {
      i && S(e), ce(l, i);
    }
  };
}
function kt(t) {
  let e, o;
  return {
    c() {
      e = u("img"), ae(e.src, o = /*outcome*/
      t[46].assets) || c(e, "src", o), c(e, "alt", "");
    },
    m(l, i) {
      R(l, e, i);
    },
    p(l, i) {
      i[0] & /*coinRoyalesHistory*/
      512 && !ae(e.src, o = /*outcome*/
      l[46].assets) && c(e, "src", o);
    },
    d(l) {
      l && S(e);
    }
  };
}
function Ct(t) {
  let e = (
    /*outcome*/
    t[46].name + ""
  ), o;
  return {
    c() {
      o = L(e);
    },
    m(l, i) {
      R(l, o, i);
    },
    p(l, i) {
      i[0] & /*coinRoyalesHistory*/
      512 && e !== (e = /*outcome*/
      l[46].name + "") && z(o, e);
    },
    d(l) {
      l && S(o);
    }
  };
}
function Pe(t) {
  var v;
  let e, o, l, i, r, n, a, g, m, p = (
    /*outcome*/
    ((v = t[46]) == null ? void 0 : v.date) + ""
  ), w;
  function f(_, k) {
    var C;
    return (
      /*outcome*/
      (C = _[46]) != null && C.name ? Ct : kt
    );
  }
  let x = f(t), h = x(t);
  return {
    c() {
      var _;
      e = u("div"), o = u("span"), o.textContent = `${/*index*/
      t[48] + 1}`, l = b(), i = u("p"), h.c(), r = b(), n = u("img"), g = b(), m = u("span"), w = L(p), c(o, "class", "index"), ae(n.src, a = /*outcome*/
      (_ = t[46]) != null && _.state ? Ce : ke) || c(n, "src", a), c(n, "alt", ""), c(i, "class", "name"), c(m, "class", "time"), c(e, "class", "coins-history__list__item");
    },
    m(_, k) {
      R(_, e, k), s(e, o), s(e, l), s(e, i), h.m(i, null), s(i, r), s(i, n), s(e, g), s(e, m), s(m, w);
    },
    p(_, k) {
      var C, P;
      x === (x = f(_)) && h ? h.p(_, k) : (h.d(1), h = x(_), h && (h.c(), h.m(i, r))), k[0] & /*coinRoyalesHistory*/
      512 && !ae(n.src, a = /*outcome*/
      (C = _[46]) != null && C.state ? Ce : ke) && c(n, "src", a), k[0] & /*coinRoyalesHistory*/
      512 && p !== (p = /*outcome*/
      ((P = _[46]) == null ? void 0 : P.date) + "") && z(w, p);
    },
    d(_) {
      _ && S(e), h.d();
    }
  };
}
function De(t) {
  let e, o = (
    /*$_*/
    t[10]("more") + ""
  ), l, i, r, n, a, g;
  function m() {
    return (
      /*click_handler_1*/
      t[24](
        /*history*/
        t[43]
      )
    );
  }
  return {
    c() {
      e = u("button"), l = L(o), i = b(), r = u("img"), ae(r.src, n = st) || c(r, "src", n), c(r, "alt", "More"), c(e, "class", "coins-history__more");
    },
    m(p, w) {
      R(p, e, w), s(e, l), s(e, i), s(e, r), a || (g = J(e, "click", m), a = !0);
    },
    p(p, w) {
      t = p, w[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      t[10]("more") + "") && z(l, o);
    },
    d(p) {
      p && S(e), a = !1, g();
    }
  };
}
function Oe(t) {
  var w;
  let e, o, l = (
    /*history*/
    t[43].name + ""
  ), i, r, n, a, g = Q(
    /*history*/
    t[43].outcomes.slice(
      0,
      /*history*/
      t[43].endPos
    )
  ), m = [];
  for (let f = 0; f < g.length; f += 1)
    m[f] = Pe(Me(t, g, f));
  let p = (
    /*history*/
    ((w = t[43].outcomes) == null ? void 0 : w.length) > 3 && /*history*/
    t[43].endPos === 3 && De(t)
  );
  return {
    c() {
      e = u("div"), o = u("div"), i = L(l), r = b();
      for (let f = 0; f < m.length; f += 1)
        m[f].c();
      n = b(), p && p.c(), a = b(), c(o, "class", "coins-history__title"), c(e, "class", "coins-history__list");
    },
    m(f, x) {
      R(f, e, x), s(e, o), s(o, i), s(e, r);
      for (let h = 0; h < m.length; h += 1)
        m[h] && m[h].m(e, null);
      s(e, n), p && p.m(e, null), s(e, a);
    },
    p(f, x) {
      var h;
      if (x[0] & /*coinRoyalesHistory*/
      512 && l !== (l = /*history*/
      f[43].name + "") && z(i, l), x[0] & /*coinRoyalesHistory*/
      512) {
        g = Q(
          /*history*/
          f[43].outcomes.slice(
            0,
            /*history*/
            f[43].endPos
          )
        );
        let v;
        for (v = 0; v < g.length; v += 1) {
          const _ = Me(f, g, v);
          m[v] ? m[v].p(_, x) : (m[v] = Pe(_), m[v].c(), m[v].m(e, n));
        }
        for (; v < m.length; v += 1)
          m[v].d(1);
        m.length = g.length;
      }
      /*history*/
      ((h = f[43].outcomes) == null ? void 0 : h.length) > 3 && /*history*/
      f[43].endPos === 3 ? p ? p.p(f, x) : (p = De(f), p.c(), p.m(e, a)) : p && (p.d(1), p = null);
    },
    d(f) {
      f && S(e), ce(m, f), p && p.d();
    }
  };
}
function zt(t) {
  let e, o = (
    /*$_*/
    t[10]("noCoinYet") + ""
  ), l;
  return {
    c() {
      e = u("div"), l = L(o), c(e, "class", "coins-empty");
    },
    m(i, r) {
      R(i, e, r), s(e, l);
    },
    p(i, r) {
      r[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      i[10]("noCoinYet") + "") && z(l, o);
    },
    d(i) {
      i && S(e);
    }
  };
}
function Lt(t) {
  let e, o = Q(
    /*coinRoyales*/
    t[6]
  ), l = [];
  for (let i = 0; i < o.length; i += 1)
    l[i] = Ae(Se(t, o, i));
  return {
    c() {
      e = u("div");
      for (let i = 0; i < l.length; i += 1)
        l[i].c();
      c(e, "class", "coins-list");
    },
    m(i, r) {
      R(i, e, r);
      for (let n = 0; n < l.length; n += 1)
        l[n] && l[n].m(e, null);
    },
    p(i, r) {
      if (r[0] & /*openCoinDetails, coinRoyales, lang*/
      65602) {
        o = Q(
          /*coinRoyales*/
          i[6]
        );
        let n;
        for (n = 0; n < o.length; n += 1) {
          const a = Se(i, o, n);
          l[n] ? l[n].p(a, r) : (l[n] = Ae(a), l[n].c(), l[n].m(e, null));
        }
        for (; n < l.length; n += 1)
          l[n].d(1);
        l.length = o.length;
      }
    },
    d(i) {
      i && S(e), ce(l, i);
    }
  };
}
function Ae(t) {
  var _, k;
  let e, o = (
    /*coin*/
    (t[40].program.name[
      /*lang*/
      t[1]
    ] || /*coin*/
    t[40].program.name[le.default]) + ""
  ), l, i, r, n, a, g, m, p = (
    /*coin*/
    ((k = (_ = t[40]) == null ? void 0 : _.current) == null ? void 0 : k.remainingTimes) + ""
  ), w, f, x, h;
  function v() {
    return (
      /*click_handler*/
      t[23](
        /*coin*/
        t[40]
      )
    );
  }
  return {
    c() {
      e = u("button"), l = L(o), i = b(), r = u("div"), n = u("img"), g = b(), m = u("span"), w = L(p), f = b(), ae(n.src, a = rt) || c(n, "src", a), c(n, "alt", "Key"), c(r, "class", "coins-list__item__keys"), c(e, "class", "coins-list__item");
    },
    m(C, P) {
      R(C, e, P), s(e, l), s(e, i), s(e, r), s(r, n), s(r, g), s(r, m), s(m, w), s(e, f), x || (h = J(e, "click", v), x = !0);
    },
    p(C, P) {
      var Z, T;
      t = C, P[0] & /*coinRoyales, lang*/
      66 && o !== (o = /*coin*/
      (t[40].program.name[
        /*lang*/
        t[1]
      ] || /*coin*/
      t[40].program.name[le.default]) + "") && z(l, o), P[0] & /*coinRoyales*/
      64 && p !== (p = /*coin*/
      ((T = (Z = t[40]) == null ? void 0 : Z.current) == null ? void 0 : T.remainingTimes) + "") && z(w, p);
    },
    d(C) {
      C && S(e), x = !1, h();
    }
  };
}
function Tt(t) {
  let e;
  return {
    c() {
      e = u("div"), e.innerHTML = '<div class="coins-history-loader-left"><ui-skeleton class="coins-history-dot" structure="rectangle" width="16px" height="16px"></ui-skeleton> <ui-skeleton class="coins-history-text" structure="text" height="16px"></ui-skeleton></div> <ui-skeleton structure="text" width="50px" height="16px"></ui-skeleton>', c(e, "class", "coins-history-loader-body");
    },
    m(o, l) {
      R(o, e, l);
    },
    p: re,
    d(o) {
      o && S(e);
    }
  };
}
function Mt(t) {
  let e, o, l, i, r = Q([1, 2, 3]), n = [];
  for (let a = 0; a < 3; a += 1)
    n[a] = Tt(pt(t, r, a));
  return {
    c() {
      e = u("div"), o = u("ui-skeleton"), l = b();
      for (let a = 0; a < 3; a += 1)
        n[a].c();
      i = b(), ye(o, "structure", "text"), ye(o, "height", "16px"), c(e, "class", "coins-history-loader");
    },
    m(a, g) {
      R(a, e, g), s(e, o), s(e, l);
      for (let m = 0; m < 3; m += 1)
        n[m] && n[m].m(e, null);
      s(e, i);
    },
    p: re,
    d(a) {
      a && S(e), ce(n, a);
    }
  };
}
function St(t) {
  let e;
  return {
    c() {
      e = u("div"), e.innerHTML = '<ui-skeleton structure="text" height="16px"></ui-skeleton> <ui-skeleton structure="rectangle" width="50px" height="16px"></ui-skeleton> ', c(e, "class", "coins-loader");
    },
    m(o, l) {
      R(o, e, l);
    },
    p: re,
    d(o) {
      o && S(e);
    }
  };
}
function Rt(t) {
  let e, o, l, i, r, n, a, g, m, p = (
    /*$_*/
    t[10]("headerTitle") + ""
  ), w, f, x, h, v, _, k, C = (
    /*$_*/
    t[10]("play") + ""
  ), P, Z, T, I = (
    /*$_*/
    t[10]("history") + ""
  ), q, ie, j, E = (
    /*$_*/
    t[10]("rules") + ""
  ), K, X, W, V, F = (
    /*tooltip*/
    t[7] && Re(t)
  );
  function $(y, d) {
    return (
      /*coinsLoading*/
      y[5] ? vt : (
        /*historyLoading*/
        y[4] ? wt : (
          /*activeTab*/
          y[3] === 1 ? bt : (
            /*activeTab*/
            y[3] === 2 ? _t : ht
          )
        )
      )
    );
  }
  let G = $(t), A = G(t);
  return {
    c() {
      e = u("div"), o = u("button"), l = b(), i = u("div"), F && F.c(), r = b(), n = u("div"), a = u("button"), g = b(), m = u("div"), w = L(p), f = b(), x = u("button"), h = b(), v = u("div"), _ = u("div"), k = u("button"), P = L(C), Z = b(), T = u("button"), q = L(I), ie = b(), j = u("button"), K = L(E), X = b(), A.c(), c(o, "class", "overlay"), c(a, "class", "icon-button help"), c(m, "class", "coins-header__title"), c(x, "class", "icon-button close"), c(n, "class", "coins-header"), c(k, "data-index", "1"), c(k, "class", "coins-tabs__tab"), se(
        k,
        "active",
        /*activeTab*/
        t[3] === 1
      ), c(T, "data-index", "2"), c(T, "class", "coins-tabs__tab"), se(
        T,
        "active",
        /*activeTab*/
        t[3] === 2
      ), c(j, "data-index", "3"), c(j, "class", "coins-tabs__tab"), se(
        j,
        "active",
        /*activeTab*/
        t[3] === 3
      ), c(_, "class", "coins-tabs__container"), c(v, "class", "coins-tabs"), c(i, "class", "drawer " + /*mobileView*/
      (t[11] ? "mobile" : "")), c(e, "part", "CustomStylingContainer");
    },
    m(y, d) {
      R(y, e, d), s(e, o), s(e, l), s(e, i), F && F.m(i, null), s(i, r), s(i, n), s(n, a), s(n, g), s(n, m), s(m, w), s(n, f), s(n, x), s(i, h), s(i, v), s(v, _), s(_, k), s(k, P), s(_, Z), s(_, T), s(T, q), s(_, ie), s(_, j), s(j, K), s(i, X), A.m(i, null), t[25](e), W || (V = [
        J(
          o,
          "click",
          /*onClose*/
          t[12]
        ),
        J(
          a,
          "click",
          /*showHideToolip*/
          t[13]
        ),
        J(
          x,
          "click",
          /*onClose*/
          t[12]
        ),
        J(
          k,
          "click",
          /*handleTabChange*/
          t[15]
        ),
        J(
          T,
          "click",
          /*handleTabChange*/
          t[15]
        ),
        J(
          j,
          "click",
          /*handleTabChange*/
          t[15]
        )
      ], W = !0);
    },
    p(y, d) {
      /*tooltip*/
      y[7] ? F ? F.p(y, d) : (F = Re(y), F.c(), F.m(i, r)) : F && (F.d(1), F = null), d[0] & /*$_*/
      1024 && p !== (p = /*$_*/
      y[10]("headerTitle") + "") && z(w, p), d[0] & /*$_*/
      1024 && C !== (C = /*$_*/
      y[10]("play") + "") && z(P, C), d[0] & /*activeTab*/
      8 && se(
        k,
        "active",
        /*activeTab*/
        y[3] === 1
      ), d[0] & /*$_*/
      1024 && I !== (I = /*$_*/
      y[10]("history") + "") && z(q, I), d[0] & /*activeTab*/
      8 && se(
        T,
        "active",
        /*activeTab*/
        y[3] === 2
      ), d[0] & /*$_*/
      1024 && E !== (E = /*$_*/
      y[10]("rules") + "") && z(K, E), d[0] & /*activeTab*/
      8 && se(
        j,
        "active",
        /*activeTab*/
        y[3] === 3
      ), G === (G = $(y)) && A ? A.p(y, d) : (A.d(1), A = G(y), A && (A.c(), A.m(i, null)));
    },
    i: re,
    o: re,
    d(y) {
      y && S(e), F && F.d(), A.d(), t[25](null), W = !1, Ve(V);
    }
  };
}
function Ft(t, e, o) {
  let l;
  Je(t, lt, (d) => o(10, l = d));
  let { terms: i = "" } = e, { lang: r = le.en } = e, { endpoint: n = "" } = e, { session: a = "" } = e, { clientstyling: g = "" } = e, { clientstylingurl: m = "" } = e, { translationurl: p = "" } = e, { mbsource: w } = e, f = window.navigator.userAgent, x = Qe(f), h, v = 1, _ = !1, k = !1, C = [], P = !1, Z = !1, T, I;
  const q = (d) => /(https?:\/\/[^\s]+)/g.test(d), ie = () => {
    xe({ type: "CloseCoinRoyaleDrawer" });
  }, j = () => {
    o(7, P = !P);
  }, E = () => Y(this, null, function* () {
    var ee;
    o(4, _ = !0);
    const d = yield pe.history(n, a), O = (ee = d == null ? void 0 : d.items) == null ? void 0 : ee.map((U) => U.programID);
    let B = C.filter((U) => !O || O.includes(U.program.id)).map((U) => ({
      id: U.program.id,
      name: U.program.name[r] || U.program.name[le.default],
      partitions: U.program.wheelOfFortune.partitions,
      endPos: 0,
      outcomes: []
    }));
    if (B.length > 0) {
      const U = B.map((N, oe) => Y(this, null, function* () {
        const D = (yield pe.outcome(n, a, N == null ? void 0 : N.id)).items || [];
        if (D.length === 0) {
          B[oe] = null;
          return;
        }
        B[oe] = ve(me({}, N), {
          endPos: D.length > 3 ? 3 : D.length,
          outcomes: D.map((M) => {
            var he, _e;
            const H = ((he = N.partitions[M.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : he.name) || {}, ge = ((_e = N.partitions[M.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : _e.image1) || {}, Be = M.draw.state === "fulfilled", He = nt(new Date(M.draw.time), "LLL d, yyyy HH:mm:ss");
            return {
              name: H[r] || H[le.default],
              state: Be,
              date: He,
              assets: ge[r] || ge[le.default]
            };
          })
        });
      }));
      yield Promise.all(U);
    }
    o(9, T = B.filter((U) => !!U)), o(4, _ = !1);
  }), K = () => Y(this, null, function* () {
    o(5, k = !0);
    const d = yield pe.lotteries(n, a);
    o(6, C = d.filter((O) => dt(O))), o(5, k = !1);
  }), X = (d) => {
    var B;
    const O = T.findIndex((ee) => ee.id === d);
    o(9, T[O].endPos = (B = T[O].outcomes) == null ? void 0 : B.length, T);
  }, W = (d) => Y(this, null, function* () {
    o(3, v = +d.target.getAttribute("data-index")), v === 2 && (yield E());
  }), V = () => {
    fetch(p).then((O) => O.json()).then((O) => {
      Object.keys(O).forEach((B) => {
        ze(B, O[B]);
      });
    });
  };
  Object.keys(Le).forEach((d) => {
    ze(d, Le[d]);
  });
  const F = () => {
    ut(r);
  }, $ = (d) => {
    xe({
      type: "OpenCoinRoyaleDetails",
      data: d
    });
  };
  Xe(() => {
    o(8, Z = q(i)), K();
  });
  const G = (d) => {
    $(d);
  }, A = (d) => X(d.id);
  function y(d) {
    $e[d ? "unshift" : "push"](() => {
      h = d, o(2, h);
    });
  }
  return t.$$set = (d) => {
    "terms" in d && o(0, i = d.terms), "lang" in d && o(1, r = d.lang), "endpoint" in d && o(17, n = d.endpoint), "session" in d && o(18, a = d.session), "clientstyling" in d && o(19, g = d.clientstyling), "clientstylingurl" in d && o(20, m = d.clientstylingurl), "translationurl" in d && o(21, p = d.translationurl), "mbsource" in d && o(22, w = d.mbsource);
  }, t.$$.update = () => {
    t.$$.dirty[0] & /*lang*/
    2 && r && F(), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    524292 && g && h && et(h, g), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    1048580 && m && h && tt(h, m), t.$$.dirty[0] & /*translationurl*/
    2097152 && p && V(), t.$$.dirty[0] & /*mbsource, customStylingContainer*/
    4194308 && w && h && it(h, `${w}.Style`, I);
  }, [
    i,
    r,
    h,
    v,
    _,
    k,
    C,
    P,
    Z,
    T,
    l,
    x,
    ie,
    j,
    X,
    W,
    $,
    n,
    a,
    g,
    m,
    p,
    w,
    G,
    A,
    y
  ];
}
class Pt extends Ye {
  constructor(e) {
    super(), We(
      this,
      e,
      Ft,
      Rt,
      qe,
      {
        terms: 0,
        lang: 1,
        endpoint: 17,
        session: 18,
        clientstyling: 19,
        clientstylingurl: 20,
        translationurl: 21,
        mbsource: 22
      },
      mt,
      [-1, -1]
    );
  }
  get terms() {
    return this.$$.ctx[0];
  }
  set terms(e) {
    this.$$set({ terms: e }), te();
  }
  get lang() {
    return this.$$.ctx[1];
  }
  set lang(e) {
    this.$$set({ lang: e }), te();
  }
  get endpoint() {
    return this.$$.ctx[17];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), te();
  }
  get session() {
    return this.$$.ctx[18];
  }
  set session(e) {
    this.$$set({ session: e }), te();
  }
  get clientstyling() {
    return this.$$.ctx[19];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), te();
  }
  get clientstylingurl() {
    return this.$$.ctx[20];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), te();
  }
  get translationurl() {
    return this.$$.ctx[21];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), te();
  }
  get mbsource() {
    return this.$$.ctx[22];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), te();
  }
}
ot(Pt, { terms: {}, lang: {}, endpoint: {}, session: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {} }, [], [], !0);
export {
  Pt as default
};
