@everymatrix/lottery-tipping-entrance 1.80.12 → 1.80.14

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.
@@ -1329,7 +1329,7 @@ const generateUUID$2 = () => {
1329
1329
  return v.toString(16);
1330
1330
  });
1331
1331
  };
1332
- function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
1332
+ function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
1333
1333
  return new Promise((resolve, reject) => {
1334
1334
  const uuid = generateUUID$2();
1335
1335
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -1471,7 +1471,7 @@ function thousandSeperator$1(value) {
1471
1471
  }
1472
1472
  async function fetchGameInfo(endpoint, gameId) {
1473
1473
  try {
1474
- const response = await fetchRequest$1(`${endpoint}/games/${gameId}`, 'GET', {});
1474
+ const response = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
1475
1475
  return response;
1476
1476
  }
1477
1477
  catch (error) {
@@ -1589,7 +1589,7 @@ const LotteryTippingLatestResult = class {
1589
1589
  const filterData = {
1590
1590
  excludeStatus: 'INIT,OPEN,CANCELED'
1591
1591
  };
1592
- const { items } = await fetchRequest$1(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams$1(filterData)}`, 'GET');
1592
+ const { items } = await fetchRequest$2(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams$1(filterData)}`, 'GET');
1593
1593
  if (!items || items.length === 0)
1594
1594
  return;
1595
1595
  const filteredItems = items.filter((item) => item.winningNumbers.length > 0);
@@ -1840,7 +1840,7 @@ const generateUUID$1 = () => {
1840
1840
  return v.toString(16);
1841
1841
  });
1842
1842
  };
1843
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
1843
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
1844
1844
  return new Promise((resolve, reject) => {
1845
1845
  const uuid = generateUUID$1();
1846
1846
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -1861,36 +1861,14 @@ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
1861
1861
  fetch(url, options)
1862
1862
  .then((response) => {
1863
1863
  if (!response.ok) {
1864
- return response.json().then((errorData) => {
1865
- const error = {
1866
- status: response.status,
1867
- statusText: response.statusText,
1868
- code: errorData.code || 'UNKNOWN_ERROR',
1869
- message: errorData.message || 'An unknown error occurred',
1870
- data: errorData.data || null
1871
- };
1872
- reject(error);
1873
- }, () => reject({
1874
- status: response.status,
1875
- statusText: response.statusText,
1876
- code: 'PARSE_ERROR',
1877
- message: 'Failed to parse error response'
1878
- }));
1879
- }
1880
- else {
1881
- return response.json();
1864
+ throw new Error(`HTTP error! Status: ${response.status}`);
1882
1865
  }
1866
+ return response.json();
1883
1867
  })
1884
- .then((data) => resolve(data), (error) => reject(error));
1868
+ .then((data) => resolve(data))
1869
+ .catch((error) => reject(error));
1885
1870
  });
1886
1871
  }
1887
- const fetcher$2 = (url) => fetch(url, {
1888
- method: 'GET',
1889
- headers: {
1890
- 'x-scheme': 'application/json',
1891
- Accept: 'application/json'
1892
- }
1893
- }).then((r) => r.json());
1894
1872
  function isEmptyValueOfArray(arr) {
1895
1873
  if (arr.length === 0) {
1896
1874
  return true;
@@ -2338,13 +2316,37 @@ const formatDate$1 = ({ date, type = 'date', format }) => {
2338
2316
  return '';
2339
2317
  }
2340
2318
  };
2341
- const fetcher$1 = (url) => fetch(url, {
2342
- method: 'GET',
2343
- headers: {
2344
- 'x-scheme': 'application/json',
2345
- Accept: 'application/json'
2346
- }
2347
- }).then((r) => r.json());
2319
+ const generateUUID = () => {
2320
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2321
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2322
+ return v.toString(16);
2323
+ });
2324
+ };
2325
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2326
+ return new Promise((resolve, reject) => {
2327
+ const uuid = generateUUID();
2328
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2329
+ if (method !== 'GET' && method !== 'HEAD') {
2330
+ headersOrigin['X-Idempotency-Key'] = uuid;
2331
+ }
2332
+ const options = {
2333
+ method,
2334
+ headers: headersOrigin
2335
+ };
2336
+ if (body && method !== 'GET' && method !== 'HEAD') {
2337
+ options.body = JSON.stringify(body);
2338
+ }
2339
+ fetch(url, options)
2340
+ .then((response) => {
2341
+ if (!response.ok) {
2342
+ throw new Error(`HTTP error! Status: ${response.status}`);
2343
+ }
2344
+ return response.json();
2345
+ })
2346
+ .then((data) => resolve(data))
2347
+ .catch((error) => reject(error));
2348
+ });
2349
+ }
2348
2350
  const showNotification$1 = ({ message, theme = 'success' }) => {
2349
2351
  window.postMessage({
2350
2352
  type: 'ShowNotificationToast',
@@ -2364,12 +2366,6 @@ const thousandSeparator = (value) => {
2364
2366
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
2365
2367
  return parts.join('.');
2366
2368
  };
2367
- const generateUUID = () => {
2368
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2369
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2370
- return v.toString(16);
2371
- });
2372
- };
2373
2369
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
2374
2370
  // format results to winning numbers
2375
2371
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -3227,7 +3223,7 @@ const LotteryTippingTicketController = class {
3227
3223
  const fetchData = () => {
3228
3224
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3229
3225
  this.isLoading = true;
3230
- fetcher$1(url.href)
3226
+ fetchRequest(url.href, 'GET')
3231
3227
  .then((res) => {
3232
3228
  var _a, _b, _c, _d, _e, _f, _g;
3233
3229
  this.rawData = res;
@@ -3334,7 +3330,7 @@ const LotteryTippingTicketController = class {
3334
3330
  }
3335
3331
  render() {
3336
3332
  var _a, _b, _c, _d, _e, _f, _g;
3337
- return (index.h("div", { key: '6b7aee4aacf53744bed1b3f3064b3a8357806ce5', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, index.h("lottery-tipping-ticket-banner", { key: '59907469fbee5440485938631bf311476d2649df', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, period: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.date, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), index.h("div", { key: '891700a5bb16ce5ddb4be8a0c48c824a97710edd', class: "flex flex-wrap LotteryTippingTicketController__main" }, index.h("div", { key: 'bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9', class: "LotteryTippingTicketController__main--left" }, index.h("lottery-tipping-ticket-bet", { key: '8fbfdf48b51ac3aa8faf51da106131d25ed99992', ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (index.h("vaadin-confirm-dialog", { key: 'a93fcec56f649438c6f0d3668d322885dd4da7dc', rejectButtonVisible: true, rejectText: translate$2('cancel', this.language), confirmText: translate$2('confirm', this.language), opened: (_f = this.dialogConfig) === null || _f === void 0 ? void 0 : _f.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_g = this.dialogConfig) === null || _g === void 0 ? void 0 : _g.content))));
3333
+ return (index.h("div", { key: '337388f1cf75297195a88c3728b865e74f613849', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, index.h("lottery-tipping-ticket-banner", { key: '2cd069a119c2a29773d217d0ad40f985fe05fb14', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, period: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.date, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), index.h("div", { key: '1ab326849e99b9558d1d6bc94985a4c48d74ab4a', class: "flex flex-wrap LotteryTippingTicketController__main" }, index.h("div", { key: 'abfb225ed18d7325555e2cdebd93348e82ae773e', class: "LotteryTippingTicketController__main--left" }, index.h("lottery-tipping-ticket-bet", { key: '19237e4c08ae390801898dd38796a6622255cd94', ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (index.h("vaadin-confirm-dialog", { key: 'fa596e199dfc64d23768c739981a4c494c93010c', rejectButtonVisible: true, rejectText: translate$2('cancel', this.language), confirmText: translate$2('confirm', this.language), opened: (_f = this.dialogConfig) === null || _f === void 0 ? void 0 : _f.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_g = this.dialogConfig) === null || _g === void 0 ? void 0 : _g.content))));
3338
3334
  }
3339
3335
  static get assetsDirs() { return ["../static"]; }
3340
3336
  static get watchers() { return {
@@ -3462,7 +3458,7 @@ const LotteryTippingTicketHistory = class {
3462
3458
  try {
3463
3459
  this.isLoading = true;
3464
3460
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3465
- const res = await fetcher$2(url.href);
3461
+ const res = await fetchRequest$1(url.href, 'GET');
3466
3462
  this.rawData = res;
3467
3463
  }
3468
3464
  catch (e) {
@@ -3503,7 +3499,7 @@ const LotteryTippingTicketHistory = class {
3503
3499
  async fetchTicketList() {
3504
3500
  this.isLoading = true;
3505
3501
  try {
3506
- const { items, total } = await fetchRequest(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
3502
+ const { items, total } = await fetchRequest$1(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
3507
3503
  Authorization: `Bearer ${this.sessionId}`
3508
3504
  });
3509
3505
  this.ticketHistory = items;
@@ -3525,7 +3521,7 @@ const LotteryTippingTicketHistory = class {
3525
3521
  }
3526
3522
  async fetchDrwaResult(gameId, drawId) {
3527
3523
  try {
3528
- const res = await fetchRequest(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
3524
+ const res = await fetchRequest$1(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
3529
3525
  return res;
3530
3526
  }
3531
3527
  catch (e) {
@@ -3684,15 +3680,15 @@ const LotteryTippingTicketHistory = class {
3684
3680
  return name !== null && name !== void 0 ? name : bettingType;
3685
3681
  }
3686
3682
  render() {
3687
- return (index.h("div", { key: '9dbed4dca8e568a334c63748d1768ace33922270', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '4149c4c6f067be28f1334a8642790d9886d219ef', class: "ticket-history-title" }, translate$4('ticketsHistory', this.language)), index.h("div", { key: '185ac4ad602e6e8bb0ec025a5cc2c4a9b8418444', class: "filter-wrap" }, index.h("div", { key: 'd136c367780b696403f075b261f2009cc94edc5d', class: "filter-status" }, this.statusOptions.map((status) => (index.h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), index.h("div", { key: 'e6a30ef0f8c957813a7b13238353709cfb9e2dd9', class: "filter-operation" }, index.h("lottery-tipping-filter", { key: '4e1e0ba0eeafd7e64344c2b8e4e7d0c0f097127b', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (index.h("div", { key: 'f572e1bd9cbf97948b9a9bda34f34c1407a8007e', class: "loading-wrap" }, index.h("section", { key: '9198457f400b175e4c9721449e49a987090860d9', class: "dots-container" }, index.h("div", { key: '0b1196e3ad2b05ef91965b2a52728e5386578e4b', class: "dot" }), index.h("div", { key: '19a5b0bc39fd931455a7972d66b640ca36685ea9', class: "dot" }), index.h("div", { key: '8bf3a43540d38c98d27cb7bf61d7595123a4739c', class: "dot" }), index.h("div", { key: '5ed33ee21018c3b2aae97a6b1345fdec2072fefe', class: "dot" }), index.h("div", { key: '2d4404c8e0d39dc82bb25554c242d27e091a9932', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (index.h("div", { key: '4b731612e57d8bde341da7d639dec6f245c7156d', class: "empty-wrap" }, translate$4('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (index.h("div", { key: 'c9a17cc74f32ae9277d069a8633f38a8478e642c', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (index.h("lottery-tipping-panel", { "header-title": lotteryTippingEntrance.format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, index.h("div", { class: "panel-content", slot: "content" }, index.h("div", { class: "ticket-info" }, index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketId', this.language)), index.h("div", { class: "ticket-info-val" }, item.id, " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketType', this.language)), index.h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketAmount', this.language)), index.h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('lineDetail', this.language)), index.h("div", { class: "ticket-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$4('seeDetails', this.language)))), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('numberOfDraw', this.language)), index.h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
3688
- item.drawResults.map((drawResultItem) => (index.h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (index.h("div", { class: "draw-info" }, index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('ticketResult', this.language)), index.h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('drawId', this.language)), index.h("div", { class: "draw-info-val" }, drawResultItem.drawId)), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('drawDate', this.language)), index.h("div", { class: "draw-info-val" }, lotteryTippingEntrance.format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('result', this.language)), index.h("div", { class: "draw-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$4('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('prize', this.language)), index.h("div", { class: "draw-info-val1" }, index.h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (index.h("span", null, index.h("div", null, index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), index.h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (index.h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (index.h("div", { class: "skeleton-line" })))))))))))))), index.h("lottery-tipping-dialog", { key: '4ef7d281084bc6441e6a3e666ac52a7df3dfd28c', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3683
+ return (index.h("div", { key: '0a8574ec1ba181a07043ec0451dfca73f8aaaf9d', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'f6f0f989a7b4e598e2d9c3d18c83d4f8b4595d84', class: "ticket-history-title" }, translate$4('ticketsHistory', this.language)), index.h("div", { key: 'e80a9d6e39d899fe6a210837853aacfea21a6cb3', class: "filter-wrap" }, index.h("div", { key: 'edeaca1e9062a0b9ef264151113bc6130f358017', class: "filter-status" }, this.statusOptions.map((status) => (index.h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), index.h("div", { key: 'fdae8b8a796d62827530955449baf85152b4bd49', class: "filter-operation" }, index.h("lottery-tipping-filter", { key: '004a977ff4460be8e1fbffd22fb6a742401b6597', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (index.h("div", { key: '4142baea434e611b871f7b8712a8ed03961bf929', class: "loading-wrap" }, index.h("section", { key: 'd412ab2648dc168e76d13957b9d654522d0211e4', class: "dots-container" }, index.h("div", { key: '81cca835dff7b6708354d79ecdb804fd768dfdf5', class: "dot" }), index.h("div", { key: '4fd405a231c5560b014bc9dc34e8847daf197ab1', class: "dot" }), index.h("div", { key: 'b89f42119dc855255ffb27b7d12d525dca40ab20', class: "dot" }), index.h("div", { key: 'c9ce133fe12b41639719558922ab0651ed82f605', class: "dot" }), index.h("div", { key: '8a18cbe9892de938f731045c0d8a01a6f58ab19d', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (index.h("div", { key: 'c806d553da2223941f0e1a28a12f96088e0bd45d', class: "empty-wrap" }, translate$4('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (index.h("div", { key: '4ac929f08ef09e5f18cfcb0424c489f8d513bc9b', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (index.h("lottery-tipping-panel", { "header-title": lotteryTippingEntrance.format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, index.h("div", { class: "panel-content", slot: "content" }, index.h("div", { class: "ticket-info" }, index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketId', this.language)), index.h("div", { class: "ticket-info-val" }, item.id, " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketType', this.language)), index.h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('ticketAmount', this.language)), index.h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('lineDetail', this.language)), index.h("div", { class: "ticket-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$4('seeDetails', this.language)))), index.h("div", { class: "ticket-info-item" }, index.h("div", { class: "ticket-info-label" }, translate$4('numberOfDraw', this.language)), index.h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
3684
+ item.drawResults.map((drawResultItem) => (index.h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (index.h("div", { class: "draw-info" }, index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('ticketResult', this.language)), index.h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('drawId', this.language)), index.h("div", { class: "draw-info-val" }, drawResultItem.drawId)), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('drawDate', this.language)), index.h("div", { class: "draw-info-val" }, lotteryTippingEntrance.format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('result', this.language)), index.h("div", { class: "draw-info-val" }, index.h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$4('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (index.h("div", { class: "draw-info-item" }, index.h("div", { class: "draw-info-label" }, translate$4('prize', this.language)), index.h("div", { class: "draw-info-val1" }, index.h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (index.h("span", null, index.h("div", null, index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), index.h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), index.h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (index.h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (index.h("div", { class: "skeleton-line" })))))))))))))), index.h("lottery-tipping-dialog", { key: 'ef4cff5d933545372cef4f6eb4e7dcd1a8f6f111', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3689
3685
  this.showCurrentTicketLine = false;
3690
- }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (index.h("div", { key: '0fe7ae0f7deceb8b3c939a401efafe70124411dd' }, index.h("div", { key: '5418df176032a83dbd05ee545fffc255694413a2', class: "betting-type" }, index.h("div", { key: '8fb74f2041677fe8876a54773451d00f53abe0df', class: "betting-type-title" }, translate$4('bettingType', this.language)), index.h("div", { key: 'b9bc169c4df854a59606d0ddf330707677720263', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), index.h("lottery-tipping-ticket-bet", { key: 'e76e8c1a24b22668d82f54bfed708afb676f23c9', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("lottery-tipping-dialog", { key: 'cf4220d7b9ef7a174ab059574e1d758096cf6f6c', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3686
+ }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (index.h("div", { key: '817ee1fe2541a4ed62b944b58b7abb1eda7afdbe' }, index.h("div", { key: '68672db719f3cc643d6b17769c0a786b3c931a42', class: "betting-type" }, index.h("div", { key: 'af264555814c9e3262b64722438ecd449f451ceb', class: "betting-type-title" }, translate$4('bettingType', this.language)), index.h("div", { key: '25b9bff20eb5a221bed6d345412dd48964890ae7', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), index.h("lottery-tipping-ticket-bet", { key: '4a01e6f1734e5165b06713d3dbb7484463cc1bf4', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("lottery-tipping-dialog", { key: '06fd83f481eb08a4601a96353557a925b1205b66', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3691
3687
  this.showCurrentDrawResult = false;
3692
- }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (index.h("div", { key: '61214e66f20708cf92fa12d9b3afa3feee2e4335' }, index.h("div", { key: '589010058422524a0b3478cee60fa13703d921e9', class: "betting-type" }, index.h("div", { key: '657e2cede56274839d1e56784e7f85e61c5b3a42', class: "betting-type-title" }, translate$4('bettingType', this.language)), index.h("div", { key: 'b2b77770d0d439d7a2d062943c1cb114a7e54574', class: "betting-type-text" }, index.h("div", { key: '8a9e0821b8165a9cc04c5be4b3eb7286bdcef21f', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (index.h("button", { class: {
3688
+ }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (index.h("div", { key: 'c9161334967e9e5abaae4a3d1df922ee7d8d7945' }, index.h("div", { key: 'c7a3ac60084056b899a2b59a6205cddbc8d4e7fc', class: "betting-type" }, index.h("div", { key: '97aa9e8c9048bb57f70d4230f29f8fde3aa4454a', class: "betting-type-title" }, translate$4('bettingType', this.language)), index.h("div", { key: '64332b20eabf75e9273bb6f16c16436e90b28346', class: "betting-type-text" }, index.h("div", { key: 'cbd1ec9e723c6a369a98141077e4648d802c76ad', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (index.h("button", { class: {
3693
3689
  LotteryTippingTicketController__segment: true,
3694
3690
  'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
3695
- }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), index.h("lottery-tipping-ticket-bet", { key: '313e81c7d8181316896a2a46211d12ede72b5353', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("div", { key: '374d4a579f634ae631392b9e16a3a9acd0cf029c', class: "pagination-wrap" }, index.h("lottery-tipping-pagination", { key: '0a22fb6a1d59c391f2db3a2e20774a1b19491739', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
3691
+ }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), index.h("lottery-tipping-ticket-bet", { key: '8b352410c87858e5629a5524e70134ccc2e1b116', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), index.h("div", { key: 'e730c86100cb47c4c63051174cd9b33dbb8e6ce4', class: "pagination-wrap" }, index.h("lottery-tipping-pagination", { key: 'dce4d6e9a18e783339d0ff545d1bd47bf1b2a33d', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
3696
3692
  }
3697
3693
  static get watchers() { return {
3698
3694
  "clientStyling": ["handleClientStylingChange"],
@@ -1326,7 +1326,7 @@ const generateUUID$2 = () => {
1326
1326
  return v.toString(16);
1327
1327
  });
1328
1328
  };
1329
- function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
1329
+ function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
1330
1330
  return new Promise((resolve, reject) => {
1331
1331
  const uuid = generateUUID$2();
1332
1332
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -1468,7 +1468,7 @@ function thousandSeperator$1(value) {
1468
1468
  }
1469
1469
  async function fetchGameInfo(endpoint, gameId) {
1470
1470
  try {
1471
- const response = await fetchRequest$1(`${endpoint}/games/${gameId}`, 'GET', {});
1471
+ const response = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
1472
1472
  return response;
1473
1473
  }
1474
1474
  catch (error) {
@@ -1586,7 +1586,7 @@ const LotteryTippingLatestResult = class {
1586
1586
  const filterData = {
1587
1587
  excludeStatus: 'INIT,OPEN,CANCELED'
1588
1588
  };
1589
- const { items } = await fetchRequest$1(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams$1(filterData)}`, 'GET');
1589
+ const { items } = await fetchRequest$2(`${this.endpoint}/games/${this.gameId}/draws${toQueryParams$1(filterData)}`, 'GET');
1590
1590
  if (!items || items.length === 0)
1591
1591
  return;
1592
1592
  const filteredItems = items.filter((item) => item.winningNumbers.length > 0);
@@ -1837,7 +1837,7 @@ const generateUUID$1 = () => {
1837
1837
  return v.toString(16);
1838
1838
  });
1839
1839
  };
1840
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
1840
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
1841
1841
  return new Promise((resolve, reject) => {
1842
1842
  const uuid = generateUUID$1();
1843
1843
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
@@ -1858,36 +1858,14 @@ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
1858
1858
  fetch(url, options)
1859
1859
  .then((response) => {
1860
1860
  if (!response.ok) {
1861
- return response.json().then((errorData) => {
1862
- const error = {
1863
- status: response.status,
1864
- statusText: response.statusText,
1865
- code: errorData.code || 'UNKNOWN_ERROR',
1866
- message: errorData.message || 'An unknown error occurred',
1867
- data: errorData.data || null
1868
- };
1869
- reject(error);
1870
- }, () => reject({
1871
- status: response.status,
1872
- statusText: response.statusText,
1873
- code: 'PARSE_ERROR',
1874
- message: 'Failed to parse error response'
1875
- }));
1876
- }
1877
- else {
1878
- return response.json();
1861
+ throw new Error(`HTTP error! Status: ${response.status}`);
1879
1862
  }
1863
+ return response.json();
1880
1864
  })
1881
- .then((data) => resolve(data), (error) => reject(error));
1865
+ .then((data) => resolve(data))
1866
+ .catch((error) => reject(error));
1882
1867
  });
1883
1868
  }
1884
- const fetcher$2 = (url) => fetch(url, {
1885
- method: 'GET',
1886
- headers: {
1887
- 'x-scheme': 'application/json',
1888
- Accept: 'application/json'
1889
- }
1890
- }).then((r) => r.json());
1891
1869
  function isEmptyValueOfArray(arr) {
1892
1870
  if (arr.length === 0) {
1893
1871
  return true;
@@ -2335,13 +2313,37 @@ const formatDate$1 = ({ date, type = 'date', format: format$1 }) => {
2335
2313
  return '';
2336
2314
  }
2337
2315
  };
2338
- const fetcher$1 = (url) => fetch(url, {
2339
- method: 'GET',
2340
- headers: {
2341
- 'x-scheme': 'application/json',
2342
- Accept: 'application/json'
2343
- }
2344
- }).then((r) => r.json());
2316
+ const generateUUID = () => {
2317
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2318
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2319
+ return v.toString(16);
2320
+ });
2321
+ };
2322
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2323
+ return new Promise((resolve, reject) => {
2324
+ const uuid = generateUUID();
2325
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2326
+ if (method !== 'GET' && method !== 'HEAD') {
2327
+ headersOrigin['X-Idempotency-Key'] = uuid;
2328
+ }
2329
+ const options = {
2330
+ method,
2331
+ headers: headersOrigin
2332
+ };
2333
+ if (body && method !== 'GET' && method !== 'HEAD') {
2334
+ options.body = JSON.stringify(body);
2335
+ }
2336
+ fetch(url, options)
2337
+ .then((response) => {
2338
+ if (!response.ok) {
2339
+ throw new Error(`HTTP error! Status: ${response.status}`);
2340
+ }
2341
+ return response.json();
2342
+ })
2343
+ .then((data) => resolve(data))
2344
+ .catch((error) => reject(error));
2345
+ });
2346
+ }
2345
2347
  const showNotification$1 = ({ message, theme = 'success' }) => {
2346
2348
  window.postMessage({
2347
2349
  type: 'ShowNotificationToast',
@@ -2361,12 +2363,6 @@ const thousandSeparator = (value) => {
2361
2363
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
2362
2364
  return parts.join('.');
2363
2365
  };
2364
- const generateUUID = () => {
2365
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2366
- var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
2367
- return v.toString(16);
2368
- });
2369
- };
2370
2366
  const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
2371
2367
  // format results to winning numbers
2372
2368
  const formatResultsToWinningNumbers = (rawResults) => {
@@ -3224,7 +3220,7 @@ const LotteryTippingTicketController = class {
3224
3220
  const fetchData = () => {
3225
3221
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3226
3222
  this.isLoading = true;
3227
- fetcher$1(url.href)
3223
+ fetchRequest(url.href, 'GET')
3228
3224
  .then((res) => {
3229
3225
  var _a, _b, _c, _d, _e, _f, _g;
3230
3226
  this.rawData = res;
@@ -3331,7 +3327,7 @@ const LotteryTippingTicketController = class {
3331
3327
  }
3332
3328
  render() {
3333
3329
  var _a, _b, _c, _d, _e, _f, _g;
3334
- return (h("div", { key: '6b7aee4aacf53744bed1b3f3064b3a8357806ce5', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '59907469fbee5440485938631bf311476d2649df', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, period: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.date, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '891700a5bb16ce5ddb4be8a0c48c824a97710edd', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'bdc6509e6a560bfaa01a730c3967d3e26c3e9dc9', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '8fbfdf48b51ac3aa8faf51da106131d25ed99992', ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (h("vaadin-confirm-dialog", { key: 'a93fcec56f649438c6f0d3668d322885dd4da7dc', rejectButtonVisible: true, rejectText: translate$2('cancel', this.language), confirmText: translate$2('confirm', this.language), opened: (_f = this.dialogConfig) === null || _f === void 0 ? void 0 : _f.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_g = this.dialogConfig) === null || _g === void 0 ? void 0 : _g.content))));
3330
+ return (h("div", { key: '337388f1cf75297195a88c3728b865e74f613849', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: '2cd069a119c2a29773d217d0ad40f985fe05fb14', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, period: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.date, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: '1ab326849e99b9558d1d6bc94985a4c48d74ab4a', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: 'abfb225ed18d7325555e2cdebd93348e82ae773e', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '19237e4c08ae390801898dd38796a6622255cd94', ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (h("vaadin-confirm-dialog", { key: 'fa596e199dfc64d23768c739981a4c494c93010c', rejectButtonVisible: true, rejectText: translate$2('cancel', this.language), confirmText: translate$2('confirm', this.language), opened: (_f = this.dialogConfig) === null || _f === void 0 ? void 0 : _f.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_g = this.dialogConfig) === null || _g === void 0 ? void 0 : _g.content))));
3335
3331
  }
3336
3332
  static get assetsDirs() { return ["../static"]; }
3337
3333
  static get watchers() { return {
@@ -3459,7 +3455,7 @@ const LotteryTippingTicketHistory = class {
3459
3455
  try {
3460
3456
  this.isLoading = true;
3461
3457
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
3462
- const res = await fetcher$2(url.href);
3458
+ const res = await fetchRequest$1(url.href, 'GET');
3463
3459
  this.rawData = res;
3464
3460
  }
3465
3461
  catch (e) {
@@ -3500,7 +3496,7 @@ const LotteryTippingTicketHistory = class {
3500
3496
  async fetchTicketList() {
3501
3497
  this.isLoading = true;
3502
3498
  try {
3503
- const { items, total } = await fetchRequest(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
3499
+ const { items, total } = await fetchRequest$1(`${this.endpointTicket}/tickets${toQueryParams(this.filterData)}`, 'GET', null, {
3504
3500
  Authorization: `Bearer ${this.sessionId}`
3505
3501
  });
3506
3502
  this.ticketHistory = items;
@@ -3522,7 +3518,7 @@ const LotteryTippingTicketHistory = class {
3522
3518
  }
3523
3519
  async fetchDrwaResult(gameId, drawId) {
3524
3520
  try {
3525
- const res = await fetchRequest(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
3521
+ const res = await fetchRequest$1(`${this.endpoint}/games/${gameId}/draws/${drawId}`, 'GET', {});
3526
3522
  return res;
3527
3523
  }
3528
3524
  catch (e) {
@@ -3681,15 +3677,15 @@ const LotteryTippingTicketHistory = class {
3681
3677
  return name !== null && name !== void 0 ? name : bettingType;
3682
3678
  }
3683
3679
  render() {
3684
- return (h("div", { key: '9dbed4dca8e568a334c63748d1768ace33922270', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, h("div", { key: '4149c4c6f067be28f1334a8642790d9886d219ef', class: "ticket-history-title" }, translate$4('ticketsHistory', this.language)), h("div", { key: '185ac4ad602e6e8bb0ec025a5cc2c4a9b8418444', class: "filter-wrap" }, h("div", { key: 'd136c367780b696403f075b261f2009cc94edc5d', class: "filter-status" }, this.statusOptions.map((status) => (h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), h("div", { key: 'e6a30ef0f8c957813a7b13238353709cfb9e2dd9', class: "filter-operation" }, h("lottery-tipping-filter", { key: '4e1e0ba0eeafd7e64344c2b8e4e7d0c0f097127b', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (h("div", { key: 'f572e1bd9cbf97948b9a9bda34f34c1407a8007e', class: "loading-wrap" }, h("section", { key: '9198457f400b175e4c9721449e49a987090860d9', class: "dots-container" }, h("div", { key: '0b1196e3ad2b05ef91965b2a52728e5386578e4b', class: "dot" }), h("div", { key: '19a5b0bc39fd931455a7972d66b640ca36685ea9', class: "dot" }), h("div", { key: '8bf3a43540d38c98d27cb7bf61d7595123a4739c', class: "dot" }), h("div", { key: '5ed33ee21018c3b2aae97a6b1345fdec2072fefe', class: "dot" }), h("div", { key: '2d4404c8e0d39dc82bb25554c242d27e091a9932', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (h("div", { key: '4b731612e57d8bde341da7d639dec6f245c7156d', class: "empty-wrap" }, translate$4('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (h("div", { key: 'c9a17cc74f32ae9277d069a8633f38a8478e642c', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, h("div", { class: "panel-content", slot: "content" }, h("div", { class: "ticket-info" }, h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketId', this.language)), h("div", { class: "ticket-info-val" }, item.id, " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketType', this.language)), h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketAmount', this.language)), h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('lineDetail', this.language)), h("div", { class: "ticket-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$4('seeDetails', this.language)))), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('numberOfDraw', this.language)), h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
3685
- item.drawResults.map((drawResultItem) => (h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (h("div", { class: "draw-info" }, h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('ticketResult', this.language)), h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('drawId', this.language)), h("div", { class: "draw-info-val" }, drawResultItem.drawId)), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('drawDate', this.language)), h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('result', this.language)), h("div", { class: "draw-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$4('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('prize', this.language)), h("div", { class: "draw-info-val1" }, h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (h("span", null, h("div", null, h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (h("div", { class: "skeleton-line" })))))))))))))), h("lottery-tipping-dialog", { key: '4ef7d281084bc6441e6a3e666ac52a7df3dfd28c', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3680
+ return (h("div", { key: '0a8574ec1ba181a07043ec0451dfca73f8aaaf9d', class: "lottery-tipping-ticket-history", ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'f6f0f989a7b4e598e2d9c3d18c83d4f8b4595d84', class: "ticket-history-title" }, translate$4('ticketsHistory', this.language)), h("div", { key: 'e80a9d6e39d899fe6a210837853aacfea21a6cb3', class: "filter-wrap" }, h("div", { key: 'edeaca1e9062a0b9ef264151113bc6130f358017', class: "filter-status" }, this.statusOptions.map((status) => (h("div", { class: 'filter-status-btn' + (this.activeStatus == status.value ? ' active' : ''), onClick: () => this.changeStatus(status.value) }, status.label)))), h("div", { key: 'fdae8b8a796d62827530955449baf85152b4bd49', class: "filter-operation" }, h("lottery-tipping-filter", { key: '004a977ff4460be8e1fbffd22fb6a742401b6597', "quick-filters-active": this.quickFiltersActive, language: this.language, "translation-url": this.translationUrl }))), this.isLoading && (h("div", { key: '4142baea434e611b871f7b8712a8ed03961bf929', class: "loading-wrap" }, h("section", { key: 'd412ab2648dc168e76d13957b9d654522d0211e4', class: "dots-container" }, h("div", { key: '81cca835dff7b6708354d79ecdb804fd768dfdf5', class: "dot" }), h("div", { key: '4fd405a231c5560b014bc9dc34e8847daf197ab1', class: "dot" }), h("div", { key: 'b89f42119dc855255ffb27b7d12d525dca40ab20', class: "dot" }), h("div", { key: 'c9ce133fe12b41639719558922ab0651ed82f605', class: "dot" }), h("div", { key: '8a18cbe9892de938f731045c0d8a01a6f58ab19d', class: "dot" })))), !this.isLoading && (!this.ticketHistory || this.ticketHistory.length == 0) && (h("div", { key: 'c806d553da2223941f0e1a28a12f96088e0bd45d', class: "empty-wrap" }, translate$4('noData', this.language))), !this.isLoading && this.ticketHistory && this.ticketHistory.length != 0 && (h("div", { key: '4ac929f08ef09e5f18cfcb0424c489f8d513bc9b', class: "ticket-list-wrap" }, this.ticketHistory.map((item) => (h("lottery-tipping-panel", { "header-title": format(new Date(item.createdAt), 'dd/MM/yyyy HH:mm:ss') + ' ' + item.state }, h("div", { class: "panel-content", slot: "content" }, h("div", { class: "ticket-info" }, h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketId', this.language)), h("div", { class: "ticket-info-val" }, item.id, " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketType', this.language)), h("div", { class: "ticket-info-val" }, this.ticketTypeMap[item.wagerType], " ")), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('ticketAmount', this.language)), h("div", { class: "ticket-info-val" }, `${item.amount} ${item.currency}`)), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('lineDetail', this.language)), h("div", { class: "ticket-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowTicketLineDetial(item) }, translate$4('seeDetails', this.language)))), h("div", { class: "ticket-info-item" }, h("div", { class: "ticket-info-label" }, translate$4('numberOfDraw', this.language)), h("div", { class: "ticket-info-val" }, item.drawCount))), item.state == 'Settled' &&
3681
+ item.drawResults.map((drawResultItem) => (h("div", { class: "draw-info-container" }, drawResultItem.tempDrawData ? (h("div", { class: "draw-info" }, h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('ticketResult', this.language)), h("div", { class: "draw-info-val" }, this.resultMap[drawResultItem.state])), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('drawId', this.language)), h("div", { class: "draw-info-val" }, drawResultItem.drawId)), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('drawDate', this.language)), h("div", { class: "draw-info-val" }, format(new Date(drawResultItem.tempDrawData.date), 'dd/MM/yyyy'))), h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('result', this.language)), h("div", { class: "draw-info-val" }, h("span", { class: "show-detail-link", onClick: () => this.handleShowCurrentDraw(drawResultItem.tempDrawData) }, translate$4('seeDetails', this.language)))), drawResultItem.state === DrawResult.WON && (h("div", { class: "draw-info-item" }, h("div", { class: "draw-info-label" }, translate$4('prize', this.language)), h("div", { class: "draw-info-val1" }, h("div", { style: { height: '20px' } }), drawResultItem.prizeDetails.map((prizeItem) => (h("span", null, h("div", null, h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.prizeName, prizeItem.times > 1 ? ' x ' + prizeItem.times : '', ":", ' '), h("span", { style: { 'margin-right': '4px', color: 'rgb(85, 85, 85)' } }, thousandSeperator(prizeItem.amount)), h("span", { style: { color: 'rgb(85, 85, 85)' } }, prizeItem.currency)))))))))) : (h("div", { class: "draw-info-skeleton" }, [...Array(5)].map(() => (h("div", { class: "skeleton-line" })))))))))))))), h("lottery-tipping-dialog", { key: 'ef4cff5d933545372cef4f6eb4e7dcd1a8f6f111', visible: this.showCurrentTicketLine, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3686
3682
  this.showCurrentTicketLine = false;
3687
- }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (h("div", { key: '0fe7ae0f7deceb8b3c939a401efafe70124411dd' }, h("div", { key: '5418df176032a83dbd05ee545fffc255694413a2', class: "betting-type" }, h("div", { key: '8fb74f2041677fe8876a54773451d00f53abe0df', class: "betting-type-title" }, translate$4('bettingType', this.language)), h("div", { key: 'b9bc169c4df854a59606d0ddf330707677720263', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), h("lottery-tipping-ticket-bet", { key: 'e76e8c1a24b22668d82f54bfed708afb676f23c9', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("lottery-tipping-dialog", { key: 'cf4220d7b9ef7a174ab059574e1d758096cf6f6c', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3683
+ }, language: this.language, "translation-url": this.translationUrl }, this.curSelection && this.curSelection.length && (h("div", { key: '817ee1fe2541a4ed62b944b58b7abb1eda7afdbe' }, h("div", { key: '68672db719f3cc643d6b17769c0a786b3c931a42', class: "betting-type" }, h("div", { key: 'af264555814c9e3262b64722438ecd449f451ceb', class: "betting-type-title" }, translate$4('bettingType', this.language)), h("div", { key: '25b9bff20eb5a221bed6d345412dd48964890ae7', class: "betting-type-text" }, this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))), h("lottery-tipping-ticket-bet", { key: '4a01e6f1734e5165b06713d3dbb7484463cc1bf4', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curTicketItem.vendorGameId, "draw-id": this.curTicketItem.startingDrawId, "default-bullet-config-line-group": JSON.stringify(this.curSelection), "read-pretty": true, "total-pages": this.curSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("lottery-tipping-dialog", { key: '06fd83f481eb08a4601a96353557a925b1205b66', visible: this.showCurrentDrawResult, width: !isMobile(window.navigator.userAgent) ? '720px' : undefined, fullscreen: isMobile(window.navigator.userAgent), closable: true, showFooter: false, onCancel: () => {
3688
3684
  this.showCurrentDrawResult = false;
3689
- }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (h("div", { key: '61214e66f20708cf92fa12d9b3afa3feee2e4335' }, h("div", { key: '589010058422524a0b3478cee60fa13703d921e9', class: "betting-type" }, h("div", { key: '657e2cede56274839d1e56784e7f85e61c5b3a42', class: "betting-type-title" }, translate$4('bettingType', this.language)), h("div", { key: 'b2b77770d0d439d7a2d062943c1cb114a7e54574', class: "betting-type-text" }, h("div", { key: '8a9e0821b8165a9cc04c5be4b3eb7286bdcef21f', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
3685
+ }, language: this.language, "translation-url": this.translationUrl }, this.curDrawSelection && this.curDrawSelection.length && (h("div", { key: 'c9161334967e9e5abaae4a3d1df922ee7d8d7945' }, h("div", { key: 'c7a3ac60084056b899a2b59a6205cddbc8d4e7fc', class: "betting-type" }, h("div", { key: '97aa9e8c9048bb57f70d4230f29f8fde3aa4454a', class: "betting-type-title" }, translate$4('bettingType', this.language)), h("div", { key: '64332b20eabf75e9273bb6f16c16436e90b28346', class: "betting-type-text" }, h("div", { key: 'cbd1ec9e723c6a369a98141077e4648d802c76ad', class: "LotteryTippingTicketController__segmented-control" }, Object.keys(this.curDrawSelectionMap).map((bettingType) => (h("button", { class: {
3690
3686
  LotteryTippingTicketController__segment: true,
3691
3687
  'LotteryTippingTicketController__segment--active': this.curDrawSelectionBettingType === bettingType
3692
- }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: '313e81c7d8181316896a2a46211d12ede72b5353', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("div", { key: '374d4a579f634ae631392b9e16a3a9acd0cf029c', class: "pagination-wrap" }, h("lottery-tipping-pagination", { key: '0a22fb6a1d59c391f2db3a2e20774a1b19491739', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
3688
+ }, onClick: () => this.handleDrawBettingTypeChange(bettingType) }, this.getBettingTypeName(bettingType))))))), h("lottery-tipping-ticket-bet", { key: '8b352410c87858e5629a5524e70134ccc2e1b116', endpoint: this.endpoint, "session-id": this.sessionId, "game-id": this.curDrawItem.vendorGameId, "draw-id": this.curDrawItem.id, "default-bullet-config-line-group": JSON.stringify(this.curDrawSelection), "read-pretty": true, "total-pages": this.curDrawSelection.length, language: this.language, "translation-url": this.translationUrl })))), h("div", { key: 'e730c86100cb47c4c63051174cd9b33dbb8e6ce4', class: "pagination-wrap" }, h("lottery-tipping-pagination", { key: 'dce4d6e9a18e783339d0ff545d1bd47bf1b2a33d', total: this.paginationInfo.total, current: this.paginationInfo.current, "page-size": this.paginationInfo.pageSize, language: this.language, "translation-url": this.translationUrl }))));
3693
3689
  }
3694
3690
  static get watchers() { return {
3695
3691
  "clientStyling": ["handleClientStylingChange"],