var Qe = Object.defineProperty, xe = Object.defineProperties;
var $e = Object.getOwnPropertyDescriptors;
var Fe = Object.getOwnPropertySymbols;
var et = Object.prototype.hasOwnProperty, tt = Object.prototype.propertyIsEnumerable;
var Ce = (t, e, n) => e in t ? Qe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ue = (t, e) => {
  for (var n in e || (e = {}))
    et.call(e, n) && Ce(t, n, e[n]);
  if (Fe)
    for (var n of Fe(e))
      tt.call(e, n) && Ce(t, n, e[n]);
  return t;
}, de = (t, e) => xe(t, $e(e));
import { a as nt, $ as at, S as st, i as rt, s as ot, f as L, b as lt, n as me, d as z, c as se, g as a, h as N, j as m, l as ee, k as w, m as I, t as j, e as b, p as it, q as ut, u as dt, v as ae, w as ce, H as pe, C as ie, D as Se, r as ct, x as mt, y as pt, z as ft, A as yt, B as bt } from "./GeneralLogout-hWNQ3J3o.js";
import { f as K, s as gt, p as Me, e as _t, a as ht } from "./PlayerAccountGamingLimitsGroupEdit-K-lekHTx.js";
import "./PlayerActiveBonuses-Cv7645BT.js";
import "./PlayerAccountProductRestriction-Cbwqgb-P.js";
function De(t, e) {
  nt(t, e);
}
function Bt(t) {
  at.set(t);
}
const Pe = {
  en: {
    titleBonusesHistory: "Bonus History",
    dateFrom: "From:",
    dateTo: "To:",
    dateFilter: "Filter",
    noBonusHistory: "You have no bonuses for the selected period."
  },
  "zh-hk": {
    titleBonusesHistory: "獎金歷史",
    dateFrom: "從：",
    dateTo: "至：",
    dateFilter: "篩選",
    noBonusHistory: "您目前沒有獎金歷史。"
  },
  fr: {
    titleBonusesHistory: "Historique du bonus",
    dateFrom: "De:",
    dateTo: "A:",
    dateFilter: "Filtre",
    noBonusHistory: "Vous n'avez pas d'historique de bonus pour le moment."
  },
  ro: {
    titleBonusesHistory: "Istoric bonusuri",
    dateFrom: "De la",
    dateTo: "La",
    dateFilter: "Filtru",
    noBonusHistory: "Nu ai bonusuri pentru perioada selectata."
  },
  es: {
    titleBonusesHistory: "Historial de Bonos",
    dateFrom: "Desde:",
    dateTo: "A:",
    dateFilter: "Filtro",
    noBonusHistory: "No tiene Bonos para el periodo seleccionado."
  },
  pt: {
    titleBonusesHistory: "Histórico de bônus",
    dateFrom: "A partir de:",
    dateTo: "Para:",
    dateFilter: "Filtro:",
    noBonusHistory: "Você não tem histórico de bônus no momento."
  },
  hr: {
    titleBonusesHistory: "Povijest bonusa",
    dateFrom: "Od:",
    dateTo: "Do:",
    dateFilter: "Filter",
    noBonusHistory: "Nemate bonusa u povijesti."
  },
  "pt-br": {
    titleBonusesHistory: "Histórico de bônus",
    dateFrom: "De:",
    dateTo: "PARA:",
    dateFilter: "Filtro",
    noBonusHistory: "Não há bônus para o período selecionado"
  },
  "es-mx": {
    titleBonusesHistory: "Historial de bonos",
    dateFrom: "De:",
    dateTo: "A:",
    dateFilter: "Filtro",
    noBonusHistory: "No tiene bonus para el periodo seleccionado"
  },
  tr: {
    titleBonusesHistory: "Bonus Geçmişi",
    dateFrom: "İtibaren:",
    dateTo: "İle:",
    dateFilter: "Filtre",
    noBonusHistory: "Seçilen dönem için bonusunuz yok."
  },
  "en-us": {
    titleBonusesHistory: "Bonus History",
    dateFrom: "From:",
    dateTo: "To:",
    dateFilter: "Filter",
    noBonusHistory: "You have no bonuses for the selected period."
  }
};
function vt(t) {
  lt(t, "svelte-18j72sv", '.BonusesWrapper{background-color:var(--emw--color-pale, var(--emw--color-gray-50, #F1F1F1));border-radius:var(--emw--border-radius-large, 10px);color:var(--emw--color-typography-cotrast, #444444);padding:50px;max-width:850px}.BonusesWrapper.BonusesWrapperMobile{padding:20px 15px;max-width:unset}.MenuReturnButton{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));display:inline-flex;align-items:center;column-gap:10px;margin-bottom:10px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusesTitle{font-size:var(--emw--font-size-x-large, 26px);color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:var(--emw--font-weigh-normal, 400)}.BonusesTitleMobile{font-size:var(--emw--size-standard, 16px)}.BonusesTitleNone{display:none}.BonusCalendarWrapper{display:flex;gap:15px;padding-bottom:30px;align-items:center}.BonusCalendarWrapper.BonusCalendarWrapperMobile{flex-direction:column;gap:10px;padding-bottom:15px}.BonusesCalendarContainer{display:flex;gap:20px}.BonusesCalendarContainer.BonusesCalendarContainerMobile{flex-direction:row;gap:0;justify-content:space-between;padding-bottom:0;width:100%}.BonusesCalendarStartDate,.BonusesCalendarEndDate{color:var(--emw--color-gray-300, #58586B);display:flex;position:relative;align-items:center;gap:10px}.BonusesCalendarStartDate.BonusesCalendarMobile,.BonusesCalendarEndDate.BonusesCalendarMobile{flex-direction:column;align-items:flex-start;gap:5px;width:48%}.BonusesCalendarStartDate.BonusesCalendarMobile .VaadinDatePicker,.BonusesCalendarEndDate.BonusesCalendarMobile .VaadinDatePicker{width:100%;border-radius:var(--emw--border-radius-large, 10px)}.BonusesCalendarStartDate label,.BonusesCalendarEndDate label{font-size:var(--emw--font-size-small, 14px);font-weight:300}.BonusesCalendarStartDate input,.BonusesCalendarEndDate input{width:100%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);border-radius:var(--emw--border-radius-small, 5px);box-sizing:border-box;padding:5px 15px;font-size:var(--emw--size-standard, 16px);line-height:18px;outline-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusesCalendarFilter{background-image:linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));border:2px solid var(--emw--button-border-color, #0E5924);color:var(--emw--button-text-color, #FFFFFF);border-radius:var(--emw--button-border-radius, 10px);cursor:pointer;width:120px;height:40px;font-size:var(--emw--font-size-medium, 15px);text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px;outline:none}.BonusesCalendarFilter.BonusesCalendarFilterMobile{width:100%;height:44px}.BonusesCalendarFilter:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusesCalendarFilter:disabled{background-image:none;background-color:var(--emw--button-disabled-text-color, #cccccc);color:var(--emw--button-disabled-text-color, #666);cursor:not-allowed;opacity:0.7;pointer-events:none;border:2px solid var(--emw--button-disabled-border-color, #aaaaaa)}.BonusesGrid{display:grid;grid-template-columns:1fr 1fr;gap:50px;border-radius:var(--emw--border-radius-large, 10px)}.BonusesGrid.BonusesGridMobile{grid-template-columns:1fr;gap:20px}.BonusesPaginationWrapper{margin:40px 0;display:block;line-break:anywhere;line-height:2em}.BonusesPaginationWrapper.BonusesPaginationWrapperMobile{text-align:center}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-size:var(--emw--size-standard, 16px);cursor:pointer;padding:5px 10px;font-weight:var(--emw--font-weight-bold, 700)}.BonusesPaginationWrapper .BonusesFirst.Inactive,.BonusesPaginationWrapper .BonusesPrev.Inactive,.BonusesPaginationWrapper .BonusesNext.Inactive,.BonusesPaginationWrapper .BonusesLast.Inactive{color:var(--emw--color-gray-100, #E6E6E6);cursor:default}.BonusesPaginationWrapper .BonusesPage{margin:0 5px;color:var(--emw--color-typography-cotrast, #444444);font-size:var(--emw--size-standard, 16px);cursor:pointer;padding:5px 10px;white-space:nowrap}.BonusesPaginationWrapper .BonusesPage.BonusPageActive{background-color:var(--emw--color-white, #FFFFFF);font-weight:var(--emw--font-weight-bold, 700)}.ModalLoader{width:300px;height:300px;margin:0 auto;display:flex;align-items:center;justify-content:center}.ModalLoader:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:5px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E)) transparent;animation:Loader 1.2s linear infinite}@keyframes Loader{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}');
}
function He(t, e, n) {
  const l = t.slice();
  return l[57] = e[n], l[59] = n, l;
}
function Ee(t, e, n) {
  const l = t.slice();
  return l[60] = e[n], l;
}
function wt(t) {
  let e, n, l, s, u, o, p, r, d, B, c = (
    /*$_*/
    t[26]("titleBonusesHistory") + ""
  ), y, F, H;
  return {
    c() {
      e = w("div"), n = ae("svg"), l = ae("defs"), s = ae("style"), u = j(`.aaa {
                fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));
              }
            `), o = ae("g"), p = ae("g"), r = ae("path"), d = I(), B = w("h2"), y = j(c), b(r, "class", "aaa"), b(r, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), b(r, "transform", "translate(15 15) rotate(180)"), b(p, "transform", "translate(20 158)"), b(o, "transform", "translate(-20 -158)"), b(n, "xmlns", "http://www.w3.org/2000/svg"), b(n, "width", "15"), b(n, "height", "15"), b(n, "viewBox", "0 0 15 15"), b(B, "class", "BonusesTitleMobile"), b(e, "class", "MenuReturnButton");
    },
    m(h, k) {
      N(h, e, k), m(e, n), m(n, l), m(l, s), m(s, u), m(n, o), m(o, p), m(p, r), m(e, d), m(e, B), m(B, y), F || (H = ee(
        e,
        "click",
        /*click_handler*/
        t[35]
      ), F = !0);
    },
    p(h, k) {
      k[0] & /*$_*/
      67108864 && c !== (c = /*$_*/
      h[26]("titleBonusesHistory") + "") && se(y, c);
    },
    d(h) {
      h && z(e), F = !1, H();
    }
  };
}
function kt(t) {
  let e, n, l;
  function s(r, d) {
    return (
      /*bonusesList*/
      r[22].length === 0 ? Mt : Ct
    );
  }
  let u = s(t), o = u(t), p = (
    /*bonusesList*/
    t[22].length !== 0 && We(t)
  );
  return {
    c() {
      e = w("div"), o.c(), n = I(), p && p.c(), l = pe(), b(e, "class", "BonusesGrid " + /*isMobile*/
      (t[27] ? "BonusesGridMobile" : ""));
    },
    m(r, d) {
      N(r, e, d), o.m(e, null), N(r, n, d), p && p.m(r, d), N(r, l, d);
    },
    p(r, d) {
      u === (u = s(r)) && o ? o.p(r, d) : (o.d(1), o = u(r), o && (o.c(), o.m(e, null))), /*bonusesList*/
      r[22].length !== 0 ? p ? p.p(r, d) : (p = We(r), p.c(), p.m(l.parentNode, l)) : p && (p.d(1), p = null);
    },
    d(r) {
      r && (z(e), z(n), z(l)), o.d(), p && p.d(r);
    }
  };
}
function Ft(t) {
  let e;
  return {
    c() {
      e = w("div"), b(e, "class", "ModalLoader");
    },
    m(n, l) {
      N(n, e, l);
    },
    p: me,
    d(n) {
      n && z(e);
    }
  };
}
function Ct(t) {
  let e, n = ie(
    /*bonusesList*/
    t[22]
  ), l = [];
  for (let s = 0; s < n.length; s += 1)
    l[s] = Te(Ee(t, n, s));
  return {
    c() {
      for (let s = 0; s < l.length; s += 1)
        l[s].c();
      e = pe();
    },
    m(s, u) {
      for (let o = 0; o < l.length; o += 1)
        l[o] && l[o].m(s, u);
      N(s, e, u);
    },
    p(s, u) {
      if (u[0] & /*termsandconditionsdescription, termsandconditionsurl, termsandconditionsasset, bonusesList, lang, clientstyling, clientstylingurl, mbsource, translationurl, currencylocale, dateformat*/
      62914975) {
        n = ie(
          /*bonusesList*/
          s[22]
        );
        let o;
        for (o = 0; o < n.length; o += 1) {
          const p = Ee(s, n, o);
          l[o] ? l[o].p(p, u) : (l[o] = Te(p), l[o].c(), l[o].m(e.parentNode, e));
        }
        for (; o < l.length; o += 1)
          l[o].d(1);
        l.length = n.length;
      }
    },
    d(s) {
      s && z(e), Se(l, s);
    }
  };
}
function Mt(t) {
  let e, n = (
    /*$_*/
    t[26]("noBonusHistory") + ""
  ), l;
  return {
    c() {
      e = w("p"), l = j(n);
    },
    m(s, u) {
      N(s, e, u), m(e, l);
    },
    p(s, u) {
      u[0] & /*$_*/
      67108864 && n !== (n = /*$_*/
      s[26]("noBonusHistory") + "") && se(l, n);
    },
    d(s) {
      s && z(e);
    }
  };
}
function Dt(t) {
  let e, n, l, s, u, o, p, r, d, B;
  return {
    c() {
      e = w("player-bonus-card"), a(
        e,
        "termsandconditionsdescription",
        /*termsandconditionsdescription*/
        t[25]
      ), a(
        e,
        "termsandconditionsurl",
        /*termsandconditionsurl*/
        t[23]
      ), a(
        e,
        "termsandconditionsasset",
        /*termsandconditionsasset*/
        t[24]
      ), a(e, "bonuswalletid", n = /*bonus*/
      t[60].walletId), a(e, "bonusdate", l = /*bonus*/
      t[60].granted), a(e, "bonusstatus", s = /*bonus*/
      t[60].status), a(e, "bonusname", u = /*bonus*/
      t[60].name), a(e, "bonustype", o = /*bonus*/
      t[60].type), a(e, "bonusamount", p = /*bonus*/
      t[60].extension.grantedPlayerCurrencyAmount), a(e, "bonuswageringamount", r = `${/*bonus*/
      t[60].fulfilledWR} / ${/*bonus*/
      t[60].originalWageringRequirement}`), a(e, "bonusremainingamount", d = /*bonus*/
      t[60].currentAmount), a(e, "bonuscurrency", B = /*bonus*/
      t[60].currency), a(
        e,
        "lang",
        /*lang*/
        t[0]
      ), a(
        e,
        "clientstyling",
        /*clientstyling*/
        t[1]
      ), a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[2]
      ), a(
        e,
        "mbsource",
        /*mbsource*/
        t[3]
      ), a(
        e,
        "translationurl",
        /*translationurl*/
        t[4]
      ), a(
        e,
        "currencylocale",
        /*currencylocale*/
        t[7]
      ), a(
        e,
        "dateformat",
        /*dateformat*/
        t[8]
      );
    },
    m(c, y) {
      N(c, e, y);
    },
    p(c, y) {
      y[0] & /*termsandconditionsdescription*/
      33554432 && a(
        e,
        "termsandconditionsdescription",
        /*termsandconditionsdescription*/
        c[25]
      ), y[0] & /*termsandconditionsurl*/
      8388608 && a(
        e,
        "termsandconditionsurl",
        /*termsandconditionsurl*/
        c[23]
      ), y[0] & /*termsandconditionsasset*/
      16777216 && a(
        e,
        "termsandconditionsasset",
        /*termsandconditionsasset*/
        c[24]
      ), y[0] & /*bonusesList*/
      4194304 && n !== (n = /*bonus*/
      c[60].walletId) && a(e, "bonuswalletid", n), y[0] & /*bonusesList*/
      4194304 && l !== (l = /*bonus*/
      c[60].granted) && a(e, "bonusdate", l), y[0] & /*bonusesList*/
      4194304 && s !== (s = /*bonus*/
      c[60].status) && a(e, "bonusstatus", s), y[0] & /*bonusesList*/
      4194304 && u !== (u = /*bonus*/
      c[60].name) && a(e, "bonusname", u), y[0] & /*bonusesList*/
      4194304 && o !== (o = /*bonus*/
      c[60].type) && a(e, "bonustype", o), y[0] & /*bonusesList*/
      4194304 && p !== (p = /*bonus*/
      c[60].extension.grantedPlayerCurrencyAmount) && a(e, "bonusamount", p), y[0] & /*bonusesList*/
      4194304 && r !== (r = `${/*bonus*/
      c[60].fulfilledWR} / ${/*bonus*/
      c[60].originalWageringRequirement}`) && a(e, "bonuswageringamount", r), y[0] & /*bonusesList*/
      4194304 && d !== (d = /*bonus*/
      c[60].currentAmount) && a(e, "bonusremainingamount", d), y[0] & /*bonusesList*/
      4194304 && B !== (B = /*bonus*/
      c[60].currency) && a(e, "bonuscurrency", B), y[0] & /*lang*/
      1 && a(
        e,
        "lang",
        /*lang*/
        c[0]
      ), y[0] & /*clientstyling*/
      2 && a(
        e,
        "clientstyling",
        /*clientstyling*/
        c[1]
      ), y[0] & /*clientstylingurl*/
      4 && a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        c[2]
      ), y[0] & /*mbsource*/
      8 && a(
        e,
        "mbsource",
        /*mbsource*/
        c[3]
      ), y[0] & /*translationurl*/
      16 && a(
        e,
        "translationurl",
        /*translationurl*/
        c[4]
      ), y[0] & /*currencylocale*/
      128 && a(
        e,
        "currencylocale",
        /*currencylocale*/
        c[7]
      ), y[0] & /*dateformat*/
      256 && a(
        e,
        "dateformat",
        /*dateformat*/
        c[8]
      );
    },
    d(c) {
      c && z(e);
    }
  };
}
function Pt(t) {
  let e, n, l, s, u, o, p;
  return {
    c() {
      e = w("player-bonus-card"), a(
        e,
        "termsandconditionsdescription",
        /*termsandconditionsdescription*/
        t[25]
      ), a(
        e,
        "termsandconditionsurl",
        /*termsandconditionsurl*/
        t[23]
      ), a(
        e,
        "termsandconditionsasset",
        /*termsandconditionsasset*/
        t[24]
      ), a(e, "bonuswalletid", n = /*bonus*/
      t[60].walletId), a(e, "bonusdate", l = /*bonus*/
      t[60].granted), a(e, "bonusstatus", s = /*bonus*/
      t[60].status), a(e, "bonusname", u = /*bonus*/
      t[60].name), a(e, "bonustype", o = /*bonus*/
      t[60].type), a(e, "bonuscurrency", p = /*bonus*/
      t[60].currency), a(
        e,
        "lang",
        /*lang*/
        t[0]
      ), a(
        e,
        "clientstyling",
        /*clientstyling*/
        t[1]
      ), a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        t[2]
      ), a(
        e,
        "mbsource",
        /*mbsource*/
        t[3]
      ), a(
        e,
        "translationurl",
        /*translationurl*/
        t[4]
      ), a(
        e,
        "currencylocale",
        /*currencylocale*/
        t[7]
      ), a(
        e,
        "dateformat",
        /*dateformat*/
        t[8]
      );
    },
    m(r, d) {
      N(r, e, d);
    },
    p(r, d) {
      d[0] & /*termsandconditionsdescription*/
      33554432 && a(
        e,
        "termsandconditionsdescription",
        /*termsandconditionsdescription*/
        r[25]
      ), d[0] & /*termsandconditionsurl*/
      8388608 && a(
        e,
        "termsandconditionsurl",
        /*termsandconditionsurl*/
        r[23]
      ), d[0] & /*termsandconditionsasset*/
      16777216 && a(
        e,
        "termsandconditionsasset",
        /*termsandconditionsasset*/
        r[24]
      ), d[0] & /*bonusesList*/
      4194304 && n !== (n = /*bonus*/
      r[60].walletId) && a(e, "bonuswalletid", n), d[0] & /*bonusesList*/
      4194304 && l !== (l = /*bonus*/
      r[60].granted) && a(e, "bonusdate", l), d[0] & /*bonusesList*/
      4194304 && s !== (s = /*bonus*/
      r[60].status) && a(e, "bonusstatus", s), d[0] & /*bonusesList*/
      4194304 && u !== (u = /*bonus*/
      r[60].name) && a(e, "bonusname", u), d[0] & /*bonusesList*/
      4194304 && o !== (o = /*bonus*/
      r[60].type) && a(e, "bonustype", o), d[0] & /*bonusesList*/
      4194304 && p !== (p = /*bonus*/
      r[60].currency) && a(e, "bonuscurrency", p), d[0] & /*lang*/
      1 && a(
        e,
        "lang",
        /*lang*/
        r[0]
      ), d[0] & /*clientstyling*/
      2 && a(
        e,
        "clientstyling",
        /*clientstyling*/
        r[1]
      ), d[0] & /*clientstylingurl*/
      4 && a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        r[2]
      ), d[0] & /*mbsource*/
      8 && a(
        e,
        "mbsource",
        /*mbsource*/
        r[3]
      ), d[0] & /*translationurl*/
      16 && a(
        e,
        "translationurl",
        /*translationurl*/
        r[4]
      ), d[0] & /*currencylocale*/
      128 && a(
        e,
        "currencylocale",
        /*currencylocale*/
        r[7]
      ), d[0] & /*dateformat*/
      256 && a(
        e,
        "dateformat",
        /*dateformat*/
        r[8]
      );
    },
    d(r) {
      r && z(e);
    }
  };
}
function Te(t) {
  let e;
  function n(u, o) {
    return (
      /*bonus*/
      u[60].type === "freeRound" ? Pt : Dt
    );
  }
  let l = n(t), s = l(t);
  return {
    c() {
      s.c(), e = pe();
    },
    m(u, o) {
      s.m(u, o), N(u, e, o);
    },
    p(u, o) {
      l === (l = n(u)) && s ? s.p(u, o) : (s.d(1), s = l(u), s && (s.c(), s.m(e.parentNode, e)));
    },
    d(u) {
      u && z(e), s.d(u);
    }
  };
}
function We(t) {
  let e, n, l, s, u, o, p, r, d, B, c, y, F, H, h, k, C, R, O, E = ie(Array(
    /*numberOfPages*/
    t[20]
  )), g = [];
  for (let f = 0; f < E.length; f += 1)
    g[f] = Ae(He(t, E, f));
  return {
    c() {
      e = w("div"), n = w("span"), l = j("|<"), u = I(), o = w("span"), p = j("<"), d = I();
      for (let f = 0; f < g.length; f += 1)
        g[f].c();
      B = I(), c = w("span"), y = j(">"), H = I(), h = w("span"), k = j(">|"), b(n, "class", s = "BonusesFirst " + /*currentPage*/
      (t[21] === 0 ? "Inactive" : "")), b(o, "class", r = "BonusesPrev " + /*currentPage*/
      (t[21] === 0 ? "Inactive" : "")), b(c, "class", F = "BonusesNext " + /*currentPage*/
      (t[21] === /*numberOfPages*/
      t[20] - 1 ? "Inactive" : "")), b(h, "class", C = "BonusesLast " + /*currentPage*/
      (t[21] === /*numberOfPages*/
      t[20] - 1 ? "Inactive" : "")), b(e, "class", "BonusesPaginationWrapper " + /*isMobile*/
      (t[27] ? "BonusesPaginationWrapperMobile" : ""));
    },
    m(f, T) {
      N(f, e, T), m(e, n), m(n, l), m(e, u), m(e, o), m(o, p), m(e, d);
      for (let _ = 0; _ < g.length; _ += 1)
        g[_] && g[_].m(e, null);
      m(e, B), m(e, c), m(c, y), m(e, H), m(e, h), m(h, k), R || (O = [
        ee(
          n,
          "click",
          /*click_handler_2*/
          t[39]
        ),
        ee(
          o,
          "click",
          /*click_handler_3*/
          t[40]
        ),
        ee(
          c,
          "click",
          /*click_handler_5*/
          t[42]
        ),
        ee(
          h,
          "click",
          /*click_handler_6*/
          t[43]
        )
      ], R = !0);
    },
    p(f, T) {
      if (T[0] & /*currentPage*/
      2097152 && s !== (s = "BonusesFirst " + /*currentPage*/
      (f[21] === 0 ? "Inactive" : "")) && b(n, "class", s), T[0] & /*currentPage*/
      2097152 && r !== (r = "BonusesPrev " + /*currentPage*/
      (f[21] === 0 ? "Inactive" : "")) && b(o, "class", r), T[0] & /*currentPage, getBonuses, bonushistorystatus, bonushistorytype, numberOfPages*/
      1076887648) {
        E = ie(Array(
          /*numberOfPages*/
          f[20]
        ));
        let _;
        for (_ = 0; _ < E.length; _ += 1) {
          const W = He(f, E, _);
          g[_] ? g[_].p(W, T) : (g[_] = Ae(W), g[_].c(), g[_].m(e, B));
        }
        for (; _ < g.length; _ += 1)
          g[_].d(1);
        g.length = E.length;
      }
      T[0] & /*currentPage, numberOfPages*/
      3145728 && F !== (F = "BonusesNext " + /*currentPage*/
      (f[21] === /*numberOfPages*/
      f[20] - 1 ? "Inactive" : "")) && b(c, "class", F), T[0] & /*currentPage, numberOfPages*/
      3145728 && C !== (C = "BonusesLast " + /*currentPage*/
      (f[21] === /*numberOfPages*/
      f[20] - 1 ? "Inactive" : "")) && b(h, "class", C);
    },
    d(f) {
      f && z(e), Se(g, f), R = !1, ct(O);
    }
  };
}
function Ae(t) {
  let e, n = (
    /*i*/
    t[59] + 1 + ""
  ), l, s, u, o;
  function p() {
    return (
      /*click_handler_4*/
      t[41](
        /*i*/
        t[59]
      )
    );
  }
  return {
    c() {
      e = w("span"), l = j(n), b(e, "class", s = "BonusesPage " + /*i*/
      (t[59] === /*currentPage*/
      t[21] ? "BonusPageActive" : ""));
    },
    m(r, d) {
      N(r, e, d), m(e, l), u || (o = ee(e, "click", p), u = !0);
    },
    p(r, d) {
      t = r, d[0] & /*currentPage*/
      2097152 && s !== (s = "BonusesPage " + /*i*/
      (t[59] === /*currentPage*/
      t[21] ? "BonusPageActive" : "")) && b(e, "class", s);
    },
    d(r) {
      r && z(e), u = !1, o();
    }
  };
}
function Ht(t) {
  let e, n, l, s, u = (
    /*$_*/
    t[26]("titleBonusesHistory") + ""
  ), o, p, r, d, B, c, y = (
    /*$_*/
    t[26]("dateFrom") + ""
  ), F, H, h, k, C, R, O = (
    /*$_*/
    t[26]("dateTo") + ""
  ), E, g, f, T, _, W = (
    /*$_*/
    t[26]("dateFilter") + ""
  ), V, Y, te, Q, ne, q = (
    /*isMobile*/
    t[27] && wt(t)
  );
  function re(v, D) {
    return (
      /*isLoading*/
      v[14] ? Ft : kt
    );
  }
  let Z = re(t), A = Z(t);
  return {
    c() {
      e = w("div"), n = w("div"), q && q.c(), l = I(), s = w("h2"), o = j(u), p = I(), r = w("div"), d = w("div"), B = w("div"), c = w("label"), F = j(y), H = I(), h = w("vaadin-date-picker"), k = I(), C = w("div"), R = w("label"), E = j(O), g = I(), f = w("vaadin-date-picker"), T = I(), _ = w("button"), V = j(W), te = I(), A.c(), b(s, "class", "BonusesTitle " + /*isMobile*/
      (t[27] ? "BonusesTitleNone" : "")), b(s, "part", "BonusesTitle " + /*isMobile*/
      (t[27] ? "BonusesTitleNone" : "")), b(c, "for", "BonusCalendarStartDate"), a(
        h,
        "max",
        /*bonusCalendarDateMax*/
        t[28]
      ), a(
        h,
        "value",
        /*bonusCalendarStartDate*/
        t[12]
      ), a(
        h,
        "placeholder",
        /*bonusCalendarStartDate*/
        t[12]
      ), a(h, "class", "VaadinDatePicker"), b(B, "class", "BonusesCalendarStartDate " + /*isMobile*/
      (t[27] ? "BonusesCalendarMobile" : "")), b(R, "for", "BonusesCalendarEndDate"), a(
        f,
        "max",
        /*bonusCalendarDateMax*/
        t[28]
      ), a(
        f,
        "min",
        /*bonusCalendarEndDateMin*/
        t[15]
      ), a(
        f,
        "value",
        /*bonusCalendarEndDate*/
        t[13]
      ), a(
        f,
        "placeholder",
        /*bonusCalendarEndDate*/
        t[13]
      ), a(f, "class", "VaadinDatePicker"), b(C, "class", "BonusesCalendarEndDate " + /*isMobile*/
      (t[27] ? "BonusesCalendarMobile" : "")), b(d, "class", "BonusesCalendarContainer " + /*isMobile*/
      (t[27] ? "BonusesCalendarContainerMobile" : "")), b(_, "class", "BonusesCalendarFilter " + /*isMobile*/
      (t[27] ? "BonusesCalendarFilterMobile" : "")), _.disabled = Y = !/*submitEnable*/
      t[16] || /*isLoading*/
      t[14], b(r, "class", "BonusCalendarWrapper " + /*isMobile*/
      (t[27] ? "BonusCalendarWrapperMobile" : "")), b(n, "class", "BonusesWrapper " + /*isMobile*/
      (t[27] ? "BonusesWrapperMobile" : ""));
    },
    m(v, D) {
      N(v, e, D), m(e, n), q && q.m(n, null), m(n, l), m(n, s), m(s, o), m(n, p), m(n, r), m(r, d), m(d, B), m(B, c), m(c, F), m(B, H), m(B, h), t[36](h), m(d, k), m(d, C), m(C, R), m(R, E), m(C, g), m(C, f), t[37](f), m(r, T), m(r, _), m(_, V), m(n, te), A.m(n, null), t[44](e), Q || (ne = ee(
        _,
        "click",
        /*click_handler_1*/
        t[38]
      ), Q = !0);
    },
    p(v, D) {
      /*isMobile*/
      v[27] && q.p(v, D), D[0] & /*$_*/
      67108864 && u !== (u = /*$_*/
      v[26]("titleBonusesHistory") + "") && se(o, u), D[0] & /*$_*/
      67108864 && y !== (y = /*$_*/
      v[26]("dateFrom") + "") && se(F, y), D[0] & /*bonusCalendarStartDate*/
      4096 && a(
        h,
        "value",
        /*bonusCalendarStartDate*/
        v[12]
      ), D[0] & /*bonusCalendarStartDate*/
      4096 && a(
        h,
        "placeholder",
        /*bonusCalendarStartDate*/
        v[12]
      ), D[0] & /*$_*/
      67108864 && O !== (O = /*$_*/
      v[26]("dateTo") + "") && se(E, O), D[0] & /*bonusCalendarEndDateMin*/
      32768 && a(
        f,
        "min",
        /*bonusCalendarEndDateMin*/
        v[15]
      ), D[0] & /*bonusCalendarEndDate*/
      8192 && a(
        f,
        "value",
        /*bonusCalendarEndDate*/
        v[13]
      ), D[0] & /*bonusCalendarEndDate*/
      8192 && a(
        f,
        "placeholder",
        /*bonusCalendarEndDate*/
        v[13]
      ), D[0] & /*$_*/
      67108864 && W !== (W = /*$_*/
      v[26]("dateFilter") + "") && se(V, W), D[0] & /*submitEnable, isLoading*/
      81920 && Y !== (Y = !/*submitEnable*/
      v[16] || /*isLoading*/
      v[14]) && (_.disabled = Y), Z === (Z = re(v)) && A ? A.p(v, D) : (A.d(1), A = Z(v), A && (A.c(), A.m(n, null)));
    },
    i: me,
    o: me,
    d(v) {
      v && z(e), q && q.d(), t[36](null), t[37](null), A.d(), t[44](null), Q = !1, ne();
    }
  };
}
let U = 6;
function Et(t, e, n) {
  let l;
  it(t, bt, (i) => n(26, l = i));
  let { endpoint: s = "" } = e, { session: u = "" } = e, { playerid: o = "" } = e, { lang: p = "en" } = e, { clientstyling: r = "" } = e, { clientstylingurl: d = "" } = e, { mbsource: B } = e, { translationurl: c = "" } = e, { bonushistorystatus: y = "" } = e, { bonushistorytype: F = "" } = e, { currencylocale: H = "" } = e, { currency: h = "" } = e, { dateformat: k = "dd-MM-yyyy" } = e, C, R = !1, O = window.navigator.userAgent, E = ut(O) !== "PC", g, f;
  const T = K(/* @__PURE__ */ new Date(), "yyyy-MM-dd");
  let _ = "", W = K(gt(/* @__PURE__ */ new Date(), 3), `${k || "yyyy-MM-dd"}`), V = K(/* @__PURE__ */ new Date(), `${k || "yyyy-MM-dd"}`), Y = !0, te = 0, Q = 0, ne = 0, q = 0, re = 0, Z = [], A = "", v = "", D = "";
  const Le = () => {
    fetch(c).then((M) => M.json()).then((M) => {
      Object.keys(M).forEach((G) => {
        De(G, M[G]);
      });
    }).catch((M) => {
      console.log(M);
    });
  };
  Object.keys(Pe).forEach((i) => {
    De(i, Pe[i]);
  });
  const fe = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: E
      },
      window.location.href
    );
  }, ye = (i, M) => {
    const G = Me(i, `${k || "yyyy-MM-dd"}`, /* @__PURE__ */ new Date()), x = M ? _t(G) : ht(G);
    return K(x, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
  }, X = (i, M, G) => {
    n(14, R = !0);
    let x = new URL(`${s}/v1/player/${o}/bonusWallet`), le = ye(W, !1), Je = ye(V, !0), $ = "", Be = "", ve = "";
    M && (Be = M.split(",").map((J) => `status=${J}`).join(","), $ = $ + Be + ","), G && (ve = G.split(",").map((J) => `type=${J}`).join(","), $ = $ + ve + ","), $ = $ + `granted=[${le}~${Je}]`, x.searchParams.append("filter", $), x.searchParams.append("pagination", `offset=${i},limit=${U}`);
    let Ke = {
      method: "GET",
      headers: { "X-SessionId": u }
    };
    fetch(x.href, Ke).then((S) => S.json()).then(
      (S) => {
        Array.isArray(S.items) && S.items.forEach((P) => {
          var we, ke;
          const J = (ke = (we = P == null ? void 0 : P.extension) == null ? void 0 : we.bonus) == null ? void 0 : ke.presentation;
          J && (n(23, A || (A = J.url)), n(25, D || (D = J.description)), n(24, v || (v = J.assets)));
        }), n(20, q = Math.ceil(S.total / U)), i - U >= 0 && n(17, te = i - U), i + U < S.total && n(18, Q = i + U), n(19, ne = (q - 1) * U), n(21, re = i / U), n(22, Z = (S == null ? void 0 : S.items) || []), H && Z.forEach((P) => {
          P.fulfilledWR = oe(P.fulfilledWR), P.originalWageringRequirement = oe(P.originalWageringRequirement), P.currentAmount = oe(P.currentAmount), P.extension.grantedPlayerCurrencyAmount = oe(P.extension.grantedPlayerCurrencyAmount);
        });
      },
      (S) => {
        console.error(S);
      }
    ).finally(() => {
      n(14, R = !1);
    }), window.postMessage({ type: "ScrollToTop" }, window.location.href);
  }, oe = (i) => new Intl.NumberFormat(H, { style: "currency", currency: h }).format(i).replace(/\s/g, ""), be = (i) => {
    n(12, W = K(new Date(i.target.value), `${k || "yyyy-MM-dd"}`)), n(15, _ = K(new Date(i.target.value), "yyyy-MM-dd"));
  }, ge = (i) => {
    n(13, V = K(new Date(i.target.value), `${k || "yyyy-MM-dd"}`));
  }, Ie = () => {
    const i = new Date(W), M = new Date(V);
    i.getTime() > M.getTime() ? n(16, Y = !1) : n(16, Y = !0);
  }, ze = () => {
    g.addEventListener("change", be, !1), f.addEventListener("change", ge, !1);
  }, _e = (i) => {
    const { year: M, month: G, day: x } = i, le = new Date(M, G, x);
    return K(le, k || "yyyy-MM-dd");
  }, he = (i) => {
    const M = Me(i, k || "yyyy-MM-dd", /* @__PURE__ */ new Date());
    return {
      year: M.getFullYear(),
      month: M.getMonth(),
      day: M.getDate()
    };
  };
  dt(() => (n(
    10,
    g.i18n = de(ue({}, g.i18n), {
      formatDate: _e,
      parseDate: he
    }),
    g
  ), n(
    11,
    f.i18n = de(ue({}, f.i18n), {
      formatDate: _e,
      parseDate: he
    }),
    f
  ), () => {
    g.removeEventListener("change", be), f.removeEventListener("change", ge);
  }));
  const Ne = () => {
    Bt(p);
  }, Re = () => fe();
  function je(i) {
    ce[i ? "unshift" : "push"](() => {
      g = i, n(10, g);
    });
  }
  function qe(i) {
    ce[i ? "unshift" : "push"](() => {
      f = i, n(11, f);
    });
  }
  const Ge = () => X(0, y, F), Oe = () => X(0, y, F), Ve = () => X(te, y, F), Ue = (i) => X(i * U, y, F), Ye = () => X(Q, y, F), Ze = () => X(ne, y, F);
  function Xe(i) {
    ce[i ? "unshift" : "push"](() => {
      C = i, n(9, C);
    });
  }
  return t.$$set = (i) => {
    "endpoint" in i && n(31, s = i.endpoint), "session" in i && n(32, u = i.session), "playerid" in i && n(33, o = i.playerid), "lang" in i && n(0, p = i.lang), "clientstyling" in i && n(1, r = i.clientstyling), "clientstylingurl" in i && n(2, d = i.clientstylingurl), "mbsource" in i && n(3, B = i.mbsource), "translationurl" in i && n(4, c = i.translationurl), "bonushistorystatus" in i && n(5, y = i.bonushistorystatus), "bonushistorytype" in i && n(6, F = i.bonushistorytype), "currencylocale" in i && n(7, H = i.currencylocale), "currency" in i && n(34, h = i.currency), "dateformat" in i && n(8, k = i.dateformat);
  }, t.$$.update = () => {
    t.$$.dirty[0] & /*lang*/
    1 && p && Ne(), t.$$.dirty[0] & /*startCalendar, endCalendar*/
    3072 && g && f && ze(), t.$$.dirty[0] & /*bonusCalendarStartDate, bonusCalendarEndDate*/
    12288 && W && V && Ie(), t.$$.dirty[0] & /*bonushistorystatus, bonushistorytype*/
    96 | t.$$.dirty[1] & /*session, playerid, endpoint*/
    7 && u && o && s && X(0, y, F), t.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    514 && r && C && mt(C, r), t.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    516 && d && C && pt(C, d), t.$$.dirty[0] & /*mbsource, customStylingContainer*/
    520 && B && C && ft(C, `${B}.Style`), t.$$.dirty[0] & /*translationurl*/
    16 && c && Le();
  }, [
    p,
    r,
    d,
    B,
    c,
    y,
    F,
    H,
    k,
    C,
    g,
    f,
    W,
    V,
    R,
    _,
    Y,
    te,
    Q,
    ne,
    q,
    re,
    Z,
    A,
    v,
    D,
    l,
    E,
    T,
    fe,
    X,
    s,
    u,
    o,
    h,
    Re,
    je,
    qe,
    Ge,
    Oe,
    Ve,
    Ue,
    Ye,
    Ze,
    Xe
  ];
}
class Tt extends st {
  constructor(e) {
    super(), rt(
      this,
      e,
      Et,
      Ht,
      ot,
      {
        endpoint: 31,
        session: 32,
        playerid: 33,
        lang: 0,
        clientstyling: 1,
        clientstylingurl: 2,
        mbsource: 3,
        translationurl: 4,
        bonushistorystatus: 5,
        bonushistorytype: 6,
        currencylocale: 7,
        currency: 34,
        dateformat: 8
      },
      vt,
      [-1, -1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[31];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), L();
  }
  get session() {
    return this.$$.ctx[32];
  }
  set session(e) {
    this.$$set({ session: e }), L();
  }
  get playerid() {
    return this.$$.ctx[33];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), L();
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), L();
  }
  get clientstyling() {
    return this.$$.ctx[1];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), L();
  }
  get clientstylingurl() {
    return this.$$.ctx[2];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), L();
  }
  get mbsource() {
    return this.$$.ctx[3];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), L();
  }
  get translationurl() {
    return this.$$.ctx[4];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), L();
  }
  get bonushistorystatus() {
    return this.$$.ctx[5];
  }
  set bonushistorystatus(e) {
    this.$$set({ bonushistorystatus: e }), L();
  }
  get bonushistorytype() {
    return this.$$.ctx[6];
  }
  set bonushistorytype(e) {
    this.$$set({ bonushistorytype: e }), L();
  }
  get currencylocale() {
    return this.$$.ctx[7];
  }
  set currencylocale(e) {
    this.$$set({ currencylocale: e }), L();
  }
  get currency() {
    return this.$$.ctx[34];
  }
  set currency(e) {
    this.$$set({ currency: e }), L();
  }
  get dateformat() {
    return this.$$.ctx[8];
  }
  set dateformat(e) {
    this.$$set({ dateformat: e }), L();
  }
}
yt(Tt, { endpoint: {}, session: {}, playerid: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, bonushistorystatus: {}, bonushistorytype: {}, currencylocale: {}, currency: {}, dateformat: {} }, [], [], !0);
export {
  Tt as default
};
