@everymatrix/lottery-game-page 1.87.28 → 1.87.29
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.
- package/dist/cjs/general-multi-select_16.cjs.entry.js +466 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.js +1 -1
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +50 -68
- package/dist/collection/models/index.js +10 -0
- package/dist/collection/utils/api.js +33 -0
- package/dist/collection/utils/locale.utils.js +7 -5
- package/dist/collection/utils/utils.js +26 -0
- package/dist/esm/general-multi-select_16.entry.js +466 -69
- package/dist/esm/loader.js +1 -1
- package/dist/esm/lottery-game-page.js +1 -1
- package/dist/lottery-game-page/general-multi-select_16.entry.js +25 -25
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +17 -5
- package/dist/types/components.d.ts +9 -0
- package/dist/types/models/index.d.ts +106 -0
- package/dist/types/utils/api.d.ts +6 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -7249,6 +7249,35 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
|
7249
7249
|
return date.getTime() - utcDate.getTime();
|
|
7250
7250
|
}
|
|
7251
7251
|
|
|
7252
|
+
/**
|
|
7253
|
+
* Days in 1 week.
|
|
7254
|
+
*
|
|
7255
|
+
* @name daysInWeek
|
|
7256
|
+
* @constant
|
|
7257
|
+
* @type {number}
|
|
7258
|
+
* @default
|
|
7259
|
+
*/
|
|
7260
|
+
|
|
7261
|
+
/**
|
|
7262
|
+
* Milliseconds in 1 minute
|
|
7263
|
+
*
|
|
7264
|
+
* @name millisecondsInMinute
|
|
7265
|
+
* @constant
|
|
7266
|
+
* @type {number}
|
|
7267
|
+
* @default
|
|
7268
|
+
*/
|
|
7269
|
+
var millisecondsInMinute = 60000;
|
|
7270
|
+
|
|
7271
|
+
/**
|
|
7272
|
+
* Milliseconds in 1 hour
|
|
7273
|
+
*
|
|
7274
|
+
* @name millisecondsInHour
|
|
7275
|
+
* @constant
|
|
7276
|
+
* @type {number}
|
|
7277
|
+
* @default
|
|
7278
|
+
*/
|
|
7279
|
+
var millisecondsInHour = 3600000;
|
|
7280
|
+
|
|
7252
7281
|
/**
|
|
7253
7282
|
* @name isDate
|
|
7254
7283
|
* @category Common Helpers
|
|
@@ -7326,6 +7355,77 @@ function isValid(dirtyDate) {
|
|
|
7326
7355
|
return !isNaN(Number(date));
|
|
7327
7356
|
}
|
|
7328
7357
|
|
|
7358
|
+
/**
|
|
7359
|
+
* @name differenceInMilliseconds
|
|
7360
|
+
* @category Millisecond Helpers
|
|
7361
|
+
* @summary Get the number of milliseconds between the given dates.
|
|
7362
|
+
*
|
|
7363
|
+
* @description
|
|
7364
|
+
* Get the number of milliseconds between the given dates.
|
|
7365
|
+
*
|
|
7366
|
+
* @param {Date|Number} dateLeft - the later date
|
|
7367
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
7368
|
+
* @returns {Number} the number of milliseconds
|
|
7369
|
+
* @throws {TypeError} 2 arguments required
|
|
7370
|
+
*
|
|
7371
|
+
* @example
|
|
7372
|
+
* // How many milliseconds are between
|
|
7373
|
+
* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
|
|
7374
|
+
* const result = differenceInMilliseconds(
|
|
7375
|
+
* new Date(2014, 6, 2, 12, 30, 21, 700),
|
|
7376
|
+
* new Date(2014, 6, 2, 12, 30, 20, 600)
|
|
7377
|
+
* )
|
|
7378
|
+
* //=> 1100
|
|
7379
|
+
*/
|
|
7380
|
+
function differenceInMilliseconds(dateLeft, dateRight) {
|
|
7381
|
+
requiredArgs(2, arguments);
|
|
7382
|
+
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
|
|
7383
|
+
}
|
|
7384
|
+
|
|
7385
|
+
var roundingMap = {
|
|
7386
|
+
ceil: Math.ceil,
|
|
7387
|
+
round: Math.round,
|
|
7388
|
+
floor: Math.floor,
|
|
7389
|
+
trunc: function trunc(value) {
|
|
7390
|
+
return value < 0 ? Math.ceil(value) : Math.floor(value);
|
|
7391
|
+
} // Math.trunc is not supported by IE
|
|
7392
|
+
};
|
|
7393
|
+
|
|
7394
|
+
var defaultRoundingMethod = 'trunc';
|
|
7395
|
+
function getRoundingMethod(method) {
|
|
7396
|
+
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
|
|
7397
|
+
}
|
|
7398
|
+
|
|
7399
|
+
/**
|
|
7400
|
+
* @name differenceInSeconds
|
|
7401
|
+
* @category Second Helpers
|
|
7402
|
+
* @summary Get the number of seconds between the given dates.
|
|
7403
|
+
*
|
|
7404
|
+
* @description
|
|
7405
|
+
* Get the number of seconds between the given dates.
|
|
7406
|
+
*
|
|
7407
|
+
* @param {Date|Number} dateLeft - the later date
|
|
7408
|
+
* @param {Date|Number} dateRight - the earlier date
|
|
7409
|
+
* @param {Object} [options] - an object with options.
|
|
7410
|
+
* @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
|
|
7411
|
+
* @returns {Number} the number of seconds
|
|
7412
|
+
* @throws {TypeError} 2 arguments required
|
|
7413
|
+
*
|
|
7414
|
+
* @example
|
|
7415
|
+
* // How many seconds are between
|
|
7416
|
+
* // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?
|
|
7417
|
+
* const result = differenceInSeconds(
|
|
7418
|
+
* new Date(2014, 6, 2, 12, 30, 20, 0),
|
|
7419
|
+
* new Date(2014, 6, 2, 12, 30, 7, 999)
|
|
7420
|
+
* )
|
|
7421
|
+
* //=> 12
|
|
7422
|
+
*/
|
|
7423
|
+
function differenceInSeconds(dateLeft, dateRight, options) {
|
|
7424
|
+
requiredArgs(2, arguments);
|
|
7425
|
+
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;
|
|
7426
|
+
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
|
|
7427
|
+
}
|
|
7428
|
+
|
|
7329
7429
|
/**
|
|
7330
7430
|
* @name subMilliseconds
|
|
7331
7431
|
* @category Millisecond Helpers
|
|
@@ -9320,6 +9420,257 @@ function cleanEscapedString(input) {
|
|
|
9320
9420
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
9321
9421
|
}
|
|
9322
9422
|
|
|
9423
|
+
/**
|
|
9424
|
+
* @name isBefore
|
|
9425
|
+
* @category Common Helpers
|
|
9426
|
+
* @summary Is the first date before the second one?
|
|
9427
|
+
*
|
|
9428
|
+
* @description
|
|
9429
|
+
* Is the first date before the second one?
|
|
9430
|
+
*
|
|
9431
|
+
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
9432
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
9433
|
+
* @returns {Boolean} the first date is before the second date
|
|
9434
|
+
* @throws {TypeError} 2 arguments required
|
|
9435
|
+
*
|
|
9436
|
+
* @example
|
|
9437
|
+
* // Is 10 July 1989 before 11 February 1987?
|
|
9438
|
+
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
9439
|
+
* //=> false
|
|
9440
|
+
*/
|
|
9441
|
+
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
9442
|
+
requiredArgs(2, arguments);
|
|
9443
|
+
var date = toDate(dirtyDate);
|
|
9444
|
+
var dateToCompare = toDate(dirtyDateToCompare);
|
|
9445
|
+
return date.getTime() < dateToCompare.getTime();
|
|
9446
|
+
}
|
|
9447
|
+
|
|
9448
|
+
/**
|
|
9449
|
+
* @name parseISO
|
|
9450
|
+
* @category Common Helpers
|
|
9451
|
+
* @summary Parse ISO string
|
|
9452
|
+
*
|
|
9453
|
+
* @description
|
|
9454
|
+
* Parse the given string in ISO 8601 format and return an instance of Date.
|
|
9455
|
+
*
|
|
9456
|
+
* Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
9457
|
+
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
9458
|
+
*
|
|
9459
|
+
* If the argument isn't a string, the function cannot parse the string or
|
|
9460
|
+
* the values are invalid, it returns Invalid Date.
|
|
9461
|
+
*
|
|
9462
|
+
* @param {String} argument - the value to convert
|
|
9463
|
+
* @param {Object} [options] - an object with options.
|
|
9464
|
+
* @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format
|
|
9465
|
+
* @returns {Date} the parsed date in the local time zone
|
|
9466
|
+
* @throws {TypeError} 1 argument required
|
|
9467
|
+
* @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2
|
|
9468
|
+
*
|
|
9469
|
+
* @example
|
|
9470
|
+
* // Convert string '2014-02-11T11:30:30' to date:
|
|
9471
|
+
* const result = parseISO('2014-02-11T11:30:30')
|
|
9472
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
9473
|
+
*
|
|
9474
|
+
* @example
|
|
9475
|
+
* // Convert string '+02014101' to date,
|
|
9476
|
+
* // if the additional number of digits in the extended year format is 1:
|
|
9477
|
+
* const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
9478
|
+
* //=> Fri Apr 11 2014 00:00:00
|
|
9479
|
+
*/
|
|
9480
|
+
function parseISO(argument, options) {
|
|
9481
|
+
var _options$additionalDi;
|
|
9482
|
+
requiredArgs(1, arguments);
|
|
9483
|
+
var additionalDigits = toInteger((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
9484
|
+
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
9485
|
+
throw new RangeError('additionalDigits must be 0, 1 or 2');
|
|
9486
|
+
}
|
|
9487
|
+
if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {
|
|
9488
|
+
return new Date(NaN);
|
|
9489
|
+
}
|
|
9490
|
+
var dateStrings = splitDateString(argument);
|
|
9491
|
+
var date;
|
|
9492
|
+
if (dateStrings.date) {
|
|
9493
|
+
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
9494
|
+
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
9495
|
+
}
|
|
9496
|
+
if (!date || isNaN(date.getTime())) {
|
|
9497
|
+
return new Date(NaN);
|
|
9498
|
+
}
|
|
9499
|
+
var timestamp = date.getTime();
|
|
9500
|
+
var time = 0;
|
|
9501
|
+
var offset;
|
|
9502
|
+
if (dateStrings.time) {
|
|
9503
|
+
time = parseTime(dateStrings.time);
|
|
9504
|
+
if (isNaN(time)) {
|
|
9505
|
+
return new Date(NaN);
|
|
9506
|
+
}
|
|
9507
|
+
}
|
|
9508
|
+
if (dateStrings.timezone) {
|
|
9509
|
+
offset = parseTimezone(dateStrings.timezone);
|
|
9510
|
+
if (isNaN(offset)) {
|
|
9511
|
+
return new Date(NaN);
|
|
9512
|
+
}
|
|
9513
|
+
} else {
|
|
9514
|
+
var dirtyDate = new Date(timestamp + time);
|
|
9515
|
+
// js parsed string assuming it's in UTC timezone
|
|
9516
|
+
// but we need it to be parsed in our timezone
|
|
9517
|
+
// so we use utc values to build date in our timezone.
|
|
9518
|
+
// Year values from 0 to 99 map to the years 1900 to 1999
|
|
9519
|
+
// so set year explicitly with setFullYear.
|
|
9520
|
+
var result = new Date(0);
|
|
9521
|
+
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
9522
|
+
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
9523
|
+
return result;
|
|
9524
|
+
}
|
|
9525
|
+
return new Date(timestamp + time + offset);
|
|
9526
|
+
}
|
|
9527
|
+
var patterns = {
|
|
9528
|
+
dateTimeDelimiter: /[T ]/,
|
|
9529
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
9530
|
+
timezone: /([Z+-].*)$/
|
|
9531
|
+
};
|
|
9532
|
+
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
9533
|
+
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
9534
|
+
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
9535
|
+
function splitDateString(dateString) {
|
|
9536
|
+
var dateStrings = {};
|
|
9537
|
+
var array = dateString.split(patterns.dateTimeDelimiter);
|
|
9538
|
+
var timeString;
|
|
9539
|
+
|
|
9540
|
+
// The regex match should only return at maximum two array elements.
|
|
9541
|
+
// [date], [time], or [date, time].
|
|
9542
|
+
if (array.length > 2) {
|
|
9543
|
+
return dateStrings;
|
|
9544
|
+
}
|
|
9545
|
+
if (/:/.test(array[0])) {
|
|
9546
|
+
timeString = array[0];
|
|
9547
|
+
} else {
|
|
9548
|
+
dateStrings.date = array[0];
|
|
9549
|
+
timeString = array[1];
|
|
9550
|
+
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
9551
|
+
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
9552
|
+
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
9553
|
+
}
|
|
9554
|
+
}
|
|
9555
|
+
if (timeString) {
|
|
9556
|
+
var token = patterns.timezone.exec(timeString);
|
|
9557
|
+
if (token) {
|
|
9558
|
+
dateStrings.time = timeString.replace(token[1], '');
|
|
9559
|
+
dateStrings.timezone = token[1];
|
|
9560
|
+
} else {
|
|
9561
|
+
dateStrings.time = timeString;
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
return dateStrings;
|
|
9565
|
+
}
|
|
9566
|
+
function parseYear(dateString, additionalDigits) {
|
|
9567
|
+
var regex = new RegExp('^(?:(\\d{4}|[+-]\\d{' + (4 + additionalDigits) + '})|(\\d{2}|[+-]\\d{' + (2 + additionalDigits) + '})$)');
|
|
9568
|
+
var captures = dateString.match(regex);
|
|
9569
|
+
// Invalid ISO-formatted year
|
|
9570
|
+
if (!captures) return {
|
|
9571
|
+
year: NaN,
|
|
9572
|
+
restDateString: ''
|
|
9573
|
+
};
|
|
9574
|
+
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
9575
|
+
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
9576
|
+
|
|
9577
|
+
// either year or century is null, not both
|
|
9578
|
+
return {
|
|
9579
|
+
year: century === null ? year : century * 100,
|
|
9580
|
+
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
9581
|
+
};
|
|
9582
|
+
}
|
|
9583
|
+
function parseDate(dateString, year) {
|
|
9584
|
+
// Invalid ISO-formatted year
|
|
9585
|
+
if (year === null) return new Date(NaN);
|
|
9586
|
+
var captures = dateString.match(dateRegex);
|
|
9587
|
+
// Invalid ISO-formatted string
|
|
9588
|
+
if (!captures) return new Date(NaN);
|
|
9589
|
+
var isWeekDate = !!captures[4];
|
|
9590
|
+
var dayOfYear = parseDateUnit(captures[1]);
|
|
9591
|
+
var month = parseDateUnit(captures[2]) - 1;
|
|
9592
|
+
var day = parseDateUnit(captures[3]);
|
|
9593
|
+
var week = parseDateUnit(captures[4]);
|
|
9594
|
+
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
9595
|
+
if (isWeekDate) {
|
|
9596
|
+
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
9597
|
+
return new Date(NaN);
|
|
9598
|
+
}
|
|
9599
|
+
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
9600
|
+
} else {
|
|
9601
|
+
var date = new Date(0);
|
|
9602
|
+
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
|
|
9603
|
+
return new Date(NaN);
|
|
9604
|
+
}
|
|
9605
|
+
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
9606
|
+
return date;
|
|
9607
|
+
}
|
|
9608
|
+
}
|
|
9609
|
+
function parseDateUnit(value) {
|
|
9610
|
+
return value ? parseInt(value) : 1;
|
|
9611
|
+
}
|
|
9612
|
+
function parseTime(timeString) {
|
|
9613
|
+
var captures = timeString.match(timeRegex);
|
|
9614
|
+
if (!captures) return NaN; // Invalid ISO-formatted time
|
|
9615
|
+
|
|
9616
|
+
var hours = parseTimeUnit(captures[1]);
|
|
9617
|
+
var minutes = parseTimeUnit(captures[2]);
|
|
9618
|
+
var seconds = parseTimeUnit(captures[3]);
|
|
9619
|
+
if (!validateTime(hours, minutes, seconds)) {
|
|
9620
|
+
return NaN;
|
|
9621
|
+
}
|
|
9622
|
+
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1000;
|
|
9623
|
+
}
|
|
9624
|
+
function parseTimeUnit(value) {
|
|
9625
|
+
return value && parseFloat(value.replace(',', '.')) || 0;
|
|
9626
|
+
}
|
|
9627
|
+
function parseTimezone(timezoneString) {
|
|
9628
|
+
if (timezoneString === 'Z') return 0;
|
|
9629
|
+
var captures = timezoneString.match(timezoneRegex);
|
|
9630
|
+
if (!captures) return 0;
|
|
9631
|
+
var sign = captures[1] === '+' ? -1 : 1;
|
|
9632
|
+
var hours = parseInt(captures[2]);
|
|
9633
|
+
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
9634
|
+
if (!validateTimezone(hours, minutes)) {
|
|
9635
|
+
return NaN;
|
|
9636
|
+
}
|
|
9637
|
+
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
9638
|
+
}
|
|
9639
|
+
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
9640
|
+
var date = new Date(0);
|
|
9641
|
+
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
9642
|
+
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
9643
|
+
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
9644
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
9645
|
+
return date;
|
|
9646
|
+
}
|
|
9647
|
+
|
|
9648
|
+
// Validation functions
|
|
9649
|
+
|
|
9650
|
+
// February is null to handle the leap year (using ||)
|
|
9651
|
+
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
9652
|
+
function isLeapYearIndex(year) {
|
|
9653
|
+
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
9654
|
+
}
|
|
9655
|
+
function validateDate(year, month, date) {
|
|
9656
|
+
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
|
|
9657
|
+
}
|
|
9658
|
+
function validateDayOfYearDate(year, dayOfYear) {
|
|
9659
|
+
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
9660
|
+
}
|
|
9661
|
+
function validateWeekDate(_year, week, day) {
|
|
9662
|
+
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
9663
|
+
}
|
|
9664
|
+
function validateTime(hours, minutes, seconds) {
|
|
9665
|
+
if (hours === 24) {
|
|
9666
|
+
return minutes === 0 && seconds === 0;
|
|
9667
|
+
}
|
|
9668
|
+
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
9669
|
+
}
|
|
9670
|
+
function validateTimezone(_hours, minutes) {
|
|
9671
|
+
return minutes >= 0 && minutes <= 59;
|
|
9672
|
+
}
|
|
9673
|
+
|
|
9323
9674
|
const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 15px;width:max-content;border:1px solid var(--emw--color-primary, #009993);background:var(--emw--color-typography-inverse, #fff);color:var(--emw--color-typography, #000);font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .filterKey,.FilterModalBody .filterKey,.FilterModalFooter .filterKey{color:var(--emw--color-primary, #009993);text-align:left;font-size:16px}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:var(--emw--color-primary, #009993);text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:var(--emw--button-border-radius, 4px);background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-primary-variant, #004d4a);width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:var(--emw--color-primary, #009993)}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:var(--emw--button-border-radius, 4px);padding:8px 60px;width:max-content;margin:5px;background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff);font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:var(--emw--color-primary, #009993);color:var(--emw--color-typography-inverse, #fff)}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}.ticketFilterItem{margin:12px 0}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}";
|
|
9324
9675
|
const HelperFiltersStyle0 = helperFiltersCss;
|
|
9325
9676
|
|
|
@@ -15327,10 +15678,12 @@ const TRANSLATIONS$4 = {
|
|
|
15327
15678
|
error: 'Error',
|
|
15328
15679
|
backButton: 'Back',
|
|
15329
15680
|
lobbyButton: 'Lobby',
|
|
15330
|
-
|
|
15681
|
+
nextDrawIn: 'Next draw in: ',
|
|
15682
|
+
startIn: 'Sales Start in:',
|
|
15331
15683
|
buy: 'Buy tickets',
|
|
15332
15684
|
viewLatest: 'View latest results',
|
|
15333
15685
|
submitSuccess: 'Submit successfully!',
|
|
15686
|
+
ticketFailed: 'Failed to submit tickets.',
|
|
15334
15687
|
orderSummaryTitle: 'Order Summary',
|
|
15335
15688
|
orderSummaryTickets: 'Ticket',
|
|
15336
15689
|
orderSummaryTotal: 'Total',
|
|
@@ -15343,7 +15696,7 @@ const TRANSLATIONS$4 = {
|
|
|
15343
15696
|
error: 'Eroare',
|
|
15344
15697
|
backButton: 'Inapoi',
|
|
15345
15698
|
lobbyButton: 'Lobby',
|
|
15346
|
-
|
|
15699
|
+
nextDrawIn: 'Urmatoarea extragere:',
|
|
15347
15700
|
buy: 'Cumpara bilet',
|
|
15348
15701
|
viewLatest: 'Ultimile extrageri',
|
|
15349
15702
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15358,7 +15711,7 @@ const TRANSLATIONS$4 = {
|
|
|
15358
15711
|
error: 'Error',
|
|
15359
15712
|
backButton: 'Back',
|
|
15360
15713
|
lobbyButton: 'Lobby',
|
|
15361
|
-
|
|
15714
|
+
nextDrawIn: 'Next draw in: ',
|
|
15362
15715
|
buy: 'Buy tickets',
|
|
15363
15716
|
viewLatest: 'View latest results',
|
|
15364
15717
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15373,7 +15726,7 @@ const TRANSLATIONS$4 = {
|
|
|
15373
15726
|
error: 'خطأ',
|
|
15374
15727
|
backButton: 'خلف',
|
|
15375
15728
|
lobbyButton: 'ردهة',
|
|
15376
|
-
|
|
15729
|
+
nextDrawIn: 'السحب التالي:',
|
|
15377
15730
|
buy: 'اشتري تذاكر',
|
|
15378
15731
|
viewLatest: 'عرض أحدث النتائج',
|
|
15379
15732
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15388,7 +15741,7 @@ const TRANSLATIONS$4 = {
|
|
|
15388
15741
|
error: 'Greška',
|
|
15389
15742
|
backButton: 'Nazad',
|
|
15390
15743
|
lobbyButton: 'Lobby',
|
|
15391
|
-
|
|
15744
|
+
nextDrawIn: 'Sljedeće izvlačenje za: ',
|
|
15392
15745
|
buy: 'Uplati listić',
|
|
15393
15746
|
viewLatest: 'Pogledajte najnovije rezultate',
|
|
15394
15747
|
submitSuccess: 'Submit successfully!',
|
|
@@ -15422,12 +15775,17 @@ const getTranslations$4 = (url) => {
|
|
|
15422
15775
|
});
|
|
15423
15776
|
};
|
|
15424
15777
|
|
|
15425
|
-
|
|
15426
|
-
|
|
15427
|
-
|
|
15428
|
-
|
|
15429
|
-
|
|
15430
|
-
|
|
15778
|
+
var DrawStatus;
|
|
15779
|
+
(function (DrawStatus) {
|
|
15780
|
+
DrawStatus["OPEN"] = "OPEN";
|
|
15781
|
+
})(DrawStatus || (DrawStatus = {}));
|
|
15782
|
+
var TicketState;
|
|
15783
|
+
(function (TicketState) {
|
|
15784
|
+
TicketState["Settled"] = "Settled";
|
|
15785
|
+
TicketState["Purchased"] = "Purchased";
|
|
15786
|
+
TicketState["Canceled"] = "Canceled";
|
|
15787
|
+
})(TicketState || (TicketState = {}));
|
|
15788
|
+
|
|
15431
15789
|
const generateUUID$1 = () => {
|
|
15432
15790
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
15433
15791
|
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
@@ -15463,6 +15821,62 @@ const showNotification = ({ message, theme = 'success' }) => {
|
|
|
15463
15821
|
theme
|
|
15464
15822
|
});
|
|
15465
15823
|
};
|
|
15824
|
+
function checkDrawAvailable(currentDraw = {}) {
|
|
15825
|
+
if (currentDraw && currentDraw.id && currentDraw.status === DrawStatus.OPEN) {
|
|
15826
|
+
return true;
|
|
15827
|
+
}
|
|
15828
|
+
return false;
|
|
15829
|
+
}
|
|
15830
|
+
function formatCountdown(stopTime, _now) {
|
|
15831
|
+
if (!stopTime)
|
|
15832
|
+
return;
|
|
15833
|
+
const endTime = typeof stopTime === 'string' ? parseISO(stopTime) : stopTime;
|
|
15834
|
+
const now = _now && new Date();
|
|
15835
|
+
let totalSeconds = differenceInSeconds(endTime, now);
|
|
15836
|
+
if (totalSeconds < 0)
|
|
15837
|
+
return '0D 00H 00M 00S';
|
|
15838
|
+
const days = Math.floor(totalSeconds / 86400);
|
|
15839
|
+
totalSeconds %= 86400;
|
|
15840
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
15841
|
+
totalSeconds %= 3600;
|
|
15842
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
15843
|
+
const seconds = totalSeconds % 60;
|
|
15844
|
+
return `${days}D ${hours.toString().padStart(2, '0')}H ${minutes.toString().padStart(2, '0')}M ${seconds
|
|
15845
|
+
.toString()
|
|
15846
|
+
.padStart(2, '0')}S`;
|
|
15847
|
+
}
|
|
15848
|
+
|
|
15849
|
+
const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
|
|
15850
|
+
const doSubmitTicket = ({ body, sessionId, url }) => {
|
|
15851
|
+
const options = {
|
|
15852
|
+
method: 'POST',
|
|
15853
|
+
headers: {
|
|
15854
|
+
'Content-Type': 'application/json',
|
|
15855
|
+
Accept: 'application/json',
|
|
15856
|
+
Authorization: `Bearer ${sessionId}`,
|
|
15857
|
+
'X-Idempotency-Key': generateUUID$1()
|
|
15858
|
+
},
|
|
15859
|
+
body: JSON.stringify(body)
|
|
15860
|
+
};
|
|
15861
|
+
return fetch(url, options).then((res) => {
|
|
15862
|
+
if (res.status === 401) {
|
|
15863
|
+
throw new Error(TICKET_INVALID_TOKEN);
|
|
15864
|
+
}
|
|
15865
|
+
if (res.status > 300) {
|
|
15866
|
+
throw new Error(res.statusText);
|
|
15867
|
+
}
|
|
15868
|
+
return res.json().then((data) => {
|
|
15869
|
+
if (checkTicketDetailHasError(data.tickets))
|
|
15870
|
+
throw new Error(res.statusText);
|
|
15871
|
+
return data;
|
|
15872
|
+
});
|
|
15873
|
+
});
|
|
15874
|
+
};
|
|
15875
|
+
function checkTicketDetailHasError(tickets) {
|
|
15876
|
+
if (!tickets || !tickets.length)
|
|
15877
|
+
return true;
|
|
15878
|
+
return tickets.some((i) => i.state !== TicketState.Purchased);
|
|
15879
|
+
}
|
|
15466
15880
|
|
|
15467
15881
|
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.GamePage {\n background-color: var(--emw--color-background, #fff);\n}\n.GamePage .GridBanner {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n background-repeat: no-repeat;\n background-position: center;\n color: var(--emw--color-typography, #000);\n padding: 0 20px 10px;\n height: 220px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.GamePage .GridBanner .BannerButtonsWrapper {\n display: flex;\n justify-content: space-between;\n padding-top: 16px;\n}\n.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,\n.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 7px 15px;\n font-size: 12px;\n text-transform: uppercase;\n width: 80px;\n cursor: pointer;\n}\n.GamePage .GridBanner .GridBannerArea {\n padding-top: 30px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.GamePage .TotalWinnings {\n color: var(--emw--color-typography, #000);\n font-size: 18px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n text-transform: uppercase;\n}\n.GamePage .TotalWinnings span {\n font-size: 18px;\n font-weight: 700;\n}\n.GamePage .NextDraw {\n color: var(--emw--color-primary, #009993);\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto;\n text-align: center;\n text-transform: uppercase;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 4px;\n}\n.GamePage .NextDraw .BannerText {\n font-weight: 400;\n font-size: 18px;\n text-transform: uppercase;\n padding: 0;\n margin: 15px 0 0 0;\n}\n.GamePage .NextDraw .BannerCountdown {\n font-size: 22px;\n color: var(--emw--color-primary, #009993);\n display: flex;\n gap: 20px;\n}\n.GamePage .Tabs {\n display: flex;\n justify-content: center;\n gap: 10px;\n}\n.GamePage .Tabs .TabButton {\n border-radius: var(--emw--button-border-radius, 4px);\n cursor: pointer;\n padding: 8px 0;\n width: 50%;\n max-width: 200px;\n border: 1px solid var(--emw--color-primary, #009993);\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.GamePage .Tabs .TabButton.Active {\n color: var(--emw--color-primary, #009993);\n background: var(--emw--color-gray-50, #f5f5f5);\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n}\n\n.LastDrawResultsTitle {\n color: var(--emw--color-primary, #009993);\n padding: 25px 0 10px 0;\n text-align: center;\n border-radius: var(--emw--button-border-radius, 4px);\n text-transform: uppercase;\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n}\n\n.NextDrawWrapper {\n padding: 10px 15px;\n background: var(--emw--color-background, #fff);\n}\n.NextDrawWrapper .BannerText {\n font-size: 16px;\n font-weight: 700;\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n.NextDrawWrapper .BannerCountdown {\n font-size: 22px;\n display: flex;\n gap: 8px;\n color: var(--emw--color-primary, #009993);\n font-weight: bolder;\n justify-content: center;\n}\n\n.GamePageContent {\n max-width: 1200px;\n margin: 0 auto;\n background: var(--emw--color-background, #fff);\n container-type: inline-size;\n container-name: gamePage;\n}\n\n.TicketsWrapper {\n min-height: 300px;\n}\n\n@container gamePage (min-width: 1200px) {\n .GamePageContent .TicketsWrapper {\n float: left;\n width: 49%;\n }\n .GamePageContent .GameDetails {\n float: right;\n width: 49%;\n }\n .GamePageContent .OrderSummary {\n float: right;\n width: 49%;\n }\n}\n.GameDetails {\n padding-bottom: 10px;\n margin-bottom: 20px;\n}\n\n.OrderSummary {\n min-width: 200px;\n border-radius: var(--emw--button-border-radius, 4px);\n color: var(--emw--color-typography, #000);\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-top: 20px;\n background: var(--emw--color-background, #fff);\n}\n.OrderSummary .OrderSummaryTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n text-transform: uppercase;\n text-align: center;\n}\n.OrderSummary .OrderTicketInfo {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n.OrderSummary .OrderTicketInfo .Multiplier {\n margin: 0 6px;\n}\n.OrderSummary .Ticket {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n margin-right: 30px;\n}\n.OrderSummary .Ticket span {\n text-align: right;\n}\n.OrderSummary hr {\n border: none;\n border-top: 1px double var(--emw--color-gray-100, #e6e6e6);\n color: var(--emw--color-gray-100, #e6e6e6);\n width: 100%;\n}\n.OrderSummary .Total {\n display: inline-block;\n color: var(--emw--color-typography, #000);\n font-size: 14px;\n height: 50px;\n line-height: 50px;\n margin-left: 15px;\n}\n.OrderSummary .Total span {\n text-align: right;\n}\n\n.ButtonWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ButtonWrapper .Button {\n cursor: pointer;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 8px 60px;\n width: max-content;\n margin: 5px;\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-primary, #009993);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.ButtonWrapper .Button:hover {\n background: var(--emw--color-secondary, #00aba4);\n}\n.ButtonWrapper .Button.ButtonDisabled {\n pointer-events: none;\n background: var(--emw--color-background-tertiary, #ccc);\n}\n.ButtonWrapper .submitError {\n margin-top: 10px;\n color: var(--emw--color-error, #ff3d00);\n}\n.ButtonWrapper .submitWrap {\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.SubmitModalSuccess {\n text-align: center;\n font-size: 18px;\n padding: 20px;\n}\n\n.DeleteTicketModalWrapper {\n padding: 20px;\n text-align: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalTitle {\n font-size: 16px;\n color: var(--emw--color-primary, #009993);\n font-weight: 400;\n text-transform: uppercase;\n margin: 20px 0 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalText {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n line-height: 22px;\n margin-bottom: 40px;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons {\n display: flex;\n gap: 10px;\n justify-content: center;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm {\n cursor: pointer;\n border-radius: 4px;\n padding: 8px 25px;\n width: max-content;\n margin: 5px;\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n background: var(--emw--color-error, #ff3d00);\n border: 1px solid var(--emw--color-error, #ff3d00);\n color: var(--emw--color-background-secondary, #f5f5f5);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover {\n background: var(--emw--color-tertiary, #ff6536);\n border: 1px solid var(--emw--color-error, #ff3d00);\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel {\n cursor: pointer;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 4px);\n padding: 10px 25px;\n margin: 5px;\n border: 1px solid var(--emw--color-secondary, #00aba4);\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-size: 12px;\n transition: all 0.2s linear;\n text-transform: uppercase;\n text-align: center;\n letter-spacing: 0;\n}\n.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n}\n\n.GamePage {\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n.GamePage .GamePageContentWrapper,\n.GamePage .HistoryContentWrapper {\n padding: 15px;\n flex: 1;\n background: var(--emw--color-background, #fff);\n}\n\n.HistoryContentWrapper::after,\n.GamePageContent::after {\n content: \"\";\n display: block;\n clear: both;\n}\n\n.GamePageWrap .noActiveDraw {\n margin: 10% auto 0px;\n padding: 24px;\n border: 1px solid var(--emw--color-primary, #009993);\n border-radius: 4px;\n width: 280px;\n color: var(--emw--color-primary, #009993);\n}\n\n.fetching {\n margin: 40px auto;\n}";
|
|
15468
15882
|
const LotteryGamePageStyle0 = lotteryGamePageCss;
|
|
@@ -15505,10 +15919,6 @@ const LotteryGamePage = class {
|
|
|
15505
15919
|
this.hasErrors = false;
|
|
15506
15920
|
this.totalAmount = 0;
|
|
15507
15921
|
this.successVisible = false;
|
|
15508
|
-
this.daysRemaining = undefined;
|
|
15509
|
-
this.hoursRemaining = undefined;
|
|
15510
|
-
this.minutesRemaining = undefined;
|
|
15511
|
-
this.secondsRemaining = undefined;
|
|
15512
15922
|
this.nextDate = undefined;
|
|
15513
15923
|
this.isLoggedIn = false;
|
|
15514
15924
|
this.loginModalVisible = false;
|
|
@@ -15524,6 +15934,8 @@ const LotteryGamePage = class {
|
|
|
15524
15934
|
this.subscriptionError = '';
|
|
15525
15935
|
this.isSubscribed = false;
|
|
15526
15936
|
this.isFetchingGame = false;
|
|
15937
|
+
this.drawSubmitAvailable = false;
|
|
15938
|
+
this.formattedTime = undefined;
|
|
15527
15939
|
}
|
|
15528
15940
|
handleClientStylingChange(newValue, oldValue) {
|
|
15529
15941
|
if (newValue != oldValue) {
|
|
@@ -15582,23 +15994,8 @@ const LotteryGamePage = class {
|
|
|
15582
15994
|
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
15583
15995
|
}
|
|
15584
15996
|
}
|
|
15585
|
-
countdownLogic(date) {
|
|
15586
|
-
const setTime = () => {
|
|
15587
|
-
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
15588
|
-
this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
|
|
15589
|
-
this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) -
|
|
15590
|
-
this.daysRemaining * 24 * 60 -
|
|
15591
|
-
this.hoursRemaining * 60);
|
|
15592
|
-
this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 -
|
|
15593
|
-
this.daysRemaining * 24 * 60 * 60 -
|
|
15594
|
-
this.hoursRemaining * 60 * 60 -
|
|
15595
|
-
this.minutesRemaining * 60);
|
|
15596
|
-
};
|
|
15597
|
-
setTime();
|
|
15598
|
-
this.interval = setInterval(setTime, 1000);
|
|
15599
|
-
}
|
|
15600
15997
|
disconnectedCallback() {
|
|
15601
|
-
clearInterval(this.interval);
|
|
15998
|
+
this.interval && clearInterval(this.interval);
|
|
15602
15999
|
}
|
|
15603
16000
|
getGameDetails() {
|
|
15604
16001
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -15612,13 +16009,32 @@ const LotteryGamePage = class {
|
|
|
15612
16009
|
return res.json();
|
|
15613
16010
|
})
|
|
15614
16011
|
.then((data) => {
|
|
15615
|
-
var _a, _b;
|
|
16012
|
+
var _a, _b, _c, _d, _e;
|
|
15616
16013
|
this.gameData = data;
|
|
15617
16014
|
this.basicStake = this.gameData.rules.stakes.length ? Number(this.gameData.rules.stakes[0].value) : 0;
|
|
15618
16015
|
this.basicLine = ((_a = this.gameData.rules.betTypes) === null || _a === void 0 ? void 0 : _a.length) ? this.gameData.rules.betTypes[0].boardsAllowed[0] : 1;
|
|
15619
16016
|
this.basicBetType = this.gameData.rules.betTypes[0];
|
|
15620
|
-
this.
|
|
15621
|
-
|
|
16017
|
+
if (this.gameData && checkDrawAvailable((_b = this.gameData) === null || _b === void 0 ? void 0 : _b.currentDraw)) {
|
|
16018
|
+
this.nextDate = (_c = this.gameData.currentDraw) === null || _c === void 0 ? void 0 : _c.date;
|
|
16019
|
+
const start = (_e = (_d = this.gameData) === null || _d === void 0 ? void 0 : _d.currentDraw) === null || _e === void 0 ? void 0 : _e.wagerStartTime;
|
|
16020
|
+
const updateTime = () => {
|
|
16021
|
+
var _a;
|
|
16022
|
+
const now = new Date();
|
|
16023
|
+
if (start && isBefore(now, parseISO(start))) {
|
|
16024
|
+
this.drawSubmitAvailable = false;
|
|
16025
|
+
this.formattedTime = { start: formatCountdown(start, now) };
|
|
16026
|
+
}
|
|
16027
|
+
else {
|
|
16028
|
+
this.drawSubmitAvailable = true;
|
|
16029
|
+
this.formattedTime = { nextIn: formatCountdown((_a = data === null || data === void 0 ? void 0 : data.currentDraw) === null || _a === void 0 ? void 0 : _a.date, now) };
|
|
16030
|
+
}
|
|
16031
|
+
if (this.formattedTime.nextIn === '0D 00H 00M 00S') {
|
|
16032
|
+
clearInterval(this.interval);
|
|
16033
|
+
}
|
|
16034
|
+
};
|
|
16035
|
+
updateTime();
|
|
16036
|
+
this.interval = setInterval(updateTime, 1000);
|
|
16037
|
+
}
|
|
15622
16038
|
this.secondarySelectionAllowed = this.gameData.rules.secondarySelectionAllowed === 'INPUT' ? true : false;
|
|
15623
16039
|
this.quickPick = this.gameData.rules.quickPickAvailable;
|
|
15624
16040
|
this.isSubscription = this.gameData.rules.wagerTypes && this.gameData.rules.wagerTypes.includes('Subscription');
|
|
@@ -15855,6 +16271,8 @@ const LotteryGamePage = class {
|
|
|
15855
16271
|
return body;
|
|
15856
16272
|
}
|
|
15857
16273
|
handleSubmitTickets() {
|
|
16274
|
+
if (!this.drawSubmitAvailable)
|
|
16275
|
+
return;
|
|
15858
16276
|
if (this.isSubscription && this.isSubscribed) {
|
|
15859
16277
|
this.submitTickets();
|
|
15860
16278
|
this.submitSubscriptionTickets();
|
|
@@ -15913,41 +16331,20 @@ const LotteryGamePage = class {
|
|
|
15913
16331
|
// @TODO Body TS type
|
|
15914
16332
|
const body = this.buildTicketParam();
|
|
15915
16333
|
if (body) {
|
|
15916
|
-
const uuid = generateUUID$1();
|
|
15917
|
-
// @TODO Options TS type
|
|
15918
|
-
let options = {
|
|
15919
|
-
method: 'POST',
|
|
15920
|
-
headers: {
|
|
15921
|
-
'Content-Type': 'application/json',
|
|
15922
|
-
Accept: 'application/json',
|
|
15923
|
-
Authorization: `Bearer ${this.sessionId}`,
|
|
15924
|
-
'X-Idempotency-Key': uuid
|
|
15925
|
-
},
|
|
15926
|
-
body: JSON.stringify(body)
|
|
15927
|
-
};
|
|
15928
16334
|
this.isLoading = true;
|
|
15929
|
-
|
|
15930
|
-
.then((res) => {
|
|
15931
|
-
if (res.status > 300) {
|
|
15932
|
-
this.apiError = res.statusText + '.';
|
|
15933
|
-
this.showApiError = true;
|
|
15934
|
-
setTimeout(() => {
|
|
15935
|
-
this.showApiError = false;
|
|
15936
|
-
}, 3000);
|
|
15937
|
-
throw new Error(res.statusText);
|
|
15938
|
-
}
|
|
15939
|
-
return res.json();
|
|
15940
|
-
})
|
|
16335
|
+
doSubmitTicket({ body, sessionId: this.sessionId, url: url.href })
|
|
15941
16336
|
.then(() => {
|
|
15942
|
-
// this.successVisible = true;
|
|
15943
16337
|
showNotification({ message: 'Ticket submitted successfully.', theme: 'success' });
|
|
15944
16338
|
this.resetAllTicketSelection.emit();
|
|
15945
16339
|
const event = new CustomEvent('resetAllTicketSelection', { bubbles: true, composed: true });
|
|
15946
16340
|
document.dispatchEvent(event);
|
|
15947
16341
|
})
|
|
15948
|
-
.catch((
|
|
15949
|
-
|
|
15950
|
-
|
|
16342
|
+
.catch((res) => {
|
|
16343
|
+
if (res.message === TICKET_INVALID_TOKEN) {
|
|
16344
|
+
showNotification({ message: TICKET_INVALID_TOKEN, theme: 'error' });
|
|
16345
|
+
return;
|
|
16346
|
+
}
|
|
16347
|
+
showNotification({ message: translate$4('ticketFailed', this.language), theme: 'error' });
|
|
15951
16348
|
})
|
|
15952
16349
|
.finally(() => {
|
|
15953
16350
|
this.isLoading = false;
|
|
@@ -15964,7 +16361,7 @@ const LotteryGamePage = class {
|
|
|
15964
16361
|
this.goToLobbyEvent.emit();
|
|
15965
16362
|
}
|
|
15966
16363
|
render() {
|
|
15967
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
16364
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
15968
16365
|
if (this.hasErrors) {
|
|
15969
16366
|
return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate$4('error', this.language))));
|
|
15970
16367
|
}
|
|
@@ -15975,14 +16372,14 @@ const LotteryGamePage = class {
|
|
|
15975
16372
|
'background-size': 'contain',
|
|
15976
16373
|
'background-repeat': 'no-repeat',
|
|
15977
16374
|
'background-position': 'center'
|
|
15978
|
-
} }, h("div", { class: "BannerButtonsWrapper" }), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => (this.tabIndex = 0) }, translate$4('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => (this.tabIndex = 1) }, translate$4('viewLatest', this.language)))), this.isFetchingGame ? (h("div", { class: "fetching" }, "Loading...")) : (h("div", { class: "GamePageWrap" }, this.nextDate ? (h("div", null, h("div", { class: "NextDrawWrapper" }, h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate$4('
|
|
16375
|
+
} }, h("div", { class: "BannerButtonsWrapper" }), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => (this.tabIndex = 0) }, translate$4('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => (this.tabIndex = 1) }, translate$4('viewLatest', this.language)))), this.isFetchingGame ? (h("div", { class: "fetching" }, "Loading...")) : (h("div", { class: "GamePageWrap" }, this.nextDate ? (h("div", null, h("div", { class: "NextDrawWrapper" }, h("div", { class: "NextDraw" }, ((_a = this.formattedTime) === null || _a === void 0 ? void 0 : _a.start) ? (h("p", { class: "BannerText" }, translate$4('startIn', this.language))) : (h("p", { class: "BannerText" }, translate$4('nextDrawIn', this.language))), h("div", { class: "BannerCountdown" }, ((_b = this.formattedTime) === null || _b === void 0 ? void 0 : _b.start) || ((_c = this.formattedTime) === null || _c === void 0 ? void 0 : _c.nextIn)))), this.tabIndex == 0 && (h("div", { class: "GamePageContentWrapper" }, h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "low-number": (_e = (_d = this.gameData.rules) === null || _d === void 0 ? void 0 : _d.boards[0]) === null || _e === void 0 ? void 0 : _e.lowNumber, "high-number": (_g = (_f = this.gameData.rules) === null || _f === void 0 ? void 0 : _f.boards[0]) === null || _g === void 0 ? void 0 : _g.highNumber, "minimum-allowed": (_j = (_h = this.gameData.rules) === null || _h === void 0 ? void 0 : _h.boards[0]) === null || _j === void 0 ? void 0 : _j.minimumAllowed, "maxinum-allowed": (_l = (_k = this.gameData.rules) === null || _k === void 0 ? void 0 : _k.boards[0]) === null || _l === void 0 ? void 0 : _l.maxinumAllowed, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationData })), h("div", { class: "TicketsWrapper" }, this.mainTickets.map((item) => {
|
|
15979
16376
|
var _a, _b;
|
|
15980
16377
|
return (h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": (_a = this.gameData.rules) === null || _a === void 0 ? void 0 : _a.quickPickAvailable, "reset-button": (_b = this.gameData.rules) === null || _b === void 0 ? void 0 : _b.quickPickAvailable, "total-controllers": this.mainTickets.length, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }));
|
|
15981
|
-
})), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate$4('orderSummaryTitle', this.language)), h("div", { class: "OrderTicketInfo" }, h("div", { class: "Ticket" }, translate$4('orderSummaryTickets', this.language), ": ", h("span", null, this.mainTickets.length)), h("div", null, h("span", null, this.thousandSeperator(((
|
|
15982
|
-
? `${(
|
|
15983
|
-
: `${(
|
|
15984
|
-
? `${(
|
|
15985
|
-
: `${(
|
|
16378
|
+
})), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate$4('orderSummaryTitle', this.language)), h("div", { class: "OrderTicketInfo" }, h("div", { class: "Ticket" }, translate$4('orderSummaryTickets', this.language), ": ", h("span", null, this.mainTickets.length)), h("div", null, h("span", null, this.thousandSeperator(((_o = (_m = this.mainTickets[0]) === null || _m === void 0 ? void 0 : _m.betType) === null || _o === void 0 ? void 0 : _o.combinations) * ((_p = this.mainTickets[0]) === null || _p === void 0 ? void 0 : _p.lineNum))), h("span", { class: "Multiplier" }, "x"), ((_q = this.gameData.rules) === null || _q === void 0 ? void 0 : _q.stakeMultiplierAvailable) && (h("span", null, h("span", null, ((_r = this.mainTickets[0]) === null || _r === void 0 ? void 0 : _r.multiplierNum) === 1
|
|
16379
|
+
? `${(_s = this.mainTickets[0]) === null || _s === void 0 ? void 0 : _s.multiplierNum} Multiplier`
|
|
16380
|
+
: `${(_t = this.mainTickets[0]) === null || _t === void 0 ? void 0 : _t.multiplierNum} Multipliers`), h("span", { class: "Multiplier" }, "x"))), h("span", null, `${(_u = this.mainTickets[0]) === null || _u === void 0 ? void 0 : _u.stake} EUR`), ((_v = this.gameData.rules) === null || _v === void 0 ? void 0 : _v.drawMultiplierAvailable) && (h("span", null, h("span", { class: "Multiplier" }, "x"), h("span", null, ((_w = this.mainTickets[0]) === null || _w === void 0 ? void 0 : _w.drawCount) === 1
|
|
16381
|
+
? `${(_x = this.mainTickets[0]) === null || _x === void 0 ? void 0 : _x.drawCount} Draw`
|
|
16382
|
+
: `${(_y = this.mainTickets[0]) === null || _y === void 0 ? void 0 : _y.drawCount} Draws`))))), h("hr", null), h("div", { class: "Total" }, translate$4('orderSummaryTotal', this.language), ":", ' ', h("span", null, this.thousandSeperator(this.totalAmount), " ", this.currency)), this.isSubscription && (h("div", { class: "SubscriptionWrapper" }, h("lottery-subscription", { endpoint: this.endpoint, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, gameName: this.gameData.name }))), h("div", { class: "ButtonWrapper" }, this.isLoggedIn && (h("div", null, !this.isLoading && (h("div", { class: "submitWrap" }, h("div", { class: { Button: true, ButtonDisabled: !this.drawSubmitAvailable }, onClick: () => this.handleSubmitTickets() }, translate$4('orderSummarySubmit', this.language)), this.showSubmitError && h("div", { class: "submitError" }, this.submitError), this.showApiError && h("div", { class: "submitError" }, this.apiError), this.showSubscriptionError && (h("div", { class: "submitError" }, this.subscriptionError)))), this.isLoading && (h("span", { class: "Button", style: { cursor: 'default' } }, translate$4('loading', this.language))))), !this.isLoggedIn && (h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate$4('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate$4('modalLogin', this.language)))))))))), this.tabIndex == 1 && (h("div", { class: "HistoryContentWrapper" }, h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "translation-url": this.translationData, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }))))) : (h("div", { class: "noActiveDraw" }, translate$4('emptyText', this.language))))), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, h("p", { class: "SubmitModalSuccess" }, translate$4('submitSuccess', this.language)))));
|
|
15986
16383
|
}
|
|
15987
16384
|
static get assetsDirs() { return ["../static"]; }
|
|
15988
16385
|
get element() { return getElement(this); }
|