import { a as Xe, $ as Je, S as Ke, i as Qe, s as Ze, f as N, b as xe, n as le, d as D, w as ue, u as J, K as _e, e as j, p, x as G, g as W, q as z, v as O, t as _, h as $e, j as en, o as nn, y as Q, k as on, L as de, l as se, m as Se, r as t, B as sn, C as tn, D as an, c as rn, A as ln } from "./PlayerAccountController-BLu_m4ej.js";
function ve(n, e) {
  Xe(n, e);
}
function un(n) {
  Je.set(n);
}
const ye = {
  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"
  }
}, ce = {
  CLAIM: "/v1/bonus/claim",
  FORFEIT: "/v1/bonus/forfeit",
  GRANTED: "/v1/bonus/granted"
}, he = {
  TYPES: "standard,freeBet,freeRound,cashBack,stakeBack,oddsBoost,wagering",
  STATUS_ACTIVE: "active",
  STATUS_COMPLETED: "completed,released,forfeited,expired,closed"
}, dn = {
  ODDS_BOOST: "oddsBoost"
};
async function pe(n, e = {}) {
  const o = typeof n == "string" ? n : n.toString(), i = await fetch(o, e);
  let s = null;
  try {
    s = await i.json();
  } catch {
    s = null;
  }
  if (i.ok && s)
    return s;
  const a = s && typeof s == "object" ? s : {}, l = {
    success: !1,
    errorMessage: typeof a.errorMessage == "string" && a.errorMessage || i.statusText || String(i.status),
    errorCode: typeof a.errorCode == "number" ? a.errorCode : void 0
  };
  return { ...a, ...l };
}
async function cn(n, e, o) {
  const i = `${n}${ce.CLAIM}`;
  return pe(i, {
    method: "PUT",
    headers: {
      "x-SessionId": e,
      accept: "application/json",
      "Content-Type": "application/json-patch+json"
    },
    body: JSON.stringify(o)
  });
}
async function pn(n, e, o) {
  const i = new URL(`${n}${ce.FORFEIT}`);
  return i.searchParams.append("bonusWalletID", o.bonusWalletID), pe(i, {
    method: "DELETE",
    headers: {
      "x-SessionId": e,
      accept: "application/json"
    }
  });
}
async function fn(n, e, o) {
  const i = new URL(`${n}${ce.GRANTED}`);
  Object.entries(o).forEach(([a, l]) => {
    l != null && i.searchParams.append(a, String(l));
  });
  const s = {};
  return e && (s["x-SessionId"] = e), pe(i, {
    headers: s
  });
}
if (typeof window < "u") {
  let n = function(e) {
    return function(...o) {
      try {
        return e.apply(this, o);
      } catch (i) {
        if (i instanceof DOMException && i.message.includes("has already been used with this registry") || i.message.includes("Cannot define multiple custom elements with the same tag name"))
          return !1;
        throw i;
      }
    };
  };
  customElements.define = n(customElements.define), import("./PlayerBonusCard-BRcN1ur_.js").then(({ default: e }) => {
    !customElements.get("player-bonus-card") && customElements.define("player-bonus-card", e.element);
  });
}
function mn(n) {
  xe(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 Ce(n, e, o) {
  const i = n.slice();
  return i[57] = e[o], i[59] = o, i;
}
function we(n, e, o) {
  const i = n.slice();
  return i[60] = e[o], i;
}
function bn(n) {
  let e, o, i, s, a, l, d, u, g, y, M = (
    /*$_*/
    n[21]("titleBonuses") + ""
  ), A, v, h;
  return {
    c() {
      e = W("div"), o = Q("svg"), i = Q("defs"), s = Q("style"), a = O(`.aaa {
                fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22b04e));
              }
            `), l = Q("g"), d = Q("g"), u = Q("path"), g = z(), y = W("h2"), A = O(M), _(u, "class", "aaa"), _(u, "d", "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z"), _(u, "transform", "translate(15 15) rotate(180)"), _(d, "transform", "translate(20 158)"), _(l, "transform", "translate(-20 -158)"), _(o, "xmlns", "http://www.w3.org/2000/svg"), _(o, "width", "15"), _(o, "height", "15"), _(o, "viewBox", "0 0 15 15"), _(y, "class", "ActiveBonusesTitleMobile"), _(e, "class", "MenuReturnButton");
    },
    m(w, C) {
      j(w, e, C), p(e, o), p(o, i), p(i, s), p(s, a), p(o, l), p(l, d), p(d, u), p(e, g), p(e, y), p(y, A), v || (h = G(
        e,
        "click",
        /*click_handler*/
        n[36]
      ), v = !0);
    },
    p(w, C) {
      C[0] & /*$_*/
      2097152 && M !== (M = /*$_*/
      w[21]("titleBonuses") + "") && J(A, M);
    },
    d(w) {
      w && D(e), v = !1, h();
    }
  };
}
function Me(n) {
  let e, o = (
    /*$_*/
    n[21]("invalidBonusCode") + ""
  ), i;
  return {
    c() {
      e = W("p"), i = O(o), _(e, "class", "InvalidBonusCodeMessage");
    },
    m(s, a) {
      j(s, e, a), p(e, i);
    },
    p(s, a) {
      a[0] & /*$_*/
      2097152 && o !== (o = /*$_*/
      s[21]("invalidBonusCode") + "") && J(i, o);
    },
    d(s) {
      s && D(e);
    }
  };
}
function gn(n) {
  let e, o, i;
  function s(u, g) {
    return (
      /*activeBonusesList*/
      u[19].length === 0 ? vn : _n
    );
  }
  let a = s(n), l = a(n), d = (
    /*activeBonusesList*/
    n[19].length !== 0 && Ae(n)
  );
  return {
    c() {
      e = W("div"), l.c(), o = z(), d && d.c(), i = de(), _(e, "class", "ActiveBonusesGrid " + /*isMobile*/
      (n[22] ? "ActiveBonusesGridMobile" : ""));
    },
    m(u, g) {
      j(u, e, g), l.m(e, null), j(u, o, g), d && d.m(u, g), j(u, i, g);
    },
    p(u, g) {
      a === (a = s(u)) && l ? l.p(u, g) : (l.d(1), l = a(u), l && (l.c(), l.m(e, null))), /*activeBonusesList*/
      u[19].length !== 0 ? d ? d.p(u, g) : (d = Ae(u), d.c(), d.m(i.parentNode, i)) : d && (d.d(1), d = null);
    },
    d(u) {
      u && (D(e), D(o), D(i)), l.d(), d && d.d(u);
    }
  };
}
function Bn(n) {
  let e;
  return {
    c() {
      e = W("div"), _(e, "class", "ModalLoader"), _(e, "part", "ModalLoader");
    },
    m(o, i) {
      j(o, e, i);
    },
    p: le,
    d(o) {
      o && D(e);
    }
  };
}
function _n(n) {
  let e, o = se(
    /*activeBonusesList*/
    n[19]
  ), i = [];
  for (let s = 0; s < o.length; s += 1)
    i[s] = We(we(n, o, s));
  return {
    c() {
      for (let s = 0; s < i.length; s += 1)
        i[s].c();
      e = de();
    },
    m(s, a) {
      for (let l = 0; l < i.length; l += 1)
        i[l] && i[l].m(s, a);
      j(s, e, a);
    },
    p(s, a) {
      if (a[0] & /*activeBonusesList, lang, dateformat, clientstyling, clientstylingurl, mbsource, translationurl, currencylocale, ishiddenwageringbonus, filterbonusbalance*/
      524799) {
        o = se(
          /*activeBonusesList*/
          s[19]
        );
        let l;
        for (l = 0; l < o.length; l += 1) {
          const d = we(s, o, l);
          i[l] ? i[l].p(d, a) : (i[l] = We(d), i[l].c(), i[l].m(e.parentNode, e));
        }
        for (; l < i.length; l += 1)
          i[l].d(1);
        i.length = o.length;
      }
    },
    d(s) {
      s && D(e), Se(i, s);
    }
  };
}
function vn(n) {
  let e, o = (
    /*$_*/
    n[21]("noActiveBonuses") + ""
  ), i;
  return {
    c() {
      e = W("p"), i = O(o);
    },
    m(s, a) {
      j(s, e, a), p(e, i);
    },
    p(s, a) {
      a[0] & /*$_*/
      2097152 && o !== (o = /*$_*/
      s[21]("noActiveBonuses") + "") && J(i, o);
    },
    d(s) {
      s && D(e);
    }
  };
}
function yn(n) {
  let e, o, i, s, a, l, d, u, g, y, M, A, v, h, w, C, f, c;
  return {
    c() {
      e = W("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[60].termsandconditionsdescription), t(e, "termsandconditionsurl", i = /*activeBonus*/
      n[60].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[60].termsandconditionsasset), t(e, "endpoint", a = /*activeBonus*/
      n[60].endpoint), t(e, "playerid", l = /*activeBonus*/
      n[60].playerid), t(e, "session", d = /*activeBonus*/
      n[60].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[60].walletId), t(e, "bonusdate", g = /*activeBonus*/
      n[60].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[60].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[60].status), t(e, "bonusname", A = /*activeBonus*/
      n[60].name), t(e, "bonustype", v = /*activeBonus*/
      n[60].type), t(e, "bonusamount", h = /*activeBonus*/
      n[60].extension.grantedPlayerCurrencyAmount), t(e, "bonuswageringamount", w = `${/*activeBonus*/
      n[60].fulfilledWR} / ${/*activeBonus*/
      n[60].originalWageringRequirement}`), t(e, "bonusremainingamount", C = /*activeBonus*/
      n[60].currentAmount), t(e, "bonuscurrency", f = /*activeBonus*/
      n[60].currency), t(e, "isWinBonus", c = /*activeBonus*/
      n[60].isWinBonus), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      ), t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        n[8]
      );
    },
    m(b, B) {
      j(b, e, B);
    },
    p(b, B) {
      B[0] & /*activeBonusesList*/
      524288 && o !== (o = /*activeBonus*/
      b[60].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), B[0] & /*activeBonusesList*/
      524288 && i !== (i = /*activeBonus*/
      b[60].termsandconditionsurl) && t(e, "termsandconditionsurl", i), B[0] & /*activeBonusesList*/
      524288 && s !== (s = /*activeBonus*/
      b[60].termsandconditionsasset) && t(e, "termsandconditionsasset", s), B[0] & /*activeBonusesList*/
      524288 && a !== (a = /*activeBonus*/
      b[60].endpoint) && t(e, "endpoint", a), B[0] & /*activeBonusesList*/
      524288 && l !== (l = /*activeBonus*/
      b[60].playerid) && t(e, "playerid", l), B[0] & /*activeBonusesList*/
      524288 && d !== (d = /*activeBonus*/
      b[60].session) && t(e, "session", d), B[0] & /*activeBonusesList*/
      524288 && u !== (u = /*activeBonus*/
      b[60].walletId) && t(e, "bonuswalletid", u), B[0] & /*activeBonusesList*/
      524288 && g !== (g = /*activeBonus*/
      b[60].granted) && t(e, "bonusdate", g), B[0] & /*activeBonusesList*/
      524288 && y !== (y = /*activeBonus*/
      b[60].expiryTime) && t(e, "bonusexpirationdate", y), B[0] & /*activeBonusesList*/
      524288 && M !== (M = /*activeBonus*/
      b[60].status) && t(e, "bonusstatus", M), B[0] & /*activeBonusesList*/
      524288 && A !== (A = /*activeBonus*/
      b[60].name) && t(e, "bonusname", A), B[0] & /*activeBonusesList*/
      524288 && v !== (v = /*activeBonus*/
      b[60].type) && t(e, "bonustype", v), B[0] & /*activeBonusesList*/
      524288 && h !== (h = /*activeBonus*/
      b[60].extension.grantedPlayerCurrencyAmount) && t(e, "bonusamount", h), B[0] & /*activeBonusesList*/
      524288 && w !== (w = `${/*activeBonus*/
      b[60].fulfilledWR} / ${/*activeBonus*/
      b[60].originalWageringRequirement}`) && t(e, "bonuswageringamount", w), B[0] & /*activeBonusesList*/
      524288 && C !== (C = /*activeBonus*/
      b[60].currentAmount) && t(e, "bonusremainingamount", C), B[0] & /*activeBonusesList*/
      524288 && f !== (f = /*activeBonus*/
      b[60].currency) && t(e, "bonuscurrency", f), B[0] & /*activeBonusesList*/
      524288 && c !== (c = /*activeBonus*/
      b[60].isWinBonus) && t(e, "isWinBonus", c), B[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        b[0]
      ), B[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        b[6]
      ), B[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        b[1]
      ), B[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        b[2]
      ), B[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        b[3]
      ), B[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        b[4]
      ), B[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        b[5]
      ), B[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        b[7]
      ), B[0] & /*filterbonusbalance*/
      256 && t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        b[8]
      );
    },
    d(b) {
      b && D(e);
    }
  };
}
function hn(n) {
  let e, o, i, s, a, l, d, u, g, y, M, A, v, h, w, C;
  return {
    c() {
      e = W("player-bonus-card"), t(e, "termsandconditionsdescription", o = /*activeBonus*/
      n[60].termsandconditionsdescription), t(e, "termsandconditionsurl", i = /*activeBonus*/
      n[60].termsandconditionsurl), t(e, "termsandconditionsasset", s = /*activeBonus*/
      n[60].termsandconditionsasset), t(e, "endpoint", a = /*activeBonus*/
      n[60].endpoint), t(e, "playerid", l = /*activeBonus*/
      n[60].playerid), t(e, "session", d = /*activeBonus*/
      n[60].session), t(e, "bonuswalletid", u = /*activeBonus*/
      n[60].walletId), t(e, "bonusdate", g = /*activeBonus*/
      n[60].granted), t(e, "bonusexpirationdate", y = /*activeBonus*/
      n[60].expiryTime), t(e, "bonusstatus", M = /*activeBonus*/
      n[60].status), t(e, "bonusname", A = /*activeBonus*/
      n[60].name), t(e, "bonustype", v = /*activeBonus*/
      n[60].type), t(e, "bonuscurrency", h = /*activeBonus*/
      n[60].currency), t(e, "bonusfreespins", w = /*activeBonus*/
      n[60].freeRoundNumber), t(e, "isWinBonus", C = /*activeBonus*/
      n[60].isWinBonus), t(
        e,
        "lang",
        /*lang*/
        n[0]
      ), t(
        e,
        "dateformat",
        /*dateformat*/
        n[6]
      ), t(
        e,
        "clientstyling",
        /*clientstyling*/
        n[1]
      ), t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        n[2]
      ), t(
        e,
        "mbsource",
        /*mbsource*/
        n[3]
      ), t(
        e,
        "translationurl",
        /*translationurl*/
        n[4]
      ), t(
        e,
        "currencylocale",
        /*currencylocale*/
        n[5]
      ), t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        n[7]
      ), t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        n[8]
      );
    },
    m(f, c) {
      j(f, e, c);
    },
    p(f, c) {
      c[0] & /*activeBonusesList*/
      524288 && o !== (o = /*activeBonus*/
      f[60].termsandconditionsdescription) && t(e, "termsandconditionsdescription", o), c[0] & /*activeBonusesList*/
      524288 && i !== (i = /*activeBonus*/
      f[60].termsandconditionsurl) && t(e, "termsandconditionsurl", i), c[0] & /*activeBonusesList*/
      524288 && s !== (s = /*activeBonus*/
      f[60].termsandconditionsasset) && t(e, "termsandconditionsasset", s), c[0] & /*activeBonusesList*/
      524288 && a !== (a = /*activeBonus*/
      f[60].endpoint) && t(e, "endpoint", a), c[0] & /*activeBonusesList*/
      524288 && l !== (l = /*activeBonus*/
      f[60].playerid) && t(e, "playerid", l), c[0] & /*activeBonusesList*/
      524288 && d !== (d = /*activeBonus*/
      f[60].session) && t(e, "session", d), c[0] & /*activeBonusesList*/
      524288 && u !== (u = /*activeBonus*/
      f[60].walletId) && t(e, "bonuswalletid", u), c[0] & /*activeBonusesList*/
      524288 && g !== (g = /*activeBonus*/
      f[60].granted) && t(e, "bonusdate", g), c[0] & /*activeBonusesList*/
      524288 && y !== (y = /*activeBonus*/
      f[60].expiryTime) && t(e, "bonusexpirationdate", y), c[0] & /*activeBonusesList*/
      524288 && M !== (M = /*activeBonus*/
      f[60].status) && t(e, "bonusstatus", M), c[0] & /*activeBonusesList*/
      524288 && A !== (A = /*activeBonus*/
      f[60].name) && t(e, "bonusname", A), c[0] & /*activeBonusesList*/
      524288 && v !== (v = /*activeBonus*/
      f[60].type) && t(e, "bonustype", v), c[0] & /*activeBonusesList*/
      524288 && h !== (h = /*activeBonus*/
      f[60].currency) && t(e, "bonuscurrency", h), c[0] & /*activeBonusesList*/
      524288 && w !== (w = /*activeBonus*/
      f[60].freeRoundNumber) && t(e, "bonusfreespins", w), c[0] & /*activeBonusesList*/
      524288 && C !== (C = /*activeBonus*/
      f[60].isWinBonus) && t(e, "isWinBonus", C), c[0] & /*lang*/
      1 && t(
        e,
        "lang",
        /*lang*/
        f[0]
      ), c[0] & /*dateformat*/
      64 && t(
        e,
        "dateformat",
        /*dateformat*/
        f[6]
      ), c[0] & /*clientstyling*/
      2 && t(
        e,
        "clientstyling",
        /*clientstyling*/
        f[1]
      ), c[0] & /*clientstylingurl*/
      4 && t(
        e,
        "clientstylingurl",
        /*clientstylingurl*/
        f[2]
      ), c[0] & /*mbsource*/
      8 && t(
        e,
        "mbsource",
        /*mbsource*/
        f[3]
      ), c[0] & /*translationurl*/
      16 && t(
        e,
        "translationurl",
        /*translationurl*/
        f[4]
      ), c[0] & /*currencylocale*/
      32 && t(
        e,
        "currencylocale",
        /*currencylocale*/
        f[5]
      ), c[0] & /*ishiddenwageringbonus*/
      128 && t(
        e,
        "ishiddenwageringbonus",
        /*ishiddenwageringbonus*/
        f[7]
      ), c[0] & /*filterbonusbalance*/
      256 && t(
        e,
        "filterbonusbalance",
        /*filterbonusbalance*/
        f[8]
      );
    },
    d(f) {
      f && D(e);
    }
  };
}
function We(n) {
  let e;
  function o(a, l) {
    return (
      /*activeBonus*/
      a[60].type === "freeRound" ? hn : yn
    );
  }
  let i = o(n), s = i(n);
  return {
    c() {
      s.c(), e = de();
    },
    m(a, l) {
      s.m(a, l), j(a, e, l);
    },
    p(a, l) {
      i === (i = o(a)) && s ? s.p(a, l) : (s.d(1), s = i(a), s && (s.c(), s.m(e.parentNode, e)));
    },
    d(a) {
      a && D(e), s.d(a);
    }
  };
}
function Ae(n) {
  let e, o, i, s, a, l, d, u, g, y, M, A, v, h, w, C, f, c, b, B, Y, K, X, U = se(Array(
    /*numberOfPages*/
    n[17]
  )), k = [];
  for (let m = 0; m < U.length; m += 1)
    k[m] = ke(Ce(n, U, m));
  return {
    c() {
      e = W("div"), o = W("button"), i = O("|<"), l = z(), d = W("button"), u = O("<"), M = z();
      for (let m = 0; m < k.length; m += 1)
        k[m].c();
      A = z(), v = W("button"), h = O(">"), f = z(), c = W("button"), b = O(">|"), o.disabled = s = /*currentPage*/
      n[18] === 0, _(o, "class", a = "BonusesFirst " + /*currentPage*/
      (n[18] === 0 ? "Inactive" : "")), d.disabled = g = /*currentPage*/
      n[18] === 0, _(d, "class", y = "BonusesPrev " + /*currentPage*/
      (n[18] === 0 ? "Inactive" : "")), v.disabled = w = /*currentPage*/
      n[18] === /*numberOfPages*/
      n[17] - 1, _(v, "class", C = "BonusesNext " + /*currentPage*/
      (n[18] === /*numberOfPages*/
      n[17] - 1 ? "Inactive" : "")), c.disabled = B = /*currentPage*/
      n[18] === /*numberOfPages*/
      n[17] - 1, _(c, "class", Y = "BonusesLast " + /*currentPage*/
      (n[18] === /*numberOfPages*/
      n[17] - 1 ? "Inactive" : "")), _(e, "class", "BonusesPaginationWrapper " + /*isMobile*/
      (n[22] ? "BonusesPaginationWrapperMobile" : ""));
    },
    m(m, T) {
      j(m, e, T), p(e, o), p(o, i), p(e, l), p(e, d), p(d, u), p(e, M);
      for (let S = 0; S < k.length; S += 1)
        k[S] && k[S].m(e, null);
      p(e, A), p(e, v), p(v, h), p(e, f), p(e, c), p(c, b), K || (X = [
        G(
          o,
          "click",
          /*click_handler_1*/
          n[38]
        ),
        G(
          d,
          "click",
          /*click_handler_2*/
          n[39]
        ),
        G(
          v,
          "click",
          /*click_handler_4*/
          n[41]
        ),
        G(
          c,
          "click",
          /*click_handler_5*/
          n[42]
        )
      ], K = !0);
    },
    p(m, T) {
      if (T[0] & /*currentPage*/
      262144 && s !== (s = /*currentPage*/
      m[18] === 0) && (o.disabled = s), T[0] & /*currentPage*/
      262144 && a !== (a = "BonusesFirst " + /*currentPage*/
      (m[18] === 0 ? "Inactive" : "")) && _(o, "class", a), T[0] & /*currentPage*/
      262144 && g !== (g = /*currentPage*/
      m[18] === 0) && (d.disabled = g), T[0] & /*currentPage*/
      262144 && y !== (y = "BonusesPrev " + /*currentPage*/
      (m[18] === 0 ? "Inactive" : "")) && _(d, "class", y), T[0] & /*currentPage, getActiveBonuses, numberOfPages*/
      33947648) {
        U = se(Array(
          /*numberOfPages*/
          m[17]
        ));
        let S;
        for (S = 0; S < U.length; S += 1) {
          const F = Ce(m, U, S);
          k[S] ? k[S].p(F, T) : (k[S] = ke(F), k[S].c(), k[S].m(e, A));
        }
        for (; S < k.length; S += 1)
          k[S].d(1);
        k.length = U.length;
      }
      T[0] & /*currentPage, numberOfPages*/
      393216 && w !== (w = /*currentPage*/
      m[18] === /*numberOfPages*/
      m[17] - 1) && (v.disabled = w), T[0] & /*currentPage, numberOfPages*/
      393216 && C !== (C = "BonusesNext " + /*currentPage*/
      (m[18] === /*numberOfPages*/
      m[17] - 1 ? "Inactive" : "")) && _(v, "class", C), T[0] & /*currentPage, numberOfPages*/
      393216 && B !== (B = /*currentPage*/
      m[18] === /*numberOfPages*/
      m[17] - 1) && (c.disabled = B), T[0] & /*currentPage, numberOfPages*/
      393216 && Y !== (Y = "BonusesLast " + /*currentPage*/
      (m[18] === /*numberOfPages*/
      m[17] - 1 ? "Inactive" : "")) && _(c, "class", Y);
    },
    d(m) {
      m && D(e), Se(k, m), K = !1, ue(X);
    }
  };
}
function ke(n) {
  let e, o = (
    /*i*/
    n[59] + 1 + ""
  ), i, s, a, l, d;
  function u() {
    return (
      /*click_handler_3*/
      n[40](
        /*i*/
        n[59]
      )
    );
  }
  return {
    c() {
      e = W("button"), i = O(o), e.disabled = s = /*i*/
      n[59] === /*currentPage*/
      n[18], _(e, "class", a = "BonusesPage " + /*i*/
      (n[59] === /*currentPage*/
      n[18] ? "BonusPageActive" : ""));
    },
    m(g, y) {
      j(g, e, y), p(e, i), l || (d = G(e, "click", u), l = !0);
    },
    p(g, y) {
      n = g, y[0] & /*currentPage*/
      262144 && s !== (s = /*i*/
      n[59] === /*currentPage*/
      n[18]) && (e.disabled = s), y[0] & /*currentPage*/
      262144 && a !== (a = "BonusesPage " + /*i*/
      (n[59] === /*currentPage*/
      n[18] ? "BonusPageActive" : "")) && _(e, "class", a);
    },
    d(g) {
      g && D(e), l = !1, d();
    }
  };
}
function Ee(n) {
  let e, o, i, s, a = (
    /*$_*/
    n[21]("forfeitBonus") + ""
  ), l, d, u, g, y = (
    /*$_*/
    n[21]("forfeitBonusCancel") + ""
  ), M, A, v, h = (
    /*$_*/
    n[21]("forfeitBonusConfirm") + ""
  ), w, C, f;
  return {
    c() {
      e = W("div"), o = W("div"), i = W("div"), s = W("p"), l = O(a), d = z(), u = W("div"), g = W("button"), M = O(y), A = z(), v = W("button"), w = O(h), _(s, "class", "ModalText"), _(g, "class", "ModalCancel"), _(v, "class", "ModalConfirm"), _(u, "class", "ModalButtons"), _(i, "class", "ModalBody"), _(o, "class", "ModalContent"), _(e, "class", "ModalWrapper " + /*isMobile*/
      (n[22] ? "ModalWrapperMobile" : ""));
    },
    m(c, b) {
      j(c, e, b), p(e, o), p(o, i), p(i, s), p(s, l), p(i, d), p(i, u), p(u, g), p(g, M), p(u, A), p(u, v), p(v, w), C || (f = [
        G(
          g,
          "click",
          /*closeBonusModal*/
          n[27]
        ),
        G(
          v,
          "click",
          /*debouncedFunction*/
          n[29](
            /*deleteBonus*/
            n[28]
          )
        )
      ], C = !0);
    },
    p(c, b) {
      b[0] & /*$_*/
      2097152 && a !== (a = /*$_*/
      c[21]("forfeitBonus") + "") && J(l, a), b[0] & /*$_*/
      2097152 && y !== (y = /*$_*/
      c[21]("forfeitBonusCancel") + "") && J(M, y), b[0] & /*$_*/
      2097152 && h !== (h = /*$_*/
      c[21]("forfeitBonusConfirm") + "") && J(w, h);
    },
    d(c) {
      c && D(e), C = !1, ue(f);
    }
  };
}
function Cn(n) {
  let e, o, i, s, a = (
    /*$_*/
    n[21]("titleBonuses") + ""
  ), l, d, u, g, y = (
    /*$_*/
    n[21]("bonusCode") + ""
  ), M, A, v, h, w, C, f = (
    /*$_*/
    n[21]("getBonus") + ""
  ), c, b, B, Y, K, X, U, k = (
    /*isMobile*/
    n[22] && bn(n)
  ), m = (
    /*invalidBonusCode*/
    n[12] && Me(n)
  );
  function T(E, R) {
    return (
      /*isLoading*/
      E[10] ? Bn : gn
    );
  }
  let S = T(n), F = S(n), I = (
    /*bonusModal*/
    n[20] && Ee(n)
  );
  return {
    c() {
      e = W("div"), o = W("div"), k && k.c(), i = z(), s = W("h2"), l = O(a), d = z(), u = W("div"), g = W("label"), M = O(y), A = z(), v = W("div"), h = W("input"), w = z(), C = W("button"), c = O(f), B = z(), m && m.c(), Y = z(), F.c(), K = z(), I && I.c(), _(s, "class", "ActiveBonusesTitle " + /*isMobile*/
      (n[22] ? "ActiveBonusesTitleNone" : "")), _(g, "for", "BonusCode"), _(h, "class", "BonusCodeInput " + /*isMobile*/
      (n[22] ? "BonusCodeInputMobile" : "")), _(h, "type", "text"), _(h, "id", "BonusCode"), _(C, "class", "SubmitBonusCode " + /*isMobile*/
      (n[22] ? "SubmitBonusCodeMobile" : "")), C.disabled = b = /*invalidBonusField*/
      n[11] || /*isLoading*/
      n[10], _(v, "class", "BonusCodeWrapper " + /*isMobile*/
      (n[22] ? "BonusCodeWrapperMobile" : "")), _(u, "class", "BonusCodeContainer " + /*isMobile*/
      (n[22] ? "BonusCodeContainerMobile" : "")), _(o, "class", "ActiveBonusesWrapper " + /*isMobile*/
      (n[22] ? "ActiveBonusesWrapperMobile" : ""));
    },
    m(E, R) {
      j(E, e, R), p(e, o), k && k.m(o, null), p(o, i), p(o, s), p(s, l), p(o, d), p(o, u), p(u, g), p(g, M), p(u, A), p(u, v), p(v, h), _e(
        h,
        /*bonusCode*/
        n[13]
      ), p(v, w), p(v, C), p(C, c), p(u, B), m && m.m(u, null), p(o, Y), F.m(o, null), p(e, K), I && I.m(e, null), n[43](e), X || (U = [
        G(
          h,
          "input",
          /*input_input_handler*/
          n[37]
        ),
        G(
          h,
          "keyup",
          /*validateBonusCode*/
          n[24]
        ),
        G(
          C,
          "click",
          /*claimBonus*/
          n[26]
        )
      ], X = !0);
    },
    p(E, R) {
      /*isMobile*/
      E[22] && k.p(E, R), R[0] & /*$_*/
      2097152 && a !== (a = /*$_*/
      E[21]("titleBonuses") + "") && J(l, a), R[0] & /*$_*/
      2097152 && y !== (y = /*$_*/
      E[21]("bonusCode") + "") && J(M, y), R[0] & /*bonusCode*/
      8192 && h.value !== /*bonusCode*/
      E[13] && _e(
        h,
        /*bonusCode*/
        E[13]
      ), R[0] & /*$_*/
      2097152 && f !== (f = /*$_*/
      E[21]("getBonus") + "") && J(c, f), R[0] & /*invalidBonusField, isLoading*/
      3072 && b !== (b = /*invalidBonusField*/
      E[11] || /*isLoading*/
      E[10]) && (C.disabled = b), /*invalidBonusCode*/
      E[12] ? m ? m.p(E, R) : (m = Me(E), m.c(), m.m(u, null)) : m && (m.d(1), m = null), S === (S = T(E)) && F ? F.p(E, R) : (F.d(1), F = S(E), F && (F.c(), F.m(o, null))), /*bonusModal*/
      E[20] ? I ? I.p(E, R) : (I = Ee(E), I.c(), I.m(e, null)) : I && (I.d(1), I = null);
    },
    i: le,
    o: le,
    d(E) {
      E && D(e), k && k.d(), m && m.d(), F.d(), I && I.d(), n[43](null), X = !1, ue(U);
    }
  };
}
let wn = "status=active", H = 6;
function Mn(n, e, o) {
  let i;
  $e(n, ln, (r) => o(21, i = r));
  let { endpoint: s = "" } = e, { session: a = "" } = e, { playerid: l = "" } = e, { lang: d = "en" } = e, { currency: u = "" } = e, { clientstyling: g = "" } = e, { clientstylingurl: y = "" } = e, { mbsource: M } = e, { translationurl: A = "" } = e, { currencylocale: v = "" } = e, { dateformat: h = "" } = e, { bonuscoderegex: w = "" } = e, { ishiddenwageringbonus: C = "false" } = e, { gmversion: f = "" } = e, { filterbonusbalance: c = "false" } = e, b = !1, B, Y, K = window.navigator.userAgent, X = en(K) !== "PC", U = !0, k = !1, m = "", T = 0, S = 0, F = 0, I = 0, E = 0, R = [], fe, te = "", ie = !1;
  const Pe = () => {
    fetch(A).then((P) => P.json()).then((P) => {
      Object.keys(P).forEach((q) => {
        ve(q, P[q]);
      });
    }).catch((P) => {
      console.log(P);
    });
  };
  Object.keys(ye).forEach((r) => {
    ve(r, ye[r]);
  });
  const me = (r) => {
    if (r.data)
      switch (r.data.type) {
        case "DeleteActiveBonus":
          te = r.data.bonuswalletid, o(20, ie = !0);
          break;
      }
  };
  function Te(r, P) {
    return (...q) => {
      clearTimeout(fe), fe = setTimeout(
        () => {
          r.apply(this, q);
        },
        P
      );
    };
  }
  const be = () => {
    window.postMessage(
      {
        type: "PlayerAccountMenuActive",
        isMobile: X
      },
      window.location.href
    );
  }, Ie = () => m ? w ? new RegExp(w).test(m) : !0 : !1, Fe = () => {
    o(11, U = !Ie()), w && o(12, k = U);
  };
  function Re(r) {
    const P = r.initialWagerRequirementAmount ?? 0, q = r.remainingWagerRequirementAmount ?? 0;
    return {
      ...r,
      freeRoundNumber: r.numberOfFreeSpin ?? void 0,
      walletId: r.bonusWalletID ?? void 0,
      granted: r.grantedDate ?? void 0,
      expiryTime: r.expiryDate ?? void 0,
      currentAmount: r.remainingAmount ?? void 0,
      originalWageringRequirement: r.initialWagerRequirementAmount ?? void 0,
      fulfilledWR: P - q,
      extension: {
        grantedPlayerCurrencyAmount: r.amount ?? void 0
      },
      termsandconditionsurl: r.url ?? void 0,
      termsandconditionsdescription: r.description ?? void 0,
      termsandconditionsasset: r.assets ?? void 0,
      isWinBonus: r?.tags?.includes("auto_apply") === !0 && r.type === dn.ODDS_BOOST
    };
  }
  const V = async (r) => {
    o(10, b = !0);
    try {
      let P = [], q = 0;
      if (f === "gm2") {
        console.log("getActiveBonuses - gm2", f);
        const L = {
          pagination: `limit=${H},offset=${r}`,
          language: d || "en",
          sortOrder: "desc",
          status: he.STATUS_ACTIVE,
          type: he.TYPES,
          expand: "freeSpin"
        };
        C === "true" && (L.includeHiddenWallet = !0);
        const Z = await fn(s, a, L), x = Z.items;
        Array.isArray(x) ? P = x.map(Re) : console.error("Unexpected granted bonuses payload", Z), q = Z.total ?? 0;
      } else {
        console.log("getActiveBonuses - /bonusWallet", f);
        const L = {
          method: "GET",
          headers: { "X-SessionId": a }
        }, Z = `/v1/player/${l}/bonusWallet`, x = new URL(`${s}${Z}`), re = new URLSearchParams();
        re.set("filter", wn), re.set("pagination", `offset=${r},limit=${H}`), x.search = re.toString();
        const $ = await (await fetch(x, L)).json();
        if (Array.isArray($.items)) {
          for (const ne of $.items) {
            const oe = ne?.extension?.bonus?.presentation;
            oe && (ne.termsandconditionsurl = oe.url, ne.termsandconditionsdescription = oe.description, ne.termsandconditionsasset = oe.assets);
          }
          P = $.items;
        } else
          console.error("Unexpected legacy bonus list payload", $);
        q = $.total ?? 0;
      }
      o(17, I = Math.ceil(q / H)), r - H >= 0 && o(14, T = r - H), r + H < q && o(15, S = r + H), o(16, F = (I - 1) * H), o(18, E = r / H), o(19, R = P), v && R.forEach((L) => {
        L.fulfilledWR = ee(L.fulfilledWR), L.originalWageringRequirement = ee(L.originalWageringRequirement), L.currentAmount = ee(L.currentAmount), L.extension && (L.extension.grantedPlayerCurrencyAmount = ee(L.extension.grantedPlayerCurrencyAmount));
      }), window.scrollTo({ top: 0, behavior: "smooth" });
    } catch (P) {
      console.error(P);
    } finally {
      o(10, b = !1);
    }
  }, ee = (r) => new Intl.NumberFormat(v, { style: "currency", currency: u }).format(r).replace(/\s/g, ""), ge = () => {
    console.log("post claim success, status 200"), o(12, k = !1), V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "success",
          message: i("bonusClaimSuccessMessage")
        }
      },
      window.location.href
    ), typeof gtag == "function" && gtag("event", "ClaimBonus", {
      context: "PlayerActiveBonuses",
      userId: `${l || "Not logged in"}`,
      bonusCode: `${m}`
    });
  }, Be = () => {
    o(12, k = !0), console.log("post claim error - status not 200"), window.postMessage(
      {
        type: "WidgetNotification",
        data: {
          type: "error",
          message: i("bonusClaimErrorMessage")
        }
      },
      window.location.href
    );
  }, Le = async () => {
    o(10, b = !0);
    try {
      if (f === "gm2") {
        if (!(await cn(s, a, { bonusCode: m, currency: u })).success) {
          Be();
          //!
          return;
        }
        ge();
        return;
      }
      const r = new URL(`${s}/v1/player/${l}/claimbonus`);
      r.searchParams.append("currency", u), r.searchParams.append("bonusCode", m);
      const P = {
        method: "POST",
        headers: {
          "X-SessionId": a,
          accept: "application/json"
        }
      };
      (await fetch(r.href, P)).status == 200 ? ge() : Be();
    } finally {
      o(10, b = !1);
    }
  }, ae = () => {
    window.postMessage({ type: "EnableScroll" }, window.location.href), o(20, ie = !1);
  }, Ne = async () => {
    if (f === "gm2") {
      if (!(await pn(s, a, { bonusWalletID: te })).success)
        return;
      V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ae();
      return;
    }
    const r = {
      method: "DELETE",
      headers: {
        "X-SessionId": a,
        "Content-Type": "application/json",
        Accept: "application/json"
      }
    }, P = new URL(`${s}/v1/player/${l}/bonusWallet`);
    P.searchParams.append("bonusWalletID", te), (await fetch(P, r)).status == 200 && (V(0), window.postMessage({ type: "ActiveBonusesUpdated" }, window.location.href), ae());
  }, ze = () => {
    un(d);
  };
  function Oe(r) {
    return Te(r, 1e3);
  }
  nn(() => (window.addEventListener("message", me, !1), () => {
    window.removeEventListener("message", me);
  }));
  const De = () => be();
  function je() {
    m = this.value, o(13, m);
  }
  const Ue = () => V(0), qe = () => V(T), Ge = (r) => V(r * H), Ve = () => V(S), He = () => V(F);
  function Ye(r) {
    on[r ? "unshift" : "push"](() => {
      B = r, o(9, B);
    });
  }
  return n.$$set = (r) => {
    "endpoint" in r && o(30, s = r.endpoint), "session" in r && o(31, a = r.session), "playerid" in r && o(32, l = r.playerid), "lang" in r && o(0, d = r.lang), "currency" in r && o(33, u = r.currency), "clientstyling" in r && o(1, g = r.clientstyling), "clientstylingurl" in r && o(2, y = r.clientstylingurl), "mbsource" in r && o(3, M = r.mbsource), "translationurl" in r && o(4, A = r.translationurl), "currencylocale" in r && o(5, v = r.currencylocale), "dateformat" in r && o(6, h = r.dateformat), "bonuscoderegex" in r && o(34, w = r.bonuscoderegex), "ishiddenwageringbonus" in r && o(7, C = r.ishiddenwageringbonus), "gmversion" in r && o(35, f = r.gmversion), "filterbonusbalance" in r && o(8, c = r.filterbonusbalance);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*lang*/
    1 && d && ze(), n.$$.dirty[0] & /*endpoint*/
    1073741824 | n.$$.dirty[1] & /*session, playerid*/
    3 && a && l && s && V(0), n.$$.dirty[0] & /*clientstyling, customStylingContainer*/
    514 && g && B && sn(B, g), n.$$.dirty[0] & /*clientstylingurl, customStylingContainer*/
    516 && y && B && tn(B, y), n.$$.dirty[0] & /*mbsource, customStylingContainer*/
    520 && M && B && an(B, `${M}.Style`, Y), n.$$.dirty[0] & /*translationurl*/
    16 && A && Pe();
  }, [
    d,
    g,
    y,
    M,
    A,
    v,
    h,
    C,
    c,
    B,
    b,
    U,
    k,
    m,
    T,
    S,
    F,
    I,
    E,
    R,
    ie,
    i,
    X,
    be,
    Fe,
    V,
    Le,
    ae,
    Ne,
    Oe,
    s,
    a,
    l,
    u,
    w,
    f,
    De,
    je,
    Ue,
    qe,
    Ge,
    Ve,
    He,
    Ye
  ];
}
class Wn extends Ke {
  constructor(e) {
    super(), Qe(
      this,
      e,
      Mn,
      Cn,
      Ze,
      {
        endpoint: 30,
        session: 31,
        playerid: 32,
        lang: 0,
        currency: 33,
        clientstyling: 1,
        clientstylingurl: 2,
        mbsource: 3,
        translationurl: 4,
        currencylocale: 5,
        dateformat: 6,
        bonuscoderegex: 34,
        ishiddenwageringbonus: 7,
        gmversion: 35,
        filterbonusbalance: 8
      },
      mn,
      [-1, -1, -1]
    );
  }
  get endpoint() {
    return this.$$.ctx[30];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), N();
  }
  get session() {
    return this.$$.ctx[31];
  }
  set session(e) {
    this.$$set({ session: e }), N();
  }
  get playerid() {
    return this.$$.ctx[32];
  }
  set playerid(e) {
    this.$$set({ playerid: e }), N();
  }
  get lang() {
    return this.$$.ctx[0];
  }
  set lang(e) {
    this.$$set({ lang: e }), N();
  }
  get currency() {
    return this.$$.ctx[33];
  }
  set currency(e) {
    this.$$set({ currency: e }), N();
  }
  get clientstyling() {
    return this.$$.ctx[1];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), N();
  }
  get clientstylingurl() {
    return this.$$.ctx[2];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), N();
  }
  get mbsource() {
    return this.$$.ctx[3];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), N();
  }
  get translationurl() {
    return this.$$.ctx[4];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), N();
  }
  get currencylocale() {
    return this.$$.ctx[5];
  }
  set currencylocale(e) {
    this.$$set({ currencylocale: e }), N();
  }
  get dateformat() {
    return this.$$.ctx[6];
  }
  set dateformat(e) {
    this.$$set({ dateformat: e }), N();
  }
  get bonuscoderegex() {
    return this.$$.ctx[34];
  }
  set bonuscoderegex(e) {
    this.$$set({ bonuscoderegex: e }), N();
  }
  get ishiddenwageringbonus() {
    return this.$$.ctx[7];
  }
  set ishiddenwageringbonus(e) {
    this.$$set({ ishiddenwageringbonus: e }), N();
  }
  get gmversion() {
    return this.$$.ctx[35];
  }
  set gmversion(e) {
    this.$$set({ gmversion: e }), N();
  }
  get filterbonusbalance() {
    return this.$$.ctx[8];
  }
  set filterbonusbalance(e) {
    this.$$set({ filterbonusbalance: e }), N();
  }
}
rn(Wn, { endpoint: {}, session: {}, playerid: {}, lang: {}, currency: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {}, translationurl: {}, currencylocale: {}, dateformat: {}, bonuscoderegex: {}, ishiddenwageringbonus: {}, gmversion: {}, filterbonusbalance: {} }, [], [], !0);
export {
  Wn as default
};
