var et = Object.defineProperty, tt = Object.defineProperties;
var rt = Object.getOwnPropertyDescriptors;
var Te = Object.getOwnPropertySymbols;
var nt = Object.prototype.hasOwnProperty, at = Object.prototype.propertyIsEnumerable;
var Me = (r, e, t) => e in r ? et(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, ye = (r, e) => {
  for (var t in e || (e = {}))
    nt.call(e, t) && Me(r, t, e[t]);
  if (Te)
    for (var t of Te(e))
      at.call(e, t) && Me(r, t, e[t]);
  return r;
}, Oe = (r, e) => tt(r, rt(e));
var Z = (r, e, t) => new Promise((a, n) => {
  var i = (c) => {
    try {
      s(t.next(c));
    } catch (u) {
      n(u);
    }
  }, o = (c) => {
    try {
      s(t.throw(c));
    } catch (u) {
      n(u);
    }
  }, s = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(i, o);
  s((t = t.apply(r, e)).next());
});
import { a as it, $ as ot, S as st, c as lt, s as ut, f as ne, d as ct, e as ie, g as Y, r as dt, h as W, D as se, m as E, p as l, q as $, t as g, u as y, v as U, j as m, x as ft, y as mt, o as ht, A as gt, E as ee, F as ce, G as ge, H as Pe, k as pe, B as pt, C as vt } from "./CasinoMysteryChestContainer-C4JtpuAm.js";
import "../stencil/ui-skeleton-Ca5rz3Hv.js";
const De = (r) => window.postMessage(r, window.location.href), wt = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.1978%2013.2348C12.1978%209.60751%2015.1383%206.66699%2018.7656%206.66699C22.3929%206.66699%2025.3334%209.60751%2025.3334%2013.2348C25.3334%2016.8621%2022.3929%2019.8026%2018.7656%2019.8026C18.467%2019.8026%2018.1725%2019.7826%2017.8835%2019.7438C17.6825%2019.7168%2017.557%2019.7001%2017.4658%2019.6909C17.4218%2019.7326%2017.3626%2019.7916%2017.2673%2019.8869L12.5565%2024.5977C12.5457%2024.6085%2012.5344%2024.6198%2012.5229%2024.6315C12.4009%2024.7542%2012.2356%2024.9205%2012.0329%2025.0448C11.8576%2025.1522%2011.6665%2025.2313%2011.4666%2025.2793C11.2354%2025.3348%2011.001%2025.3341%2010.8279%2025.3335C10.8115%2025.3335%2010.7956%2025.3334%2010.7803%2025.3334L9.14719%2025.3334C8.91663%2025.3335%208.68571%2025.3335%208.48899%2025.3174C8.27114%2025.2996%208.00565%2025.2571%207.7365%2025.1199C7.36793%2024.9321%207.06826%2024.6325%206.88046%2024.2639C6.74332%2023.9948%206.70076%2023.7293%206.68297%2023.5114C6.66689%2023.3147%206.66693%2023.0838%206.66696%2022.8532L6.66696%2021.2201C6.66696%2021.2049%206.66691%2021.189%206.66686%2021.1725C6.66631%2020.9994%206.66557%2020.765%206.72109%2020.5338C6.76907%2020.3339%206.84822%2020.1428%206.95562%2019.9676C7.07986%2019.7648%207.24617%2019.5995%207.36894%2019.4776C7.3806%2019.466%207.39188%2019.4548%207.40268%2019.4439L12.1135%2014.7331C12.2088%2014.6378%2012.2678%2014.5786%2012.3095%2014.5346C12.3003%2014.4434%2012.2836%2014.3179%2012.2566%2014.1169C12.2178%2013.8279%2012.1978%2013.5334%2012.1978%2013.2348ZM18.7656%208.74104C16.2837%208.74104%2014.2718%2010.753%2014.2718%2013.2348C14.2718%2013.4408%2014.2856%2013.6429%2014.3122%2013.8406L14.3146%2013.8585C14.3394%2014.0432%2014.3618%2014.2097%2014.3749%2014.3451C14.3874%2014.4747%2014.4011%2014.6598%2014.3736%2014.8525C14.3367%2015.1105%2014.2715%2015.3033%2014.1443%2015.5308C14.0078%2015.7751%2013.7931%2015.9881%2013.629%2016.151C13.6121%2016.1678%2013.5958%2016.184%2013.5801%2016.1997L8.86926%2020.9105C8.82845%2020.9513%208.79718%2020.9826%208.77036%2021.0099C8.75929%2021.0212%208.74992%2021.0308%208.74194%2021.0392C8.7417%2021.0507%208.74151%2021.0641%208.74137%2021.0799C8.74102%2021.1182%208.74101%2021.1624%208.74101%2021.2201V22.8215C8.74101%2023.0268%208.74146%2023.1591%208.74514%2023.2553C8.84132%2023.2589%208.97362%2023.2594%209.17887%2023.2594H10.7803C10.838%2023.2594%2010.8822%2023.2594%2010.9205%2023.259C10.9363%2023.2589%2010.9497%2023.2587%2010.9613%2023.2585C10.9696%2023.2505%2010.9792%2023.2411%2010.9905%2023.2301C11.0178%2023.2032%2011.0491%2023.172%2011.0899%2023.1312L15.8007%2018.4203C15.8164%2018.4046%2015.8327%2018.3883%2015.8494%2018.3714C16.0123%2018.2073%2016.2253%2017.9926%2016.4696%2017.8561C16.6971%2017.7289%2016.8899%2017.6638%2017.1479%2017.6268C17.3406%2017.5993%2017.5257%2017.613%2017.6553%2017.6255C17.7907%2017.6386%2017.9572%2017.661%2018.1419%2017.6858L18.1598%2017.6882C18.3575%2017.7148%2018.5597%2017.7286%2018.7656%2017.7286C21.2474%2017.7286%2023.2594%2015.7167%2023.2594%2013.2348C23.2594%2010.753%2021.2474%208.74104%2018.7656%208.74104ZM17.7286%2013.2348C17.7286%2012.6621%2018.1929%2012.1978%2018.7656%2012.1978H18.7748C19.3475%2012.1978%2019.8118%2012.6621%2019.8118%2013.2348C19.8118%2013.8076%2019.3475%2014.2718%2018.7748%2014.2718H18.7656C18.1929%2014.2718%2017.7286%2013.8076%2017.7286%2013.2348Z'%20fill='url(%23paint0_linear_714_605)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_714_605'%20x1='6.66675'%20y1='16.0003'%20x2='25.3334'%20y2='16.0003'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2375FFE9'/%3e%3cstop%20offset='1'%20stop-color='%23B2FF6D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", Se = "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", We = "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", bt = "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";
function ve(r) {
  "@babel/helpers - typeof";
  return ve = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, ve(r);
}
function oe(r) {
  if (r === null || r === !0 || r === !1)
    return NaN;
  var e = Number(r);
  return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
}
function A(r, e) {
  if (e.length < r)
    throw new TypeError(r + " argument" + (r > 1 ? "s" : "") + " required, but only " + e.length + " present");
}
function J(r) {
  A(1, arguments);
  var e = Object.prototype.toString.call(r);
  return r instanceof Date || ve(r) === "object" && e === "[object Date]" ? new Date(r.getTime()) : typeof r == "number" || e === "[object Number]" ? new Date(r) : ((typeof r == "string" || e === "[object String]") && typeof console != "undefined" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
}
function _t(r, e) {
  A(2, arguments);
  var t = J(r).getTime(), a = oe(e);
  return new Date(t + a);
}
var yt = {};
function _e() {
  return yt;
}
function xt(r) {
  var e = new Date(Date.UTC(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds()));
  return e.setUTCFullYear(r.getFullYear()), r.getTime() - e.getTime();
}
function Ct(r) {
  return A(1, arguments), r instanceof Date || ve(r) === "object" && Object.prototype.toString.call(r) === "[object Date]";
}
function kt(r) {
  if (A(1, arguments), !Ct(r) && typeof r != "number")
    return !1;
  var e = J(r);
  return !isNaN(Number(e));
}
function Tt(r, e) {
  A(2, arguments);
  var t = oe(e);
  return _t(r, -t);
}
var Mt = 864e5;
function Ot(r) {
  A(1, arguments);
  var e = J(r), t = e.getTime();
  e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
  var a = e.getTime(), n = t - a;
  return Math.floor(n / Mt) + 1;
}
function we(r) {
  A(1, arguments);
  var e = 1, t = J(r), a = t.getUTCDay(), n = (a < e ? 7 : 0) + a - e;
  return t.setUTCDate(t.getUTCDate() - n), t.setUTCHours(0, 0, 0, 0), t;
}
function Ve(r) {
  A(1, arguments);
  var e = J(r), t = e.getUTCFullYear(), a = /* @__PURE__ */ new Date(0);
  a.setUTCFullYear(t + 1, 0, 4), a.setUTCHours(0, 0, 0, 0);
  var n = we(a), i = /* @__PURE__ */ new Date(0);
  i.setUTCFullYear(t, 0, 4), i.setUTCHours(0, 0, 0, 0);
  var o = we(i);
  return e.getTime() >= n.getTime() ? t + 1 : e.getTime() >= o.getTime() ? t : t - 1;
}
function Pt(r) {
  A(1, arguments);
  var e = Ve(r), t = /* @__PURE__ */ new Date(0);
  t.setUTCFullYear(e, 0, 4), t.setUTCHours(0, 0, 0, 0);
  var a = we(t);
  return a;
}
var Dt = 6048e5;
function St(r) {
  A(1, arguments);
  var e = J(r), t = we(e).getTime() - Pt(e).getTime();
  return Math.round(t / Dt) + 1;
}
function be(r, e) {
  var t, a, n, i, o, s, c, u;
  A(1, arguments);
  var f = _e(), p = oe((t = (a = (n = (i = e == null ? void 0 : e.weekStartsOn) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && n !== void 0 ? n : f.weekStartsOn) !== null && a !== void 0 ? a : (c = f.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.weekStartsOn) !== null && t !== void 0 ? t : 0);
  if (!(p >= 0 && p <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  var d = J(r), v = d.getUTCDay(), w = (v < p ? 7 : 0) + v - p;
  return d.setUTCDate(d.getUTCDate() - w), d.setUTCHours(0, 0, 0, 0), d;
}
function Ze(r, e) {
  var t, a, n, i, o, s, c, u;
  A(1, arguments);
  var f = J(r), p = f.getUTCFullYear(), d = _e(), v = oe((t = (a = (n = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && n !== void 0 ? n : d.firstWeekContainsDate) !== null && a !== void 0 ? a : (c = d.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1);
  if (!(v >= 1 && v <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var w = /* @__PURE__ */ new Date(0);
  w.setUTCFullYear(p + 1, 0, v), w.setUTCHours(0, 0, 0, 0);
  var b = be(w, e), _ = /* @__PURE__ */ new Date(0);
  _.setUTCFullYear(p, 0, v), _.setUTCHours(0, 0, 0, 0);
  var P = be(_, e);
  return f.getTime() >= b.getTime() ? p + 1 : f.getTime() >= P.getTime() ? p : p - 1;
}
function Wt(r, e) {
  var t, a, n, i, o, s, c, u;
  A(1, arguments);
  var f = _e(), p = oe((t = (a = (n = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && n !== void 0 ? n : f.firstWeekContainsDate) !== null && a !== void 0 ? a : (c = f.locale) === null || c === void 0 || (u = c.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1), d = Ze(r, e), v = /* @__PURE__ */ new Date(0);
  v.setUTCFullYear(d, 0, p), v.setUTCHours(0, 0, 0, 0);
  var w = be(v, e);
  return w;
}
var Ut = 6048e5;
function zt(r, e) {
  A(1, arguments);
  var t = J(r), a = be(t, e).getTime() - Wt(t, e).getTime();
  return Math.round(a / Ut) + 1;
}
function C(r, e) {
  for (var t = r < 0 ? "-" : "", a = Math.abs(r).toString(); a.length < e; )
    a = "0" + a;
  return t + a;
}
var re = {
  // Year
  y: function(e, t) {
    var a = e.getUTCFullYear(), n = a > 0 ? a : 1 - a;
    return C(t === "yy" ? n % 100 : n, t.length);
  },
  // Month
  M: function(e, t) {
    var a = e.getUTCMonth();
    return t === "M" ? String(a + 1) : C(a + 1, 2);
  },
  // Day of the month
  d: function(e, t) {
    return C(e.getUTCDate(), t.length);
  },
  // AM or PM
  a: function(e, t) {
    var a = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return a.toUpperCase();
      case "aaa":
        return a;
      case "aaaaa":
        return a[0];
      case "aaaa":
      default:
        return a === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h: function(e, t) {
    return C(e.getUTCHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H: function(e, t) {
    return C(e.getUTCHours(), t.length);
  },
  // Minute
  m: function(e, t) {
    return C(e.getUTCMinutes(), t.length);
  },
  // Second
  s: function(e, t) {
    return C(e.getUTCSeconds(), t.length);
  },
  // Fraction of second
  S: function(e, t) {
    var a = t.length, n = e.getUTCMilliseconds(), i = Math.floor(n * Math.pow(10, a - 3));
    return C(i, t.length);
  }
}, le = {
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Lt = {
  // Era
  G: function(e, t, a) {
    var n = e.getUTCFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return a.era(n, {
          width: "abbreviated"
        });
      case "GGGGG":
        return a.era(n, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return a.era(n, {
          width: "wide"
        });
    }
  },
  // Year
  y: function(e, t, a) {
    if (t === "yo") {
      var n = e.getUTCFullYear(), i = n > 0 ? n : 1 - n;
      return a.ordinalNumber(i, {
        unit: "year"
      });
    }
    return re.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, a, n) {
    var i = Ze(e, n), o = i > 0 ? i : 1 - i;
    if (t === "YY") {
      var s = o % 100;
      return C(s, 2);
    }
    return t === "Yo" ? a.ordinalNumber(o, {
      unit: "year"
    }) : C(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    var a = Ve(e);
    return C(a, t.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(e, t) {
    var a = e.getUTCFullYear();
    return C(a, t.length);
  },
  // Quarter
  Q: function(e, t, a) {
    var n = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(n);
      case "QQ":
        return C(n, 2);
      case "Qo":
        return a.ordinalNumber(n, {
          unit: "quarter"
        });
      case "QQQ":
        return a.quarter(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return a.quarter(n, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return a.quarter(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, a) {
    var n = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(n);
      case "qq":
        return C(n, 2);
      case "qo":
        return a.ordinalNumber(n, {
          unit: "quarter"
        });
      case "qqq":
        return a.quarter(n, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return a.quarter(n, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return a.quarter(n, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, a) {
    var n = e.getUTCMonth();
    switch (t) {
      case "M":
      case "MM":
        return re.M(e, t);
      case "Mo":
        return a.ordinalNumber(n + 1, {
          unit: "month"
        });
      case "MMM":
        return a.month(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return a.month(n, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return a.month(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function(e, t, a) {
    var n = e.getUTCMonth();
    switch (t) {
      case "L":
        return String(n + 1);
      case "LL":
        return C(n + 1, 2);
      case "Lo":
        return a.ordinalNumber(n + 1, {
          unit: "month"
        });
      case "LLL":
        return a.month(n, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return a.month(n, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return a.month(n, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function(e, t, a, n) {
    var i = zt(e, n);
    return t === "wo" ? a.ordinalNumber(i, {
      unit: "week"
    }) : C(i, t.length);
  },
  // ISO week of year
  I: function(e, t, a) {
    var n = St(e);
    return t === "Io" ? a.ordinalNumber(n, {
      unit: "week"
    }) : C(n, t.length);
  },
  // Day of the month
  d: function(e, t, a) {
    return t === "do" ? a.ordinalNumber(e.getUTCDate(), {
      unit: "date"
    }) : re.d(e, t);
  },
  // Day of year
  D: function(e, t, a) {
    var n = Ot(e);
    return t === "Do" ? a.ordinalNumber(n, {
      unit: "dayOfYear"
    }) : C(n, t.length);
  },
  // Day of week
  E: function(e, t, a) {
    var n = e.getUTCDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return a.day(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return a.day(n, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return a.day(n, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return a.day(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, a, n) {
    var i = e.getUTCDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return C(o, 2);
      case "eo":
        return a.ordinalNumber(o, {
          unit: "day"
        });
      case "eee":
        return a.day(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return a.day(i, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return a.day(i, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return a.day(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, a, n) {
    var i = e.getUTCDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return C(o, t.length);
      case "co":
        return a.ordinalNumber(o, {
          unit: "day"
        });
      case "ccc":
        return a.day(i, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return a.day(i, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return a.day(i, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return a.day(i, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, a) {
    var n = e.getUTCDay(), i = n === 0 ? 7 : n;
    switch (t) {
      case "i":
        return String(i);
      case "ii":
        return C(i, t.length);
      case "io":
        return a.ordinalNumber(i, {
          unit: "day"
        });
      case "iii":
        return a.day(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return a.day(n, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return a.day(n, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return a.day(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, a) {
    var n = e.getUTCHours(), i = n / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, a) {
    var n = e.getUTCHours(), i;
    switch (n === 12 ? i = le.noon : n === 0 ? i = le.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, a) {
    var n = e.getUTCHours(), i;
    switch (n >= 17 ? i = le.evening : n >= 12 ? i = le.afternoon : n >= 4 ? i = le.morning : i = le.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return a.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return a.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return a.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, a) {
    if (t === "ho") {
      var n = e.getUTCHours() % 12;
      return n === 0 && (n = 12), a.ordinalNumber(n, {
        unit: "hour"
      });
    }
    return re.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, a) {
    return t === "Ho" ? a.ordinalNumber(e.getUTCHours(), {
      unit: "hour"
    }) : re.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, a) {
    var n = e.getUTCHours() % 12;
    return t === "Ko" ? a.ordinalNumber(n, {
      unit: "hour"
    }) : C(n, t.length);
  },
  // Hour [1-24]
  k: function(e, t, a) {
    var n = e.getUTCHours();
    return n === 0 && (n = 24), t === "ko" ? a.ordinalNumber(n, {
      unit: "hour"
    }) : C(n, t.length);
  },
  // Minute
  m: function(e, t, a) {
    return t === "mo" ? a.ordinalNumber(e.getUTCMinutes(), {
      unit: "minute"
    }) : re.m(e, t);
  },
  // Second
  s: function(e, t, a) {
    return t === "so" ? a.ordinalNumber(e.getUTCSeconds(), {
      unit: "second"
    }) : re.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return re.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, a, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    if (o === 0)
      return "Z";
    switch (t) {
      case "X":
        return ze(o);
      case "XXXX":
      case "XX":
        return ae(o);
      case "XXXXX":
      case "XXX":
      default:
        return ae(o, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, a, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "x":
        return ze(o);
      case "xxxx":
      case "xx":
        return ae(o);
      case "xxxxx":
      case "xxx":
      default:
        return ae(o, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, a, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Ue(o, ":");
      case "OOOO":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, a, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Ue(o, ":");
      case "zzzz":
      default:
        return "GMT" + ae(o, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, a, n) {
    var i = n._originalDate || e, o = Math.floor(i.getTime() / 1e3);
    return C(o, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, a, n) {
    var i = n._originalDate || e, o = i.getTime();
    return C(o, t.length);
  }
};
function Ue(r, e) {
  var t = r > 0 ? "-" : "+", a = Math.abs(r), n = Math.floor(a / 60), i = a % 60;
  if (i === 0)
    return t + String(n);
  var o = e;
  return t + String(n) + o + C(i, 2);
}
function ze(r, e) {
  if (r % 60 === 0) {
    var t = r > 0 ? "-" : "+";
    return t + C(Math.abs(r) / 60, 2);
  }
  return ae(r, e);
}
function ae(r, e) {
  var t = e || "", a = r > 0 ? "-" : "+", n = Math.abs(r), i = C(Math.floor(n / 60), 2), o = C(n % 60, 2);
  return a + i + t + o;
}
var Le = function(e, t) {
  switch (e) {
    case "P":
      return t.date({
        width: "short"
      });
    case "PP":
      return t.date({
        width: "medium"
      });
    case "PPP":
      return t.date({
        width: "long"
      });
    case "PPPP":
    default:
      return t.date({
        width: "full"
      });
  }
}, Je = function(e, t) {
  switch (e) {
    case "p":
      return t.time({
        width: "short"
      });
    case "pp":
      return t.time({
        width: "medium"
      });
    case "ppp":
      return t.time({
        width: "long"
      });
    case "pppp":
    default:
      return t.time({
        width: "full"
      });
  }
}, Yt = function(e, t) {
  var a = e.match(/(P+)(p+)?/) || [], n = a[1], i = a[2];
  if (!i)
    return Le(e, t);
  var o;
  switch (n) {
    case "P":
      o = t.dateTime({
        width: "short"
      });
      break;
    case "PP":
      o = t.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      o = t.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      o = t.dateTime({
        width: "full"
      });
      break;
  }
  return o.replace("{{date}}", Le(n, t)).replace("{{time}}", Je(i, t));
}, Et = {
  p: Je,
  P: Yt
}, Ft = ["D", "DD"], Nt = ["YY", "YYYY"];
function Ht(r) {
  return Ft.indexOf(r) !== -1;
}
function qt(r) {
  return Nt.indexOf(r) !== -1;
}
function Ye(r, e, t) {
  if (r === "YYYY")
    throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "YY")
    throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "D")
    throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (r === "DD")
    throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
}
var Rt = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, Bt = function(e, t, a) {
  var n, i = Rt[e];
  return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), a != null && a.addSuffix ? a.comparison && a.comparison > 0 ? "in " + n : n + " ago" : n;
};
function xe(r) {
  return function() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : r.defaultWidth, a = r.formats[t] || r.formats[r.defaultWidth];
    return a;
  };
}
var jt = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, At = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, It = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Gt = {
  date: xe({
    formats: jt,
    defaultWidth: "full"
  }),
  time: xe({
    formats: At,
    defaultWidth: "full"
  }),
  dateTime: xe({
    formats: It,
    defaultWidth: "full"
  })
}, Qt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, Xt = function(e, t, a, n) {
  return Qt[e];
};
function fe(r) {
  return function(e, t) {
    var a = t != null && t.context ? String(t.context) : "standalone", n;
    if (a === "formatting" && r.formattingValues) {
      var i = r.defaultFormattingWidth || r.defaultWidth, o = t != null && t.width ? String(t.width) : i;
      n = r.formattingValues[o] || r.formattingValues[i];
    } else {
      var s = r.defaultWidth, c = t != null && t.width ? String(t.width) : r.defaultWidth;
      n = r.values[c] || r.values[s];
    }
    var u = r.argumentCallback ? r.argumentCallback(e) : e;
    return n[u];
  };
}
var Vt = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, Zt = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Jt = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, Kt = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
}, $t = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, er = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, tr = function(e, t) {
  var a = Number(e), n = a % 100;
  if (n > 20 || n < 10)
    switch (n % 10) {
      case 1:
        return a + "st";
      case 2:
        return a + "nd";
      case 3:
        return a + "rd";
    }
  return a + "th";
}, rr = {
  ordinalNumber: tr,
  era: fe({
    values: Vt,
    defaultWidth: "wide"
  }),
  quarter: fe({
    values: Zt,
    defaultWidth: "wide",
    argumentCallback: function(e) {
      return e - 1;
    }
  }),
  month: fe({
    values: Jt,
    defaultWidth: "wide"
  }),
  day: fe({
    values: Kt,
    defaultWidth: "wide"
  }),
  dayPeriod: fe({
    values: $t,
    defaultWidth: "wide",
    formattingValues: er,
    defaultFormattingWidth: "wide"
  })
};
function me(r) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = t.width, n = a && r.matchPatterns[a] || r.matchPatterns[r.defaultMatchWidth], i = e.match(n);
    if (!i)
      return null;
    var o = i[0], s = a && r.parsePatterns[a] || r.parsePatterns[r.defaultParseWidth], c = Array.isArray(s) ? ar(s, function(p) {
      return p.test(o);
    }) : nr(s, function(p) {
      return p.test(o);
    }), u;
    u = r.valueCallback ? r.valueCallback(c) : c, u = t.valueCallback ? t.valueCallback(u) : u;
    var f = e.slice(o.length);
    return {
      value: u,
      rest: f
    };
  };
}
function nr(r, e) {
  for (var t in r)
    if (r.hasOwnProperty(t) && e(r[t]))
      return t;
}
function ar(r, e) {
  for (var t = 0; t < r.length; t++)
    if (e(r[t]))
      return t;
}
function ir(r) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = e.match(r.matchPattern);
    if (!a)
      return null;
    var n = a[0], i = e.match(r.parsePattern);
    if (!i)
      return null;
    var o = r.valueCallback ? r.valueCallback(i[0]) : i[0];
    o = t.valueCallback ? t.valueCallback(o) : o;
    var s = e.slice(n.length);
    return {
      value: o,
      rest: s
    };
  };
}
var or = /^(\d+)(th|st|nd|rd)?/i, sr = /\d+/i, lr = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, ur = {
  any: [/^b/i, /^(a|c)/i]
}, cr = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, dr = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, fr = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, mr = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
}, hr = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, gr = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, pr = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, vr = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, wr = {
  ordinalNumber: ir({
    matchPattern: or,
    parsePattern: sr,
    valueCallback: function(e) {
      return parseInt(e, 10);
    }
  }),
  era: me({
    matchPatterns: lr,
    defaultMatchWidth: "wide",
    parsePatterns: ur,
    defaultParseWidth: "any"
  }),
  quarter: me({
    matchPatterns: cr,
    defaultMatchWidth: "wide",
    parsePatterns: dr,
    defaultParseWidth: "any",
    valueCallback: function(e) {
      return e + 1;
    }
  }),
  month: me({
    matchPatterns: fr,
    defaultMatchWidth: "wide",
    parsePatterns: mr,
    defaultParseWidth: "any"
  }),
  day: me({
    matchPatterns: hr,
    defaultMatchWidth: "wide",
    parsePatterns: gr,
    defaultParseWidth: "any"
  }),
  dayPeriod: me({
    matchPatterns: pr,
    defaultMatchWidth: "any",
    parsePatterns: vr,
    defaultParseWidth: "any"
  })
}, br = {
  code: "en-US",
  formatDistance: Bt,
  formatLong: Gt,
  formatRelative: Xt,
  localize: rr,
  match: wr,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
}, _r = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, yr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, xr = /^'([^]*?)'?$/, Cr = /''/g, kr = /[a-zA-Z]/;
function Tr(r, e, t) {
  var a, n, i, o, s, c, u, f, p, d, v, w, b, _;
  A(2, arguments);
  var P = String(e), M = _e(), x = (a = (n = void 0) !== null && n !== void 0 ? n : M.locale) !== null && a !== void 0 ? a : br, D = oe((i = (o = (s = (c = void 0) !== null && c !== void 0 ? c : void 0) !== null && s !== void 0 ? s : M.firstWeekContainsDate) !== null && o !== void 0 ? o : (u = M.locale) === null || u === void 0 || (f = u.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
  if (!(D >= 1 && D <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var N = oe((p = (d = (v = (w = void 0) !== null && w !== void 0 ? w : void 0) !== null && v !== void 0 ? v : M.weekStartsOn) !== null && d !== void 0 ? d : (b = M.locale) === null || b === void 0 || (_ = b.options) === null || _ === void 0 ? void 0 : _.weekStartsOn) !== null && p !== void 0 ? p : 0);
  if (!(N >= 0 && N <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  if (!x.localize)
    throw new RangeError("locale must contain localize property");
  if (!x.formatLong)
    throw new RangeError("locale must contain formatLong property");
  var I = J(r);
  if (!kt(I))
    throw new RangeError("Invalid time value");
  var H = xt(I), X = Tt(I, H), G = {
    firstWeekContainsDate: D,
    weekStartsOn: N,
    locale: x,
    _originalDate: I
  }, Q = P.match(yr).map(function(S) {
    var q = S[0];
    if (q === "p" || q === "P") {
      var O = Et[q];
      return O(S, x.formatLong);
    }
    return S;
  }).join("").match(_r).map(function(S) {
    if (S === "''")
      return "'";
    var q = S[0];
    if (q === "'")
      return Mr(S);
    var O = Lt[q];
    if (O)
      return qt(S) && Ye(S, e, String(r)), Ht(S) && Ye(S, e, String(r)), O(X, S, x.localize, G);
    if (q.match(kr))
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + q + "`");
    return S;
  }).join("");
  return Q;
}
function Mr(r) {
  var e = r.match(xr);
  return e ? e[1].replace(Cr, "'") : r;
}
var he = /* @__PURE__ */ ((r) => (r.lotteries = "lotteries", r.outcome = "outcome", r.draw = "draw", r))(he || {}), ue = /* @__PURE__ */ ((r) => (r.en = "en", r.default = "*", r))(ue || {});
const Or = (r) => Z(void 0, null, function* () {
  const { path: e, params: t = {}, options: a = {} } = r, n = new URL(e);
  return Object.keys(t).map((i) => {
    n.searchParams.append(i, t[i]);
  }), yield Pr(n, a);
}), Pr = (t, ...a) => Z(void 0, [t, ...a], function* (r, e = {}) {
  let n;
  try {
    n = yield fetch(r, e), n = yield n.text(), n = JSON.parse(n);
  } catch (i) {
    throw new Error(i.message);
  }
  return n;
}), Ee = (r, e, t) => Z(void 0, null, function* () {
  const { session: a } = t, n = {
    headers: ye({
      "Content-Type": "application/json",
      accept: "text/plain"
    }, a ? { "x-SessionId": a } : {})
  }, o = {
    [he.lotteries]: () => ({
      path: "/wof/lotteries",
      params: {
        filter: "Types[]=mysteryChest"
      },
      options: n
    }),
    [he.outcome]: () => {
      const { id: s } = t;
      return {
        path: `/wof/outcome/${s}`,
        params: {
          filter: "Types[]=mysteryChest"
        },
        options: n
      };
    }
  }[r]();
  return o.path = e + "/v1" + o.path, yield Or(o);
}), Fe = {
  lotteries: (r, e) => Z(void 0, null, function* () {
    const t = yield Ee(he.lotteries, r, { session: e });
    return (t == null ? void 0 : t.items) || [];
  }),
  outcome: (r, e, t) => Z(void 0, null, function* () {
    return yield Ee(he.outcome, r, { session: e, id: t });
  })
}, Dr = (r) => {
  var e;
  return ((e = r == null ? void 0 : r.current) == null ? void 0 : e.remainingTimes) > 0 && (r == null ? void 0 : r.next);
};
function Ne(r, e) {
  it(r, e);
}
function Sr(r) {
  ot.set(r);
}
const He = {
  en: {
    infoTooltip: "Open Mystery Chest and find your reward!",
    play: "Play",
    history: "History",
    rules: "Rules",
    noChestYet: "There are no available Chests",
    noHistoryYet: "There is no history yet",
    more: "More",
    rulesDescription: "Mystery Chest is a particularly interesting game, will bring you a lot of surprises; When you obtained the Mystery Chest, means you got a key to open the Chest, 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",
    customRewards: "Custom Rewards"
  }
};
function Wr(r) {
  ct(r, "svelte-4ymzhp", `.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 .chests-header__title{font-size:var(--emw--font-size-medium, 16px);font-weight:var(--emw--font-weight-medium, 500);line-height:14px}.mobile .chests-tabs{margin:20px 0}.mobile .chests-tabs__container{border-bottom:1px solid var(--emw--color-secondary, #729787)}.mobile .chests-tabs__tab{font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.mobile .chests-tabs__tab.active{border-bottom:1px solid}.mobile .chests-list{gap:16px}.mobile .chests-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:16px;height:56px}.mobile .chests-list__item__keys{gap:5px;font-size:var(--emw--font-size-medium, 16px)}.mobile .chests-rules{gap:24px}.mobile .chests-rules__description{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__terms{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-rules__prize-title{font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-rules__list{padding-inline-start:15px;margin:5px 0 0}.mobile .chests-rules__list__item{margin-bottom:5px;font-size:var(--emw--font-size-x-small, 12px);line-height:24px}.mobile .chests-empty{margin-top:50px;font-size:var(--emw--font-size-x-small, 12px)}.mobile .chests-history__title{font-size:var(--emw--font-size-x-small, 12px);line-height:14px;margin-bottom:12px}.mobile .chests-history__list{margin-bottom:32px}.mobile .chests-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 .chests-history__list__item .name img{width:14px;height:14px}.mobile .chests-loader{border-radius:var(--emw--border-radius-large, 16px);padding:20px;line-height:15px}.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% 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>') no-repeat}.icon-button.close{background:center/100% 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>') no-repeat}.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}.chests-header{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.chests-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}.chests-tabs{margin:28px 0}.chests-tabs__container{display:flex;position:relative;border-bottom:2px solid var(--emw--color-secondary, #729787)}.chests-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}.chests-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:-2px;border-bottom:2px solid}@media screen and (max-width: 1300px){.chests-tabs{margin:15px 0 28px}}.chests-list{max-height:85%;overflow:auto;gap:24px;display:flex;flex-wrap:wrap}.chests-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:28px;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}.chests-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}@media screen and (max-width: 992px){.chests-list__item{font-size:var(--emw--font-size-medium, 16px);padding:20px 24px}.chests-list__item__keys{font-size:var(--emw--font-size-medium, 16px)}}@media screen and (max-width: 1300px){.chests-list{gap:20px}.chests-list__item{padding:25px 24px}}.chests-rules{display:flex;flex-flow:column;gap:40px;color:var(--emw--color-primary-variant, #a9ccbe)}.chests-rules__description{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-medium, 16px);line-height:32px}.chests-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}.chests-rules__terms .arrow-icon{width:14px;height:14px;background:center/100% 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}.chests-rules__prize-title{color:#ffffff;font-weight:var(--emw--font-weight-bold, 700);font-size:var(--emw--font-size-medium, 16px);line-height:18px}.chests-rules__list{padding-inline-start:25px;margin:15px 0 0}.chests-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}.chests-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)}.chests-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}.chests-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}.chests-history__list{margin-bottom:40px;overflow:auto;max-height:215px}.chests-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}.chests-history__list__item .index{margin-right:20px}.chests-history__list__item .name{flex-grow:1;margin:0;display:flex;gap:6px}.chests-history__list__item .name img{width:18px;height:18px}.chests-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}.chests-history-loader{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.chests-history-loader-body{display:flex}.chests-history-dot .Skeleton{border-radius:var(--emw--border-radius-large, 50%);margin-right:10px}.chests-history-text .Skeleton{margin-right:20px}`);
}
function qe(r, e, t) {
  const a = r.slice();
  return a[43] = e[t], a;
}
function Re(r, e, t) {
  const a = r.slice();
  return a[46] = e[t], a[48] = t, a;
}
function Be(r, e, t) {
  const a = r.slice();
  return a[40] = e[t], a[42] = t, a;
}
function Ur(r, e, t) {
  const a = r.slice();
  return a[33] = e[t], a;
}
function zr(r, e, t) {
  const a = r.slice();
  return a[33] = e[t], a;
}
function Lr(r, e, t) {
  const a = r.slice();
  return a[33] = e[t], a;
}
function je(r) {
  let e, t, a, n, i, o = (
    /*$_*/
    r[10]("infoTooltip") + ""
  ), s, c, u;
  return {
    c() {
      e = g("div"), t = g("div"), a = g("button"), n = y(), i = g("span"), s = U(o), m(a, "class", "icon-button close"), m(t, "class", "tooltip"), m(e, "class", "tooltip-backdrop");
    },
    m(f, p) {
      E(f, e, p), l(e, t), l(t, a), l(t, n), l(t, i), l(i, s), c || (u = $(
        a,
        "click",
        /*showHideToolip*/
        r[13]
      ), c = !0);
    },
    p(f, p) {
      p[0] & /*$_*/
      1024 && o !== (o = /*$_*/
      f[10]("infoTooltip") + "") && W(s, o);
    },
    d(f) {
      f && Y(e), c = !1, u();
    }
  };
}
function Yr(r) {
  let e, t, a = (
    /*$_*/
    r[10]("rulesDescription") + ""
  ), n, i, o, s, c, u = (
    /*$_*/
    r[10]("prizeAgenda") + ""
  ), f, p, d, v, w = (
    /*$_*/
    r[10]("tournamentTicket") + ""
  ), b, _, P, M = (
    /*$_*/
    r[10]("freeSpins") + ""
  ), x, D, N, I = (
    /*$_*/
    r[10]("bonusMoney") + ""
  ), H, X, G, Q = (
    /*$_*/
    r[10]("loyaltyPoints") + ""
  ), S, q, O, K = (
    /*$_*/
    r[10]("luckyWheel") + ""
  ), V, R, k, F = (
    /*$_*/
    r[10]("mysteryChest") + ""
  ), de, h, T, L = (
    /*$_*/
    r[10]("customRewards") + ""
  ), te, j = (
    /*hasUrl*/
    r[8] && Ae(r)
  );
  return {
    c() {
      e = g("div"), t = g("span"), n = U(a), i = y(), j && j.c(), o = y(), s = g("section"), c = g("span"), f = U(u), p = y(), d = g("ul"), v = g("li"), b = U(w), _ = y(), P = g("li"), x = U(M), D = y(), N = g("li"), H = U(I), X = y(), G = g("li"), S = U(Q), q = y(), O = g("li"), V = U(K), R = y(), k = g("li"), de = U(F), h = y(), T = g("li"), te = U(L), m(t, "class", "chests-rules__description"), m(c, "class", "chests-rules__prize-title"), m(v, "class", "chests-rules__list__item"), m(P, "class", "chests-rules__list__item"), m(N, "class", "chests-rules__list__item"), m(G, "class", "chests-rules__list__item"), m(O, "class", "chests-rules__list__item"), m(k, "class", "chests-rules__list__item"), m(T, "class", "chests-rules__list__item"), m(d, "class", "chests-rules__list"), m(e, "class", "chests-rules");
    },
    m(z, B) {
      E(z, e, B), l(e, t), l(t, n), l(e, i), j && j.m(e, null), l(e, o), l(e, s), l(s, c), l(c, f), l(s, p), l(s, d), l(d, v), l(v, b), l(d, _), l(d, P), l(P, x), l(d, D), l(d, N), l(N, H), l(d, X), l(d, G), l(G, S), l(d, q), l(d, O), l(O, V), l(d, R), l(d, k), l(k, de), l(d, h), l(d, T), l(T, te);
    },
    p(z, B) {
      B[0] & /*$_*/
      1024 && a !== (a = /*$_*/
      z[10]("rulesDescription") + "") && W(n, a), /*hasUrl*/
      z[8] ? j ? j.p(z, B) : (j = Ae(z), j.c(), j.m(e, o)) : j && (j.d(1), j = null), B[0] & /*$_*/
      1024 && u !== (u = /*$_*/
      z[10]("prizeAgenda") + "") && W(f, u), B[0] & /*$_*/
      1024 && w !== (w = /*$_*/
      z[10]("tournamentTicket") + "") && W(b, w), B[0] & /*$_*/
      1024 && M !== (M = /*$_*/
      z[10]("freeSpins") + "") && W(x, M), B[0] & /*$_*/
      1024 && I !== (I = /*$_*/
      z[10]("bonusMoney") + "") && W(H, I), B[0] & /*$_*/
      1024 && Q !== (Q = /*$_*/
      z[10]("loyaltyPoints") + "") && W(S, Q), B[0] & /*$_*/
      1024 && K !== (K = /*$_*/
      z[10]("luckyWheel") + "") && W(V, K), B[0] & /*$_*/
      1024 && F !== (F = /*$_*/
      z[10]("mysteryChest") + "") && W(de, F), B[0] & /*$_*/
      1024 && L !== (L = /*$_*/
      z[10]("customRewards") + "") && W(te, L);
    },
    d(z) {
      z && Y(e), j && j.d();
    }
  };
}
function Er(r) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChestsHistory*/
      i[9].length > 0 ? Rr : qr
    );
  }
  let a = t(r), n = a(r);
  return {
    c() {
      n.c(), e = ge();
    },
    m(i, o) {
      n.m(i, o), E(i, e, o);
    },
    p(i, o) {
      a === (a = t(i)) && n ? n.p(i, o) : (n.d(1), n = a(i), n && (n.c(), n.m(e.parentNode, e)));
    },
    d(i) {
      i && Y(e), n.d(i);
    }
  };
}
function Fr(r) {
  let e;
  function t(i, o) {
    return (
      /*mysteryChests*/
      i[6].length > 0 ? jr : Br
    );
  }
  let a = t(r), n = a(r);
  return {
    c() {
      n.c(), e = ge();
    },
    m(i, o) {
      n.m(i, o), E(i, e, o);
    },
    p(i, o) {
      a === (a = t(i)) && n ? n.p(i, o) : (n.d(1), n = a(i), n && (n.c(), n.m(e.parentNode, e)));
    },
    d(i) {
      i && Y(e), n.d(i);
    }
  };
}
function Nr(r) {
  let e, t = ee([1, 2, 3]), a = [];
  for (let n = 0; n < 3; n += 1)
    a[n] = Ir(Ur(r, t, n));
  return {
    c() {
      for (let n = 0; n < 3; n += 1)
        a[n].c();
      e = ge();
    },
    m(n, i) {
      for (let o = 0; o < 3; o += 1)
        a[o] && a[o].m(n, i);
      E(n, e, i);
    },
    p: ie,
    d(n) {
      n && Y(e), ce(a, n);
    }
  };
}
function Hr(r) {
  let e, t = ee([1, 2, 3, 4, 5, 6, 7]), a = [];
  for (let n = 0; n < 7; n += 1)
    a[n] = Gr(Lr(r, t, n));
  return {
    c() {
      for (let n = 0; n < 7; n += 1)
        a[n].c();
      e = ge();
    },
    m(n, i) {
      for (let o = 0; o < 7; o += 1)
        a[o] && a[o].m(n, i);
      E(n, e, i);
    },
    p: ie,
    d(n) {
      n && Y(e), ce(a, n);
    }
  };
}
function Ae(r) {
  let e, t, a = (
    /*$_*/
    r[10]("terms") + ""
  ), n, i, o;
  return {
    c() {
      e = g("a"), t = g("span"), n = U(a), i = y(), o = g("span"), m(o, "class", "arrow-icon"), m(e, "class", "chests-rules__terms"), m(
        e,
        "href",
        /*terms*/
        r[0]
      ), m(e, "target", "_blank");
    },
    m(s, c) {
      E(s, e, c), l(e, t), l(t, n), l(e, i), l(e, o);
    },
    p(s, c) {
      c[0] & /*$_*/
      1024 && a !== (a = /*$_*/
      s[10]("terms") + "") && W(n, a), c[0] & /*terms*/
      1 && m(
        e,
        "href",
        /*terms*/
        s[0]
      );
    },
    d(s) {
      s && Y(e);
    }
  };
}
function qr(r) {
  let e, t = (
    /*$_*/
    r[10]("noHistoryYet") + ""
  ), a;
  return {
    c() {
      e = g("div"), a = U(t), m(e, "class", "chests-empty");
    },
    m(n, i) {
      E(n, e, i), l(e, a);
    },
    p(n, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      n[10]("noHistoryYet") + "") && W(a, t);
    },
    d(n) {
      n && Y(e);
    }
  };
}
function Rr(r) {
  let e, t = ee(
    /*mysteryChestsHistory*/
    r[9]
  ), a = [];
  for (let n = 0; n < t.length; n += 1)
    a[n] = Qe(qe(r, t, n));
  return {
    c() {
      for (let n = 0; n < a.length; n += 1)
        a[n].c();
      e = ge();
    },
    m(n, i) {
      for (let o = 0; o < a.length; o += 1)
        a[o] && a[o].m(n, i);
      E(n, e, i);
    },
    p(n, i) {
      if (i[0] & /*showMore, mysteryChestsHistory, $_*/
      17920) {
        t = ee(
          /*mysteryChestsHistory*/
          n[9]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = qe(n, t, o);
          a[o] ? a[o].p(s, i) : (a[o] = Qe(s), a[o].c(), a[o].m(e.parentNode, e));
        }
        for (; o < a.length; o += 1)
          a[o].d(1);
        a.length = t.length;
      }
    },
    d(n) {
      n && Y(e), ce(a, n);
    }
  };
}
function Ie(r) {
  var w, b;
  let e, t, a, n, i = (
    /*outcome*/
    ((w = r[46]) == null ? void 0 : w.name) + ""
  ), o, s, c, u, f, p, d = (
    /*outcome*/
    ((b = r[46]) == null ? void 0 : b.date) + ""
  ), v;
  return {
    c() {
      var _;
      e = g("div"), t = g("span"), t.textContent = `${/*index*/
      r[48] + 1}`, a = y(), n = g("p"), o = U(i), s = y(), c = g("img"), f = y(), p = g("span"), v = U(d), m(t, "class", "index"), pe(c.src, u = /*outcome*/
      (_ = r[46]) != null && _.state ? We : Se) || m(c, "src", u), m(c, "alt", ""), m(n, "class", "name"), m(p, "class", "time"), m(e, "class", "chests-history__list__item");
    },
    m(_, P) {
      E(_, e, P), l(e, t), l(e, a), l(e, n), l(n, o), l(n, s), l(n, c), l(e, f), l(e, p), l(p, v);
    },
    p(_, P) {
      var M, x, D;
      P[0] & /*mysteryChestsHistory*/
      512 && i !== (i = /*outcome*/
      ((M = _[46]) == null ? void 0 : M.name) + "") && W(o, i), P[0] & /*mysteryChestsHistory*/
      512 && !pe(c.src, u = /*outcome*/
      (x = _[46]) != null && x.state ? We : Se) && m(c, "src", u), P[0] & /*mysteryChestsHistory*/
      512 && d !== (d = /*outcome*/
      ((D = _[46]) == null ? void 0 : D.date) + "") && W(v, d);
    },
    d(_) {
      _ && Y(e);
    }
  };
}
function Ge(r) {
  let e, t = (
    /*$_*/
    r[10]("more") + ""
  ), a, n, i, o, s, c;
  function u() {
    return (
      /*click_handler_1*/
      r[23](
        /*history*/
        r[43]
      )
    );
  }
  return {
    c() {
      e = g("button"), a = U(t), n = y(), i = g("img"), pe(i.src, o = bt) || m(i, "src", o), m(i, "alt", "More"), m(e, "class", "chests-history__more");
    },
    m(f, p) {
      E(f, e, p), l(e, a), l(e, n), l(e, i), s || (c = $(e, "click", u), s = !0);
    },
    p(f, p) {
      r = f, p[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      r[10]("more") + "") && W(a, t);
    },
    d(f) {
      f && Y(e), s = !1, c();
    }
  };
}
function Qe(r) {
  var p;
  let e, t, a = (
    /*history*/
    r[43].name + ""
  ), n, i, o, s, c = ee(
    /*history*/
    r[43].outcomes.slice(
      0,
      /*history*/
      r[43].endPos
    )
  ), u = [];
  for (let d = 0; d < c.length; d += 1)
    u[d] = Ie(Re(r, c, d));
  let f = (
    /*history*/
    ((p = r[43].outcomes) == null ? void 0 : p.length) > 3 && /*history*/
    r[43].endPos === 3 && Ge(r)
  );
  return {
    c() {
      e = g("div"), t = g("div"), n = U(a), i = y();
      for (let d = 0; d < u.length; d += 1)
        u[d].c();
      o = y(), f && f.c(), s = y(), m(t, "class", "chests-history__title"), m(e, "class", "chests-history__list");
    },
    m(d, v) {
      E(d, e, v), l(e, t), l(t, n), l(e, i);
      for (let w = 0; w < u.length; w += 1)
        u[w] && u[w].m(e, null);
      l(e, o), f && f.m(e, null), l(e, s);
    },
    p(d, v) {
      var w;
      if (v[0] & /*mysteryChestsHistory*/
      512 && a !== (a = /*history*/
      d[43].name + "") && W(n, a), v[0] & /*mysteryChestsHistory*/
      512) {
        c = ee(
          /*history*/
          d[43].outcomes.slice(
            0,
            /*history*/
            d[43].endPos
          )
        );
        let b;
        for (b = 0; b < c.length; b += 1) {
          const _ = Re(d, c, b);
          u[b] ? u[b].p(_, v) : (u[b] = Ie(_), u[b].c(), u[b].m(e, o));
        }
        for (; b < u.length; b += 1)
          u[b].d(1);
        u.length = c.length;
      }
      /*history*/
      ((w = d[43].outcomes) == null ? void 0 : w.length) > 3 && /*history*/
      d[43].endPos === 3 ? f ? f.p(d, v) : (f = Ge(d), f.c(), f.m(e, s)) : f && (f.d(1), f = null);
    },
    d(d) {
      d && Y(e), ce(u, d), f && f.d();
    }
  };
}
function Br(r) {
  let e, t = (
    /*$_*/
    r[10]("noChestYet") + ""
  ), a;
  return {
    c() {
      e = g("div"), a = U(t), m(e, "class", "chests-empty");
    },
    m(n, i) {
      E(n, e, i), l(e, a);
    },
    p(n, i) {
      i[0] & /*$_*/
      1024 && t !== (t = /*$_*/
      n[10]("noChestYet") + "") && W(a, t);
    },
    d(n) {
      n && Y(e);
    }
  };
}
function jr(r) {
  let e, t = ee(
    /*mysteryChests*/
    r[6]
  ), a = [];
  for (let n = 0; n < t.length; n += 1)
    a[n] = Xe(Be(r, t, n));
  return {
    c() {
      e = g("div");
      for (let n = 0; n < a.length; n += 1)
        a[n].c();
      m(e, "class", "chests-list");
    },
    m(n, i) {
      E(n, e, i);
      for (let o = 0; o < a.length; o += 1)
        a[o] && a[o].m(e, null);
    },
    p(n, i) {
      if (i[0] & /*openChestDetails, mysteryChests, lang*/
      65602) {
        t = ee(
          /*mysteryChests*/
          n[6]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = Be(n, t, o);
          a[o] ? a[o].p(s, i) : (a[o] = Xe(s), a[o].c(), a[o].m(e, null));
        }
        for (; o < a.length; o += 1)
          a[o].d(1);
        a.length = t.length;
      }
    },
    d(n) {
      n && Y(e), ce(a, n);
    }
  };
}
function Xe(r) {
  var _, P;
  let e, t = (
    /*chest*/
    (r[40].program.name[
      /*lang*/
      r[1]
    ] || /*chest*/
    r[40].program.name[ue.default]) + ""
  ), a, n, i, o, s, c, u, f = (
    /*chest*/
    ((P = (_ = r[40]) == null ? void 0 : _.current) == null ? void 0 : P.remainingTimes) + ""
  ), p, d, v, w;
  function b() {
    return (
      /*click_handler*/
      r[22](
        /*chest*/
        r[40]
      )
    );
  }
  return {
    c() {
      e = g("button"), a = U(t), n = y(), i = g("div"), o = g("img"), c = y(), u = g("span"), p = U(f), d = y(), pe(o.src, s = wt) || m(o, "src", s), m(o, "alt", "Key"), m(i, "class", "chests-list__item__keys"), m(e, "class", "chests-list__item");
    },
    m(M, x) {
      E(M, e, x), l(e, a), l(e, n), l(e, i), l(i, o), l(i, c), l(i, u), l(u, p), l(e, d), v || (w = $(e, "click", b), v = !0);
    },
    p(M, x) {
      var D, N;
      r = M, x[0] & /*mysteryChests, lang*/
      66 && t !== (t = /*chest*/
      (r[40].program.name[
        /*lang*/
        r[1]
      ] || /*chest*/
      r[40].program.name[ue.default]) + "") && W(a, t), x[0] & /*mysteryChests*/
      64 && f !== (f = /*chest*/
      ((N = (D = r[40]) == null ? void 0 : D.current) == null ? void 0 : N.remainingTimes) + "") && W(p, f);
    },
    d(M) {
      M && Y(e), v = !1, w();
    }
  };
}
function Ar(r) {
  let e;
  return {
    c() {
      e = g("div"), e.innerHTML = '<ui-skeleton class="chests-history-dot" structure="rectangle" width="16px" height="16px"></ui-skeleton> <ui-skeleton class="chests-history-text" structure="text" height="16px"></ui-skeleton> <ui-skeleton structure="text" width="50px" height="16px"></ui-skeleton>', m(e, "class", "chests-history-loader-body");
    },
    m(t, a) {
      E(t, e, a);
    },
    p: ie,
    d(t) {
      t && Y(e);
    }
  };
}
function Ir(r) {
  let e, t, a, n, i = ee([1, 2, 3]), o = [];
  for (let s = 0; s < 3; s += 1)
    o[s] = Ar(zr(r, i, s));
  return {
    c() {
      e = g("div"), t = g("ui-skeleton"), a = y();
      for (let s = 0; s < 3; s += 1)
        o[s].c();
      n = y(), Pe(t, "structure", "text"), Pe(t, "height", "16px"), m(e, "class", "chests-history-loader");
    },
    m(s, c) {
      E(s, e, c), l(e, t), l(e, a);
      for (let u = 0; u < 3; u += 1)
        o[u] && o[u].m(e, null);
      l(e, n);
    },
    p: ie,
    d(s) {
      s && Y(e), ce(o, s);
    }
  };
}
function Gr(r) {
  let e;
  return {
    c() {
      e = g("div"), e.innerHTML = '<ui-skeleton structure="text" height="16px"></ui-skeleton> <ui-skeleton structure="rectangle" width="50px" height="16px"></ui-skeleton> ', m(e, "class", "chests-loader");
    },
    m(t, a) {
      E(t, e, a);
    },
    p: ie,
    d(t) {
      t && Y(e);
    }
  };
}
function Qr(r) {
  let e, t, a, n, i, o, s, c, u, f, p, d, v, w, b, _ = (
    /*$_*/
    r[10]("play") + ""
  ), P, M, x, D = (
    /*$_*/
    r[10]("history") + ""
  ), N, I, H, X = (
    /*$_*/
    r[10]("rules") + ""
  ), G, Q, S, q, O = (
    /*tooltip*/
    r[7] && je(r)
  );
  function K(k, F) {
    return (
      /*chestsLoading*/
      k[5] ? Hr : (
        /*historyLoading*/
        k[4] ? Nr : (
          /*activeTab*/
          k[3] === 1 ? Fr : (
            /*activeTab*/
            k[3] === 2 ? Er : Yr
          )
        )
      )
    );
  }
  let V = K(r), R = V(r);
  return {
    c() {
      e = g("div"), t = g("button"), a = y(), n = g("div"), O && O.c(), i = y(), o = g("div"), s = g("button"), c = y(), u = g("div"), u.textContent = "Mystery Chests", f = y(), p = g("button"), d = y(), v = g("div"), w = g("div"), b = g("button"), P = U(_), M = y(), x = g("button"), N = U(D), I = y(), H = g("button"), G = U(X), Q = y(), R.c(), m(t, "class", "overlay"), m(s, "class", "icon-button help"), m(u, "class", "chests-header__title"), m(p, "class", "icon-button close"), m(o, "class", "chests-header"), m(b, "data-index", "1"), m(b, "class", "chests-tabs__tab"), se(
        b,
        "active",
        /*activeTab*/
        r[3] === 1
      ), m(x, "data-index", "2"), m(x, "class", "chests-tabs__tab"), se(
        x,
        "active",
        /*activeTab*/
        r[3] === 2
      ), m(H, "data-index", "3"), m(H, "class", "chests-tabs__tab"), se(
        H,
        "active",
        /*activeTab*/
        r[3] === 3
      ), m(w, "class", "chests-tabs__container"), m(v, "class", "chests-tabs"), m(n, "class", "drawer " + /*mobileView*/
      (r[11] ? "mobile" : "")), m(e, "part", "CustomStylingContainer");
    },
    m(k, F) {
      E(k, e, F), l(e, t), l(e, a), l(e, n), O && O.m(n, null), l(n, i), l(n, o), l(o, s), l(o, c), l(o, u), l(o, f), l(o, p), l(n, d), l(n, v), l(v, w), l(w, b), l(b, P), l(w, M), l(w, x), l(x, N), l(w, I), l(w, H), l(H, G), l(n, Q), R.m(n, null), r[24](e), S || (q = [
        $(
          t,
          "click",
          /*onClose*/
          r[12]
        ),
        $(
          s,
          "click",
          /*showHideToolip*/
          r[13]
        ),
        $(
          p,
          "click",
          /*onClose*/
          r[12]
        ),
        $(
          b,
          "click",
          /*handleTabChange*/
          r[15]
        ),
        $(
          x,
          "click",
          /*handleTabChange*/
          r[15]
        ),
        $(
          H,
          "click",
          /*handleTabChange*/
          r[15]
        )
      ], S = !0);
    },
    p(k, F) {
      /*tooltip*/
      k[7] ? O ? O.p(k, F) : (O = je(k), O.c(), O.m(n, i)) : O && (O.d(1), O = null), F[0] & /*$_*/
      1024 && _ !== (_ = /*$_*/
      k[10]("play") + "") && W(P, _), F[0] & /*activeTab*/
      8 && se(
        b,
        "active",
        /*activeTab*/
        k[3] === 1
      ), F[0] & /*$_*/
      1024 && D !== (D = /*$_*/
      k[10]("history") + "") && W(N, D), F[0] & /*activeTab*/
      8 && se(
        x,
        "active",
        /*activeTab*/
        k[3] === 2
      ), F[0] & /*$_*/
      1024 && X !== (X = /*$_*/
      k[10]("rules") + "") && W(G, X), F[0] & /*activeTab*/
      8 && se(
        H,
        "active",
        /*activeTab*/
        k[3] === 3
      ), V === (V = K(k)) && R ? R.p(k, F) : (R.d(1), R = V(k), R && (R.c(), R.m(n, null)));
    },
    i: ie,
    o: ie,
    d(k) {
      k && Y(e), O && O.d(), R.d(), r[24](null), S = !1, dt(q);
    }
  };
}
function Xr(r, e, t) {
  let a;
  ft(r, vt, (h) => t(10, a = h));
  let { terms: n = "" } = e, { lang: i = ue.en } = e, { endpoint: o = "" } = e, { session: s = "" } = e, { clientstyling: c = "" } = e, { clientstylingurl: u = "" } = e, { translationurl: f = "" } = e, p = window.navigator.userAgent, d = mt(p), v, w = 1, b = !1, _ = !1, P = [], M = !1, x = !1, D;
  const N = (h) => /(https?:\/\/[^\s]+)/g.test(h), I = () => {
    De({ type: "CloseMysteryChestDrawer" });
  }, H = () => {
    t(7, M = !M);
  }, X = () => Z(this, null, function* () {
    t(4, b = !0);
    let h = P.map((T) => ({
      id: T.program.id,
      name: T.program.name[i] || T.program.name[ue.default],
      partitions: T.program.wheelOfFortune.partitions,
      endPos: 0,
      outcomes: []
    }));
    if (h.length > 0) {
      const T = h.map((L, te) => Z(this, null, function* () {
        const z = (yield Fe.outcome(o, s, L == null ? void 0 : L.id)).items || [];
        if (z.length === 0) {
          h[te] = null;
          return;
        }
        h[te] = Oe(ye({}, L), {
          endPos: z.length > 3 ? 3 : z.length,
          outcomes: z.map((B) => {
            var ke;
            const Ce = ((ke = L.partitions[B.draw.result.wheelOfFortunePartitionIndex]) == null ? void 0 : ke.name) || {}, Ke = B.draw.state === "fulfilled", $e = Tr(new Date(B.draw.time), "LLL d, yyyy HH:mm:ss");
            return {
              name: Ce[i] || Ce[ue.default],
              state: Ke,
              date: $e
            };
          })
        });
      }));
      yield Promise.all(T);
    }
    t(9, D = h.filter((T) => !!T)), t(4, b = !1);
  }), G = () => Z(this, null, function* () {
    t(5, _ = !0);
    const h = yield Fe.lotteries(o, s);
    t(6, P = h.filter((T) => Dr(T))), t(5, _ = !1);
  }), Q = (h) => {
    var L;
    const T = D.findIndex((te) => te.id === h);
    t(9, D[T].endPos = (L = D[T].outcomes) == null ? void 0 : L.length, D);
  }, S = (h) => Z(this, null, function* () {
    t(3, w = +h.target.getAttribute("data-index")), w === 2 && (yield X());
  }), q = () => {
    let h = document.createElement("style");
    h.innerHTML = c, v.appendChild(h);
  }, O = () => {
    let h = new URL(u), T = document.createElement("style");
    fetch(h.href).then((L) => L.text()).then((L) => {
      T.innerHTML = L, setTimeout(
        () => {
          v.appendChild(T);
        },
        1
      );
    });
  }, K = () => {
    fetch(f).then((T) => T.json()).then((T) => {
      Object.keys(T).forEach((L) => {
        Ne(L, T[L]);
      });
    });
  };
  Object.keys(He).forEach((h) => {
    Ne(h, He[h]);
  });
  const V = () => {
    Sr(i);
  }, R = (h) => {
    De({
      type: "OpenMysteryChestDetails",
      data: h
    });
  };
  ht(() => {
    t(8, x = N(n)), G();
  });
  const k = (h) => {
    R(h);
  }, F = (h) => Q(h.id);
  function de(h) {
    gt[h ? "unshift" : "push"](() => {
      v = h, t(2, v);
    });
  }
  return r.$$set = (h) => {
    "terms" in h && t(0, n = h.terms), "lang" in h && t(1, i = h.lang), "endpoint" in h && t(17, o = h.endpoint), "session" in h && t(18, s = h.session), "clientstyling" in h && t(19, c = h.clientstyling), "clientstylingurl" in h && t(20, u = h.clientstylingurl), "translationurl" in h && t(21, f = h.translationurl);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*lang*/
    2 && i && V(), r.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    524292 && c && v && q(), r.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    1048580 && u && v && O(), r.$$.dirty[0] & /*translationurl*/
    2097152 && f && K();
  }, [
    n,
    i,
    v,
    w,
    b,
    _,
    P,
    M,
    x,
    D,
    a,
    d,
    I,
    H,
    Q,
    S,
    R,
    o,
    s,
    c,
    u,
    f,
    k,
    F,
    de
  ];
}
class Vr extends st {
  constructor(e) {
    super(), lt(
      this,
      e,
      Xr,
      Qr,
      ut,
      {
        terms: 0,
        lang: 1,
        endpoint: 17,
        session: 18,
        clientstyling: 19,
        clientstylingurl: 20,
        translationurl: 21
      },
      Wr,
      [-1, -1]
    );
  }
  get terms() {
    return this.$$.ctx[0];
  }
  set terms(e) {
    this.$$set({ terms: e }), ne();
  }
  get lang() {
    return this.$$.ctx[1];
  }
  set lang(e) {
    this.$$set({ lang: e }), ne();
  }
  get endpoint() {
    return this.$$.ctx[17];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), ne();
  }
  get session() {
    return this.$$.ctx[18];
  }
  set session(e) {
    this.$$set({ session: e }), ne();
  }
  get clientstyling() {
    return this.$$.ctx[19];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), ne();
  }
  get clientstylingurl() {
    return this.$$.ctx[20];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), ne();
  }
  get translationurl() {
    return this.$$.ctx[21];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), ne();
  }
}
pt(Vr, { terms: {}, lang: {}, endpoint: {}, session: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {} }, [], [], !0);
export {
  Vr as default
};
