@everymatrix/casino-tournament-banner 1.29.9 → 1.30.0

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,9 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-a4c93352.js');
6
+ require('@everymatrix/casino-tournament-buttons');
6
7
 
7
- const DEFAULT_LANGUAGE$1 = 'en';
8
- const TRANSLATIONS$1 = {
8
+ const DEFAULT_LANGUAGE = 'en';
9
+ const TRANSLATIONS = {
9
10
  en: {
10
11
  joined: 'Joined',
11
12
  join: 'Join',
@@ -391,15 +392,15 @@ const TRANSLATIONS$1 = {
391
392
  days: 'dani',
392
393
  }
393
394
  };
394
- const translate$1 = (key, customLang) => {
395
+ const translate = (key, customLang) => {
395
396
  var _a, _b;
396
397
  const lang = customLang;
397
- return ((_a = TRANSLATIONS$1[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS$1[DEFAULT_LANGUAGE$1]) === null || _b === void 0 ? void 0 : _b[key]);
398
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
398
399
  };
399
- const getTranslations$1 = (data) => {
400
+ const getTranslations = (data) => {
400
401
  Object.keys(data).forEach((item) => {
401
402
  for (let key in data[item]) {
402
- TRANSLATIONS$1[item][key] = data[item][key];
403
+ TRANSLATIONS[item][key] = data[item][key];
403
404
  }
404
405
  });
405
406
  };
@@ -6123,7 +6124,7 @@ const CasinoTournamentBanner = class {
6123
6124
  return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
6124
6125
  }
6125
6126
  getTextByDiff(diff) {
6126
- const renderText = (amount, type) => ' - ' + amount + ' ' + translate$1(type);
6127
+ const renderText = (amount, type) => ' - ' + amount + ' ' + translate(type);
6127
6128
  const renderTimeColumn = (column) => {
6128
6129
  const columnInt = Math.floor(column);
6129
6130
  if (columnInt < 10) {
@@ -6163,16 +6164,16 @@ const CasinoTournamentBanner = class {
6163
6164
  let text = '';
6164
6165
  switch (state) {
6165
6166
  case 'Upcoming':
6166
- text = translate$1('scheduled', this.language);
6167
+ text = translate('scheduled', this.language);
6167
6168
  break;
6168
6169
  case 'Unstarted':
6169
- text = translate$1('scheduled', this.language);
6170
+ text = translate('scheduled', this.language);
6170
6171
  break;
6171
6172
  case 'Running':
6172
- text = translate$1('ongoing', this.language);
6173
+ text = translate('ongoing', this.language);
6173
6174
  break;
6174
6175
  default:
6175
- text = translate$1('finished', this.language);
6176
+ text = translate('finished', this.language);
6176
6177
  break;
6177
6178
  }
6178
6179
  return text;
@@ -6210,14 +6211,14 @@ const CasinoTournamentBanner = class {
6210
6211
  let currentDate = new Date(this.startTime);
6211
6212
  const setTranslation = () => {
6212
6213
  return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6213
- translate$1('startedAt', this.language) :
6214
- translate$1('startingAt', this.language);
6214
+ translate('startedAt', this.language) :
6215
+ translate('startingAt', this.language);
6215
6216
  };
6216
6217
  if (this.shortStart) {
6217
6218
  let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6218
6219
  this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6219
- translate$1('startedAtWithTime', this.language) + startTimeAsString :
6220
- translate$1('startingAtWithTime', this.language) + startTimeAsString;
6220
+ translate('startedAtWithTime', this.language) + startTimeAsString :
6221
+ translate('startingAtWithTime', this.language) + startTimeAsString;
6221
6222
  }
6222
6223
  else {
6223
6224
  let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
@@ -6225,14 +6226,14 @@ const CasinoTournamentBanner = class {
6225
6226
  let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6226
6227
  this.startdate =
6227
6228
  `${currentDay}` + ' ' +
6228
- translate$1(`${currentMonthKey}`, this.language) + ', ' +
6229
+ translate(`${currentMonthKey}`, this.language) + ', ' +
6229
6230
  setTranslation() +
6230
6231
  ` ${currentHour}`;
6231
6232
  }
6232
6233
  }
6233
6234
  componentWillLoad() {
6234
6235
  if (this.translationData) {
6235
- getTranslations$1(JSON.parse(this.translationData));
6236
+ getTranslations(JSON.parse(this.translationData));
6236
6237
  if (this.state) {
6237
6238
  this.stateText = this.getStateText(this.state);
6238
6239
  }
@@ -6267,574 +6268,17 @@ const CasinoTournamentBanner = class {
6267
6268
  index.h("span", { class: "Tag Date" }, this.showCalendar &&
6268
6269
  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 &&
6269
6270
  index.h("span", { class: "Tag Enroll" }, this.showCheck &&
6270
- 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.session && this.enrolled ?
6271
- 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))
6271
+ 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.session && this.enrolled ?
6272
+ 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))
6272
6273
  :
6273
6274
  this.session && this.state != 'Closed' &&
6274
- 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.showRunningDate &&
6275
- index.h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6275
+ 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.showRunningDate &&
6276
+ index.h("span", { class: "TagRemain" }, this.showRemain, " ", translate('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6276
6277
  index.h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6277
- 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, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6278
+ 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, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), index.h("div", { class: "ThumbTC" }, index.h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6278
6279
  }
6279
6280
  get host() { return index.getElement(this); }
6280
6281
  };
6281
6282
  CasinoTournamentBanner.style = casinoTournamentBannerCss;
6282
6283
 
6283
- const getDevice = () => {
6284
- let userAgent = window.navigator.userAgent;
6285
- if (userAgent.toLowerCase().match(/android/i)) {
6286
- return 'Android';
6287
- }
6288
- if (userAgent.toLowerCase().match(/iphone/i)) {
6289
- return 'iPhone';
6290
- }
6291
- if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
6292
- return 'iPad';
6293
- }
6294
- return 'PC';
6295
- };
6296
-
6297
- const DEFAULT_LANGUAGE = 'en';
6298
- const TRANSLATIONS = {
6299
- en: {
6300
- joined: 'Joined',
6301
- join: 'Join',
6302
- enrolled: 'Enrolled',
6303
- scoreCriteria: 'Score Criteria',
6304
- minbet: 'min bet count',
6305
- seegames: 'You can see the games',
6306
- here: 'here',
6307
- scheduled: 'Scheduled',
6308
- ongoing: 'Ongoing',
6309
- finished: 'Finished',
6310
- startingAt: 'Starting at:',
6311
- startedAt: 'Started at:',
6312
- startingAtWithTime: `Starts `,
6313
- startedAtWithTime: `Started `,
6314
- mostRounds: 'Most Rounds',
6315
- betCount: 'Number of Bets',
6316
- maxWinStakeRatio: 'Max Win per Stake',
6317
- winStakeRatio: 'Total Win per Stake',
6318
- January: 'January',
6319
- February: 'February',
6320
- March: 'March',
6321
- April: 'April',
6322
- May: 'May',
6323
- June: 'June',
6324
- July: 'July',
6325
- August: 'August',
6326
- September: 'September',
6327
- October: 'October',
6328
- November: 'November',
6329
- December: 'December',
6330
- login: 'Log in',
6331
- register: 'Register',
6332
- details: 'Details',
6333
- joinerror: 'An error occurred while registering in the tournament, please try again.'
6334
- },
6335
- 'zh-hk': {
6336
- enrolled: '已註冊',
6337
- scoreCriteria: '評分標準',
6338
- minbet: '最小投注數:',
6339
- seegames: '你可以看比賽',
6340
- here: '這裡',
6341
- scheduled: '預定的',
6342
- ongoing: '進行中',
6343
- finished: '完成的',
6344
- startingAt: '開始於',
6345
- startedAt: '大多數回合',
6346
- mostRounds: '投注數',
6347
- betCount: '投注计数',
6348
- maxWinStakeRatio: '最大勝率',
6349
- winStakeRatio: '勝率',
6350
- January: '一月',
6351
- February: '二月',
6352
- March: '行进',
6353
- April: '四月',
6354
- May: '可能',
6355
- June: '六月',
6356
- July: '七月',
6357
- August: '八月',
6358
- September: '九月',
6359
- October: '十月',
6360
- November: '十一月',
6361
- December: '十二月',
6362
- login: '登錄',
6363
- register: '登記',
6364
- details: '細節',
6365
- join: '加入',
6366
- joinerror: '加入錦標賽時出錯,請重試'
6367
- },
6368
- fr: {
6369
- enrolled: 'Inscrits',
6370
- scoreCriteria: 'Critères de notation',
6371
- minbet: 'nombre de paris minimum',
6372
- seegames: 'Vous pouvez voir les jeux',
6373
- here: 'ici',
6374
- scheduled: 'Programmé',
6375
- ongoing: 'En cours',
6376
- finished: 'Fini',
6377
- startingAt: 'À partir de:',
6378
- startedAt: 'Commencé à:',
6379
- mostRounds: 'Le plus grand nombre de tours',
6380
- betCount: 'Nombre de paris',
6381
- maxWinStakeRatio: 'Indice maximum du gain d\'une mise',
6382
- winStakeRatio: 'Indice du gain d\'une mise',
6383
- January: 'January',
6384
- February: 'February',
6385
- March: 'March',
6386
- April: 'April',
6387
- May: 'May',
6388
- June: 'June',
6389
- July: 'July',
6390
- August: 'August',
6391
- September: 'September',
6392
- October: 'October',
6393
- November: 'November',
6394
- December: 'December',
6395
- login: 'Connexion',
6396
- register: 'Enregistre',
6397
- details: 'Détails',
6398
- join: 'Rejoignez',
6399
- joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
6400
- },
6401
- ro: {
6402
- enrolled: 'Înscris',
6403
- scoreCriteria: 'Criterii de punctaj',
6404
- minbet: 'număr minim de pariuri',
6405
- seegames: 'Vezi jocurile',
6406
- here: 'aici',
6407
- scheduled: 'Programat',
6408
- ongoing: 'În desfășurare',
6409
- finished: 'Finalizat',
6410
- startingAt: 'Începând de la',
6411
- startedAt: 'A inceput la:',
6412
- startingAtWithTime: 'Începând de',
6413
- startedAtWithTime: 'A inceput:',
6414
- mostRounds: 'Cele mai multe runde',
6415
- betCount: 'Număr de pariuri',
6416
- maxWinStakeRatio: 'Pondere maximă a mizei din câștig',
6417
- winStakeRatio: 'Câștig Total per Miză',
6418
- January: 'Ianuarie',
6419
- February: 'Februarie',
6420
- March: 'Martie',
6421
- April: 'Aprilie',
6422
- May: 'Mai',
6423
- June: 'Iunie',
6424
- July: 'Iulie',
6425
- August: 'August',
6426
- September: 'Septembrie',
6427
- October: 'Octombrie',
6428
- November: 'Noiembrie',
6429
- December: 'Decembrie',
6430
- login: 'Autentificare',
6431
- register: 'Înregistrare',
6432
- details: 'Detalii',
6433
- join: 'Participă',
6434
- joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
6435
- },
6436
- tr: {
6437
- enrolled: 'Katıldın',
6438
- scoreCriteria: 'Skor kriteri',
6439
- minbet: 'en düşük bahis sayısı',
6440
- seegames: 'Turnuvadaki oyunları görmek için',
6441
- here: 'tıklayın',
6442
- scheduled: 'Planlanmış',
6443
- ongoing: 'Devam Eden',
6444
- finished: 'Sona Ermiş',
6445
- startingAt: 'Başlangıç saati:',
6446
- startedAt: 'Başlangıç saati:',
6447
- mostRounds: 'ÇoğuRounds',
6448
- betCount: 'Oynanan Tur Sayısı',
6449
- maxWinStakeRatio: 'Maksimum Kazanç / Bahis Oranı',
6450
- winStakeRatio: 'Kazanç / Bahis Oranı',
6451
- January: 'Ocak',
6452
- February: 'Şubat',
6453
- March: 'Mart',
6454
- April: 'Nisan',
6455
- May: 'Mayıs',
6456
- June: 'Haziran',
6457
- July: 'Temmuz',
6458
- August: 'Ağustos',
6459
- September: 'Eylül',
6460
- October: 'Ekim',
6461
- November: 'Kasım',
6462
- December: 'Aralık',
6463
- login: 'Giriş',
6464
- register: 'Kayıt Ol',
6465
- details: 'Detaylar',
6466
- join: 'Katıl',
6467
- joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
6468
- },
6469
- el: {
6470
- enrolled: 'Εγγεγραμμένος',
6471
- scoreCriteria: 'Κριτήρια Σκορ',
6472
- minbet: 'Ελάχιστος αριθμός πονταρισμάτων',
6473
- seegames: 'Μπορείς να δεις τα παιχνίδια',
6474
- here: 'εδώ',
6475
- all: 'Όλα',
6476
- scheduled: 'Προγραμματισμένα',
6477
- ongoing: 'Τρέχοντα',
6478
- finished: 'Ολοκληρωμένα',
6479
- startingAt: 'Αρχίζει στις:',
6480
- startedAt: 'Άρχισε στις:',
6481
- startingAtWithTime: `Αρχίζει στις `,
6482
- startedAtWithTime: `Άρχισε στις `,
6483
- mostRounds: 'Οι περισσότεροι γύροι',
6484
- betCount: 'Οι περισσότεροι γύροι',
6485
- maxWinStakeRatio: 'Μεγαλύτερο Κέρδος άνα Ποντάρισμα',
6486
- winStakeRatio: 'Συνολική Αναλογία Κερδών άνα Ποντάρισμα',
6487
- January: 'Ιανουαρίου',
6488
- February: 'Φεβρουαρίου',
6489
- March: 'Μαρτίου',
6490
- April: 'Απριλίου',
6491
- May: 'Μαΐου',
6492
- June: 'Ιουνίου',
6493
- July: 'Ιουλίου',
6494
- August: 'Αυγούστου',
6495
- September: 'Σεπτεμβρίου',
6496
- October: 'Οκτωβρίου',
6497
- November: 'Νοεμβρίου',
6498
- December: 'Δεκεμβρίου',
6499
- login: 'Είσοδος',
6500
- register: 'Εγγραφή',
6501
- details: 'Λεπτομέρειες',
6502
- join: 'Συμμετοχή',
6503
- joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
6504
- },
6505
- es: {
6506
- enrolled: 'Inscrito',
6507
- scoreCriteria: 'Criterios de puntuación',
6508
- minbet: 'la apuesta mínima cuenta',
6509
- seegames: 'Puedes ver los juegos',
6510
- here: 'aquí',
6511
- scheduled: 'Programado',
6512
- ongoing: 'En marcha',
6513
- finished: 'Terminado',
6514
- startingAt: 'Desde',
6515
- startedAt: 'Empezó el:',
6516
- mostRounds: 'LaMayoríaDeLasRondas',
6517
- betCount: 'Recuento De Apuestas',
6518
- maxWinStakeRatio: 'Ratio De Ganancia Máxima',
6519
- winStakeRatio: 'Ratio De Ganancia',
6520
- January: 'de enero',
6521
- February: 'de febrero',
6522
- March: 'de marzo',
6523
- April: 'de abril',
6524
- May: 'de mayo',
6525
- June: 'de junio',
6526
- July: 'de julio',
6527
- August: 'de agosto',
6528
- September: 'de septiembre',
6529
- October: 'de octubre',
6530
- November: 'de noviembre',
6531
- December: 'de diciembre',
6532
- login: 'Iniciar sesión',
6533
- register: 'Regístrate',
6534
- details: 'Detalles',
6535
- join: 'Unirse',
6536
- joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
6537
- },
6538
- pt: {
6539
- enrolled: 'Inscrito',
6540
- scoreCriteria: 'Critérios de pontuação',
6541
- minbet: 'Contagens de aposta mínima',
6542
- seegames: 'Você pode ver os jogos',
6543
- here: 'Aqui',
6544
- scheduled: 'Agendado',
6545
- ongoing: 'Em progresso',
6546
- finished: 'Finalizado',
6547
- startingAt: 'Começando às:',
6548
- startedAt: 'Começou às:',
6549
- mostRounds: 'Mais rodadas',
6550
- betCount: 'Contagem de Apostas',
6551
- maxWinStakeRatio: 'Rácio máximo de vitórias',
6552
- winStakeRatio: 'Rácio de Vitórias',
6553
- January: 'January',
6554
- February: 'February',
6555
- March: 'March',
6556
- April: 'April',
6557
- May: 'May',
6558
- June: 'June',
6559
- July: 'July',
6560
- August: 'August',
6561
- September: 'September',
6562
- October: 'October',
6563
- November: 'November',
6564
- December: 'December',
6565
- login: 'Entrar',
6566
- register: 'Registro',
6567
- details: 'Detalhes',
6568
- join: 'Junte-se',
6569
- joinerror: 'Ocorreu um erro ao entrar no torneio -'
6570
- },
6571
- hu: {
6572
- enrolled: 'Feliratkozott',
6573
- scoreCriteria: 'Pontozási kritériumok',
6574
- minbet: 'Minimális tét',
6575
- seegames: 'Játékok megnézése',
6576
- here: 'itt',
6577
- scheduled: 'Ütemezés',
6578
- ongoing: 'Folyamatban lévő',
6579
- finished: 'Befejezett',
6580
- startingAt: 'Kezdődik',
6581
- startedAt: 'Started at:',
6582
- mostRounds: 'Legtöbb kör',
6583
- betCount: 'Számított tét',
6584
- maxWinStakeRatio: 'Maximális nyeremény tétenként',
6585
- winStakeRatio: 'Összes nyeremény tétenként',
6586
- January: 'January',
6587
- February: 'February',
6588
- March: 'March',
6589
- April: 'April',
6590
- May: 'May',
6591
- June: 'June',
6592
- July: 'July',
6593
- August: 'August',
6594
- September: 'September',
6595
- October: 'October',
6596
- November: 'November',
6597
- December: 'December',
6598
- login: 'Bejelentkezés',
6599
- register: 'Regisztráció',
6600
- details: 'Adatok',
6601
- join: 'Csatlakozás',
6602
- joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
6603
- },
6604
- hr: {
6605
- joined: 'Pridružen',
6606
- enrolled: 'Upisan',
6607
- scoreCriteria: 'Kriteriji bodovanja',
6608
- minbet: 'minimalni broj beta',
6609
- seegames: 'Možete vidjeti igre',
6610
- here: 'Ovdje',
6611
- scheduled: 'Zakazano',
6612
- ongoing: 'U tijeku',
6613
- finished: 'Gotovo',
6614
- startingAt: 'S početkom u',
6615
- startedAt: 'Započelo u',
6616
- startingAtWithTime: `Počinje `,
6617
- startedAtWithTime: `Započelo `,
6618
- mostRounds: 'Najviše rundi',
6619
- betCount: 'Broj betova',
6620
- maxWinStakeRatio: 'Maksimalni dobitak po ulogu',
6621
- winStakeRatio: 'Ukupni dobitak po ulogu',
6622
- January: 'Siječanj',
6623
- February: 'Veljača',
6624
- March: 'Ožujak',
6625
- April: 'Travanj',
6626
- May: 'Svibanj',
6627
- June: 'Lipanj',
6628
- July: 'Srpanj',
6629
- August: 'Kolovoz',
6630
- September: 'Rujan',
6631
- October: 'Listopad',
6632
- November: 'Studeni',
6633
- December: 'Prosinac',
6634
- login: 'Prijaviti se',
6635
- register: 'Registracija',
6636
- details: 'Detalji',
6637
- join: 'join',
6638
- joinerror: 'Došlo je do pogreške prilikom registracije na turnir, pokušajte ponovno.',
6639
- left: 'lijevo',
6640
- minutes: 'minute',
6641
- hours: 'sati',
6642
- days: 'dani',
6643
- }
6644
- };
6645
- const translate = (key, customLang) => {
6646
- var _a, _b;
6647
- const lang = customLang;
6648
- return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
6649
- };
6650
- const getTranslations = (data) => {
6651
- Object.keys(data).forEach((item) => {
6652
- for (let key in data[item]) {
6653
- TRANSLATIONS[item][key] = data[item][key];
6654
- }
6655
- });
6656
- };
6657
-
6658
- 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}";
6659
-
6660
- const CasinoTournamentButtons = class {
6661
- constructor(hostRef) {
6662
- index.registerInstance(this, hostRef);
6663
- /**
6664
- * Player enrolled
6665
- */
6666
- this.enrolled = false;
6667
- /**
6668
- * Show read more button
6669
- */
6670
- this.showReadMore = false;
6671
- /**
6672
- * Client custom styling via inline styles
6673
- */
6674
- this.clientStyling = '';
6675
- /**
6676
- * Client custom styling via url
6677
- */
6678
- this.clientStylingUrl = '';
6679
- this.limitStylingAppends = false;
6680
- this.joinButtonLoading = false;
6681
- this.errorJoin = false;
6682
- this.errorJoinConcurrently = false;
6683
- }
6684
- componentWillLoad() {
6685
- if (this.translationData) {
6686
- getTranslations(JSON.parse(this.translationData));
6687
- }
6688
- }
6689
- componentDidRender() {
6690
- if (!this.limitStylingAppends && this.host) {
6691
- if (this.clientStyling)
6692
- this.setClientStyling();
6693
- if (this.clientStylingUrl)
6694
- this.setClientStylingURL();
6695
- this.limitStylingAppends = true;
6696
- }
6697
- }
6698
- setClientStyling() {
6699
- const sheet = new CSSStyleSheet();
6700
- // @ts-ignore
6701
- sheet.replace(this.clientStyling);
6702
- // @ts-ignore
6703
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6704
- }
6705
- setClientStylingURL() {
6706
- let url = new URL(this.clientStylingUrl);
6707
- fetch(url.href)
6708
- .then((res) => res.text())
6709
- .then((data) => {
6710
- const sheet = new CSSStyleSheet();
6711
- // @ts-ignore
6712
- sheet.replace(data);
6713
- // @ts-ignore
6714
- this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6715
- });
6716
- }
6717
- loginAction() {
6718
- if (this.loginEvent) {
6719
- window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
6720
- // @ts-ignore Analytics event
6721
- if (typeof gtag == 'function') {
6722
- // @ts-ignore
6723
- gtag('event', 'OpenLoginModal', {
6724
- 'context': 'TournamentsThumbnailController'
6725
- });
6726
- }
6727
- }
6728
- if (this.loginUrl) {
6729
- location.href = this.loginUrl;
6730
- }
6731
- }
6732
- registerAction() {
6733
- if (this.registerEvent) {
6734
- window.postMessage({ type: this.registerEvent, transition: 'Register' }, window.location.href);
6735
- //@ts-ignoreAnalytics event
6736
- if (typeof gtag == 'function') {
6737
- //@ts-ignore
6738
- gtag('event', 'OpenRegisterModal', {
6739
- 'context': 'TournamentsThumbnailController'
6740
- });
6741
- }
6742
- }
6743
- if (this.registerUrl) {
6744
- location.href = this.registerUrl;
6745
- }
6746
- }
6747
- async joinAction(tournamentId, bonuscode) {
6748
- var _a;
6749
- this.errorJoin = false;
6750
- this.errorJoinConcurrently = false;
6751
- window.postMessage({ type: 'TournamentJoinRequest', tournamentId }, window.location.href);
6752
- this.joinButtonLoading = true;
6753
- let joinUrl = new URL(`${this.endpoint}/v1/bonus/claim`);
6754
- let reqHeaders = new Headers();
6755
- let body = {};
6756
- joinUrl.searchParams.append('language', this.language);
6757
- joinUrl.searchParams.append('platform', getDevice());
6758
- reqHeaders.append('Content-Type', 'application/json');
6759
- reqHeaders.append("X-SessionID", this.session);
6760
- if (bonuscode) {
6761
- body = {
6762
- language: this.language,
6763
- bonusCode: bonuscode,
6764
- currency: this.currency
6765
- };
6766
- }
6767
- let requestOptions = {
6768
- method: 'PUT',
6769
- headers: reqHeaders,
6770
- body: JSON.stringify(body),
6771
- };
6772
- const handlerOnSuccess = () => {
6773
- this.joinButtonLoading = false;
6774
- this.enrolled = true;
6775
- window.postMessage({ type: 'TournamentUserEnrolled', userenrolled: this.enrolled }, window.location.href);
6776
- };
6777
- const handlerOnFail = () => {
6778
- this.joinButtonLoading = false;
6779
- this.errorJoin = true;
6780
- };
6781
- const fetcher = async () => {
6782
- let result;
6783
- try {
6784
- result = await fetch(`${this.endpoint}/v1/bonus/claim?${joinUrl.searchParams.toString()}`, requestOptions);
6785
- result = await result.json();
6786
- }
6787
- catch (e) {
6788
- handlerOnFail();
6789
- }
6790
- return result;
6791
- };
6792
- const data = await fetcher();
6793
- if (!data)
6794
- return;
6795
- if (data.success == true) {
6796
- handlerOnSuccess();
6797
- }
6798
- else {
6799
- if (data.errorMessage.match("VersionMismatchException")) {
6800
- let resultDoubleCheck;
6801
- resultDoubleCheck = await fetch(`${this.endpoint}/v1/tournaments/${this.tournamentId}`, {
6802
- headers: {
6803
- 'X-SessionID': this.session
6804
- }
6805
- });
6806
- resultDoubleCheck = await resultDoubleCheck.json();
6807
- if ((_a = resultDoubleCheck === null || resultDoubleCheck === void 0 ? void 0 : resultDoubleCheck.item) === null || _a === void 0 ? void 0 : _a.playerEnrolled) {
6808
- handlerOnSuccess();
6809
- }
6810
- else {
6811
- handlerOnFail();
6812
- this.errorJoinConcurrently = true;
6813
- this.errorJoin = false;
6814
- }
6815
- }
6816
- else {
6817
- handlerOnFail();
6818
- }
6819
- }
6820
- }
6821
- detailAction(tournamentId) {
6822
- window.postMessage({ type: 'TournamentDetailsClicked', tournamentId, showLeaderboard: true }, window.location.href);
6823
- }
6824
- moreAction(tournamentId) {
6825
- window.postMessage({ type: 'TournamentReadMoreClicked', tournamentId }, window.location.href);
6826
- }
6827
- render() {
6828
- return index.h("div", { class: "TournamentButtons" }, !this.session &&
6829
- 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 &&
6830
- index.h("div", null, !this.enrolled &&
6831
- 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) }, translate('readmore', this.language))), this.enrolled &&
6832
- 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) }, translate('readmore', this.language)))), (this.errorJoin || this.errorJoinConcurrently) &&
6833
- index.h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6834
- }
6835
- get host() { return index.getElement(this); }
6836
- };
6837
- CasinoTournamentButtons.style = casinoTournamentButtonsCss;
6838
-
6839
6284
  exports.casino_tournament_banner = CasinoTournamentBanner;
6840
- exports.casino_tournament_buttons = CasinoTournamentButtons;