@everymatrix/casino-tournament-banner 1.19.5 → 1.19.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,11 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-743ee8f8.js');
6
- require('@everymatrix/casino-tournament-buttons');
7
6
 
8
- const DEFAULT_LANGUAGE = 'en';
9
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
10
- const TRANSLATIONS = {
7
+ const DEFAULT_LANGUAGE$1 = 'en';
8
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
9
+ const TRANSLATIONS$1 = {
11
10
  en: {
12
11
  joined: 'Joined',
13
12
  join: 'Join',
@@ -316,9 +315,9 @@ const TRANSLATIONS = {
316
315
  joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
317
316
  }
318
317
  };
319
- const translate = (key, customLang) => {
318
+ const translate$1 = (key, customLang) => {
320
319
  const lang = customLang;
321
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
320
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
322
321
  };
323
322
 
324
323
  //! moment.js
@@ -6027,14 +6026,14 @@ const CasinoTournamentBanner = class {
6027
6026
  let currentDate = new Date(this.startTime);
6028
6027
  const setTranslation = () => {
6029
6028
  return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6030
- translate('startedAt', this.language) :
6031
- translate('startingAt', this.language);
6029
+ translate$1('startedAt', this.language) :
6030
+ translate$1('startingAt', this.language);
6032
6031
  };
6033
6032
  if (this.shortStart) {
6034
6033
  let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6035
6034
  this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6036
- translate('startedAtWithTime', this.language) + startTimeAsString :
6037
- translate('startingAtWithTime', this.language) + startTimeAsString;
6035
+ translate$1('startedAtWithTime', this.language) + startTimeAsString :
6036
+ translate$1('startingAtWithTime', this.language) + startTimeAsString;
6038
6037
  }
6039
6038
  else {
6040
6039
  let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
@@ -6042,7 +6041,7 @@ const CasinoTournamentBanner = class {
6042
6041
  let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6043
6042
  this.startdate =
6044
6043
  `${currentDay}` + ' ' +
6045
- translate(`${currentMonthKey}`, this.language) + ', ' +
6044
+ translate$1(`${currentMonthKey}`, this.language) + ', ' +
6046
6045
  setTranslation() +
6047
6046
  ` ${currentHour}`;
6048
6047
  }
@@ -6065,16 +6064,16 @@ const CasinoTournamentBanner = class {
6065
6064
  let text = '';
6066
6065
  switch (state) {
6067
6066
  case 'Upcoming':
6068
- text = translate('scheduled', this.language);
6067
+ text = translate$1('scheduled', this.language);
6069
6068
  break;
6070
6069
  case 'Unstarted':
6071
- text = translate('scheduled', this.language);
6070
+ text = translate$1('scheduled', this.language);
6072
6071
  break;
6073
6072
  case 'Running':
6074
- text = translate('ongoing', this.language);
6073
+ text = translate$1('ongoing', this.language);
6075
6074
  break;
6076
6075
  default:
6077
- text = translate('finished', this.language);
6076
+ text = translate$1('finished', this.language);
6078
6077
  break;
6079
6078
  }
6080
6079
  return text;
@@ -6105,15 +6104,500 @@ const CasinoTournamentBanner = class {
6105
6104
  index.h("span", { class: "Tag Date" }, this.showCalendar &&
6106
6105
  index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), index.h("div", { class: "BannerInfo", part: "BannerInfo" }, this.enrolled &&
6107
6106
  index.h("span", { class: "Tag Enroll" }, this.showCheck &&
6108
- index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('enrolled', this.language)))), this.cardMode && index.h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, index.h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate('tournament', this.language)), index.h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), index.h("div", { class: "ThumbState" }, this.enrolled ?
6109
- index.h("span", { class: "Tag Join" }, index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('joined', this.language))
6107
+ index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('enrolled', this.language)))), this.cardMode && index.h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, index.h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), index.h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), index.h("div", { class: "ThumbState" }, this.enrolled ?
6108
+ index.h("span", { class: "Tag Join" }, index.h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, index.h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('joined', this.language))
6110
6109
  :
6111
6110
  this.state != 'Closed' &&
6112
- index.h("span", { class: "Tag Join" }, index.h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, index.h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate('join', this.language)), this.state == 'Running' && index.h("span", { class: `Tag State ${this.state}` }, this.stateText), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6111
+ index.h("span", { class: "Tag Join" }, index.h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, index.h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate$1('join', this.language)), this.state == 'Running' && index.h("span", { class: `Tag State ${this.state}` }, this.stateText), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6113
6112
  index.h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6114
- index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), index.h("div", { class: "ThumbButtons" }, index.h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6113
+ index.h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), index.h("div", { class: "ThumbButtons" }, index.h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6115
6114
  }
6116
6115
  };
6117
6116
  CasinoTournamentBanner.style = casinoTournamentBannerCss;
6118
6117
 
6118
+ const getDevice = () => {
6119
+ let userAgent = window.navigator.userAgent;
6120
+ if (userAgent.toLowerCase().match(/android/i)) {
6121
+ return 'Android';
6122
+ }
6123
+ if (userAgent.toLowerCase().match(/iphone/i)) {
6124
+ return 'iPhone';
6125
+ }
6126
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
6127
+ return 'iPad';
6128
+ }
6129
+ return 'PC';
6130
+ };
6131
+
6132
+ const DEFAULT_LANGUAGE = 'en';
6133
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
6134
+ const TRANSLATIONS = {
6135
+ en: {
6136
+ joined: 'Joined',
6137
+ join: 'Join',
6138
+ enrolled: 'Enrolled',
6139
+ scoreCriteria: 'Score Criteria',
6140
+ minbet: 'min bet count',
6141
+ seegames: 'You can see the games',
6142
+ here: 'here',
6143
+ scheduled: 'Scheduled',
6144
+ ongoing: 'Ongoing',
6145
+ finished: 'Finished',
6146
+ startingAt: 'Starting at:',
6147
+ startedAt: 'Started at:',
6148
+ startingAtWithTime: `Starts `,
6149
+ startedAtWithTime: `Started `,
6150
+ mostRounds: 'Most Rounds',
6151
+ betCount: 'Number of Bets',
6152
+ maxWinStakeRatio: 'Max Win per Stake',
6153
+ winStakeRatio: 'Total Win per Stake',
6154
+ January: 'January',
6155
+ February: 'February',
6156
+ March: 'March',
6157
+ April: 'April',
6158
+ May: 'May',
6159
+ June: 'June',
6160
+ July: 'July',
6161
+ August: 'August',
6162
+ September: 'September',
6163
+ October: 'October',
6164
+ November: 'November',
6165
+ December: 'December',
6166
+ login: 'Log in',
6167
+ register: 'Register',
6168
+ details: 'Details',
6169
+ joinerror: 'An error occurred while registering in the tournament, please try again.'
6170
+ },
6171
+ 'zh-hk': {
6172
+ enrolled: '已註冊',
6173
+ scoreCriteria: '評分標準',
6174
+ minbet: '最小投注數:',
6175
+ seegames: '你可以看比賽',
6176
+ here: '這裡',
6177
+ scheduled: '預定的',
6178
+ ongoing: '進行中',
6179
+ finished: '完成的',
6180
+ startingAt: '開始於',
6181
+ startedAt: '大多數回合',
6182
+ mostRounds: '投注數',
6183
+ betCount: '投注计数',
6184
+ maxWinStakeRatio: '最大勝率',
6185
+ winStakeRatio: '勝率',
6186
+ January: '一月',
6187
+ February: '二月',
6188
+ March: '行进',
6189
+ April: '四月',
6190
+ May: '可能',
6191
+ June: '六月',
6192
+ July: '七月',
6193
+ August: '八月',
6194
+ September: '九月',
6195
+ October: '十月',
6196
+ November: '十一月',
6197
+ December: '十二月',
6198
+ login: '登錄',
6199
+ register: '登記',
6200
+ details: '細節',
6201
+ join: '加入',
6202
+ joinerror: '加入錦標賽時出錯,請重試'
6203
+ },
6204
+ fr: {
6205
+ enrolled: 'Inscrits',
6206
+ scoreCriteria: 'Critères de notation',
6207
+ minbet: 'nombre de paris minimum',
6208
+ seegames: 'Vous pouvez voir les jeux',
6209
+ here: 'ici',
6210
+ scheduled: 'Programmé',
6211
+ ongoing: 'En cours',
6212
+ finished: 'Fini',
6213
+ startingAt: 'À partir de:',
6214
+ startedAt: 'Commencé à:',
6215
+ mostRounds: 'Le plus grand nombre de tours',
6216
+ betCount: 'Nombre de paris',
6217
+ maxWinStakeRatio: 'Indice maximum du gain d\'une mise',
6218
+ winStakeRatio: 'Indice du gain d\'une mise',
6219
+ January: 'January',
6220
+ February: 'February',
6221
+ March: 'March',
6222
+ April: 'April',
6223
+ May: 'May',
6224
+ June: 'June',
6225
+ July: 'July',
6226
+ August: 'August',
6227
+ September: 'September',
6228
+ October: 'October',
6229
+ November: 'November',
6230
+ December: 'December',
6231
+ login: 'Connexion',
6232
+ register: 'Enregistre',
6233
+ details: 'Détails',
6234
+ join: 'Rejoignez',
6235
+ joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
6236
+ },
6237
+ ro: {
6238
+ enrolled: 'Înscris',
6239
+ scoreCriteria: 'Criterii de punctaj',
6240
+ minbet: 'număr minim de pariuri',
6241
+ seegames: 'Vezi jocurile',
6242
+ here: 'aici',
6243
+ scheduled: 'Programat',
6244
+ ongoing: 'În desfășurare',
6245
+ finished: 'Finalizat',
6246
+ startingAt: 'Începând de la',
6247
+ startedAt: 'A inceput la:',
6248
+ startingAtWithTime: 'Începând de',
6249
+ startedAtWithTime: 'A inceput:',
6250
+ mostRounds: 'Cele mai multe runde',
6251
+ betCount: 'Număr de pariuri',
6252
+ maxWinStakeRatio: 'Pondere maximă a mizei din câștig',
6253
+ winStakeRatio: 'Câștig Total per Miză',
6254
+ January: 'Ianuarie',
6255
+ February: 'Februarie',
6256
+ March: 'Martie',
6257
+ April: 'Aprilie',
6258
+ May: 'Mai',
6259
+ June: 'Iunie',
6260
+ July: 'Iulie',
6261
+ August: 'August',
6262
+ September: 'Septembrie',
6263
+ October: 'Octombrie',
6264
+ November: 'Noiembrie',
6265
+ December: 'Decembrie',
6266
+ login: 'Autentificare',
6267
+ register: 'Înregistrare',
6268
+ details: 'Detalii',
6269
+ join: 'Participă',
6270
+ joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
6271
+ },
6272
+ tr: {
6273
+ enrolled: 'Katıldın',
6274
+ scoreCriteria: 'Skor kriteri',
6275
+ minbet: 'en düşük bahis sayısı',
6276
+ seegames: 'Turnuvadaki oyunları görmek için',
6277
+ here: 'tıklayın',
6278
+ scheduled: 'Planlanmış',
6279
+ ongoing: 'Devam Eden',
6280
+ finished: 'Sona Ermiş',
6281
+ startingAt: 'Başlangıç saati:',
6282
+ startedAt: 'Başlangıç saati:',
6283
+ mostRounds: 'ÇoğuRounds',
6284
+ betCount: 'Oynanan Tur Sayısı',
6285
+ maxWinStakeRatio: 'Maksimum Kazanç / Bahis Oranı',
6286
+ winStakeRatio: 'Kazanç / Bahis Oranı',
6287
+ January: 'Ocak',
6288
+ February: 'Şubat',
6289
+ March: 'Mart',
6290
+ April: 'Nisan',
6291
+ May: 'Mayıs',
6292
+ June: 'Haziran',
6293
+ July: 'Temmuz',
6294
+ August: 'Ağustos',
6295
+ September: 'Eylül',
6296
+ October: 'Ekim',
6297
+ November: 'Kasım',
6298
+ December: 'Aralık',
6299
+ login: 'Giriş',
6300
+ register: 'Kayıt Ol',
6301
+ details: 'Detaylar',
6302
+ join: 'Katıl',
6303
+ joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
6304
+ },
6305
+ el: {
6306
+ enrolled: 'Εγγεγραμμένος',
6307
+ scoreCriteria: 'Κριτήρια Σκορ',
6308
+ minbet: 'Ελάχιστος αριθμός πονταρισμάτων',
6309
+ seegames: 'Μπορείς να δεις τα παιχνίδια',
6310
+ here: 'εδώ',
6311
+ all: 'Όλα',
6312
+ scheduled: 'Προγραμματισμένα',
6313
+ ongoing: 'Τρέχοντα',
6314
+ finished: 'Ολοκληρωμένα',
6315
+ startingAt: 'Αρχίζει στις:',
6316
+ startedAt: 'Άρχισε στις:',
6317
+ startingAtWithTime: `Αρχίζει στις `,
6318
+ startedAtWithTime: `Άρχισε στις `,
6319
+ mostRounds: 'Οι περισσότεροι γύροι',
6320
+ betCount: 'Οι περισσότεροι γύροι',
6321
+ maxWinStakeRatio: 'Μεγαλύτερο Κέρδος άνα Ποντάρισμα',
6322
+ winStakeRatio: 'Συνολική Αναλογία Κερδών άνα Ποντάρισμα',
6323
+ January: 'Ιανουαρίου',
6324
+ February: 'Φεβρουαρίου',
6325
+ March: 'Μαρτίου',
6326
+ April: 'Απριλίου',
6327
+ May: 'Μαΐου',
6328
+ June: 'Ιουνίου',
6329
+ July: 'Ιουλίου',
6330
+ August: 'Αυγούστου',
6331
+ September: 'Σεπτεμβρίου',
6332
+ October: 'Οκτωβρίου',
6333
+ November: 'Νοεμβρίου',
6334
+ December: 'Δεκεμβρίου',
6335
+ login: 'Είσοδος',
6336
+ register: 'Εγγραφή',
6337
+ details: 'Λεπτομέρειες',
6338
+ join: 'Συμμετοχή',
6339
+ joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
6340
+ },
6341
+ es: {
6342
+ enrolled: 'Inscrito',
6343
+ scoreCriteria: 'Criterios de puntuación',
6344
+ minbet: 'la apuesta mínima cuenta',
6345
+ seegames: 'Puedes ver los juegos',
6346
+ here: 'aquí',
6347
+ scheduled: 'Programado',
6348
+ ongoing: 'En marcha',
6349
+ finished: 'Terminado',
6350
+ startingAt: 'Desde',
6351
+ startedAt: 'Empezó el:',
6352
+ mostRounds: 'LaMayoríaDeLasRondas',
6353
+ betCount: 'Recuento De Apuestas',
6354
+ maxWinStakeRatio: 'Ratio De Ganancia Máxima',
6355
+ winStakeRatio: 'Ratio De Ganancia',
6356
+ January: 'de enero',
6357
+ February: 'de febrero',
6358
+ March: 'de marzo',
6359
+ April: 'de abril',
6360
+ May: 'de mayo',
6361
+ June: 'de junio',
6362
+ July: 'de julio',
6363
+ August: 'de agosto',
6364
+ September: 'de septiembre',
6365
+ October: 'de octubre',
6366
+ November: 'de noviembre',
6367
+ December: 'de diciembre',
6368
+ login: 'Iniciar sesión',
6369
+ register: 'Regístrate',
6370
+ details: 'Detalles',
6371
+ join: 'Unirse',
6372
+ joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
6373
+ },
6374
+ pt: {
6375
+ enrolled: 'Inscrito',
6376
+ scoreCriteria: 'Critérios de pontuação',
6377
+ minbet: 'Contagens de aposta mínima',
6378
+ seegames: 'Você pode ver os jogos',
6379
+ here: 'Aqui',
6380
+ scheduled: 'Agendado',
6381
+ ongoing: 'Em progresso',
6382
+ finished: 'Finalizado',
6383
+ startingAt: 'Começando às:',
6384
+ startedAt: 'Começou às:',
6385
+ mostRounds: 'Mais rodadas',
6386
+ betCount: 'Contagem de Apostas',
6387
+ maxWinStakeRatio: 'Rácio máximo de vitórias',
6388
+ winStakeRatio: 'Rácio de Vitórias',
6389
+ January: 'January',
6390
+ February: 'February',
6391
+ March: 'March',
6392
+ April: 'April',
6393
+ May: 'May',
6394
+ June: 'June',
6395
+ July: 'July',
6396
+ August: 'August',
6397
+ September: 'September',
6398
+ October: 'October',
6399
+ November: 'November',
6400
+ December: 'December',
6401
+ login: 'Entrar',
6402
+ register: 'Registro',
6403
+ details: 'Detalhes',
6404
+ join: 'Junte-se',
6405
+ joinerror: 'Ocorreu um erro ao entrar no torneio -'
6406
+ },
6407
+ hu: {
6408
+ enrolled: 'Feliratkozott',
6409
+ scoreCriteria: 'Pontozási kritériumok',
6410
+ minbet: 'Minimális tét',
6411
+ seegames: 'Játékok megnézése',
6412
+ here: 'itt',
6413
+ scheduled: 'Ütemezés',
6414
+ ongoing: 'Folyamatban lévő',
6415
+ finished: 'Befejezett',
6416
+ startingAt: 'Kezdődik',
6417
+ startedAt: 'Started at:',
6418
+ mostRounds: 'Legtöbb kör',
6419
+ betCount: 'Számított tét',
6420
+ maxWinStakeRatio: 'Maximális nyeremény tétenként',
6421
+ winStakeRatio: 'Összes nyeremény tétenként',
6422
+ January: 'January',
6423
+ February: 'February',
6424
+ March: 'March',
6425
+ April: 'April',
6426
+ May: 'May',
6427
+ June: 'June',
6428
+ July: 'July',
6429
+ August: 'August',
6430
+ September: 'September',
6431
+ October: 'October',
6432
+ November: 'November',
6433
+ December: 'December',
6434
+ login: 'Bejelentkezés',
6435
+ register: 'Regisztráció',
6436
+ details: 'Adatok',
6437
+ join: 'Csatlakozás',
6438
+ joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
6439
+ }
6440
+ };
6441
+ const translate = (key, customLang) => {
6442
+ const lang = customLang;
6443
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
6444
+ };
6445
+
6446
+ const casinoTournamentButtonsCss = ":host{display:block}.ButtonGroup{display:flex;gap:4px}.Button{padding:6px 8px;border-radius:2px;border:1px solid #fff;color:#fff;background:none;position:relative;cursor:pointer}.Button.NoBorder{border:0;padding:7px 8px}.Button::after{content:\"\";display:block;position:absolute;border-radius:2px;left:0;top:0;width:100%;height:100%;opacity:0;transition:all 0.5s;box-shadow:0 0 10px 10px white}.Button:active::after{box-shadow:0 0 0 0 white;position:absolute;border-radius:2px;left:0;top:0;opacity:1;transition:0s}.Button:active{top:1px}";
6447
+
6448
+ const CasinoTournamentButtons = class {
6449
+ constructor(hostRef) {
6450
+ index.registerInstance(this, hostRef);
6451
+ this.enrolled = false;
6452
+ this.showReadMore = false;
6453
+ this.clientStyling = '';
6454
+ this.clientStylingUrl = '';
6455
+ this.limitStylingAppends = false;
6456
+ this.joinButtonLoading = false;
6457
+ this.errorJoin = false;
6458
+ this.errorJoinConcurrently = false;
6459
+ this.setClientStyling = () => {
6460
+ let sheet = document.createElement('style');
6461
+ sheet.innerHTML = this.clientStyling;
6462
+ this.stylingContainer.prepend(sheet);
6463
+ };
6464
+ this.setClientStylingURL = () => {
6465
+ let cssFile = document.createElement('style');
6466
+ setTimeout(() => {
6467
+ cssFile.innerHTML = this.clientStylingUrl;
6468
+ this.stylingContainer.prepend(cssFile);
6469
+ }, 1);
6470
+ };
6471
+ }
6472
+ componentDidRender() {
6473
+ if (!this.limitStylingAppends && this.stylingContainer) {
6474
+ if (this.clientStyling)
6475
+ this.setClientStyling();
6476
+ if (this.clientStylingUrl)
6477
+ this.setClientStylingURL();
6478
+ this.limitStylingAppends = true;
6479
+ }
6480
+ }
6481
+ loginAction() {
6482
+ if (this.loginEvent) {
6483
+ window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
6484
+ // @ts-ignore Analytics event
6485
+ if (typeof gtag == 'function') {
6486
+ // @ts-ignore
6487
+ gtag('event', 'OpenLoginModal', {
6488
+ 'context': 'TournamentsThumbnailController'
6489
+ });
6490
+ }
6491
+ }
6492
+ if (this.loginUrl) {
6493
+ location.href = this.loginUrl;
6494
+ }
6495
+ }
6496
+ registerAction() {
6497
+ if (this.registerEvent) {
6498
+ window.postMessage({ type: this.registerEvent, transition: 'Register' }, window.location.href);
6499
+ //@ts-ignoreAnalytics event
6500
+ if (typeof gtag == 'function') {
6501
+ //@ts-ignore
6502
+ gtag('event', 'OpenRegisterModal', {
6503
+ 'context': 'TournamentsThumbnailController'
6504
+ });
6505
+ }
6506
+ }
6507
+ if (this.registerUrl) {
6508
+ location.href = this.registerUrl;
6509
+ }
6510
+ }
6511
+ async joinAction(tournamentId, bonuscode) {
6512
+ var _a;
6513
+ this.errorJoin = false;
6514
+ this.errorJoinConcurrently = false;
6515
+ window.postMessage({ type: 'TournamentJoinRequest', tournamentId }, window.location.href);
6516
+ this.joinButtonLoading = true;
6517
+ let joinUrl = new URL(`${this.endpoint}/bonus/claim`);
6518
+ let reqHeaders = new Headers();
6519
+ let body = {};
6520
+ joinUrl.searchParams.append('language', this.language);
6521
+ joinUrl.searchParams.append('platform', getDevice());
6522
+ reqHeaders.append('Content-Type', 'application/json');
6523
+ reqHeaders.append("X-SessionID", this.session);
6524
+ if (bonuscode) {
6525
+ body = {
6526
+ language: this.language,
6527
+ bonusCode: bonuscode,
6528
+ currency: this.currency
6529
+ };
6530
+ }
6531
+ let requestOptions = {
6532
+ method: 'PUT',
6533
+ headers: reqHeaders,
6534
+ body: JSON.stringify(body),
6535
+ };
6536
+ const handlerOnSuccess = () => {
6537
+ this.joinButtonLoading = false;
6538
+ this.enrolled = true;
6539
+ window.postMessage({ type: 'TournamentUserEnrolled', userenrolled: this.enrolled }, window.location.href);
6540
+ };
6541
+ const handlerOnFail = () => {
6542
+ this.joinButtonLoading = false;
6543
+ this.errorJoin = true;
6544
+ };
6545
+ const fetcher = async () => {
6546
+ let result;
6547
+ try {
6548
+ result = await fetch(`${this.endpoint}/bonus/claim?${joinUrl.searchParams.toString()}`, requestOptions);
6549
+ result = await result.json();
6550
+ }
6551
+ catch (e) {
6552
+ handlerOnFail();
6553
+ }
6554
+ return result;
6555
+ };
6556
+ const data = await fetcher();
6557
+ if (!data)
6558
+ return;
6559
+ if (data.success == true) {
6560
+ handlerOnSuccess();
6561
+ }
6562
+ else {
6563
+ if (data.errorMessage.match("VersionMismatchException")) {
6564
+ let resultDoubleCheck;
6565
+ resultDoubleCheck = await fetch(`${this.endpoint}/tournaments/${this.tournamentId}`, {
6566
+ headers: {
6567
+ 'X-SessionID': this.session
6568
+ }
6569
+ });
6570
+ resultDoubleCheck = await resultDoubleCheck.json();
6571
+ if ((_a = resultDoubleCheck === null || resultDoubleCheck === void 0 ? void 0 : resultDoubleCheck.item) === null || _a === void 0 ? void 0 : _a.playerEnrolled) {
6572
+ handlerOnSuccess();
6573
+ }
6574
+ else {
6575
+ handlerOnFail();
6576
+ this.errorJoinConcurrently = true;
6577
+ this.errorJoin = false;
6578
+ }
6579
+ }
6580
+ else {
6581
+ handlerOnFail();
6582
+ }
6583
+ }
6584
+ }
6585
+ detailAction(tournamentId) {
6586
+ window.postMessage({ type: 'TournamentDetailsClicked', tournamentId, showLeaderboard: true }, window.location.href);
6587
+ }
6588
+ moreAction(tournamentId) {
6589
+ window.postMessage({ type: 'TournamentReadMoreClicked', tournamentId }, window.location.href);
6590
+ }
6591
+ render() {
6592
+ return index.h("div", { ref: el => this.stylingContainer = el, class: "TournamentButtons" }, !this.session &&
6593
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "LoginButton Button", part: "LoginButton", onClick: () => this.loginAction() }, translate('login', this.language)), index.h("button", { class: "RegisterButton Button", part: "RegisterButton", onClick: () => this.registerAction() }, translate('register', this.language))), this.session &&
6594
+ index.h("div", null, !this.enrolled &&
6595
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "Button", onClick: () => this.joinAction(this.tournamentId, this.bonusCode) }, translate('join', this.language)), this.showReadMore && index.h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, "Read more")), this.enrolled &&
6596
+ index.h("div", { class: "ButtonGroup" }, index.h("button", { class: "Button", onClick: () => this.detailAction(this.tournamentId) }, translate('details', this.language)), this.showReadMore && index.h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, "Read more"))), (this.errorJoin || this.errorJoinConcurrently) &&
6597
+ index.h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6598
+ }
6599
+ };
6600
+ CasinoTournamentButtons.style = casinoTournamentButtonsCss;
6601
+
6119
6602
  exports.casino_tournament_banner = CasinoTournamentBanner;
6603
+ exports.casino_tournament_buttons = CasinoTournamentButtons;
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["casino-tournament-banner.cjs",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]]]]], options);
17
+ return index.bootstrapLazy([["casino-tournament-banner_2.cjs",[[1,"casino-tournament-banner",{"useEvent":[1,"use-event"],"state":[1],"enrolled":[4],"startTime":[1,"start-time"],"thumbnail":[1],"language":[1],"showCalendar":[4,"show-calendar"],"shortStart":[4,"short-start"],"shortstartformat":[1],"showDate":[4,"show-date"],"showCheck":[4,"show-check"],"cardMode":[4,"card-mode"],"nameOrTitle":[1,"name-or-title"],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"stateText":[32],"limitStylingAppends":[32],"stylingContainer":[32],"startdate":[32]},[[8,"getTournamentInfoCompleted","infoCompletedHandler"]]],[1,"casino-tournament-buttons",{"language":[1],"tournamentId":[1,"tournament-id"],"session":[1],"loginEvent":[1,"login-event"],"loginUrl":[1,"login-url"],"registerEvent":[1,"register-event"],"registerUrl":[1,"register-url"],"endpoint":[1],"currency":[1],"bonusCode":[1,"bonus-code"],"enrolled":[4],"showReadMore":[4,"show-read-more"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"limitStylingAppends":[32],"stylingContainer":[32],"joinButtonLoading":[32],"errorJoin":[32],"errorJoinConcurrently":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -7,6 +7,13 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/casino-tournament-buttons",
13
+ "tags": [
14
+ "casino-tournament-buttons"
15
+ ]
16
+ }
17
+ ],
11
18
  "bundles": []
12
19
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import '@everymatrix/casino-tournament-buttons';
2
+ import { d as defineCustomElement$2 } from './casino-tournament-buttons2.js';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
5
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'zh-hk', 'fr', 'hu', 'tr', 'el', 'es', 'pt'];
@@ -6147,13 +6147,18 @@ function defineCustomElement$1() {
6147
6147
  if (typeof customElements === "undefined") {
6148
6148
  return;
6149
6149
  }
6150
- const components = ["casino-tournament-banner"];
6150
+ const components = ["casino-tournament-banner", "casino-tournament-buttons"];
6151
6151
  components.forEach(tagName => { switch (tagName) {
6152
6152
  case "casino-tournament-banner":
6153
6153
  if (!customElements.get(tagName)) {
6154
6154
  customElements.define(tagName, CasinoTournamentBanner$1);
6155
6155
  }
6156
6156
  break;
6157
+ case "casino-tournament-buttons":
6158
+ if (!customElements.get(tagName)) {
6159
+ defineCustomElement$2();
6160
+ }
6161
+ break;
6157
6162
  } });
6158
6163
  }
6159
6164
 
@@ -0,0 +1,6 @@
1
+ import { C as CasinoTournamentButtons$1, d as defineCustomElement$1 } from './casino-tournament-buttons2.js';
2
+
3
+ const CasinoTournamentButtons = CasinoTournamentButtons$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { CasinoTournamentButtons, defineCustomElement };