@fasttrack-solutions/rewards 1.63.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -109,7 +109,6 @@ its data.
109
109
  | `<ft-my-rewards>` | The rewards modal |
110
110
  | `<ft-wheel-component>` | A spin wheel on its own |
111
111
  | `<ft-tournament-page>` | Tournament leaderboards and details |
112
- | `<ft-jackpot-card>` | A progressive jackpot |
113
112
  | `<ft-notifications-center>` | Toast notifications for rewards events |
114
113
  | `<ft-game-launcher game="ancient-temple" label="Play">` | A play button that opens a mini game full screen |
115
114
 
@@ -144,7 +143,7 @@ Everything goes under `window.fasttrack`:
144
143
  | --- | --- |
145
144
  | `ft-rewards-ready` | Rewards started and is on for this player. |
146
145
  | `ft-config-error` | The start stopped, or Rewards was turned off for this player. `event.detail.reason` is `'disabled'` (Rewards is off for this player) or `'unauthenticated'` (the backend refused the token). An event without a `reason` means the start failed; only that is an error, and `window.ftRewardsError.reason` is then `'failed'`. For a player the backend does not know yet, it fires only when the SDK stops waiting for them, after 3 minutes. |
147
- | `ft-rewards-pending` | The backend does not know the player yet: the CRM has not processed their registration, which is common right after sign-up. Not an error: widgets show their loading state and the SDK tries again by itself about every 30 s (a hidden page once it shows), firing this event each time with `detail: { reason: 'player_not_ready', retryInMs }`. `ft-rewards-ready` follows once the player is known, so there is no need to start Rewards again. The last try runs 3 minutes after the first one; if the player is still unknown then, `ft-config-error` fires. A player whose Rewards is already on screen keeps it, and this event does not fire. |
146
+ | `ft-rewards-pending` | The backend does not know the player yet: the CRM has not processed their registration, which is common right after sign-up. Not an error: widgets show their loading state and the SDK tries again by itself at about 5, 10, 20 and 30 s, then every 30 s (a hidden page once it shows), firing this event each time with `detail: { reason: 'player_not_ready', retryInMs }`. `ft-rewards-ready` follows once the player is known, so there is no need to start Rewards again. The last try runs 3 minutes after the first one; if the player is still unknown then, `ft-config-error` fires. A player whose Rewards is already on screen keeps it, and this event does not fire. |
148
147
  | `ft-rewards-signed-out` | The player logged out. |
149
148
 
150
149
  To open or close the rewards modal from your own code, dispatch `show-my-rewards` or `close-my-rewards` on `window`, for example `window.dispatchEvent(new CustomEvent('show-my-rewards'))`. They are commands, not notifications: closing the modal with its close button or Escape fires neither.
@@ -1,4 +1,4 @@
1
- import { t as e, ti as t } from "./sdkCallback-DWIZY_7s.js";
1
+ import { t as e, ti as t } from "./sdkCallback-S4i5zqaD.js";
2
2
  //#region node_modules/.pnpm/gsap@3.15.0/node_modules/gsap/gsap-core.js
3
3
  function n(e) {
4
4
  if (e === void 0) throw ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -215,11 +215,9 @@ var e = [
215
215
  shopItems: [
216
216
  {
217
217
  variationId: 1001,
218
- shopItemId: 1,
219
218
  name: "Mystery Box",
220
219
  currencyAmount: 500,
221
220
  currencyId: 1,
222
- currencyType: "coins",
223
221
  description: "A mystery box containing a surprise reward!",
224
222
  shortDescription: "Surprise reward inside",
225
223
  termsAndConditions: "One per player per week.",
@@ -238,7 +236,6 @@ var e = [
238
236
  },
239
237
  {
240
238
  variationId: 1002,
241
- shopItemId: 2,
242
239
  name: "Free Spins Pack",
243
240
  currencyAmount: 140,
244
241
  originalCurrencyAmount: 200,
@@ -247,7 +244,6 @@ var e = [
247
244
  endsAt: new Date(Date.now() + 2 * 864e5).toISOString()
248
245
  },
249
246
  currencyId: 1,
250
- currencyType: "coins",
251
247
  description: "Get 10 free spins on selected slots.",
252
248
  shortDescription: "10 free spins",
253
249
  termsAndConditions: "Valid on selected games only.",
@@ -258,11 +254,9 @@ var e = [
258
254
  },
259
255
  {
260
256
  variationId: 1003,
261
- shopItemId: 3,
262
257
  name: "Cash Bonus",
263
258
  currencyAmount: 1e3,
264
259
  currencyId: 1,
265
- currencyType: "coins",
266
260
  description: "Exchange your coins for a €10 cash bonus.",
267
261
  shortDescription: "€10 cash bonus",
268
262
  termsAndConditions: "1x wagering requirement.",
@@ -316,132 +310,154 @@ var e = [
316
310
  ContentId: 200,
317
311
  Order: 5,
318
312
  Slug: "promotions"
313
+ },
314
+ {
315
+ Id: 6,
316
+ Title: "Terms and conditions",
317
+ Icon: "overview",
318
+ ContentType: "cms_page",
319
+ ContentId: 300,
320
+ Order: 6,
321
+ Slug: "terms",
322
+ PinToRight: !0
319
323
  }
320
- ], i = [{
321
- id: 100,
322
- sections: [{
323
- id: 1,
324
- sectionType: "banner",
325
- displayOrder: 1,
326
- banner: {
327
- imageUrl: "https://crm-lib.fasttrack-solutions.com/rewards/mocks/image_53.png",
328
- title: "Your Challenges"
329
- }
330
- }, {
331
- id: 2,
332
- sectionType: "challenges",
333
- displayOrder: 2,
334
- challenges: {
335
- tags: [],
336
- includeNotYetStarted: !1,
337
- emptyState: "<p>No active challenges right now. Check back soon!</p>"
338
- }
339
- }]
340
- }, {
341
- id: 200,
342
- sections: [
343
- {
344
- id: 10,
324
+ ], i = [
325
+ {
326
+ id: 100,
327
+ sections: [{
328
+ id: 1,
345
329
  sectionType: "banner",
346
330
  displayOrder: 1,
347
331
  banner: {
348
- imageUrl: "https://crm-lib.fasttrack-solutions.com/rewards/mocks/eldorado00000000.jpg",
349
- title: "Hot Promotions"
350
- }
351
- },
352
- {
353
- id: 11,
354
- sectionType: "html",
355
- displayOrder: 2,
356
- html: { html: "<div style=\"padding: 16px; text-align: center;\"><h3>Welcome to our promotions page!</h3><p>Check out the latest offers below.</p></div>" }
357
- },
358
- {
359
- id: 12,
360
- sectionType: "bonuses",
361
- displayOrder: 3,
362
- bonuses: {
363
- tags: [],
364
- types: [],
365
- includeClaimed: !1,
366
- includeExpired: !1,
367
- emptyState: "<p>No bonuses available at the moment.</p>"
332
+ imageUrl: "https://crm-lib.fasttrack-solutions.com/rewards/mocks/image_53.png",
333
+ title: "Your Challenges"
368
334
  }
369
- },
370
- {
371
- id: 13,
372
- sectionType: "wheels",
373
- displayOrder: 4,
374
- wheels: {
375
- tags: [],
376
- emptyState: "<p>No wheel spins available.</p>"
377
- }
378
- },
379
- {
380
- id: 15,
381
- sectionType: "mini_games",
382
- displayOrder: 6,
383
- miniGames: {
384
- tags: [],
385
- miniGameType: "all",
386
- includeUnclaimed: !0,
387
- emptyState: "<p>No mini games available.</p>"
388
- }
389
- },
390
- {
391
- id: 14,
335
+ }, {
336
+ id: 2,
392
337
  sectionType: "challenges",
393
- displayOrder: 5,
338
+ displayOrder: 2,
394
339
  challenges: {
395
340
  tags: [],
396
341
  includeNotYetStarted: !1,
397
- emptyState: "<p>No challenges available.</p>"
342
+ emptyState: "<p>No active challenges right now. Check back soon!</p>"
398
343
  }
399
- },
400
- {
401
- id: 19,
402
- sectionType: "image",
403
- displayOrder: 7,
404
- image: {
405
- desktopImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='300'%3E%3Crect width='800' height='300' fill='%234a90d9'/%3E%3Ctext x='400' y='140' font-size='28' fill='white' text-anchor='middle' font-family='sans-serif'%3EDesktop Image (fillWidth%3Atrue)%3C/text%3E%3Ctext x='400' y='180' font-size='18' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3ESwitches to mobile image below 768px%3C/text%3E%3C/svg%3E",
406
- mobileImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23e05c4a'/%3E%3Ctext x='200' y='140' font-size='24' fill='white' text-anchor='middle' font-family='sans-serif'%3EMobile Image%3C/text%3E%3Ctext x='200' y='175' font-size='16' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3E(visible below 768px)%3C/text%3E%3C/svg%3E",
407
- fillWidth: !0,
408
- imageAlignment: null
409
- }
410
- },
411
- {
412
- id: 16,
413
- sectionType: "image",
414
- displayOrder: 8,
415
- image: {
416
- desktopImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200'%3E%3Crect width='400' height='200' fill='%2348a85e'/%3E%3Ctext x='200' y='90' font-size='22' fill='white' text-anchor='middle' font-family='sans-serif'%3EAligned Image%3C/text%3E%3Ctext x='200' y='125' font-size='16' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3EfillWidth%3Afalse%2C alignment%3Acenter%3C/text%3E%3C/svg%3E",
417
- mobileImageUrl: null,
418
- fillWidth: !1,
419
- imageAlignment: "center"
420
- }
421
- },
422
- {
423
- id: 17,
424
- sectionType: "shop",
425
- displayOrder: 9,
426
- shop: { shopPageId: 1 }
427
- },
428
- {
429
- id: 18,
430
- sectionType: "calendar",
431
- displayOrder: 10,
432
- calendar: { calendarId: 1 }
433
- },
434
- {
435
- id: 20,
436
- sectionType: "tournament_leaderboard",
437
- displayOrder: 11,
438
- tournamentLeaderboard: {
439
- tournamentId: 1,
440
- showHeader: !0
344
+ }]
345
+ },
346
+ {
347
+ id: 200,
348
+ sections: [
349
+ {
350
+ id: 10,
351
+ sectionType: "banner",
352
+ displayOrder: 1,
353
+ banner: {
354
+ imageUrl: "https://crm-lib.fasttrack-solutions.com/rewards/mocks/eldorado00000000.jpg",
355
+ title: "Hot Promotions"
356
+ }
357
+ },
358
+ {
359
+ id: 11,
360
+ sectionType: "html",
361
+ displayOrder: 2,
362
+ html: { html: "<div style=\"padding: 16px; text-align: center;\"><h3>Welcome to our promotions page!</h3><p>Check out the latest offers below.</p></div>" }
363
+ },
364
+ {
365
+ id: 12,
366
+ sectionType: "bonuses",
367
+ displayOrder: 3,
368
+ bonuses: {
369
+ tags: [],
370
+ types: [],
371
+ includeClaimed: !1,
372
+ includeExpired: !1,
373
+ emptyState: "<p>No bonuses available at the moment.</p>"
374
+ }
375
+ },
376
+ {
377
+ id: 13,
378
+ sectionType: "wheels",
379
+ displayOrder: 4,
380
+ wheels: {
381
+ tags: [],
382
+ emptyState: "<p>No wheel spins available.</p>"
383
+ }
384
+ },
385
+ {
386
+ id: 15,
387
+ sectionType: "mini_games",
388
+ displayOrder: 6,
389
+ miniGames: {
390
+ tags: [],
391
+ miniGameType: "all",
392
+ includeUnclaimed: !0,
393
+ emptyState: "<p>No mini games available.</p>"
394
+ }
395
+ },
396
+ {
397
+ id: 14,
398
+ sectionType: "challenges",
399
+ displayOrder: 5,
400
+ challenges: {
401
+ tags: [],
402
+ includeNotYetStarted: !1,
403
+ emptyState: "<p>No challenges available.</p>"
404
+ }
405
+ },
406
+ {
407
+ id: 19,
408
+ sectionType: "image",
409
+ displayOrder: 7,
410
+ image: {
411
+ desktopImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='300'%3E%3Crect width='800' height='300' fill='%234a90d9'/%3E%3Ctext x='400' y='140' font-size='28' fill='white' text-anchor='middle' font-family='sans-serif'%3EDesktop Image (fillWidth%3Atrue)%3C/text%3E%3Ctext x='400' y='180' font-size='18' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3ESwitches to mobile image below 768px%3C/text%3E%3C/svg%3E",
412
+ mobileImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect width='400' height='300' fill='%23e05c4a'/%3E%3Ctext x='200' y='140' font-size='24' fill='white' text-anchor='middle' font-family='sans-serif'%3EMobile Image%3C/text%3E%3Ctext x='200' y='175' font-size='16' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3E(visible below 768px)%3C/text%3E%3C/svg%3E",
413
+ fillWidth: !0,
414
+ imageAlignment: null
415
+ }
416
+ },
417
+ {
418
+ id: 16,
419
+ sectionType: "image",
420
+ displayOrder: 8,
421
+ image: {
422
+ desktopImageUrl: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200'%3E%3Crect width='400' height='200' fill='%2348a85e'/%3E%3Ctext x='200' y='90' font-size='22' fill='white' text-anchor='middle' font-family='sans-serif'%3EAligned Image%3C/text%3E%3Ctext x='200' y='125' font-size='16' fill='rgba(255,255,255,0.7)' text-anchor='middle' font-family='sans-serif'%3EfillWidth%3Afalse%2C alignment%3Acenter%3C/text%3E%3C/svg%3E",
423
+ mobileImageUrl: null,
424
+ fillWidth: !1,
425
+ imageAlignment: "center"
426
+ }
427
+ },
428
+ {
429
+ id: 17,
430
+ sectionType: "shop",
431
+ displayOrder: 9,
432
+ shop: { shopPageId: 1 }
433
+ },
434
+ {
435
+ id: 18,
436
+ sectionType: "calendar",
437
+ displayOrder: 10,
438
+ calendar: { calendarId: 1 }
439
+ },
440
+ {
441
+ id: 20,
442
+ sectionType: "tournament_leaderboard",
443
+ displayOrder: 11,
444
+ tournamentLeaderboard: {
445
+ tournamentId: 1,
446
+ showHeader: !0
447
+ }
441
448
  }
442
- }
443
- ]
444
- }], a = [
449
+ ]
450
+ },
451
+ {
452
+ id: 300,
453
+ sections: [{
454
+ id: 30,
455
+ sectionType: "html",
456
+ displayOrder: 1,
457
+ html: { html: "<div style=\"padding: 16px;\"><h3>Terms and conditions</h3><p>How the program works, and the rules that apply to it.</p></div>" }
458
+ }]
459
+ }
460
+ ], a = [
445
461
  {
446
462
  ID: 1,
447
463
  XP: 0,