var en = Object.defineProperty, nn = Object.defineProperties;
var on = Object.getOwnPropertyDescriptors;
var we = Object.getOwnPropertySymbols;
var sn = Object.prototype.hasOwnProperty, tn = Object.prototype.propertyIsEnumerable;
var Me = (n, e, o) => e in n ? en(n, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[e] = o, re = (n, e) => {
  for (var o in e || (e = {}))
    sn.call(e, o) && Me(n, o, e[o]);
  if (we)
    for (var o of we(e))
      tn.call(e, o) && Me(n, o, e[o]);
  return n;
}, Ae = (n, e) => nn(n, on(e));
var K = (n, e, o) => new Promise((t, s) => {
  var i = (l) => {
    try {
      u(o.next(l));
    } catch (f) {
      s(f);
    }
  }, r = (l) => {
    try {
      u(o.throw(l));
    } catch (f) {
      s(f);
    }
  }, u = (l) => l.done ? t(l.value) : Promise.resolve(l.value).then(i, r);
  u((o = o.apply(n, e)).next());
});
import { c as an, b as rn, S as ln, D as un, R as dn, v as O, f as cn, K as fe, r as z, Q as me, Z, _ as ke, F as N, e as m, J as U, s as k, a1 as R, a4 as L, g as y, k as pn, y as fn, N as mn, a3 as $, h as bn, t as be, u as le, q as Ne, Y as a, V as gn, W as Bn, X as vn, n as _n, a as yn } from "./PlayerAccountControllerNd-D1zDXBBo.js";
import "../lazy/player-bonus-card-CJkiZl6_.js";
function We(n, e) {
  an(n, e);
}
function hn(n) {
  rn.set(n);
}
const Ee = {
  en: {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  },
  "zh-hk": {
    titleBonuses: "活躍獎金",
    bonusCode: "你有獎金代碼嗎？",
    getBonus: "獲得獎金",
    invalidBonusCode: "提供的紅利代碼無效。",
    noActiveBonuses: "您目前沒有有效的獎金。",
    forfeitBonus: "您確定要放棄獎金及其獎金嗎？",
    forfeitBonusConfirm: "確認",
    forfeitBonusCancel: "取消",
    bonusClaimSuccessMessage: "獎金要求！",
    bonusClaimErrorMessage: "無效獎金"
  },
  fr: {
    titleBonuses: "Bonus actifs",
    bonusCode: "Avez-vous un code bonus?",
    getBonus: "Obtenir un bonus",
    invalidBonusCode: "Le code bonus fourni n'est pas valide.",
    noActiveBonuses: "Vous n'avez pas de bonus actifs pour le moment.",
    forfeitBonus: "Etes-vous sûr de vouloir supprimer le bonus et ses gains?",
    forfeitBonusConfirm: "Confirmer",
    forfeitBonusCancel: "Annuler",
    bonusClaimSuccessMessage: "Bonus réclamé!",
    bonusClaimErrorMessage: "Bonus invalide"
  },
  ro: {
    titleBonuses: "Bonusuri active",
    bonusCode: "Ai un cod de bonus?",
    getBonus: "Revendică",
    invalidBonusCode: "Codul de bonus introdus este invalid.",
    noActiveBonuses: "Nu ai niciun bonus activ în acest moment.",
    forfeitBonus: "Ești sigur că vrei să anulezi acest bonus și câștigurile provenite din acest bonus?",
    forfeitBonusConfirm: "Confirmă",
    forfeitBonusCancel: "Anulează",
    bonusClaimSuccessMessage: "Bonus revendicat!",
    bonusClaimErrorMessage: "Bonus invalid"
  },
  es: {
    titleBonuses: "Bonos Activos",
    bonusCode: "Tienes un código de Bono?",
    getBonus: "Obtener Bono",
    invalidBonusCode: "El código del Bono no es válido.",
    noActiveBonuses: "Usted no tiene Bonos activos en este momento.",
    forfeitBonus: "Estas seguro que quieres perder el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono adjudicado!",
    bonusClaimErrorMessage: "Bono invalido"
  },
  pt: {
    titleBonuses: "Bônus Ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Obter bônus",
    invalidBonusCode: "O código de bônus fornecido é inválido.",
    noActiveBonuses: "Você não tem bônus ativos no momento.",
    forfeitBonus: "Tem certeza de que deseja perder o bônus e seus ganhos?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus reivindicado!",
    bonusClaimErrorMessage: "Bônus inválido"
  },
  hr: {
    titleBonuses: "Aktivni bonusi",
    bonusCode: "Imate li bonus kod?",
    getBonus: "Preuzmi bonus",
    invalidBonusCode: "Navedeni bonus kod je nevažeći.",
    noActiveBonuses: "Trenutno nemate aktivnih bonusa.",
    forfeitBonus: "Jeste li sigurni da želite otkazati bonus?",
    forfeitBonusConfirm: "Potvrdi",
    forfeitBonusCancel: "Otkaži",
    bonusClaimSuccessMessage: "Preuzet bonus!",
    bonusClaimErrorMessage: "Nevažeći bonus"
  },
  "pt-br": {
    titleBonuses: "Títulos ativos",
    bonusCode: "Você tem um código de bônus?",
    getBonus: "Reivindicar bônus",
    invalidBonusCode: "O código de bônus emitido é inválido",
    noActiveBonuses: "Não possui títulos ativos no momento",
    forfeitBonus: "Tem certeza de que deseja recusar o bônus?",
    forfeitBonusConfirm: "confirme",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bônus ativado",
    bonusClaimErrorMessage: "Voucher inválido"
  },
  "es-mx": {
    titleBonuses: "Bonos activos",
    bonusCode: "¿Tiene código de bonos?",
    getBonus: "Reclamar bono",
    invalidBonusCode: "El código de bono emitido es inválido",
    noActiveBonuses: "No tiene bonos activos al momento",
    forfeitBonus: "¿ Está seguro que quiere declinar el bono?",
    forfeitBonusConfirm: "Confirmar",
    forfeitBonusCancel: "Cancelar",
    bonusClaimSuccessMessage: "Bono activado",
    bonusClaimErrorMessage: "Bono inválido"
  },
  tr: {
    titleBonuses: "Aktif Bonuslar",
    bonusCode: "Bonus kodunuz var mı?",
    getBonus: "Bonusu Al",
    invalidBonusCode: "Sağlanan bonus kodu geçersiz.",
    noActiveBonuses: "Şu anda aktif bonusunuz yok.",
    forfeitBonus: "Bonusu kaybetmek istediğinizden emin misiniz?",
    forfeitBonusConfirm: "Onaylamak",
    forfeitBonusCancel: "İptal etmek",
    bonusClaimSuccessMessage: "Bonus talep edildi!",
    bonusClaimErrorMessage: "Geçersiz bonus"
  },
  "en-us": {
    titleBonuses: "Active Bonuses",
    bonusCode: "Do you have a bonus code?",
    getBonus: "Get Bonus",
    invalidBonusCode: "The bonus code provided is invalid.",
    noActiveBonuses: "You have no active bonuses at the moment.",
    forfeitBonus: "Are you sure want to forfeit bonus?",
    forfeitBonusConfirm: "Confirm",
    forfeitBonusCancel: "Cancel",
    bonusClaimSuccessMessage: "Bonus claimed!",
    bonusClaimErrorMessage: "Invalid bonus"
  }
}, ge = {
  CLAIM: "/v1/bonus/claim",
  FORFEIT: "/v1/bonus/forfeit",
  GRANTED: "/v1/bonus/granted"
}, Pe = {
  TYPES: "standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering",
  STATUS_ACTIVE: "active",
  STATUS_COMPLETED: "completed,released,forfeited,expired,closed"
};
function Be(o) {
  return K(this, arguments, function* (n, e = {}) {
    const t = typeof n == "string" ? n : n.toString(), s = yield fetch(t, e);
    let i = null;
    try {
      i = yield s.json();
    } catch (l) {
      i = null;
    }
    if (s.ok && i)
      return i;
    const r = i && typeof i == "object" ? i : {}, u = {
      success: !1,
      errorMessage: typeof r.errorMessage == "string" && r.errorMessage || s.statusText || String(s.status),
      errorCode: typeof r.errorCode == "number" ? r.errorCode : void 0
    };
    return re(re({}, r), u);
  });
}
function Cn(n, e, o) {
  return K(this, null, function* () {
    const t = `${n}${ge.CLAIM}`;
    return Be(t, {
      method: "PUT",
      headers: {
        "x-SessionId": e,
        accept: "application/json",
        "Content-Type": "application/json-patch+json"
      },
      body: JSON.stringify(o)
    });
  });
}
function wn(n, e, o) {
  return K(this, null, function* () {
    const t = new URL(`${n}${ge.FORFEIT}`);
    return t.searchParams.append("bonusWalletID", o.bonusWalletID), Be(t, {
      method: "DELETE",
      headers: {
        "x-SessionId": e,
        accept: "application/json"
      }
    });
  });
}
function Mn(n, e, o) {
  return K(this, null, function* () {
    const t = new URL(`${n}${ge.GRANTED}`);
    Object.entries(o).forEach(([i, r]) => {
      r != null && t.searchParams.append(i, String(r));
    });
    const s = {};
    return e && (s["x-SessionId"] = e), Be(t, {
      headers: s
    });
  });
}
function An(n) {
  cn(n, "svelte-2jgm79", '.ActiveBonusesWrapper{color:var(--emw--pam-typography, var(--emw--color-contrast, #07072A));padding:50px;max-width:850px}.ActiveBonusesWrapper.ActiveBonusesWrapperMobile{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:30px}.MenuReturnButton svg{fill:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesTitle{font-size:26px;color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-weight:400}.ActiveBonusesTitleMobile{font-size:16px}.ActiveBonusesTitleNone{display:none}.BonusCodeContainer{color:var(--emw--color-gray-300, #58586B);display:flex;flex-direction:column;padding-bottom:30px;position:relative;width:70%}.BonusCodeContainer label{font-size:16px;font-weight:300;padding-bottom:5px}.BonusCodeContainer.BonusCodeContainerMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper{display:flex;gap:10px}.BonusCodeContainer .BonusCodeWrapper.BonusCodeWrapperMobile{flex-direction:column}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput{width:70%;height:44px;border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--pam-contrast, var(--emw--color-contrast, #07072A));border-radius:5px;box-sizing:border-box;padding:5px 15px;font-size:16px;line-height:18px}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput:focus{outline-color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .BonusCodeWrapper .BonusCodeInput.BonusCodeInputMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode[disabled]{opacity:0.3;cursor:not-allowed}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:hover{filter:brightness(0.9)}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode.SubmitBonusCodeMobile{width:100%}.BonusCodeContainer .BonusCodeWrapper .SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer.InvalidField input{border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));background:var(--emw--color-primary-50, var(--emw--color-pink-50, #F1BED9));color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.BonusCodeContainer .InvalidBonusCodeMessage{color:var(--emw--color-error, var(--emw--color-red, #FD2839))}.BonusCodeWrapper{display:flex;gap:20px}.SubmitBonusCode{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--color-white, #FFFFFF);cursor:pointer;border-radius:5px;width:30%;height:44px;font-size:15px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.SubmitBonusCode[disabled]{opacity:0.3}.SubmitBonusCode:hover{filter:brightness(0.9)}.SubmitBonusCode:active{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E))}.ActiveBonusesGrid{display:grid;grid-template-columns:1fr 1fr;gap:50px}.ActiveBonusesGrid.ActiveBonusesGridMobile{grid-template-columns:1fr}.ModalWrapper{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, 0.7);display:flex;justify-content:center;align-items:center;z-index:300}.ModalWrapper .ModalContent{background-color:var(--emw--color-white, #FFFFFF);position:relative;padding:30px;border-top:5px solid var(--emw--color-secondary, var(--emw--color-secondary, #FD2839));border-radius:5px}.ModalWrapper .ModalBody{background-color:var(--emw--color-gray-50, #F9F8F8);padding:30px;text-align:center}.ModalWrapper .ModalBody .ModalText{font-size:22px;margin-bottom:40px}.ModalWrapper .ModalBody .ModalButtons{display:flex;gap:36px}.ModalWrapper .ModalBody .ModalCancel,.ModalWrapper .ModalBody .ModalConfirm{background:transparent;border:1px solid var(--emw--color-gray-300, #58586B);color:var(--emw--color-gray-300, #58586B);cursor:pointer;border-radius:5px;width:200px;height:50px;font-size:16px;text-transform:uppercase;text-align:center;transition-duration:0.3s;box-sizing:border-box;padding:10px}.ModalWrapper .ModalBody .ModalConfirm{background:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));border:1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));color:var(--emw--button-typography, var(--emw--color-white, #FFFFFF))}.ModalWrapper.ModalWrapperMobile .ModalContent{padding:20px;width:80vw;border-top:none}.ModalWrapper.ModalWrapperMobile .ModalBody{padding:0;background:transparent}.ModalWrapper.ModalWrapperMobile .ModalText{font-size:16px}.ModalWrapper.ModalWrapperMobile .ModalButtons{gap:10px}.ModalWrapper.ModalWrapperMobile .ModalCancel,.ModalWrapper.ModalWrapperMobile .ModalConfirm{height:40px;width:50%;font-size:14px}.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,.BonusesPaginationWrapper .BonusesPage{all:unset;box-sizing:border-box;cursor:pointer}.BonusesPaginationWrapper .BonusesFirst,.BonusesPaginationWrapper .BonusesPrev,.BonusesPaginationWrapper .BonusesNext,.BonusesPaginationWrapper .BonusesLast{color:var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));font-size:16px;cursor:pointer;padding:5px 10px;font-weight: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-gray-300, #58586B);font-size:16px;cursor:pointer;padding:5px 10px;white-space:nowrap}.BonusesPaginationWrapper .BonusesPage.BonusPageActive{background-color:var(--emw--color-white, #FFFFFF);font-weight:700;cursor:default}.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 Se(n, e, o) {
  const t = n.slice();
  return t[55] = e[o], t[57] = o, t;
}
function Ie(n, e, o) {
  const t = n.slice();
  return t[58] = e[o], t;
}
function kn(n) {
  let e, o, t, s, i, r, u, l, f, _, C = (
    /*$_*/
    n[20]("titleBonuses") + ""
  ), A, v, h;
  return {
    c() {
      e = k("div"), o = $("svg"), t = $("defs"), s = $("style"), i = L(`.aaa {
                fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));
              }
            `), r = $("g"), u = $("g"), l = $("path"), f = R(), _ = k("h2"), A = L(C), y(l, "class", "aaa"), y(l, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), y(l, "transform", "translate(15 15) rotate(180)"), y(u, "transform", "translate(20 158)"), y(r, "transform", "translate(-20 -158)"), y(o, "xmlns", "http://www.w3.org/2000/svg"), y(o, "width", "15"), y(o, "height", "15"), y(o, "viewBox", "0 0 15 15"), y(_, "class", "ActiveBonusesTitleMobile"), y(e, "class", "MenuReturnButton");
    },
    m(w, c) {
      N(w, e, c), m(e, o), m(o, t), m(t, s), m(s, i), m(o, r), m(r, u), m(u, l), m(e, f), m(e, _), m(_, A), v || (h = U(
        e,
        "click",
        /*click_handler*/
        n[35]
      ), v = !0);
    },
    p(w, c) {
      c[0] & /*$_*/
      1048576 && C !== (C = /*$_*/
      w[20]("titleBonuses") + "") && Z(A, C);
    },
    d(w) {
      w && z(e), v = !1, h();
    }
  };
}
function Te(n) {
  let e, o = (
    /*$_*/
    n[20]("invalidBonusCode") + ""
  ), t;
  return {
    c() {
      e = k("p"), t = L(o), y(e, "class", "InvalidBonusCodeMessage");
    },
    m(s, i) {
      N(s, e, i), m(e, t);
    },
    p(s, i) {
      i[0] & /*$_*/
      1048576 && o !== (o = /*$_*/
      s[20]("invalidBonusCode") + "") && Z(t, o);
    },
    d(s) {
      s && z(e);
    }
  };
}
function Wn(n) {
  let e, o, t;
  function s(l, f) {
    return (
      /*activeBonusesList*/
      l[18].length === 0 ? Sn : Pn
    );
  }
  let i = s(n), r = i(n), u = (
    /*activeBonusesList*/
    n[18].length !== 0 && Re(n)
  );
  return {
    c() {
      e = k("div"), r.c(), o = R(), u && u.c(), t = be(), y(e, "class", "ActiveBonusesGrid " + /*isMobile*/
      (n[21] ? "ActiveBonusesGridMobile" : ""));
    },
    m(l, f) {
      N(l, e, f), r.m(e, null), N(l, o, f), u && u.m(l, f), N(l, t, f);
    },
    p(l, f) {
      i === (i = s(l)) && r ? r.p(l, f) : (r.d(1), r = i(l), r && (r.c(), r.m(e, null))), /*activeBonusesList*/
      l[18].length !== 0 ? u ? u.p(l, f) : (u = Re(l), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null);
    },
    d(l) {
      l && (z(e), z(o), z(t)), r.d(), u && u.d(l);
    }
  };
}
function En(n) {
  let e;
  return {
    c() {
      e = k("div"), y(e, "class", "ModalLoader"), y(e, "part", "ModalLoader");
    },
    m(o, t) {
      N(o, e, t);
    },
    p: fe,
    d(o) {
      o && z(e);
    }
  };
}
function Pn(n) {
  let e, o = le(
    /*activeBonusesList*/
    n[18]
  ), t = [];
  for (let s = 0; s < o.length; s += 1)
    t[s] = Fe(Ie(n, o, s));
  return {
    c() {
      for (let s = 0; s < t.length; s += 1)
        t[s].c();
      e = be();
    },
    m(s, i) {
      for (let r = 0; r < t.length; r += 1)
        t[r] && t[r].m(s, i);
      N(s, e, i);
    },
    p(s, i) {
      if (i[0] & /*activeBonusesList, lang, dateformat, clientstyling, clientstylingurl, mbsource, translationurl, currencylocale, ishiddenwageringbonus*/
      262399) {
        o = le(
          /*activeBonusesList*/
          s[18]
        );
        let r;
        for (r = 0; r < o.length; r += 1) {
          const u = Ie(s, o, r);
          t[r] ? t[r].p(u, i) : (t[r] = Fe(u), t[r].c(), t[r].m(e.parentNode, e));
        }
        for (; r < t.length; r += 1)
          t[r].d(1);
        t.length = o.length;
      }
    },
    d(s) {
      s && z(e), Ne(t, s);
    }
  };
}
function Sn(n) {
  let e, o = (
    /*$_*/
    n[20]("noActiveBonuses") + ""
  ), t;
  return {
    c() {
      e = k("p"), t = L(o);
    },
    m(s, i) {
      N(s, e, i), m(e, t);
    },
    p(s, i) {
      i[0] & /*$_*/
      1048576 && o !== (o = /*$_*/
      s[20]("noActiveBonuses") + "") && Z(t, o);
    },
    d(s) {
      s && z(e);
    }
  };
}
function In(n) {
  let e, o, t, s, i, r, u, l, f, _, C, A, v, h, w, c, g;
  return {
    c() {
      e = k("player-bonus-card"), a(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[58].termsandconditionsdescription), a(e, "termsandconditionsurl", t = /*activeBonus*/
      n[58].termsandconditionsurl), a(e, "termsandconditionsasset", s = /*activeBonus*/
      n[58].termsandconditionsasset), a(e, "endpoint", i = /*activeBonus*/
      n[58].endpoint), a(e, "playerid", r = /*activeBonus*/
      n[58].playerid), a(e, "session", u = /*activeBonus*/
      n[58].session), a(e, "bonuswalletid", l = /*activeBonus*/
      n[58].walletId), a(e, "bonusdate", f = /*activeBonus*/
      n[58].granted), a(e, "bonusexpirationdate", _ = /*activeBonus*/
      n[58].expiryTime), a(e, "bonusstatus", C = /*activeBonus*/
      n[58].status), a(e, "bonusname", A = /*activeBonus*/
      n[58].name), a(e, "bonustype", v = /*activeBonus*/
      n[58].type), a(e, "bonusamount", h = /*activeBonus*/
      n[58].extension.grantedPlayerCurrencyAmount), a(e, "bonuswageringamount", w = `${/*activeBonus*/
      n[58].fulfilledWR} / ${/*activeBonus*/
      n[58].originalWageringRequirement}`), a(e, "bonusremainingamount", c = /*activeBonus*/
      n[58].currentAmount), a(e, "bonuscurrency", g = /*activeBonus*/
      n[58].currency), a(
        e,
        "lang",
        /*lang*/
        n[0]
      ), a(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), a(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), a(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), a(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), a(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), a(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      );
    },
    m(p, b) {
      N(p, e, b);
    },
    p(p, b) {
      b[0] & /*activeBonusesList*/
      262144 && o !== (o = /*activeBonus*/
      p[58].termsandconditionsdescription) && a(e, "termsandconditionsdescription", o), b[0] & /*activeBonusesList*/
      262144 && t !== (t = /*activeBonus*/
      p[58].termsandconditionsurl) && a(e, "termsandconditionsurl", t), b[0] & /*activeBonusesList*/
      262144 && s !== (s = /*activeBonus*/
      p[58].termsandconditionsasset) && a(e, "termsandconditionsasset", s), b[0] & /*activeBonusesList*/
      262144 && i !== (i = /*activeBonus*/
      p[58].endpoint) && a(e, "endpoint", i), b[0] & /*activeBonusesList*/
      262144 && r !== (r = /*activeBonus*/
      p[58].playerid) && a(e, "playerid", r), b[0] & /*activeBonusesList*/
      262144 && u !== (u = /*activeBonus*/
      p[58].session) && a(e, "session", u), b[0] & /*activeBonusesList*/
      262144 && l !== (l = /*activeBonus*/
      p[58].walletId) && a(e, "bonuswalletid", l), b[0] & /*activeBonusesList*/
      262144 && f !== (f = /*activeBonus*/
      p[58].granted) && a(e, "bonusdate", f), b[0] & /*activeBonusesList*/
      262144 && _ !== (_ = /*activeBonus*/
      p[58].expiryTime) && a(e, "bonusexpirationdate", _), b[0] & /*activeBonusesList*/
      262144 && C !== (C = /*activeBonus*/
      p[58].status) && a(e, "bonusstatus", C), b[0] & /*activeBonusesList*/
      262144 && A !== (A = /*activeBonus*/
      p[58].name) && a(e, "bonusname", A), b[0] & /*activeBonusesList*/
      262144 && v !== (v = /*activeBonus*/
      p[58].type) && a(e, "bonustype", v), b[0] & /*activeBonusesList*/
      262144 && h !== (h = /*activeBonus*/
      p[58].extension.grantedPlayerCurrencyAmount) && a(e, "bonusamount", h), b[0] & /*activeBonusesList*/
      262144 && w !== (w = `${/*activeBonus*/
      p[58].fulfilledWR} / ${/*activeBonus*/
      p[58].originalWageringRequirement}`) && a(e, "bonuswageringamount", w), b[0] & /*activeBonusesList*/
      262144 && c !== (c = /*activeBonus*/
      p[58].currentAmount) && a(e, "bonusremainingamount", c), b[0] & /*activeBonusesList*/
      262144 && g !== (g = /*activeBonus*/
      p[58].currency) && a(e, "bonuscurrency", g), b[0] & /*lang*/
      1 && a(
        e,
        "lang",
        /*lang*/
        p[0]
      ), b[0] & /*dateformat*/
      64 && a(
        e,
        "dateformat",
        /*dateformat*/
        p[6]
      ), b[0] & /*clientstyling*/
      2 && a(
        e,
        "clientstyling",
        /*clientstyling*/
        p[1]
      ), b[0] & /*clientstylingurl*/
      4 && a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        p[2]
      ), b[0] & /*mbsource*/
      8 && a(
        e,
        "mbsource",
        /*mbsource*/
        p[3]
      ), b[0] & /*translationurl*/
      16 && a(
        e,
        "translationurl",
        /*translationurl*/
        p[4]
      ), b[0] & /*currencylocale*/
      32 && a(
        e,
        "currencylocale",
        /*currencylocale*/
        p[5]
      ), b[0] & /*ishiddenwageringbonus*/
      128 && a(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        p[7]
      );
    },
    d(p) {
      p && z(e);
    }
  };
}
function Tn(n) {
  let e, o, t, s, i, r, u, l, f, _, C, A, v, h, w;
  return {
    c() {
      e = k("player-bonus-card"), a(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[58].termsandconditionsdescription), a(e, "termsandconditionsurl", t = /*activeBonus*/
      n[58].termsandconditionsurl), a(e, "termsandconditionsasset", s = /*activeBonus*/
      n[58].termsandconditionsasset), a(e, "endpoint", i = /*activeBonus*/
      n[58].endpoint), a(e, "playerid", r = /*activeBonus*/
      n[58].playerid), a(e, "session", u = /*activeBonus*/
      n[58].session), a(e, "bonuswalletid", l = /*activeBonus*/
      n[58].walletId), a(e, "bonusdate", f = /*activeBonus*/
      n[58].granted), a(e, "bonusexpirationdate", _ = /*activeBonus*/
      n[58].expiryTime), a(e, "bonusstatus", C = /*activeBonus*/
      n[58].status), a(e, "bonusname", A = /*activeBonus*/
      n[58].name), a(e, "bonustype", v = /*activeBonus*/
      n[58].type), a(e, "bonuscurrency", h = /*activeBonus*/
      n[58].currency), a(e, "bonusfreespins", w = /*activeBonus*/
      n[58].freeRoundNumber), a(
        e,
        "lang",
        /*lang*/
        n[0]
      ), a(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), a(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), a(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), a(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), a(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), a(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      );
    },
    m(c, g) {
      N(c, e, g);
    },
    p(c, g) {
      g[0] & /*activeBonusesList*/
      262144 && o !== (o = /*activeBonus*/
      c[58].termsandconditionsdescription) && a(e, "termsandconditionsdescription", o), g[0] & /*activeBonusesList*/
      262144 && t !== (t = /*activeBonus*/
      c[58].termsandconditionsurl) && a(e, "termsandconditionsurl", t), g[0] & /*activeBonusesList*/
      262144 && s !== (s = /*activeBonus*/
      c[58].termsandconditionsasset) && a(e, "termsandconditionsasset", s), g[0] & /*activeBonusesList*/
      262144 && i !== (i = /*activeBonus*/
      c[58].endpoint) && a(e, "endpoint", i), g[0] & /*activeBonusesList*/
      262144 && r !== (r = /*activeBonus*/
      c[58].playerid) && a(e, "playerid", r), g[0] & /*activeBonusesList*/
      262144 && u !== (u = /*activeBonus*/
      c[58].session) && a(e, "session", u), g[0] & /*activeBonusesList*/
      262144 && l !== (l = /*activeBonus*/
      c[58].walletId) && a(e, "bonuswalletid", l), g[0] & /*activeBonusesList*/
      262144 && f !== (f = /*activeBonus*/
      c[58].granted) && a(e, "bonusdate", f), g[0] & /*activeBonusesList*/
      262144 && _ !== (_ = /*activeBonus*/
      c[58].expiryTime) && a(e, "bonusexpirationdate", _), g[0] & /*activeBonusesList*/
      262144 && C !== (C = /*activeBonus*/
      c[58].status) && a(e, "bonusstatus", C), g[0] & /*activeBonusesList*/
      262144 && A !== (A = /*activeBonus*/
      c[58].name) && a(e, "bonusname", A), g[0] & /*activeBonusesList*/
      262144 && v !== (v = /*activeBonus*/
      c[58].type) && a(e, "bonustype", v), g[0] & /*activeBonusesList*/
      262144 && h !== (h = /*activeBonus*/
      c[58].currency) && a(e, "bonuscurrency", h), g[0] & /*activeBonusesList*/
      262144 && w !== (w = /*activeBonus*/
      c[58].freeRoundNumber) && a(e, "bonusfreespins", w), g[0] & /*lang*/
      1 && a(
        e,
        "lang",
        /*lang*/
        c[0]
      ), g[0] & /*dateformat*/
      64 && a(
        e,
        "dateformat",
        /*dateformat*/
        c[6]
      ), g[0] & /*clientstyling*/
      2 && a(
        e,
        "clientstyling",
        /*clientstyling*/
        c[1]
      ), g[0] & /*clientstylingurl*/
      4 && a(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        c[2]
      ), g[0] & /*mbsource*/
      8 && a(
        e,
        "mbsource",
        /*mbsource*/
        c[3]
      ), g[0] & /*translationurl*/
      16 && a(
        e,
        "translationurl",
        /*translationurl*/
        c[4]
      ), g[0] & /*currencylocale*/
      32 && a(
        e,
        "currencylocale",
        /*currencylocale*/
        c[5]
      ), g[0] & /*ishiddenwageringbonus*/
      128 && a(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        c[7]
      );
    },
    d(c) {
      c && z(e);
    }
  };
}
function Fe(n) {
  let e;
  function o(i, r) {
    return (
      /*activeBonus*/
      i[58].type === "freeRound" ? Tn : In
    );
  }
  let t = o(n), s = t(n);
  return {
    c() {
      s.c(), e = be();
    },
    m(i, r) {
      s.m(i, r), N(i, e, r);
    },
    p(i, r) {
      t === (t = o(i)) && s ? s.p(i, r) : (s.d(1), s = t(i), s && (s.c(), s.m(e.parentNode, e)));
    },
    d(i) {
      i && z(e), s.d(i);
    }
  };
}
function Re(n) {
  let e, o, t, s, i, r, u, l, f, _, C, A, v, h, w, c, g, p, b, H, Y, X, q, j = le(Array(
    /*numberOfPages*/
    n[16]
  )), M = [];
  for (let B = 0; B < j.length; B += 1)
    M[B] = Le(Se(n, j, B));
  return {
    c() {
      e = k("div"), o = k("button"), t = L("|<"), r = R(), u = k("button"), l = L("<"), C = R();
      for (let B = 0; B < M.length; B += 1)
        M[B].c();
      A = R(), v = k("button"), h = L(">"), g = R(), p = k("button"), b = L(">|"), o.disabled = s = /*currentPage*/
      n[17] === 0, y(o, "class", i = "BonusesFirst " + /*currentPage*/
      (n[17] === 0 ? "Inactive" : "")), u.disabled = f = /*currentPage*/
      n[17] === 0, y(u, "class", _ = "BonusesPrev " + /*currentPage*/
      (n[17] === 0 ? "Inactive" : "")), v.disabled = w = /*currentPage*/
      n[17] === /*numberOfPages*/
      n[16] - 1, y(v, "class", c = "BonusesNext " + /*currentPage*/
      (n[17] === /*numberOfPages*/
      n[16] - 1 ? "Inactive" : "")), p.disabled = H = /*currentPage*/
      n[17] === /*numberOfPages*/
      n[16] - 1, y(p, "class", Y = "BonusesLast " + /*currentPage*/
      (n[17] === /*numberOfPages*/
      n[16] - 1 ? "Inactive" : "")), y(e, "class", "BonusesPaginationWrapper " + /*isMobile*/
      (n[21] ? "BonusesPaginationWrapperMobile" : ""));
    },
    m(B, P) {
      N(B, e, P), m(e, o), m(o, t), m(e, r), m(e, u), m(u, l), m(e, C);
      for (let E = 0; E < M.length; E += 1)
        M[E] && M[E].m(e, null);
      m(e, A), m(e, v), m(v, h), m(e, g), m(e, p), m(p, b), X || (q = [
        U(
          o,
          "click",
          /*click_handler_1*/
          n[37]
        ),
        U(
          u,
          "click",
          /*click_handler_2*/
          n[38]
        ),
        U(
          v,
          "click",
          /*click_handler_4*/
          n[40]
        ),
        U(
          p,
          "click",
          /*click_handler_5*/
          n[41]
        )
      ], X = !0);
    },
    p(B, P) {
      if (P[0] & /*currentPage*/
      131072 && s !== (s = /*currentPage*/
      B[17] === 0) && (o.disabled = s), P[0] & /*currentPage*/
      131072 && i !== (i = "BonusesFirst " + /*currentPage*/
      (B[17] === 0 ? "Inactive" : "")) && y(o, "class", i), P[0] & /*currentPage*/
      131072 && f !== (f = /*currentPage*/
      B[17] === 0) && (u.disabled = f), P[0] & /*currentPage*/
      131072 && _ !== (_ = "BonusesPrev " + /*currentPage*/
      (B[17] === 0 ? "Inactive" : "")) && y(u, "class", _), P[0] & /*currentPage, getActiveBonuses, numberOfPages*/
      16973824) {
        j = le(Array(
          /*numberOfPages*/
          B[16]
        ));
        let E;
        for (E = 0; E < j.length; E += 1) {
          const S = Se(B, j, E);
          M[E] ? M[E].p(S, P) : (M[E] = Le(S), M[E].c(), M[E].m(e, A));
        }
        for (; E < M.length; E += 1)
          M[E].d(1);
        M.length = j.length;
      }
      P[0] & /*currentPage, numberOfPages*/
      196608 && w !== (w = /*currentPage*/
      B[17] === /*numberOfPages*/
      B[16] - 1) && (v.disabled = w), P[0] & /*currentPage, numberOfPages*/
      196608 && c !== (c = "BonusesNext " + /*currentPage*/
      (B[17] === /*numberOfPages*/
      B[16] - 1 ? "Inactive" : "")) && y(v, "class", c), P[0] & /*currentPage, numberOfPages*/
      196608 && H !== (H = /*currentPage*/
      B[17] === /*numberOfPages*/
      B[16] - 1) && (p.disabled = H), P[0] & /*currentPage, numberOfPages*/
      196608 && Y !== (Y = "BonusesLast " + /*currentPage*/
      (B[17] === /*numberOfPages*/
      B[16] - 1 ? "Inactive" : "")) && y(p, "class", Y);
    },
    d(B) {
      B && z(e), Ne(M, B), X = !1, me(q);
    }
  };
}
function Le(n) {
  let e, o = (
    /*i*/
    n[57] + 1 + ""
  ), t, s, i, r, u;
  function l() {
    return (
      /*click_handler_3*/
      n[39](
        /*i*/
        n[57]
      )
    );
  }
  return {
    c() {
      e = k("button"), t = L(o), e.disabled = s = /*i*/
      n[57] === /*currentPage*/
      n[17], y(e, "class", i = "BonusesPage " + /*i*/
      (n[57] === /*currentPage*/
      n[17] ? "BonusPageActive" : ""));
    },
    m(f, _) {
      N(f, e, _), m(e, t), r || (u = U(e, "click", l), r = !0);
    },
    p(f, _) {
      n = f, _[0] & /*currentPage*/
      131072 && s !== (s = /*i*/
      n[57] === /*currentPage*/
      n[17]) && (e.disabled = s), _[0] & /*currentPage*/
      131072 && i !== (i = "BonusesPage " + /*i*/
      (n[57] === /*currentPage*/
      n[17] ? "BonusPageActive" : "")) && y(e, "class", i);
    },
    d(f) {
      f && z(e), r = !1, u();
    }
  };
}
function ze(n) {
  let e, o, t, s, i = (
    /*$_*/
    n[20]("forfeitBonus") + ""
  ), r, u, l, f, _ = (
    /*$_*/
    n[20]("forfeitBonusCancel") + ""
  ), C, A, v, h = (
    /*$_*/
    n[20]("forfeitBonusConfirm") + ""
  ), w, c, g;
  return {
    c() {
      e = k("div"), o = k("div"), t = k("div"), s = k("p"), r = L(i), u = R(), l = k("div"), f = k("button"), C = L(_), A = R(), v = k("button"), w = L(h), y(s, "class", "ModalText"), y(f, "class", "ModalCancel"), y(v, "class", "ModalConfirm"), y(l, "class", "ModalButtons"), y(t, "class", "ModalBody"), y(o, "class", "ModalContent"), y(e, "class", "ModalWrapper " + /*isMobile*/
      (n[21] ? "ModalWrapperMobile" : ""));
    },
    m(p, b) {
      N(p, e, b), m(e, o), m(o, t), m(t, s), m(s, r), m(t, u), m(t, l), m(l, f), m(f, C), m(l, A), m(l, v), m(v, w), c || (g = [
        U(
          f,
          "click",
          /*closeBonusModal*/
          n[26]
        ),
        U(
          v,
          "click",
          /*debouncedFunction*/
          n[28](
            /*deleteBonus*/
            n[27]
          )
        )
      ], c = !0);
    },
    p(p, b) {
      b[0] & /*$_*/
      1048576 && i !== (i = /*$_*/
      p[20]("forfeitBonus") + "") && Z(r, i), b[0] & /*$_*/
      1048576 && _ !== (_ = /*$_*/
      p[20]("forfeitBonusCancel") + "") && Z(C, _), b[0] & /*$_*/
      1048576 && h !== (h = /*$_*/
      p[20]("forfeitBonusConfirm") + "") && Z(w, h);
    },
    d(p) {
      p && z(e), c = !1, me(g);
    }
  };
}
function Fn(n) {
  let e, o, t, s, i = (
    /*$_*/
    n[20]("titleBonuses") + ""
  ), r, u, l, f, _ = (
    /*$_*/
    n[20]("bonusCode") + ""
  ), C, A, v, h, w, c, g = (
    /*$_*/
    n[20]("getBonus") + ""
  ), p, b, H, Y, X, q, j, M = (
    /*isMobile*/
    n[21] && kn(n)
  ), B = (
    /*invalidBonusCode*/
    n[11] && Te(n)
  );
  function P(W, F) {
    return (
      /*isLoading*/
      W[9] ? En : Wn
    );
  }
  let E = P(n), S = E(n), I = (
    /*bonusModal*/
    n[19] && ze(n)
  );
  return {
    c() {
      e = k("div"), o = k("div"), M && M.c(), t = R(), s = k("h2"), r = L(i), u = R(), l = k("div"), f = k("label"), C = L(_), A = R(), v = k("div"), h = k("input"), w = R(), c = k("button"), p = L(g), H = R(), B && B.c(), Y = R(), S.c(), X = R(), I && I.c(), y(s, "class", "ActiveBonusesTitle " + /*isMobile*/
      (n[21] ? "ActiveBonusesTitleNone" : "")), y(f, "for", "BonusCode"), y(h, "class", "BonusCodeInput " + /*isMobile*/
      (n[21] ? "BonusCodeInputMobile" : "")), y(h, "type", "text"), y(h, "id", "BonusCode"), y(c, "class", "SubmitBonusCode " + /*isMobile*/
      (n[21] ? "SubmitBonusCodeMobile" : "")), c.disabled = b = /*invalidBonusField*/
      n[10] || /*isLoading*/
      n[9], y(v, "class", "BonusCodeWrapper " + /*isMobile*/
      (n[21] ? "BonusCodeWrapperMobile" : "")), y(l, "class", "BonusCodeContainer " + /*isMobile*/
      (n[21] ? "BonusCodeContainerMobile" : "")), y(o, "class", "ActiveBonusesWrapper " + /*isMobile*/
      (n[21] ? "ActiveBonusesWrapperMobile" : ""));
    },
    m(W, F) {
      N(W, e, F), m(e, o), M && M.m(o, null), m(o, t), m(o, s), m(s, r), m(o, u), m(o, l), m(l, f), m(f, C), m(l, A), m(l, v), m(v, h), ke(
        h,
        /*bonusCode*/
        n[12]
      ), m(v, w), m(v, c), m(c, p), m(l, H), B && B.m(l, null), m(o, Y), S.m(o, null), m(e, X), I && I.m(e, null), n[42](e), q || (j = [
        U(
          h,
          "input",
          /*input_input_handler*/
          n[36]
        ),
        U(
          h,
          "keyup",
          /*validateBonusCode*/
          n[23]
        ),
        U(
          c,
          "click",
          /*claimBonus*/
          n[25]
        )
      ], q = !0);
    },
    p(W, F) {
      /*isMobile*/
      W[21] && M.p(W, F), F[0] & /*$_*/
      1048576 && i !== (i = /*$_*/
      W[20]("titleBonuses") + "") && Z(r, i), F[0] & /*$_*/
      1048576 && _ !== (_ = /*$_*/
      W[20]("bonusCode") + "") && Z(C, _), F[0] & /*bonusCode*/
      4096 && h.value !== /*bonusCode*/
      W[12] && ke(
        h,
        /*bonusCode*/
        W[12]
      ), F[0] & /*$_*/
      1048576 && g !== (g = /*$_*/
      W[20]("getBonus") + "") && Z(p, g), F[0] & /*invalidBonusField, isLoading*/
      1536 && b !== (b = /*invalidBonusField*/
      W[10] || /*isLoading*/
      W[9]) && (c.disabled = b), /*invalidBonusCode*/
      W[11] ? B ? B.p(W, F) : (B = Te(W), B.c(), B.m(l, null)) : B && (B.d(1), B = null), E === (E = P(W)) && S ? S.p(W, F) : (S.d(1), S = E(W), S && (S.c(), S.m(o, null))), /*bonusModal*/
      W[19] ? I ? I.p(W, F) : (I = ze(W), I.c(), I.m(e, null)) : I && (I.d(1), I = null);
    },
    i: fe,
    o: fe,
    d(W) {
      W && z(e), M && M.d(), B && B.d(), S.d(), I && I.d(), n[42](null), q = !1, me(j);
    }
  };
}
let Rn = "status=active", V = 6;
function Ln(n) {
  var t, s, i, r, u, l, f, _, C, A, v;
  const e = (t = n.initialWagerRequirementAmount) != null ? t : 0, o = (s = n.remainingWagerRequirementAmount) != null ? s : 0;
  return Ae(re({}, n), {
    walletId: (i = n.bonusWalletID) != null ? i : void 0,
    granted: (r = n.grantedDate) != null ? r : void 0,
    expiryTime: (u = n.expiryDate) != null ? u : void 0,
    currentAmount: (l = n.remainingAmount) != null ? l : void 0,
    originalWageringRequirement: (f = n.initialWagerRequirementAmount) != null ? f : void 0,
    fulfilledWR: e - o,
    extension: {
      grantedPlayerCurrencyAmount: (_ = n.amount) != null ? _ : void 0
    },
    termsandconditionsurl: (C = n.url) != null ? C : void 0,
    termsandconditionsdescription: (A = n.description) != null ? A : void 0,
    termsandconditionsasset: (v = n.assets) != null ? v : void 0
  });
}
function zn(n, e, o) {
  let t;
  pn(n, yn, (d) => o(20, t = d));
  let { endpoint: s = "" } = e, { session: i = "" } = e, { playerid: r = "" } = e, { lang: u = "en" } = e, { currency: l = "" } = e, { clientstyling: f = "" } = e, { clientstylingurl: _ = "" } = e, { mbsource: C } = e, { translationurl: A = "" } = e, { currencylocale: v = "" } = e, { dateformat: h = "" } = e, { bonuscoderegex: w = "" } = e, { ishiddenwageringbonus: c = "false" } = e, { gmversion: g = "" } = e, p = !1, b, H, Y = window.navigator.userAgent, X = fn(Y) !== "PC", q = !0, j = !1, M = "", B = 0, P = 0, E = 0, S = 0, I = 0, W = [], F, ue = "", de = !1;
  const je = () => {
    fetch(A).then((T) => T.json()).then((T) => {
      Object.keys(T).forEach((J) => {
        We(J, T[J]);
      });
    }).catch((T) => {
      console.log(T);
    });
  };
  Object.keys(Ee).forEach((d) => {
    We(d, Ee[d]);
  });
  const ve = (d) => {
    if (d.data)
      switch (d.data.type) {
        case "DeleteActiveBonus":
          ue = d.data.bonuswalletid, o(19, de = !0);
          break;
      }
  };
  function De(d, T) {
    return (...J) => {
      clearTimeout(F), F = setTimeout(
        () => {
          d.apply(this, J);
        },
        T
      );
    };
  }
  const _e = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: X
      },
      window.location.href
    );
  }, Oe = () => M ? w ? new RegExp(w).test(M) : !0 : !1, Ue = () => {
    o(10, q = !Oe()), w && o(11, j = q);
  }, G = (d) => K(this, null, function* () {
    var T, J, te, Ce;
    o(9, p = !0);
    try {
      let ee = [], ae = 0;
      if (g === "gm2") {
        console.log("getActiveBonuses - gm2", g);
        const D = {
          pagination: `limit=${V},offset=${d}`,
          language: u || "en",
          sortOrder: "desc",
          status: Pe.STATUS_ACTIVE,
          type: Pe.TYPES,
          expand: "freeSpin"
        };
        c === "true" && (D.includeHiddenWallet = !0);
        const Q = yield Mn(s, i, D);
        console.log("data from getActiveBonuses", Q);
        const ne = Q.items;
        Array.isArray(ne) ? ee = ne.map(Ln) : console.error("Unexpected granted bonuses payload", Q), ae = (T = Q.total) != null ? T : 0;
      } else {
        console.log("getActiveBonuses - /bonusWallet", g);
        const D = {
          method: "GET",
          headers: { "X-SessionId": i }
        }, Q = `/v1/player/${r}/bonusWallet`, ne = new URL(`${s}${Q}`), pe = new URLSearchParams();
        pe.set("filter", Rn), pe.set("pagination", `offset=${d},limit=${V}`), ne.search = pe.toString();
        const oe = yield (yield fetch(ne, D)).json();
        if (Array.isArray(oe.items)) {
          for (const x of oe.items) {
            const ie = (te = (J = x == null ? void 0 : x.extension) == null ? void 0 : J.bonus) == null ? void 0 : te.presentation;
            ie && (x.termsandconditionsurl = ie.url, x.termsandconditionsdescription = ie.description, x.termsandconditionsasset = ie.assets);
          }
          ee = oe.items;
        } else
          console.error("Unexpected legacy bonus list payload", oe);
        ae = (Ce = oe.total) != null ? Ce : 0;
      }
      o(16, S = Math.ceil(ae / V)), d - V >= 0 && o(13, B = d - V), d + V < ae && o(14, P = d + V), o(15, E = (S - 1) * V), o(17, I = d / V), o(18, W = ee), v && W.forEach((D) => {
        D.fulfilledWR = se(D.fulfilledWR), D.originalWageringRequirement = se(D.originalWageringRequirement), D.currentAmount = se(D.currentAmount), D.extension && (D.extension.grantedPlayerCurrencyAmount = se(D.extension.grantedPlayerCurrencyAmount));
      }), window.scrollTo({ top: 0, behavior: "smooth" });
    } catch (ee) {
      console.error(ee);
    } finally {
      o(9, p = !1);
    }
  }), se = (d) => new Intl.NumberFormat(v, { style: "currency", currency: l }).format(d).replace(/\s/g, ""), ye = () => {
    console.log("post claim success, status 200"), o(11, j = !1), G(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "success",
          message: t("bonusClaimSuccessMessage")
        }
      },
      window.location.href
    ), typeof gtag == "function" && gtag("event", "ClaimBonus", {
      context: "PlayerActiveBonuses",
      userId: `${r || "Not logged in"}`,
      bonusCode: `${M}`
    });
  }, he = () => {
    o(11, j = !0), console.log("post claim error - status not 200"), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "error",
          message: t("bonusClaimErrorMessage")
        }
      },
      window.location.href
    );
  }, qe = () => K(this, null, function* () {
    o(9, p = !0);
    try {
      if (g === "gm2") {
        if (!(yield Cn(s, i, { bonusCode: M, currency: l })).success) {
          he();
          //!
          return;
        }
        ye();
        return;
      }
      const d = new URL(`${s}/v1/player/${r}/claimbonus`);
      d.searchParams.append("currency", l), d.searchParams.append("bonusCode", M);
      const T = {
        method: "POST",
        headers: {
          "X-SessionId": i,
          accept: "application/json"
        }
      };
      (yield fetch(d.href, T)).status == 200 ? ye() : he();
    } finally {
      o(9, p = !1);
    }
  }), ce = () => {
    window.postMessage({ type: "EnableScroll" }, window.location.href), o(19, de = !1);
  }, Ge = () => K(this, null, function* () {
    if (g === "gm2") {
      if (!(yield wn(s, i, { bonusWalletID: ue })).success)
        return;
      G(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ce();
      return;
    }
    const d = {
      method: "DELETE",
      headers: {
        "X-SessionId": i,
        "Content-Type": "application/json",
        Accept: "application/json"
      }
    }, T = new URL(`${s}/v1/player/${r}/bonusWallet`);
    T.searchParams.append("bonusWalletID", ue), (yield fetch(T, d)).status == 200 && (G(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ce());
  }), Ve = () => {
    hn(u);
  };
  function He(d) {
    return De(d, 1e3);
  }
  mn(() => (window.addEventListener("message", ve, !1), () => {
    window.removeEventListener("message", ve);
  }));
  const Ye = () => _e();
  function Xe() {
    M = this.value, o(12, M);
  }
  const Je = () => G(0), Ze = () => G(B), Ke = (d) => G(d * V), Qe = () => G(P), xe = () => G(E);
  function $e(d) {
    bn[d ? "unshift" : "push"](() => {
      b = d, o(8, b);
    });
  }
  return n.$$set = (d) => {
    "endpoint" in d && o(29, s = d.endpoint), "session" in d && o(30, i = d.session), "playerid" in d && o(31, r = d.playerid), "lang" in d && o(0, u = d.lang), "currency" in d && o(32, l = d.currency), "clientstyling" in d && o(1, f = d.clientstyling), "clientstylingurl" in d && o(2, _ = d.clientstylingurl), "mbsource" in d && o(3, C = d.mbsource), "translationurl" in d && o(4, A = d.translationurl), "currencylocale" in d && o(5, v = d.currencylocale), "dateformat" in d && o(6, h = d.dateformat), "bonuscoderegex" in d && o(33, w = d.bonuscoderegex), "ishiddenwageringbonus" in d && o(7, c = d.ishiddenwageringbonus), "gmversion" in d && o(34, g = d.gmversion);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*lang*/
    1 && u && Ve(), n.$$.dirty[0] & /*session, endpoint*/
    1610612736 | n.$$.dirty[1] & /*playerid*/
    1 && i && r && s && G(0), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    258 && f && b && gn(b, f), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    260 && _ && b && Bn(b, _), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
    264 && C && b && vn(b, `${C}.Style`, H), n.$$.dirty[0] & /*translationurl*/
    16 && A && je();
  }, [
    u,
    f,
    _,
    C,
    A,
    v,
    h,
    c,
    b,
    p,
    q,
    j,
    M,
    B,
    P,
    E,
    S,
    I,
    W,
    de,
    t,
    X,
    _e,
    Ue,
    G,
    qe,
    ce,
    Ge,
    He,
    s,
    i,
    r,
    l,
    w,
    g,
    Ye,
    Xe,
    Je,
    Ze,
    Ke,
    Qe,
    xe,
    $e
  ];
}
class Nn extends ln {
  constructor(e) {
    super(), un(
      this,
      e,
      zn,
      Fn,
      dn,
      {
        endpoint: 29,
        session: 30,
        playerid: 31,
        lang: 0,
        currency: 32,
        clientstyling: 1,
        clientstylingurl: 2,
        mbsource: 3,
        translationurl: 4,
        currencylocale: 5,
        dateformat: 6,
        bonuscoderegex: 33,
        ishiddenwageringbonus: 7,
        gmversion: 34
      },
      An,
      [-1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[29];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), O();
  }
  get session() {
    return this.$$.ctx[30];
  }
  set session(e) {
    this.$$set({ session: e }), O();
  }
  get playerid() {
    return this.$$.ctx[31];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), O();
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), O();
  }
  get currency() {
    return this.$$.ctx[32];
  }
  set currency(e) {
    this.$$set({ currency: e }), O();
  }
  get clientstyling() {
    return this.$$.ctx[1];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), O();
  }
  get clientstylingurl() {
    return this.$$.ctx[2];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), O();
  }
  get mbsource() {
    return this.$$.ctx[3];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), O();
  }
  get translationurl() {
    return this.$$.ctx[4];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), O();
  }
  get currencylocale() {
    return this.$$.ctx[5];
  }
  set currencylocale(e) {
    this.$$set({ currencylocale: e }), O();
  }
  get dateformat() {
    return this.$$.ctx[6];
  }
  set dateformat(e) {
    this.$$set({ dateformat: e }), O();
  }
  get bonuscoderegex() {
    return this.$$.ctx[33];
  }
  set bonuscoderegex(e) {
    this.$$set({ bonuscoderegex: e }), O();
  }
  get ishiddenwageringbonus() {
    return this.$$.ctx[7];
  }
  set ishiddenwageringbonus(e) {
    this.$$set({ ishiddenwageringbonus: e }), O();
  }
  get gmversion() {
    return this.$$.ctx[34];
  }
  set gmversion(e) {
    this.$$set({ gmversion: e }), O();
  }
}
_n(Nn, { endpoint: {}, session: {}, playerid: {}, lang: {}, currency: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, currencylocale: {}, dateformat: {}, bonuscoderegex: {}, ishiddenwageringbonus: {}, gmversion: {} }, [], [], !0);
export {
  Nn as default
};
