@opexa/portal-sdk 0.0.20 → 0.0.22

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.
Files changed (38) hide show
  1. package/README.md +19 -17
  2. package/dist/index.js +466 -469
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +902 -868
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/sdk/sdk.d.ts +8 -23
  7. package/dist/sdk/session-manager.d.ts +8 -3
  8. package/dist/sdk/types.d.ts +141 -98
  9. package/dist/services/account.service.d.ts +1 -4
  10. package/dist/services/auth.service.d.ts +2 -4
  11. package/dist/services/file.service.d.ts +1 -1
  12. package/dist/services/game.service.d.ts +11 -6
  13. package/dist/services/index.d.ts +0 -16
  14. package/dist/services/portal.service.d.ts +1 -1
  15. package/dist/services/queries.d.ts +54 -0
  16. package/dist/services/report.service.d.ts +1 -6
  17. package/dist/services/types.d.ts +780 -8
  18. package/dist/services/utils.d.ts +2 -9
  19. package/dist/services/wallet.service.d.ts +17 -10
  20. package/dist/utils/clamp.d.ts +1 -0
  21. package/dist/utils/graphql-client.d.ts +8 -1
  22. package/dist/utils/pollable.d.ts +28 -0
  23. package/package.json +4 -1
  24. package/dist/services/announcement.d.ts +0 -29
  25. package/dist/services/bet-record.d.ts +0 -65
  26. package/dist/services/bonus.d.ts +0 -45
  27. package/dist/services/cashback.d.ts +0 -20
  28. package/dist/services/deposit.d.ts +0 -90
  29. package/dist/services/file.d.ts +0 -49
  30. package/dist/services/game.d.ts +0 -98
  31. package/dist/services/member.d.ts +0 -202
  32. package/dist/services/platform.d.ts +0 -38
  33. package/dist/services/points.d.ts +0 -24
  34. package/dist/services/promo.d.ts +0 -33
  35. package/dist/services/session.d.ts +0 -80
  36. package/dist/services/transaction.d.ts +0 -25
  37. package/dist/services/wallet.d.ts +0 -14
  38. package/dist/services/withdrawal.d.ts +0 -114
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- var be = Object.defineProperty;
2
- var ge = (n, e, t) => e in n ? be(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var m = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { ObjectId as h } from "@opexa/object-id";
5
- import { ObjectId as It } from "@opexa/object-id";
6
- const w = {
1
+ var Ce = Object.defineProperty;
2
+ var _e = (n, e, t) => e in n ? Ce(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var d = (n, e, t) => _e(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { ObjectId as b } from "@opexa/object-id";
5
+ import { ObjectId as Gt } from "@opexa/object-id";
6
+ const g = {
7
7
  Account: 8,
8
8
  Deposit: 9,
9
9
  Withdrawal: 14,
@@ -12,7 +12,7 @@ const w = {
12
12
  GameSession: 204,
13
13
  MayaSession: 230
14
14
  };
15
- function i(n, ...e) {
15
+ function o(n, ...e) {
16
16
  let t = "";
17
17
  for (const [a, r] of n.entries()) {
18
18
  const s = e.at(a) ?? "";
@@ -20,55 +20,76 @@ function i(n, ...e) {
20
20
  }
21
21
  return t.trim();
22
22
  }
23
- const Ee = i`
24
- query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
25
- announcements(first: $first, after: $after, filter: $filter) {
26
- edges {
27
- cursor
28
- node {
29
- ... on Announcement {
30
- id
31
- type
32
- title
33
- status
34
- message
35
- activationStartDateTime
36
- activationEndDateTime
37
- dateTimeCreated
38
- dateTimeLastUpdated
39
- }
40
- }
23
+ const C = o`
24
+ fragment FileFragment on File {
25
+ id
26
+ url
27
+ status
28
+ dateTimeCreated
29
+ }
30
+ `, Te = o`
31
+ ${C}
32
+
33
+ query File($id: ObjectId!) {
34
+ node(id: $id) {
35
+ ... on File {
36
+ ...FileFragment
41
37
  }
42
- totalCount
43
- pageInfo {
44
- hasNextPage
45
- endCursor
38
+ }
39
+ }
40
+ `, ve = o`
41
+ mutation UploadPrivateImageFile($input: UploadFileInput!) {
42
+ uploadPrivateImageFile(input: $input) {
43
+ ... on FileFormatNotSupportedError {
44
+ __typename
45
+ }
46
+ ... on FileNameTooLongError {
47
+ __typename
48
+ }
49
+ ... on FileSizeTooBigError {
50
+ __typename
51
+ }
52
+ }
53
+ }
54
+ `, Me = o`
55
+ query Wallet {
56
+ wallet {
57
+ id
58
+ balance
59
+ currency
60
+ dateTimeCreated
61
+ dateTimeLastUpdated
62
+ }
63
+ }
64
+ `, De = o`
65
+ query PointsWallet {
66
+ pointsWallet {
67
+ id
68
+ points
69
+ account
70
+ dateTimeCreated
71
+ }
72
+ }
73
+ `, Ne = o`
74
+ mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
75
+ pointsToCashConversion(input: $input) {
76
+ ... on InsufficientPointsError {
77
+ __typename
46
78
  }
47
79
  }
48
80
  }
49
- `, k = i`
81
+ `, _ = o`
50
82
  fragment GameFragment on Game {
51
83
  id
52
84
  type
53
85
  name
54
86
  provider
55
87
  }
56
- `, Ae = i`
57
- ${k}
88
+ `, we = o`
89
+ ${_}
58
90
 
59
- query Game($id: ObjectId!) {
60
- node(id: $id) {
61
- ... on Game {
62
- ...GameFragment
63
- }
64
- }
65
- }
66
- `, Se = i`
67
- ${k}
68
-
69
- query Games($after: Cursor, $first: Int, $filter: GameFilterInput) {
70
- games(after: $after, first: $first, filter: $filter) {
71
- totalCount
91
+ query Games($first: Int, $after: Cursor, $filter: GameFilterInput) {
92
+ games(first: $first, after: $after, filter: $filter) {
72
93
  edges {
73
94
  cursor
74
95
  node {
@@ -77,25 +98,27 @@ const Ee = i`
77
98
  }
78
99
  }
79
100
  }
101
+ totalCount
80
102
  pageInfo {
81
103
  hasNextPage
82
104
  endCursor
83
105
  }
84
106
  }
85
107
  }
86
- `, ke = i`
87
- ${k}
108
+ `, ye = o`
109
+ ${_}
88
110
 
89
- query GamesByName($search: String!, $filter: GameFilterInput, $first: Int) {
90
- gamesByName(search: $search, filter: $filter, first: $first) {
91
- ...GameFragment
111
+ query GamesByName($first: Int, $search: String!, $filter: GameFilterInput) {
112
+ gamesByName(first: $first, search: $search, filter: $filter) {
113
+ id
92
114
  }
93
115
  }
94
- `, Ce = i`
116
+ `, be = o`
95
117
  query GameSession($id: ObjectId!) {
96
118
  node(id: $id) {
97
119
  ... on GameSession {
98
120
  id
121
+ game
99
122
  status
100
123
  launchUrl
101
124
  dateTimeCreated
@@ -103,7 +126,7 @@ const Ee = i`
103
126
  }
104
127
  }
105
128
  }
106
- `, Te = i`
129
+ `, ge = o`
107
130
  mutation CreateGameSession($input: CreateGameSessionInput!) {
108
131
  createGameSession(input: $input) {
109
132
  ... on GameDoesNotExistError {
@@ -111,43 +134,110 @@ const Ee = i`
111
134
  }
112
135
  }
113
136
  }
114
- `, _e = i`
137
+ `, Ie = o`
115
138
  mutation EndGameSession($input: EndGameSessionInput!) {
116
139
  endGameSession(input: $input)
117
140
  }
118
- `, ve = i`
119
- ${k}
120
-
121
- query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
141
+ `, Re = o`
142
+ mutation EndGameSession($input: EndGameSessionInput!) {
143
+ endGameSession(input: $input) {
144
+ ... on GameSessionDoesNotExistError {
145
+ __typename
146
+ }
147
+ ... on GameSessionAlreadyClosedError {
148
+ __typename
149
+ }
150
+ ... on GameProviderError {
151
+ __typename
152
+ }
153
+ }
154
+ }
155
+ `, Ge = o`
156
+ query Announcements($first: Int, $after: Cursor, $filter: AnnouncementFilterInput) {
157
+ announcements(first: $first, after: $after, filter: $filter) {
158
+ edges {
159
+ cursor
160
+ node {
161
+ ... on Announcement {
162
+ id
163
+ type
164
+ title
165
+ status
166
+ message
167
+ activationStartDateTime
168
+ activationEndDateTime
169
+ dateTimeCreated
170
+ dateTimeLastUpdated
171
+ }
172
+ }
173
+ }
174
+ totalCount
175
+ pageInfo {
176
+ hasNextPage
177
+ endCursor
178
+ }
179
+ }
180
+ }
181
+ `, Pe = o`
182
+ query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
122
183
  member {
123
- betRecords(first: $first, after: $after, filter: $filter) {
124
- totalCount
184
+ withdrawalRecords(first: $first, after: $after, filter: $filter) {
125
185
  edges {
126
186
  cursor
127
187
  node {
128
- ... on BetRecord {
188
+ ... on BankWithdrawalRecord {
129
189
  id
130
- serialCode
131
- game {
132
- ...GameFragment
133
- }
134
- bet
135
- payout
136
- winloss
137
- jackpotPayout
138
- jackpotContribution
190
+ type
191
+ bank
192
+ fee
193
+ netAmount
194
+ reference
195
+ amount
139
196
  status
197
+ withdrawalNumber
198
+ dateTimeCreated
199
+ dateTimeLastUpdated
200
+ }
201
+ ... on GCashWithdrawalRecord {
202
+ id
203
+ type
204
+ fee
205
+ netAmount
206
+ reference
207
+ amount
208
+ status
209
+ withdrawalNumber
210
+ recipientMobileNumber
211
+ dateTimeCreated
212
+ dateTimeLastUpdated
213
+ }
214
+ ... on ManualWithdrawalRecord {
215
+ id
216
+ type
217
+ fee
218
+ netAmount
219
+ reference
220
+ amount
221
+ status
222
+ withdrawalNumber
223
+ dateTimeCreated
224
+ dateTimeLastUpdated
225
+ }
226
+ ... on MayaAppWithdrawalRecord {
227
+ id
228
+ type
229
+ fee
230
+ netAmount
231
+ reference
232
+ amount
233
+ status
234
+ withdrawalNumber
140
235
  dateTimeCreated
141
- dateTimeSettled
142
236
  dateTimeLastUpdated
143
- metadata
144
- vendorRoundId
145
- betContent
146
- contestName
147
- externalCategory
148
237
  }
149
238
  }
150
239
  }
240
+ totalCount
151
241
  pageInfo {
152
242
  hasNextPage
153
243
  endCursor
@@ -155,168 +245,100 @@ const Ee = i`
155
245
  }
156
246
  }
157
247
  }
158
- `, Me = i`
159
- query LatestBetRecords {
160
- latestBetRecords {
161
- id
162
- member {
163
- id
164
- name
165
- }
166
- game {
167
- ...GameFragment
248
+ `, xe = o`
249
+ mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
250
+ createGCashWithdrawal(input: $input) {
251
+ ... on AccountNotVerifiedError {
252
+ __typename
168
253
  }
169
- bet
170
- payout
171
- validBet
172
- dateTimeSettled
173
- dateTimeCreated
174
- }
175
- }
176
-
177
- ${k}
178
- `, T = i`
179
- fragment FileFragment on File {
180
- id
181
- url
182
- status
183
- dateTimeCreated
184
- }
185
- `, De = i`
186
- ${T}
187
-
188
- query File($id: ObjectId!) {
189
- node(id: $id) {
190
- ... on File {
191
- ...FileFragment
254
+ ... on InvalidTransactionPasswordError {
255
+ __typename
192
256
  }
193
- }
194
- }
195
- `, Ne = i`
196
- mutation UploadPrivateImageFile($input: UploadFileInput!) {
197
- uploadPrivateImageFile(input: $input) {
198
- ... on FileFormatNotSupportedError {
257
+ ... on InvalidWithdrawalAmountError {
199
258
  __typename
200
259
  }
201
- ... on FileNameTooLongError {
260
+ ... on MobileNumberNotVerifiedError {
202
261
  __typename
203
262
  }
204
- ... on FileSizeTooBigError {
263
+ ... on NotEnoughBalanceError {
205
264
  __typename
206
265
  }
207
- }
208
- }
209
- `, he = i`
210
- ${T}
211
-
212
- fragment CashbackFragment on Cashback {
213
- id
214
- name
215
- banner {
216
- ...FileFragment
217
- }
218
- status
219
- description
220
- activationStartDateTime
221
- activationEndDateTime
222
- dateTimeCreated
223
- dateTimeLastUpdated
224
- }
225
- `, Ie = i`
226
- ${he}
227
-
228
- query Cashbacks {
229
- cashbacks {
230
- ...CashbackFragment
231
- }
232
- }
233
- `, v = i`
234
- ${T}
235
-
236
- fragment PromoFragment on Promo {
237
- id
238
- type
239
- name
240
- banner {
241
- ...FileFragment
242
- }
243
- status
244
- description
245
- maximumBonusAmount
246
- minimumBonusAmount
247
- activationStartDateTime
248
- activationEndDateTime
249
- dateTimeCreated
250
- dateTimeLastUpdated
251
- }
252
- `, Re = i`
253
- ${v}
254
-
255
- query Promos {
256
- promos {
257
- ...PromoFragment
258
- }
259
- }
260
- `, Pe = i`
261
- ${v}
262
-
263
- query AvailablePromos($filter: PromoFilterInput) {
264
- availablePromos(filter: $filter) {
265
- ...PromoFragment
266
- }
267
- }
268
- `, Ge = i`
269
- ${v}
270
-
271
- query Bonus {
272
- bonus {
273
- id
274
- promo {
275
- ...PromoFragment
266
+ ... on WithdrawalDailyLimitExceededError {
267
+ __typename
276
268
  }
277
- deposit {
278
- type
279
- amount
280
- netAmount
281
- fee
282
- status
283
- reference
284
- dateTimeCreated
285
- dateTimeLastUpdated
269
+ }
270
+ }
271
+ `, $e = o`
272
+ mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
273
+ createMayaWithdrawal(input: $input) {
274
+ ... on AccountNotVerifiedError {
275
+ __typename
276
+ }
277
+ ... on InvalidTransactionPasswordError {
278
+ __typename
279
+ }
280
+ ... on InvalidWithdrawalAmountError {
281
+ __typename
282
+ }
283
+ ... on MobileNumberNotVerifiedError {
284
+ __typename
285
+ }
286
+ ... on NotEnoughBalanceError {
287
+ __typename
288
+ }
289
+ ... on WithdrawalDailyLimitExceededError {
290
+ __typename
286
291
  }
287
- amount
288
- balance
289
- turnoverRequirement
290
- currentTurnoverRequirementContribution
291
- currentTurnoverRequirementContributionPercentage
292
- expiration
293
- dateTimeCreated
294
- dateTimeLastUpdated
295
292
  }
296
293
  }
297
- `, xe = i`
298
- ${he}
299
-
300
- query CashbackBonuses {
301
- cashbackBonuses {
302
- id
303
- balance
304
- cashback {
305
- ...CashbackFragment
294
+ `, Be = o`
295
+ mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
296
+ createMayaAppWithdrawal(input: $input) {
297
+ ... on AccountNotVerifiedError {
298
+ __typename
299
+ }
300
+ ... on InvalidTransactionPasswordError {
301
+ __typename
302
+ }
303
+ ... on InvalidWithdrawalAmountError {
304
+ __typename
305
+ }
306
+ ... on NotEnoughBalanceError {
307
+ __typename
308
+ }
309
+ ... on WithdrawalDailyLimitExceededError {
310
+ __typename
306
311
  }
307
- dateTimeCreated
308
- dateTimeLastUpdated
309
312
  }
310
313
  }
311
- `, $e = i`
312
- mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
313
- claimCashbackBonus(input: $input) {
314
- ... on CashbackBonusDoesNotExistError {
314
+ `, We = o`
315
+ mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
316
+ createBankWithdrawal(input: $input) {
317
+ ... on MobileNumberNotVerifiedError {
318
+ __typename
319
+ }
320
+ ... on AccountNotVerifiedError {
321
+ __typename
322
+ }
323
+ ... on InvalidWithdrawalAmountError {
324
+ __typename
325
+ }
326
+ ... on WithdrawalDailyLimitExceededError {
327
+ __typename
328
+ }
329
+ ... on InvalidTransactionPasswordError {
330
+ __typename
331
+ }
332
+ ... on NotEnoughBalanceError {
315
333
  __typename
316
334
  }
317
335
  }
318
336
  }
319
- `, Be = i`
337
+ `, Ue = o`
338
+ query RemainingDailyWithdrawalsCount {
339
+ remainingDailyWithdrawalsCount
340
+ }
341
+ `, Oe = o`
320
342
  query DepositRecords($after: Cursor, $first: Int, $filter: DepositRecordFilterInput) {
321
343
  member {
322
344
  depositRecords(after: $after, first: $first, filter: $filter) {
@@ -345,7 +367,7 @@ const Ee = i`
345
367
  }
346
368
  }
347
369
  }
348
- `, We = i`
370
+ `, qe = o`
349
371
  mutation CreateGCashDeposit($input: CreateGCashDepositInput!) {
350
372
  createGCashDeposit(input: $input) {
351
373
  ... on DepositPromoMaximumAmountExceededError {
@@ -374,7 +396,7 @@ const Ee = i`
374
396
  }
375
397
  }
376
398
  }
377
- `, Ue = i`
399
+ `, Fe = o`
378
400
  mutation CreateMayaDeposit($input: CreateMayaDepositInput!) {
379
401
  createMayaDeposit(input: $input) {
380
402
  ... on DepositPromoMaximumAmountExceededError {
@@ -403,7 +425,7 @@ const Ee = i`
403
425
  }
404
426
  }
405
427
  }
406
- `, Oe = i`
428
+ `, Le = o`
407
429
  mutation CreateMayaAppDeposit($input: CreateMayaAppDepositInput!) {
408
430
  createMayaAppDeposit(input: $input) {
409
431
  ... on DepositPromoMaximumAmountExceededError {
@@ -432,35 +454,199 @@ const Ee = i`
432
454
  }
433
455
  }
434
456
  }
435
- `, qe = i`
457
+ `, Ve = o`
436
458
  query Deposit($id: ObjectId!) {
437
459
  node(id: $id) {
438
460
  ... on GCashDeposit {
439
461
  id
440
462
  type
441
- amount
442
- netAmount
443
- fee
444
463
  status
445
- reference
446
464
  checkoutUrl
447
- dateTimeCreated
448
- dateTimeLastUpdated
449
465
  }
450
466
  ... on MayaDeposit {
451
467
  id
452
468
  type
453
- amount
454
- netAmount
455
- fee
456
469
  status
457
- reference
458
470
  checkoutUrl
459
- dateTimeCreated
460
- dateTimeLastUpdated
461
471
  }
462
472
  ... on MayaAppDeposit {
463
473
  id
474
+ type
475
+ status
476
+ }
477
+ ... on BankDeposit {
478
+ id
479
+ type
480
+ status
481
+ }
482
+ ... on ManualDeposit {
483
+ id
484
+ type
485
+ status
486
+ }
487
+ }
488
+ }
489
+ `, Ye = o`
490
+ query DepositsCount {
491
+ member {
492
+ depositsCount
493
+ }
494
+ }
495
+ `, He = o`
496
+ ${_}
497
+
498
+ query BetRecords($first: Int, $after: Cursor, $filter: BetRecordFilterInput) {
499
+ member {
500
+ betRecords(first: $first, after: $after, filter: $filter) {
501
+ totalCount
502
+ edges {
503
+ cursor
504
+ node {
505
+ ... on BetRecord {
506
+ id
507
+ serialCode
508
+ game {
509
+ ...GameFragment
510
+ }
511
+ bet
512
+ payout
513
+ winloss
514
+ jackpotPayout
515
+ jackpotContribution
516
+ status
517
+ dateTimeCreated
518
+ dateTimeSettled
519
+ dateTimeLastUpdated
520
+ metadata
521
+ vendorRoundId
522
+ betContent
523
+ contestName
524
+ externalCategory
525
+ }
526
+ }
527
+ }
528
+ pageInfo {
529
+ hasNextPage
530
+ endCursor
531
+ }
532
+ }
533
+ }
534
+ }
535
+ `, je = o`
536
+ query LatestBetRecords {
537
+ latestBetRecords {
538
+ id
539
+ member {
540
+ id
541
+ name
542
+ }
543
+ game {
544
+ ...GameFragment
545
+ }
546
+ bet
547
+ payout
548
+ validBet
549
+ dateTimeSettled
550
+ dateTimeCreated
551
+ }
552
+ }
553
+
554
+ ${_}
555
+ `, Qe = o`
556
+ query TransactionRecords($first: Int, $after: Cursor, $filter: TransactionRecordFilter) {
557
+ member {
558
+ transactionRecords(first: $first, after: $after, filter: $filter) {
559
+ edges {
560
+ cursor
561
+ node {
562
+ ... on TransactionRecord {
563
+ id
564
+ type
565
+ amount
566
+ content
567
+ currentBalance
568
+ referenceNumber
569
+ dateTimeCreated
570
+ }
571
+ }
572
+ }
573
+ totalCount
574
+ pageInfo {
575
+ hasNextPage
576
+ endCursor
577
+ }
578
+ }
579
+ }
580
+ }
581
+ `, v = o`
582
+ ${C}
583
+
584
+ fragment PromoFragment on Promo {
585
+ id
586
+ type
587
+ name
588
+ banner {
589
+ ...FileFragment
590
+ }
591
+ status
592
+ description
593
+ maximumBonusAmount
594
+ minimumBonusAmount
595
+ activationStartDateTime
596
+ activationEndDateTime
597
+ dateTimeCreated
598
+ dateTimeLastUpdated
599
+ }
600
+ `, Ke = o`
601
+ ${v}
602
+
603
+ query Promos {
604
+ promos {
605
+ ...PromoFragment
606
+ }
607
+ }
608
+ `, ze = o`
609
+ ${v}
610
+
611
+ query AvailablePromos($filter: PromoFilterInput) {
612
+ availablePromos(filter: $filter) {
613
+ ...PromoFragment
614
+ }
615
+ }
616
+ `, Ee = o`
617
+ ${C}
618
+
619
+ fragment CashbackFragment on Cashback {
620
+ id
621
+ name
622
+ banner {
623
+ ...FileFragment
624
+ }
625
+ status
626
+ description
627
+ activationStartDateTime
628
+ activationEndDateTime
629
+ dateTimeCreated
630
+ dateTimeLastUpdated
631
+ }
632
+ `, Je = o`
633
+ ${Ee}
634
+
635
+ query Cashbacks {
636
+ cashbacks {
637
+ ...CashbackFragment
638
+ }
639
+ }
640
+ `, Xe = o`
641
+ ${v}
642
+
643
+ query Bonus {
644
+ bonus {
645
+ id
646
+ promo {
647
+ ...PromoFragment
648
+ }
649
+ deposit {
464
650
  type
465
651
  amount
466
652
  netAmount
@@ -470,21 +656,45 @@ const Ee = i`
470
656
  dateTimeCreated
471
657
  dateTimeLastUpdated
472
658
  }
659
+ amount
660
+ balance
661
+ turnoverRequirement
662
+ currentTurnoverRequirementContribution
663
+ currentTurnoverRequirementContributionPercentage
664
+ expiration
665
+ dateTimeCreated
666
+ dateTimeLastUpdated
473
667
  }
474
668
  }
475
- `, Fe = i`
476
- query DepositsCount {
477
- member {
478
- depositsCount
669
+ `, Ze = o`
670
+ ${Ee}
671
+
672
+ query CashbackBonuses {
673
+ cashbackBonuses {
674
+ id
675
+ balance
676
+ cashback {
677
+ ...CashbackFragment
678
+ }
679
+ dateTimeCreated
680
+ dateTimeLastUpdated
681
+ }
682
+ }
683
+ `, et = o`
684
+ mutation ClaimCashbackBonus($input: ClaimCashbackBonusInput!) {
685
+ claimCashbackBonus(input: $input) {
686
+ ... on CashbackBonusDoesNotExistError {
687
+ __typename
688
+ }
479
689
  }
480
690
  }
481
- `, Le = i`
691
+ `, tt = o`
482
692
  query Member {
483
693
  member {
484
694
  dateTimeLastActive
485
695
  }
486
696
  }
487
- `, Ve = i`
697
+ `, at = o`
488
698
  query MemberAccount {
489
699
  memberAccount: self {
490
700
  ... on MemberAccount {
@@ -508,8 +718,8 @@ const Ee = i`
508
718
  }
509
719
  }
510
720
  }
511
- `, Ye = i`
512
- ${T}
721
+ `, rt = o`
722
+ ${C}
513
723
 
514
724
  query MemberVerification {
515
725
  memberAccount: self {
@@ -532,7 +742,7 @@ const Ee = i`
532
742
  }
533
743
  }
534
744
  }
535
- `, He = i`
745
+ `, nt = o`
536
746
  mutation RegisterMemberAccount(
537
747
  $input: RegisterMemberAccountInput!
538
748
  $referralCode: String
@@ -568,7 +778,7 @@ const Ee = i`
568
778
  }
569
779
  }
570
780
  }
571
- `, je = i`
781
+ `, ot = o`
572
782
  mutation UpdateMemberAccount($input: UpdateMemberAccountInput!) {
573
783
  updateMemberAccount(input: $input) {
574
784
  ... on AccountNameNotAvailableError {
@@ -594,7 +804,7 @@ const Ee = i`
594
804
  }
595
805
  }
596
806
  }
597
- `, Qe = i`
807
+ `, it = o`
598
808
  mutation ResetPassword($input: ResetPasswordInput!, $verificationCode: String) {
599
809
  resetPassword(input: $input, verificationCode: $verificationCode) {
600
810
  ... on AccountNotFoundError {
@@ -605,22 +815,11 @@ const Ee = i`
605
815
  }
606
816
  }
607
817
  }
608
- `, Ke = i`
818
+ `, st = o`
609
819
  mutation DeleteMemberAccount($input: DeleteMemberAccountInput!) {
610
820
  deleteMemberAccount(input: $input)
611
821
  }
612
- `, ze = i`
613
- mutation SendVerificationCode($input: SendVerificationCodeInput!) {
614
- sendVerificationCode(input: $input) {
615
- ... on InvalidPlatformError {
616
- __typename
617
- }
618
- ... on NotReadyToSendVerficationCodeError {
619
- __typename
620
- }
621
- }
622
- }
623
- `, Je = i`
822
+ `, mt = o`
624
823
  mutation VerifyMobileNumber($input: VerifyMobileNumberInput!) {
625
824
  verifyMobileNumber(input: $input) {
626
825
  ... on InvalidSMSVerificationCodeError {
@@ -631,7 +830,7 @@ const Ee = i`
631
830
  }
632
831
  }
633
832
  }
634
- `, Xe = i`
833
+ `, dt = o`
635
834
  mutation CreateMemberVerification($input: CreateMemberVerificationInput!) {
636
835
  createMemberVerification(input: $input) {
637
836
  ... on FileDoesNotExistError {
@@ -645,7 +844,7 @@ const Ee = i`
645
844
  }
646
845
  }
647
846
  }
648
- `, Ze = i`
847
+ `, ct = o`
649
848
  mutation UpdateMemberVerification($input: UpdateMemberVerificationInput!) {
650
849
  updateMemberVerification(input: $input) {
651
850
  ... on FileDoesNotExistError {
@@ -662,7 +861,7 @@ const Ee = i`
662
861
  }
663
862
  }
664
863
  }
665
- `, et = i`
864
+ `, ut = o`
666
865
  query ProfileCompletion {
667
866
  profileCompletion {
668
867
  completionPercentage
@@ -673,7 +872,18 @@ const Ee = i`
673
872
  accountPassword
674
873
  }
675
874
  }
676
- `, tt = i`
875
+ `, lt = o`
876
+ mutation SendVerificationCode($input: SendVerificationCodeInput!) {
877
+ sendVerificationCode(input: $input) {
878
+ ... on InvalidPlatformError {
879
+ __typename
880
+ }
881
+ ... on NotReadyToSendVerficationCodeError {
882
+ __typename
883
+ }
884
+ }
885
+ }
886
+ `, pt = o`
677
887
  fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {
678
888
  minimumAmount
679
889
  maximumAmount
@@ -727,24 +937,7 @@ const Ee = i`
727
937
  multiplier
728
938
  }
729
939
  }
730
- `, at = i`
731
- query PointsWallet {
732
- pointsWallet {
733
- id
734
- points
735
- account
736
- dateTimeCreated
737
- }
738
- }
739
- `, rt = i`
740
- mutation PointsToCashConversion($input: PointsToCashConversionInput!) {
741
- pointsToCashConversion(input: $input) {
742
- ... on InsufficientPointsError {
743
- __typename
744
- }
745
- }
746
- }
747
- `, nt = i`
940
+ `, ft = o`
748
941
  query MayaSession($id: ObjectId!) {
749
942
  mayaSession(id: $id) {
750
943
  id
@@ -752,202 +945,6 @@ const Ee = i`
752
945
  dateTimeCreated
753
946
  }
754
947
  }
755
- `, ot = i`
756
- query TransactionRecords($first: Int, $after: Cursor, $filter: TransactionRecordFilter) {
757
- member {
758
- transactionRecords(first: $first, after: $after, filter: $filter) {
759
- edges {
760
- cursor
761
- node {
762
- ... on TransactionRecord {
763
- id
764
- type
765
- amount
766
- content
767
- currentBalance
768
- referenceNumber
769
- dateTimeCreated
770
- }
771
- }
772
- }
773
- totalCount
774
- pageInfo {
775
- hasNextPage
776
- endCursor
777
- }
778
- }
779
- }
780
- }
781
- `, it = i`
782
- query Wallet {
783
- wallet {
784
- id
785
- balance
786
- currency
787
- dateTimeCreated
788
- dateTimeLastUpdated
789
- }
790
- }
791
- `, st = i`
792
- query WithdrawalRecords($first: Int, $after: Cursor, $filter: WithdrawalRecordFilterInput) {
793
- member {
794
- withdrawalRecords(first: $first, after: $after, filter: $filter) {
795
- edges {
796
- cursor
797
- node {
798
- ... on BankWithdrawalRecord {
799
- id
800
- type
801
- bank
802
- fee
803
- netAmount
804
- reference
805
- amount
806
- status
807
- withdrawalNumber
808
- dateTimeCreated
809
- dateTimeLastUpdated
810
- }
811
- ... on GCashWithdrawalRecord {
812
- id
813
- type
814
- fee
815
- netAmount
816
- reference
817
- amount
818
- status
819
- withdrawalNumber
820
- recipientMobileNumber
821
- dateTimeCreated
822
- dateTimeLastUpdated
823
- }
824
- ... on ManualWithdrawalRecord {
825
- id
826
- type
827
- fee
828
- netAmount
829
- reference
830
- amount
831
- status
832
- withdrawalNumber
833
- dateTimeCreated
834
- dateTimeLastUpdated
835
- }
836
- ... on MayaAppWithdrawalRecord {
837
- id
838
- type
839
- fee
840
- netAmount
841
- reference
842
- amount
843
- status
844
- withdrawalNumber
845
- dateTimeCreated
846
- dateTimeLastUpdated
847
- }
848
- }
849
- }
850
- totalCount
851
- pageInfo {
852
- hasNextPage
853
- endCursor
854
- }
855
- }
856
- }
857
- }
858
- `, dt = i`
859
- mutation CreateGCashWithdrawal($input: CreateGCashWithdrawalInput!) {
860
- createGCashWithdrawal(input: $input) {
861
- ... on AccountNotVerifiedError {
862
- __typename
863
- }
864
- ... on InvalidTransactionPasswordError {
865
- __typename
866
- }
867
- ... on InvalidWithdrawalAmountError {
868
- __typename
869
- }
870
- ... on MobileNumberNotVerifiedError {
871
- __typename
872
- }
873
- ... on NotEnoughBalanceError {
874
- __typename
875
- }
876
- ... on WithdrawalDailyLimitExceededError {
877
- __typename
878
- }
879
- }
880
- }
881
- `, mt = i`
882
- mutation CreateMayaWithdrawal($input: CreateMayaWithdrawalInput!) {
883
- createMayaWithdrawal(input: $input) {
884
- ... on AccountNotVerifiedError {
885
- __typename
886
- }
887
- ... on InvalidTransactionPasswordError {
888
- __typename
889
- }
890
- ... on InvalidWithdrawalAmountError {
891
- __typename
892
- }
893
- ... on MobileNumberNotVerifiedError {
894
- __typename
895
- }
896
- ... on NotEnoughBalanceError {
897
- __typename
898
- }
899
- ... on WithdrawalDailyLimitExceededError {
900
- __typename
901
- }
902
- }
903
- }
904
- `, ct = i`
905
- mutation CreateMayaAppWithdrawal($input: CreateMayaAppWithdrawalInput!) {
906
- createMayaAppWithdrawal(input: $input) {
907
- ... on AccountNotVerifiedError {
908
- __typename
909
- }
910
- ... on InvalidTransactionPasswordError {
911
- __typename
912
- }
913
- ... on InvalidWithdrawalAmountError {
914
- __typename
915
- }
916
- ... on NotEnoughBalanceError {
917
- __typename
918
- }
919
- ... on WithdrawalDailyLimitExceededError {
920
- __typename
921
- }
922
- }
923
- }
924
- `, ut = i`
925
- mutation CreateBankWithdrawal($input: CreateBankWithdrawalInput!) {
926
- createBankWithdrawal(input: $input) {
927
- ... on MobileNumberNotVerifiedError {
928
- __typename
929
- }
930
- ... on AccountNotVerifiedError {
931
- __typename
932
- }
933
- ... on InvalidWithdrawalAmountError {
934
- __typename
935
- }
936
- ... on WithdrawalDailyLimitExceededError {
937
- __typename
938
- }
939
- ... on InvalidTransactionPasswordError {
940
- __typename
941
- }
942
- ... on NotEnoughBalanceError {
943
- __typename
944
- }
945
- }
946
- }
947
- `, lt = i`
948
- query RemainingDailyWithdrawalsCount {
949
- remainingDailyWithdrawalsCount
950
- }
951
948
  `;
952
949
  function c(n) {
953
950
  return {
@@ -992,6 +989,9 @@ function c(n) {
992
989
  ValidIdAlreadySetError: "Valid ID is already set",
993
990
  WalletDoesNotExistError: "Wallet does not exist",
994
991
  WithdrawalDailyLimitExceededError: "Daily withdrawal limit exceeded",
992
+ GameProviderError: "Game provider error",
993
+ GameSessionAlreadyClosedError: "Game session is already closed",
994
+ GameSessionDoesNotExistError: "Game session does not exist",
995
995
  AccountBlacklisted: "Account is blacklisted",
996
996
  AccountNotFound: "Account not found",
997
997
  InvalidToken: "Invalid token",
@@ -1000,21 +1000,21 @@ function c(n) {
1000
1000
  }[n]
1001
1001
  };
1002
1002
  }
1003
- class pt {
1003
+ class ht {
1004
1004
  constructor(e) {
1005
- m(this, "client");
1005
+ d(this, "client");
1006
1006
  this.client = e;
1007
1007
  }
1008
1008
  /** aka `Query.self` */
1009
1009
  async memberAccount() {
1010
- const e = await this.client.request(Ve);
1010
+ const e = await this.client.request(at);
1011
1011
  return e.ok ? {
1012
1012
  ok: !0,
1013
1013
  data: e.data.memberAccount
1014
1014
  } : e;
1015
1015
  }
1016
1016
  async registerMemberAccount(e) {
1017
- const t = await this.client.request(He, e);
1017
+ const t = await this.client.request(nt, e);
1018
1018
  return t.ok ? t.data.registerMemberAccount ? {
1019
1019
  ok: !1,
1020
1020
  error: c(t.data.registerMemberAccount.__typename)
@@ -1023,7 +1023,7 @@ class pt {
1023
1023
  } : t;
1024
1024
  }
1025
1025
  async updateMemberAccount(e) {
1026
- const t = await this.client.request(je, e);
1026
+ const t = await this.client.request(ot, e);
1027
1027
  return t.ok ? t.data.updateMemberAccount ? {
1028
1028
  ok: !1,
1029
1029
  error: c(t.data.updateMemberAccount.__typename)
@@ -1032,7 +1032,7 @@ class pt {
1032
1032
  } : t;
1033
1033
  }
1034
1034
  async deleteMemberAccount(e) {
1035
- const t = await this.client.request(Ke, e);
1035
+ const t = await this.client.request(st, e);
1036
1036
  return t.ok ? t.data.deleteMemberAccount ? {
1037
1037
  ok: !0
1038
1038
  } : {
@@ -1045,7 +1045,7 @@ class pt {
1045
1045
  }
1046
1046
  async resetPassword(e) {
1047
1047
  const t = await this.client.request(
1048
- Qe,
1048
+ it,
1049
1049
  e
1050
1050
  );
1051
1051
  return t.ok ? t.data.resetPassword ? {
@@ -1056,14 +1056,14 @@ class pt {
1056
1056
  } : t;
1057
1057
  }
1058
1058
  async profileCompletion() {
1059
- const e = await this.client.request(et);
1059
+ const e = await this.client.request(ut);
1060
1060
  return e.ok ? { ok: !0, data: e.data.profileCompletion } : e;
1061
1061
  }
1062
1062
  async platform() {
1063
- return await this.client.request(tt);
1063
+ return await this.client.request(pt);
1064
1064
  }
1065
1065
  async sendVerificationCode(e) {
1066
- const t = await this.client.request(ze, e);
1066
+ const t = await this.client.request(lt, e);
1067
1067
  return t.ok ? t.data.sendVerificationCode ? {
1068
1068
  ok: !1,
1069
1069
  error: c(t.data.sendVerificationCode.__typename)
@@ -1072,7 +1072,7 @@ class pt {
1072
1072
  } : t;
1073
1073
  }
1074
1074
  async verifyMobileNumber(e) {
1075
- const t = await this.client.request(Je, e);
1075
+ const t = await this.client.request(mt, e);
1076
1076
  return t.ok ? t.data.verifyMobileNumber ? {
1077
1077
  ok: !1,
1078
1078
  error: c(t.data.verifyMobileNumber.__typename)
@@ -1081,7 +1081,7 @@ class pt {
1081
1081
  } : t;
1082
1082
  }
1083
1083
  async createMemberVerification(e) {
1084
- const t = await this.client.request(Xe, e);
1084
+ const t = await this.client.request(dt, e);
1085
1085
  return t.ok ? t.data.createMemberVerification ? {
1086
1086
  ok: !1,
1087
1087
  error: c(t.data.createMemberVerification.__typename)
@@ -1090,7 +1090,7 @@ class pt {
1090
1090
  } : t;
1091
1091
  }
1092
1092
  async updateMemberVerification(e) {
1093
- const t = await this.client.request(Ze, e);
1093
+ const t = await this.client.request(ct, e);
1094
1094
  return t.ok ? t.data.updateMemberVerification ? {
1095
1095
  ok: !1,
1096
1096
  error: c(t.data.updateMemberVerification.__typename)
@@ -1099,7 +1099,7 @@ class pt {
1099
1099
  } : t;
1100
1100
  }
1101
1101
  async memberVerification() {
1102
- const e = await this.client.request(Ye);
1102
+ const e = await this.client.request(rt);
1103
1103
  return e.ok ? {
1104
1104
  ok: !0,
1105
1105
  data: e.data.memberAccount.verification
@@ -1107,7 +1107,7 @@ class pt {
1107
1107
  }
1108
1108
  async announcements(e) {
1109
1109
  const t = await this.client.request(
1110
- Ee,
1110
+ Ge,
1111
1111
  e
1112
1112
  );
1113
1113
  return t.ok ? {
@@ -1116,14 +1116,14 @@ class pt {
1116
1116
  } : t;
1117
1117
  }
1118
1118
  }
1119
- function u(n, e) {
1120
- const t = _[n] ? _[n] : _[500];
1119
+ function p(n, e) {
1120
+ const t = T[n] ? T[n] : T[500];
1121
1121
  return {
1122
1122
  name: t.name,
1123
1123
  message: e ?? t.message
1124
1124
  };
1125
1125
  }
1126
- const _ = {
1126
+ const T = {
1127
1127
  400: { name: "HttpBadRequest", message: "Bad Request" },
1128
1128
  401: { name: "HttpUnauthorized", message: "Unauthorized" },
1129
1129
  403: { name: "HttpForbidden", message: "Forbidden" },
@@ -1132,10 +1132,10 @@ const _ = {
1132
1132
  429: { name: "HttpTooManyRequests", message: "Too Many Requests" },
1133
1133
  500: { name: "HttpInternalServerError", message: "Internal Server Error" }
1134
1134
  };
1135
- class ft {
1135
+ class wt {
1136
1136
  constructor(e) {
1137
- m(this, "url");
1138
- m(this, "platform");
1137
+ d(this, "url");
1138
+ d(this, "platform");
1139
1139
  this.url = e.url, this.platform = e.platform;
1140
1140
  }
1141
1141
  async createSession(e) {
@@ -1144,22 +1144,15 @@ class ft {
1144
1144
  "Platform-Code": this.platform,
1145
1145
  Role: "MEMBER"
1146
1146
  });
1147
- switch (e.type) {
1148
- case "NAME_AND_PASSWORD": {
1149
- const a = `${e.name}:${e.password}`, r = Buffer.from(a).toString("base64");
1150
- t.set("Authorization", `Basic ${r}`);
1151
- break;
1152
- }
1153
- case "MOBILE_NUMBER": {
1154
- const a = `${e.mobileNumber}:${e.verificationCode}`, r = Buffer.from(a).toString("base64");
1155
- t.set("Authorization", `MobileNumberOTP ${r}`);
1156
- break;
1157
- }
1158
- case "MAYA": {
1159
- t.set("Authorization", `Maya ${e.sessionId}`);
1160
- break;
1161
- }
1147
+ if (e.name) {
1148
+ const a = `${e.name}:${e.password}`, r = Buffer.from(a).toString("base64");
1149
+ t.set("Authorization", `Basic ${r}`);
1162
1150
  }
1151
+ if (e.mobileNumber) {
1152
+ const a = `${e.mobileNumber}:${e.verificationCode}`, r = Buffer.from(a).toString("base64");
1153
+ t.set("Authorization", `MobileNumberOTP ${r}`);
1154
+ }
1155
+ e.sessionId && t.set("Authorization", `Maya ${e.sessionId}`);
1163
1156
  try {
1164
1157
  const a = await fetch(`${this.url}/sessions`, {
1165
1158
  method: "POST",
@@ -1173,12 +1166,12 @@ class ft {
1173
1166
  error: c("AccountBlacklisted")
1174
1167
  } : {
1175
1168
  ok: !1,
1176
- error: u(a.status)
1169
+ error: p(a.status)
1177
1170
  };
1178
1171
  } catch {
1179
1172
  return {
1180
1173
  ok: !1,
1181
- error: u(500)
1174
+ error: p(500)
1182
1175
  };
1183
1176
  }
1184
1177
  }
@@ -1206,12 +1199,12 @@ class ft {
1206
1199
  error: c("InvalidTokenOrSecretAnswer")
1207
1200
  } : {
1208
1201
  ok: !1,
1209
- error: u(a.status)
1202
+ error: p(a.status)
1210
1203
  };
1211
1204
  } catch {
1212
1205
  return {
1213
1206
  ok: !1,
1214
- error: u(500)
1207
+ error: p(500)
1215
1208
  };
1216
1209
  }
1217
1210
  }
@@ -1239,12 +1232,12 @@ class ft {
1239
1232
  error: c("InvalidToken")
1240
1233
  } : {
1241
1234
  ok: !1,
1242
- error: u(t.status)
1235
+ error: p(t.status)
1243
1236
  };
1244
1237
  } catch {
1245
1238
  return {
1246
1239
  ok: !1,
1247
- error: u(500)
1240
+ error: p(500)
1248
1241
  };
1249
1242
  }
1250
1243
  }
@@ -1259,9 +1252,9 @@ class ft {
1259
1252
  Authorization: `Bearer ${e}`
1260
1253
  }
1261
1254
  });
1262
- return t.ok ? { ok: !0 } : { ok: !1, error: u(t.status) };
1255
+ return t.ok ? { ok: !0 } : { ok: !1, error: p(t.status) };
1263
1256
  } catch {
1264
- return { ok: !1, error: u(500) };
1257
+ return { ok: !1, error: p(500) };
1265
1258
  }
1266
1259
  }
1267
1260
  async verifySession(e) {
@@ -1280,20 +1273,20 @@ class ft {
1280
1273
  }
1281
1274
  }
1282
1275
  }
1283
- class ht {
1276
+ class yt {
1284
1277
  constructor(e) {
1285
- m(this, "client");
1278
+ d(this, "client");
1286
1279
  this.client = e;
1287
1280
  }
1288
1281
  async file(e) {
1289
- const t = await this.client.request(De, e);
1282
+ const t = await this.client.request(Te, e);
1290
1283
  return t.ok ? {
1291
1284
  ok: !0,
1292
1285
  data: t.data.node
1293
1286
  } : t;
1294
1287
  }
1295
1288
  async uploadPrivateImageFile(e) {
1296
- const t = await this.client.upload(Ne, e);
1289
+ const t = await this.client.upload(ve, e);
1297
1290
  return t.ok ? t.data.uploadPrivateImageFile ? {
1298
1291
  ok: !1,
1299
1292
  error: c(t.data.uploadPrivateImageFile.__typename)
@@ -1302,100 +1295,48 @@ class ht {
1302
1295
  } : t;
1303
1296
  }
1304
1297
  }
1305
- class we {
1306
- constructor(e) {
1307
- m(this, "client");
1308
- this.client = e;
1309
- }
1310
- async game(e) {
1311
- const t = await this.client.request(Ae, e);
1312
- return t.ok ? { ok: !0, data: t.data.node } : t;
1313
- }
1314
- async games(e) {
1315
- const t = await this.client.request(Se, e);
1316
- return t.ok ? { ok: !0, data: t.data.games } : t;
1317
- }
1318
- async gamesByName(e) {
1319
- const t = await this.client.request(
1320
- ke,
1321
- e
1322
- );
1323
- return t.ok ? { ok: !0, data: t.data.gamesByName } : t;
1324
- }
1325
- async gameSession(e) {
1326
- const t = await this.client.request(
1327
- Ce,
1328
- e
1329
- );
1330
- return t.ok ? { ok: !0, data: t.data.node } : t;
1331
- }
1332
- async createGameSession(e) {
1333
- const t = await this.client.request(Te, e);
1334
- return t.ok ? t.data.createGameSession ? {
1335
- ok: !1,
1336
- error: c(t.data.createGameSession.__typename)
1337
- } : {
1338
- ok: !0
1339
- } : t;
1340
- }
1341
- async endGameSession(e) {
1342
- const t = await this.client.request(
1343
- _e,
1344
- e
1345
- );
1346
- return t.ok ? t.data.endGameSession ? {
1347
- ok: !0
1348
- } : {
1349
- ok: !1,
1350
- error: {
1351
- name: "UnknownError",
1352
- message: "Something went wrong."
1353
- }
1354
- } : t;
1355
- }
1356
- }
1357
- class wt {
1298
+ class bt {
1358
1299
  constructor(e) {
1359
- m(this, "client");
1300
+ d(this, "client");
1360
1301
  this.client = e;
1361
1302
  }
1362
1303
  async betRecords(e) {
1363
1304
  const t = await this.client.request(
1364
- ve,
1305
+ He,
1365
1306
  e
1366
1307
  );
1367
1308
  return t.ok ? { ok: t.ok, data: t.data.member.betRecords } : t;
1368
1309
  }
1369
1310
  async transactionRecords(e) {
1370
- const t = await this.client.request(ot, e);
1311
+ const t = await this.client.request(Qe, e);
1371
1312
  return t.ok ? { ok: t.ok, data: t.data.member.transactionRecords } : t;
1372
1313
  }
1373
1314
  async withdrawalRecords(e) {
1374
1315
  const t = await this.client.request(
1375
- st,
1316
+ Pe,
1376
1317
  e
1377
1318
  );
1378
1319
  return t.ok ? { ok: t.ok, data: t.data.member.withdrawalRecords } : t;
1379
1320
  }
1380
1321
  async depositRecords(e) {
1381
1322
  const t = await this.client.request(
1382
- Be,
1323
+ Oe,
1383
1324
  e
1384
1325
  );
1385
1326
  return t.ok ? { ok: t.ok, data: t.data.member.depositRecords } : t;
1386
1327
  }
1387
1328
  async depositsCount() {
1388
- const e = await this.client.request(Fe);
1329
+ const e = await this.client.request(Ye);
1389
1330
  return e.ok ? { ok: e.ok, data: e.data.member.depositsCount } : e;
1390
1331
  }
1391
1332
  async member() {
1392
- const e = await this.client.request(Le);
1333
+ const e = await this.client.request(tt);
1393
1334
  return e.ok ? { ok: e.ok, data: e.data.member } : e;
1394
1335
  }
1395
1336
  }
1396
- class yt {
1337
+ class gt {
1397
1338
  constructor(e) {
1398
- m(this, "url");
1339
+ d(this, "url");
1399
1340
  this.url = e.url;
1400
1341
  }
1401
1342
  gameThumbnails(e) {
@@ -1405,28 +1346,32 @@ class yt {
1405
1346
  ];
1406
1347
  }
1407
1348
  }
1408
- class bt extends we {
1349
+ class Ae {
1350
+ constructor(e) {
1351
+ d(this, "client");
1352
+ this.client = e;
1353
+ }
1409
1354
  async promos() {
1410
- const e = await this.client.request(Re);
1355
+ const e = await this.client.request(Ke);
1411
1356
  return e.ok ? { ok: e.ok, data: e.data.promos } : e;
1412
1357
  }
1413
1358
  async cashbacks() {
1414
- const e = await this.client.request(Ie);
1359
+ const e = await this.client.request(Je);
1415
1360
  return e.ok ? { ok: e.ok, data: e.data.cashbacks } : e;
1416
1361
  }
1417
1362
  async availablePromos(e) {
1418
1363
  const t = await this.client.request(
1419
- Pe,
1364
+ ze,
1420
1365
  e
1421
1366
  );
1422
1367
  return t.ok ? { ok: t.ok, data: t.data.availablePromos } : t;
1423
1368
  }
1424
1369
  async cashbackBonuses() {
1425
- const e = await this.client.request(xe);
1370
+ const e = await this.client.request(Ze);
1426
1371
  return e.ok ? { ok: e.ok, data: e.data.cashbackBonuses } : e;
1427
1372
  }
1428
1373
  async claimCashbackBonus(e) {
1429
- const t = await this.client.request($e, e);
1374
+ const t = await this.client.request(et, e);
1430
1375
  return t.ok ? t.data.claimCashbackBonus ? {
1431
1376
  ok: !1,
1432
1377
  error: c(t.data.claimCashbackBonus.__typename)
@@ -1438,22 +1383,22 @@ class bt extends we {
1438
1383
  };
1439
1384
  }
1440
1385
  async bonus() {
1441
- const e = await this.client.request(Ge);
1386
+ const e = await this.client.request(Xe);
1442
1387
  return e.ok ? { ok: e.ok, data: e.data.bonus } : e;
1443
1388
  }
1444
1389
  async wallet() {
1445
- const e = await this.client.request(it);
1390
+ const e = await this.client.request(Me);
1446
1391
  return e.ok ? { ok: e.ok, data: e.data.wallet } : e;
1447
1392
  }
1448
1393
  async deposit(e) {
1449
1394
  const t = await this.client.request(
1450
- qe,
1395
+ Ve,
1451
1396
  e
1452
1397
  );
1453
1398
  return t.ok ? { ok: t.ok, data: t.data.node } : t;
1454
1399
  }
1455
1400
  async createGCashDeposit(e) {
1456
- const t = await this.client.request(We, e);
1401
+ const t = await this.client.request(qe, e);
1457
1402
  return t.ok ? t.data.createGCashDeposit ? {
1458
1403
  ok: !1,
1459
1404
  error: c(t.data.createGCashDeposit.__typename)
@@ -1462,7 +1407,7 @@ class bt extends we {
1462
1407
  } : t;
1463
1408
  }
1464
1409
  async createMayaDeposit(e) {
1465
- const t = await this.client.request(Ue, e);
1410
+ const t = await this.client.request(Fe, e);
1466
1411
  return t.ok ? t.data.createMayaDeposit ? {
1467
1412
  ok: !1,
1468
1413
  error: c(t.data.createMayaDeposit.__typename)
@@ -1471,7 +1416,7 @@ class bt extends we {
1471
1416
  } : t;
1472
1417
  }
1473
1418
  async createMayaAppDeposit(e) {
1474
- const t = await this.client.request(Oe, e);
1419
+ const t = await this.client.request(Le, e);
1475
1420
  return t.ok ? t.data.createMayaAppDeposit ? {
1476
1421
  ok: !1,
1477
1422
  error: c(t.data.createMayaAppDeposit.__typename)
@@ -1480,7 +1425,7 @@ class bt extends we {
1480
1425
  } : t;
1481
1426
  }
1482
1427
  async createGCashWithdrawal(e) {
1483
- const t = await this.client.request(dt, e);
1428
+ const t = await this.client.request(xe, e);
1484
1429
  return t.ok ? t.data.createGCashWithdrawal ? {
1485
1430
  ok: !1,
1486
1431
  error: c(t.data.createGCashWithdrawal.__typename)
@@ -1489,7 +1434,7 @@ class bt extends we {
1489
1434
  } : t;
1490
1435
  }
1491
1436
  async createMayaWithdrawal(e) {
1492
- const t = await this.client.request(mt, e);
1437
+ const t = await this.client.request($e, e);
1493
1438
  return t.ok ? t.data.createMayaWithdrawal ? {
1494
1439
  ok: !1,
1495
1440
  error: c(t.data.createMayaWithdrawal.__typename)
@@ -1498,7 +1443,7 @@ class bt extends we {
1498
1443
  } : t;
1499
1444
  }
1500
1445
  async createMayaAppWithdrawal(e) {
1501
- const t = await this.client.request(ct, e);
1446
+ const t = await this.client.request(Be, e);
1502
1447
  return t.ok ? t.data.createMayaAppWithdrawal ? {
1503
1448
  ok: !1,
1504
1449
  error: c(t.data.createMayaAppWithdrawal.__typename)
@@ -1507,7 +1452,7 @@ class bt extends we {
1507
1452
  } : t;
1508
1453
  }
1509
1454
  async createBankWithdrawal(e) {
1510
- const t = await this.client.request(ut, e);
1455
+ const t = await this.client.request(We, e);
1511
1456
  return t.ok ? t.data.createBankWithdrawal ? {
1512
1457
  ok: !1,
1513
1458
  error: c(t.data.createBankWithdrawal.__typename)
@@ -1517,16 +1462,16 @@ class bt extends we {
1517
1462
  }
1518
1463
  async remainingDailyWithdrawalsCount() {
1519
1464
  const e = await this.client.request(
1520
- lt
1465
+ Ue
1521
1466
  );
1522
1467
  return e.ok ? { ok: e.ok, data: e.data.remainingDailyWithdrawalsCount } : e;
1523
1468
  }
1524
1469
  async pointsWallet() {
1525
- const e = await this.client.request(at);
1470
+ const e = await this.client.request(De);
1526
1471
  return e.ok ? { ok: e.ok, data: e.data.pointsWallet } : e;
1527
1472
  }
1528
1473
  async pointsToCashConversion(e) {
1529
- const t = await this.client.request(rt, e);
1474
+ const t = await this.client.request(Ne, e);
1530
1475
  return t.ok ? t.data.pointsToCashConversion ? {
1531
1476
  ok: !1,
1532
1477
  error: c(t.data.pointsToCashConversion.__typename)
@@ -1536,49 +1481,136 @@ class bt extends we {
1536
1481
  }
1537
1482
  async mayaSession(e) {
1538
1483
  const t = await this.client.request(
1539
- nt,
1484
+ ft,
1540
1485
  e
1541
1486
  );
1542
1487
  return t.ok ? { ok: t.ok, data: t.data.mayaSession } : t;
1543
1488
  }
1489
+ async games(e) {
1490
+ const t = await this.client.request(we, e);
1491
+ return t.ok ? { ok: t.ok, data: t.data.games } : t;
1492
+ }
1493
+ async gamesByName(e) {
1494
+ const t = await this.client.request(
1495
+ ye,
1496
+ e
1497
+ );
1498
+ return t.ok ? { ok: t.ok, data: t.data.gamesByName } : t;
1499
+ }
1500
+ async gameSession(e) {
1501
+ const t = await this.client.request(
1502
+ be,
1503
+ e
1504
+ );
1505
+ return t.ok ? { ok: !0, data: t.data.node } : t;
1506
+ }
1507
+ async createGameSession(e) {
1508
+ const t = await this.client.request(ge, e);
1509
+ return t.ok ? t.data.createGameSession ? {
1510
+ ok: !1,
1511
+ error: c(t.data.createGameSession.__typename)
1512
+ } : {
1513
+ ok: !0
1514
+ } : t;
1515
+ }
1516
+ async endGameSession(e) {
1517
+ const t = await this.client.request(
1518
+ Ie,
1519
+ e
1520
+ );
1521
+ return t.ok ? t.data.endGameSession ? {
1522
+ ok: !0
1523
+ } : {
1524
+ ok: !1,
1525
+ error: {
1526
+ name: "UnknownError",
1527
+ message: "Something went wrong."
1528
+ }
1529
+ } : t;
1530
+ }
1544
1531
  }
1545
- class gt {
1532
+ class Et {
1533
+ constructor(e) {
1534
+ d(this, "client");
1535
+ this.client = e;
1536
+ }
1537
+ async games(e) {
1538
+ const t = await this.client.request(we, e);
1539
+ return t.ok ? { ok: t.ok, data: t.data.games } : t;
1540
+ }
1541
+ async gamesByName(e) {
1542
+ const t = await this.client.request(
1543
+ ye,
1544
+ e
1545
+ );
1546
+ return t.ok ? { ok: t.ok, data: t.data.gamesByName } : t;
1547
+ }
1548
+ async gameSession(e) {
1549
+ const t = await this.client.request(
1550
+ be,
1551
+ e
1552
+ );
1553
+ return t.ok ? { ok: !0, data: t.data.node } : t;
1554
+ }
1555
+ async createGameSession(e) {
1556
+ const t = await this.client.request(ge, e);
1557
+ return t.ok ? t.data.createGameSession ? {
1558
+ ok: !1,
1559
+ error: c(t.data.createGameSession.__typename)
1560
+ } : {
1561
+ ok: !0
1562
+ } : t;
1563
+ }
1564
+ async endGameSession(e) {
1565
+ const t = await this.client.request(Re, e);
1566
+ return t.ok ? t.data.endGameSession ? {
1567
+ ok: !1,
1568
+ error: c(t.data.endGameSession.__typename)
1569
+ } : {
1570
+ ok: !0
1571
+ } : t;
1572
+ }
1573
+ }
1574
+ class At {
1546
1575
  constructor(e) {
1547
- m(this, "client");
1576
+ d(this, "client");
1548
1577
  this.client = e;
1549
1578
  }
1550
1579
  async latestBetRecords() {
1551
- const e = await this.client.request(Me);
1580
+ const e = await this.client.request(je);
1552
1581
  return e.ok ? {
1553
1582
  ok: !0,
1554
1583
  data: e.data.latestBetRecords
1555
1584
  } : e;
1556
1585
  }
1557
1586
  }
1558
- function Et(n) {
1587
+ function St(n, e, t) {
1588
+ return n < e ? e : n > t ? t : n;
1589
+ }
1590
+ function kt(n) {
1559
1591
  return Object.prototype.toString.call(n) === "[object Object]" && Object(n) === n;
1560
1592
  }
1561
- function At(n) {
1593
+ function Ct(n) {
1562
1594
  const e = [];
1563
1595
  function t(a, r = []) {
1564
1596
  for (const s in a) {
1565
- const d = a[s];
1566
- Et(d) ? t(d, [...r, s]) : Array.isArray(d) ? t(St(d), [...r, s]) : e.push({
1597
+ const m = a[s];
1598
+ kt(m) ? t(m, [...r, s]) : Array.isArray(m) ? t(_t(m), [...r, s]) : e.push({
1567
1599
  key: [...r, s],
1568
- value: d
1600
+ value: m
1569
1601
  });
1570
1602
  }
1571
1603
  }
1572
1604
  return t(n), e;
1573
1605
  }
1574
- function St(n) {
1606
+ function _t(n) {
1575
1607
  return n.reduce((e, t, a) => (e[a] = t, e), {});
1576
1608
  }
1577
- class b {
1609
+ class E {
1578
1610
  constructor(e, t) {
1579
- m(this, "url");
1580
- m(this, "options");
1581
- m(this, "middlewares");
1611
+ d(this, "url");
1612
+ d(this, "options");
1613
+ d(this, "middlewares");
1582
1614
  var r;
1583
1615
  const a = new Headers((r = t == null ? void 0 : t.fetchOptions) == null ? void 0 : r.headers);
1584
1616
  this.url = e, this.options = { ...t == null ? void 0 : t.fetchOptions, headers: a }, this.middlewares = (t == null ? void 0 : t.middlewares) ?? [];
@@ -1611,23 +1643,23 @@ class b {
1611
1643
  return await this.exec(s);
1612
1644
  }
1613
1645
  async exec(e) {
1614
- var t, a, r, s, d, f;
1646
+ var t, a, r, s, m, u;
1615
1647
  try {
1616
- const y = await fetch(e);
1617
- if (!y.ok)
1618
- return { ok: !1, error: u(y.status) };
1619
- const g = await y.json(), C = g.data, l = (t = g.errors) == null ? void 0 : t.at(0);
1620
- return l ? ((a = l.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = l.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: u(403, l.message) } : ((s = l.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: u(401, l.message) } : ((d = l.extensions) == null ? void 0 : d.code) === "BAD_USER_INPUT" || ((f = l.extensions) == null ? void 0 : f.code) === "BAD_REQUEST" ? { ok: !1, error: u(400, l.message) } : {
1648
+ const f = await fetch(e);
1649
+ if (!f.ok)
1650
+ return { ok: !1, error: p(f.status) };
1651
+ const l = await f.json(), y = l.data, h = (t = l.errors) == null ? void 0 : t.at(0);
1652
+ return h ? ((a = h.extensions) == null ? void 0 : a.code) === "FORBIDDEN" || ((r = h.extensions) == null ? void 0 : r.code) === "ACCESS_TOKEN_EXPIRED" ? { ok: !1, error: p(403, h.message) } : ((s = h.extensions) == null ? void 0 : s.code) === "UNAUTHORIZED" ? { ok: !1, error: p(401, h.message) } : ((m = h.extensions) == null ? void 0 : m.code) === "BAD_USER_INPUT" || ((u = h.extensions) == null ? void 0 : u.code) === "BAD_REQUEST" ? { ok: !1, error: p(400, h.message) } : {
1621
1653
  ok: !1,
1622
- error: u(500, l.message)
1654
+ error: p(500, h.message)
1623
1655
  } : {
1624
1656
  ok: !0,
1625
- data: C
1657
+ data: y
1626
1658
  };
1627
1659
  } catch {
1628
1660
  return {
1629
1661
  ok: !1,
1630
- error: u(500)
1662
+ error: p(500)
1631
1663
  };
1632
1664
  }
1633
1665
  }
@@ -1638,8 +1670,8 @@ class b {
1638
1670
  return t;
1639
1671
  }
1640
1672
  createUploadBody(e, t) {
1641
- const a = At(t).filter(
1642
- (d) => d.value instanceof File || d.value instanceof Blob
1673
+ const a = Ct(t).filter(
1674
+ (m) => m.value instanceof File || m.value instanceof Blob
1643
1675
  ), r = new FormData();
1644
1676
  r.append(
1645
1677
  "operations",
@@ -1649,20 +1681,20 @@ class b {
1649
1681
  })
1650
1682
  );
1651
1683
  const s = {};
1652
- return a.forEach((d, f) => {
1653
- s[f.toString()] = [`variables.${d.key.join(".")}`];
1654
- }), r.append("map", JSON.stringify(s)), a.forEach((d, f) => {
1655
- r.append(f.toString(), d.value);
1684
+ return a.forEach((m, u) => {
1685
+ s[u.toString()] = [`variables.${m.key.join(".")}`];
1686
+ }), r.append("map", JSON.stringify(s)), a.forEach((m, u) => {
1687
+ r.append(u.toString(), m.value);
1656
1688
  }), r;
1657
1689
  }
1658
1690
  }
1659
- async function p(n) {
1691
+ async function w(n) {
1660
1692
  const e = new TextEncoder().encode(n), t = await crypto.subtle.digest("SHA-256", e);
1661
1693
  return Array.from(new Uint8Array(t)).map((s) => s.toString(16).padStart(2, "0")).join("");
1662
1694
  }
1663
- class ye {
1695
+ class Se {
1664
1696
  constructor(e) {
1665
- m(this, "enabled");
1697
+ d(this, "enabled");
1666
1698
  this.enabled = (e == null ? void 0 : e.enabled) ?? !0;
1667
1699
  }
1668
1700
  info(e) {
@@ -1681,33 +1713,56 @@ class ye {
1681
1713
  function M(n) {
1682
1714
  return new Date(n.getTime());
1683
1715
  }
1684
- function E(n, e) {
1716
+ function A(n, e) {
1685
1717
  const t = M(n);
1686
1718
  return t.setDate(t.getDate() + e), t;
1687
1719
  }
1688
- function A(n, e) {
1720
+ function S(n, e) {
1689
1721
  const t = M(n);
1690
1722
  return t.setMinutes(t.getMinutes() + e), t;
1691
1723
  }
1692
1724
  function fe(n, e) {
1693
1725
  return n.getTime() > e.getTime();
1694
1726
  }
1695
- function kt(n) {
1727
+ function ke(n) {
1696
1728
  return new Promise((e) => {
1697
1729
  setTimeout(e, n);
1698
1730
  });
1699
1731
  }
1700
- function S(n, e) {
1732
+ function he(n, e) {
1733
+ const {
1734
+ until: t,
1735
+ interval: a = 1e3,
1736
+ maxAttempt: r = 3
1737
+ /**/
1738
+ } = e;
1739
+ async function s(m, u) {
1740
+ const f = u ?? r, l = await n(...m);
1741
+ return t(l) ? l : f > 1 ? (await ke(a * ((r - f) / 2)), s(m, f - 1)) : l;
1742
+ }
1743
+ return async (...m) => await s(m);
1744
+ }
1745
+ function k(n, e) {
1701
1746
  const t = M(n);
1702
1747
  return t.setMinutes(t.getMinutes() - e), t;
1703
1748
  }
1704
- class Ct {
1749
+ class Tt {
1705
1750
  constructor(e) {
1706
- m(this, "logger");
1707
- m(this, "storageKey", "session");
1708
- m(this, "authService");
1709
- m(this, "_refreshing", !1);
1710
- this.authService = new ft(e), this.logger = new ye({
1751
+ d(this, "logger");
1752
+ d(this, "storageKey", "session");
1753
+ d(this, "authService");
1754
+ d(this, "walletService");
1755
+ d(this, "_refreshing", !1);
1756
+ this.authService = new wt({
1757
+ url: e.authUrl,
1758
+ platform: e.platform
1759
+ }), this.walletService = new Ae(
1760
+ new E(e.walletUrl, {
1761
+ middlewares: [
1762
+ (t) => (t.headers.set("Platform", e.platform), t.headers.set("Role", "MEMBER"), t)
1763
+ ]
1764
+ })
1765
+ ), this.logger = new Se({
1711
1766
  enabled: e.log ?? !1
1712
1767
  });
1713
1768
  }
@@ -1727,23 +1782,33 @@ class Ct {
1727
1782
  }
1728
1783
  };
1729
1784
  if (e.type === "MAYA") {
1730
- const r = await this.authService.createSession(e);
1731
- if (r.ok) {
1732
- const s = /* @__PURE__ */ new Date();
1733
- return window.localStorage.setItem(
1734
- this.storageKey,
1735
- JSON.stringify({
1736
- ...r.data,
1737
- maya: !0,
1738
- accessTokenExpiresAt: A(s, 8).getTime(),
1739
- refreshTokenExpiresAt: S(E(s, 30), 2).getTime()
1740
- })
1741
- ), {
1742
- ok: !0,
1743
- data: null
1744
- };
1745
- }
1746
- return r;
1785
+ const s = await he(() => this.walletService.mayaSession({ id: e.sessionId }), {
1786
+ until: (l) => {
1787
+ var y;
1788
+ return l.ok && ((y = l.data) == null ? void 0 : y.member) != null;
1789
+ },
1790
+ interval: 1e3,
1791
+ maxAttempt: 5
1792
+ })();
1793
+ if (!s.ok) return s;
1794
+ const u = await he(() => this.authService.createSession(e), {
1795
+ until: (l) => l.ok,
1796
+ interval: 1e3,
1797
+ maxAttempt: 5
1798
+ })();
1799
+ if (!u.ok) return u;
1800
+ const f = /* @__PURE__ */ new Date();
1801
+ return window.localStorage.setItem(
1802
+ this.storageKey,
1803
+ JSON.stringify({
1804
+ ...u.data,
1805
+ accessTokenExpiresAt: S(f, 8).getTime(),
1806
+ refreshTokenExpiresAt: k(A(f, 30), 2).getTime()
1807
+ })
1808
+ ), {
1809
+ ok: !0,
1810
+ data: null
1811
+ };
1747
1812
  }
1748
1813
  if (e.type === "MOBILE_NUMBER") {
1749
1814
  const r = await this.authService.createSession(e);
@@ -1753,8 +1818,8 @@ class Ct {
1753
1818
  this.storageKey,
1754
1819
  JSON.stringify({
1755
1820
  ...r.data,
1756
- accessTokenExpiresAt: A(s, 8).getTime(),
1757
- refreshTokenExpiresAt: S(E(s, 30), 2).getTime()
1821
+ accessTokenExpiresAt: S(s, 8).getTime(),
1822
+ refreshTokenExpiresAt: k(A(s, 30), 2).getTime()
1758
1823
  })
1759
1824
  ), {
1760
1825
  ok: !0,
@@ -1777,8 +1842,8 @@ class Ct {
1777
1842
  this.storageKey,
1778
1843
  JSON.stringify({
1779
1844
  ...t.data,
1780
- accessTokenExpiresAt: A(a, 8).getTime(),
1781
- refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
1845
+ accessTokenExpiresAt: S(a, 8).getTime(),
1846
+ refreshTokenExpiresAt: k(A(a, 30), 2).getTime()
1782
1847
  })
1783
1848
  ), {
1784
1849
  ok: !0,
@@ -1793,8 +1858,8 @@ class Ct {
1793
1858
  this.storageKey,
1794
1859
  JSON.stringify({
1795
1860
  ...t.data,
1796
- accessTokenExpiresAt: A(a, 8).getTime(),
1797
- refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
1861
+ accessTokenExpiresAt: S(a, 8).getTime(),
1862
+ refreshTokenExpiresAt: k(A(a, 30), 2).getTime()
1798
1863
  })
1799
1864
  ), { ok: !0 };
1800
1865
  } else
@@ -1807,7 +1872,7 @@ class Ct {
1807
1872
  data: null
1808
1873
  };
1809
1874
  if (this.refreshing)
1810
- return await kt(1e3), await this.get();
1875
+ return await ke(1e3), await this.get();
1811
1876
  const e = window.localStorage.getItem(this.storageKey);
1812
1877
  if (!e)
1813
1878
  return {
@@ -1827,20 +1892,20 @@ class Ct {
1827
1892
  };
1828
1893
  if (fe(a, r)) {
1829
1894
  this.logger.info("Refreshing session..."), this.refreshing = !0;
1830
- const d = await this.authService.refreshSession(t.refreshToken);
1831
- if (this.refreshing = !1, !d.ok)
1832
- return this.logger.error(`Failed to refresh session: ${d.error.message}`), d.error.name === "InvalidToken" || d.error.name === "AccountBlacklisted" ? (window.localStorage.removeItem(this.storageKey), {
1895
+ const m = await this.authService.refreshSession(t.refreshToken);
1896
+ if (this.refreshing = !1, !m.ok)
1897
+ return this.logger.error(`Failed to refresh session: ${m.error.message}`), m.error.name === "InvalidToken" || m.error.name === "AccountBlacklisted" ? (window.localStorage.removeItem(this.storageKey), {
1833
1898
  ok: !1,
1834
- error: d.error
1899
+ error: m.error
1835
1900
  }) : (this.logger.warn("Old session returned."), {
1836
1901
  ok: !0,
1837
1902
  data: t
1838
1903
  });
1839
1904
  this.logger.success("Session refreshed!"), a = /* @__PURE__ */ new Date(), t = {
1840
1905
  ...t,
1841
- ...d.data,
1842
- accessTokenExpiresAt: A(a, 8).getTime(),
1843
- refreshTokenExpiresAt: S(E(a, 30), 2).getTime()
1906
+ ...m.data,
1907
+ accessTokenExpiresAt: S(a, 8).getTime(),
1908
+ refreshTokenExpiresAt: k(A(a, 30), 2).getTime()
1844
1909
  }, window.localStorage.setItem(this.storageKey, JSON.stringify(t));
1845
1910
  }
1846
1911
  return {
@@ -1880,7 +1945,7 @@ class Ct {
1880
1945
  return typeof window > "u";
1881
1946
  }
1882
1947
  }
1883
- function o(n, e) {
1948
+ function i(n, e) {
1884
1949
  if (typeof n == "number" && !Number.isNaN(n))
1885
1950
  return n;
1886
1951
  if (typeof n == "string") {
@@ -1890,11 +1955,11 @@ function o(n, e) {
1890
1955
  }
1891
1956
  return e;
1892
1957
  }
1893
- class Tt {
1958
+ class vt {
1894
1959
  constructor(e) {
1895
- m(this, "staticService");
1960
+ d(this, "staticService");
1896
1961
  const t = (e == null ? void 0 : e.environment) === "development";
1897
- this.staticService = new yt({
1962
+ this.staticService = new gt({
1898
1963
  url: t ? "https://static.development.opexa.io" : "https://static.opexa.io"
1899
1964
  });
1900
1965
  }
@@ -1923,10 +1988,10 @@ class Tt {
1923
1988
  };
1924
1989
  }
1925
1990
  platform(e) {
1926
- var t, a, r, s, d, f, y, g, C, l, D, N, I, R, P, G, x, $, B, W, U, O, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, de, me, ce, ue, le, pe;
1991
+ var t, a, r, s, m, u, f, l, y, h, D, N, I, R, G, P, x, $, B, W, U, O, q, F, L, V, Y, H, j, Q, K, z, J, X, Z, ee, te, ae, re, ne, oe, ie, se, me, de, ce, ue, le, pe;
1927
1992
  return {
1928
1993
  paymentSettings: {
1929
- minimumFirstDepositAmount: o(e.minimumFirstDepositAmount),
1994
+ minimumFirstDepositAmount: i(e.minimumFirstDepositAmount),
1930
1995
  restrictWithdrawalsToVerifiedMembers: e.restrictWithdrawalsToVerifiedMembers,
1931
1996
  depositGateway: {
1932
1997
  bank: {
@@ -1934,32 +1999,32 @@ class Tt {
1934
1999
  iosEnabled: ((a = e.bankDepositGatewaySettings) == null ? void 0 : a.iosEnabled) ?? !1,
1935
2000
  webEnabled: ((r = e.bankDepositGatewaySettings) == null ? void 0 : r.webEnabled) ?? !1,
1936
2001
  mobileWebEnabled: ((s = e.bankDepositGatewaySettings) == null ? void 0 : s.mobileWebEnabled) ?? !1,
1937
- minimumAmount: o((d = e.bankDepositGatewaySettings) == null ? void 0 : d.minimumAmount),
1938
- maximumAmount: o((f = e.bankDepositGatewaySettings) == null ? void 0 : f.maximumAmount)
2002
+ minimumAmount: i((m = e.bankDepositGatewaySettings) == null ? void 0 : m.minimumAmount),
2003
+ maximumAmount: i((u = e.bankDepositGatewaySettings) == null ? void 0 : u.maximumAmount)
1939
2004
  },
1940
2005
  gcash: {
1941
- androidEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.androidEnabled) ?? !1,
1942
- iosEnabled: ((g = e.gcashDepositGatewaySettings) == null ? void 0 : g.iosEnabled) ?? !1,
1943
- webEnabled: ((C = e.gcashDepositGatewaySettings) == null ? void 0 : C.webEnabled) ?? !1,
1944
- mobileWebEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.mobileWebEnabled) ?? !1,
1945
- minimumAmount: o((D = e.gcashDepositGatewaySettings) == null ? void 0 : D.minimumAmount),
1946
- maximumAmount: o((N = e.gcashDepositGatewaySettings) == null ? void 0 : N.maximumAmount)
2006
+ androidEnabled: ((f = e.gcashDepositGatewaySettings) == null ? void 0 : f.androidEnabled) ?? !1,
2007
+ iosEnabled: ((l = e.gcashDepositGatewaySettings) == null ? void 0 : l.iosEnabled) ?? !1,
2008
+ webEnabled: ((y = e.gcashDepositGatewaySettings) == null ? void 0 : y.webEnabled) ?? !1,
2009
+ mobileWebEnabled: ((h = e.gcashDepositGatewaySettings) == null ? void 0 : h.mobileWebEnabled) ?? !1,
2010
+ minimumAmount: i((D = e.gcashDepositGatewaySettings) == null ? void 0 : D.minimumAmount),
2011
+ maximumAmount: i((N = e.gcashDepositGatewaySettings) == null ? void 0 : N.maximumAmount)
1947
2012
  },
1948
2013
  maya: {
1949
2014
  androidEnabled: ((I = e.mayaDepositGatewaySettings) == null ? void 0 : I.androidEnabled) ?? !1,
1950
2015
  iosEnabled: ((R = e.mayaDepositGatewaySettings) == null ? void 0 : R.iosEnabled) ?? !1,
1951
- webEnabled: ((P = e.mayaDepositGatewaySettings) == null ? void 0 : P.webEnabled) ?? !1,
1952
- mobileWebEnabled: ((G = e.mayaDepositGatewaySettings) == null ? void 0 : G.mobileWebEnabled) ?? !1,
1953
- minimumAmount: o((x = e.mayaDepositGatewaySettings) == null ? void 0 : x.minimumAmount),
1954
- maximumAmount: o(($ = e.mayaDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
2016
+ webEnabled: ((G = e.mayaDepositGatewaySettings) == null ? void 0 : G.webEnabled) ?? !1,
2017
+ mobileWebEnabled: ((P = e.mayaDepositGatewaySettings) == null ? void 0 : P.mobileWebEnabled) ?? !1,
2018
+ minimumAmount: i((x = e.mayaDepositGatewaySettings) == null ? void 0 : x.minimumAmount),
2019
+ maximumAmount: i(($ = e.mayaDepositGatewaySettings) == null ? void 0 : $.maximumAmount)
1955
2020
  },
1956
2021
  mayaApp: {
1957
2022
  androidEnabled: ((B = e.mayaAppDepositGatewaySettings) == null ? void 0 : B.androidEnabled) ?? !1,
1958
2023
  iosEnabled: ((W = e.mayaAppDepositGatewaySettings) == null ? void 0 : W.iosEnabled) ?? !1,
1959
2024
  webEnabled: ((U = e.mayaAppDepositGatewaySettings) == null ? void 0 : U.webEnabled) ?? !1,
1960
2025
  mobileWebEnabled: ((O = e.mayaAppDepositGatewaySettings) == null ? void 0 : O.mobileWebEnabled) ?? !1,
1961
- minimumAmount: o((q = e.mayaAppDepositGatewaySettings) == null ? void 0 : q.minimumAmount),
1962
- maximumAmount: o((F = e.mayaAppDepositGatewaySettings) == null ? void 0 : F.maximumAmount)
2026
+ minimumAmount: i((q = e.mayaAppDepositGatewaySettings) == null ? void 0 : q.minimumAmount),
2027
+ maximumAmount: i((F = e.mayaAppDepositGatewaySettings) == null ? void 0 : F.maximumAmount)
1963
2028
  }
1964
2029
  },
1965
2030
  withdrawalGateway: {
@@ -1968,16 +2033,16 @@ class Tt {
1968
2033
  iosEnabled: ((V = e.bankWithdrawalGatewaySettings) == null ? void 0 : V.iosEnabled) ?? !1,
1969
2034
  webEnabled: ((Y = e.bankWithdrawalGatewaySettings) == null ? void 0 : Y.webEnabled) ?? !1,
1970
2035
  mobileWebEnabled: ((H = e.bankWithdrawalGatewaySettings) == null ? void 0 : H.mobileWebEnabled) ?? !1,
1971
- minimumAmount: o((j = e.bankWithdrawalGatewaySettings) == null ? void 0 : j.minimumAmount),
1972
- maximumAmount: o((Q = e.bankWithdrawalGatewaySettings) == null ? void 0 : Q.maximumAmount)
2036
+ minimumAmount: i((j = e.bankWithdrawalGatewaySettings) == null ? void 0 : j.minimumAmount),
2037
+ maximumAmount: i((Q = e.bankWithdrawalGatewaySettings) == null ? void 0 : Q.maximumAmount)
1973
2038
  },
1974
2039
  gcash: {
1975
2040
  androidEnabled: ((K = e.gcashWithdrawalGatewaySettings) == null ? void 0 : K.androidEnabled) ?? !1,
1976
2041
  iosEnabled: ((z = e.gcashWithdrawalGatewaySettings) == null ? void 0 : z.iosEnabled) ?? !1,
1977
2042
  webEnabled: ((J = e.gcashWithdrawalGatewaySettings) == null ? void 0 : J.webEnabled) ?? !1,
1978
2043
  mobileWebEnabled: ((X = e.gcashWithdrawalGatewaySettings) == null ? void 0 : X.mobileWebEnabled) ?? !1,
1979
- minimumAmount: o((Z = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Z.minimumAmount),
1980
- maximumAmount: o(
2044
+ minimumAmount: i((Z = e.gcashWithdrawalGatewaySettings) == null ? void 0 : Z.minimumAmount),
2045
+ maximumAmount: i(
1981
2046
  (ee = e.gcashWithdrawalGatewaySettings) == null ? void 0 : ee.maximumAmount,
1982
2047
  1e6
1983
2048
  )
@@ -1987,16 +2052,16 @@ class Tt {
1987
2052
  iosEnabled: ((ae = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ae.iosEnabled) ?? !1,
1988
2053
  webEnabled: ((re = e.mayaWithdrawalGatewaySettings) == null ? void 0 : re.webEnabled) ?? !1,
1989
2054
  mobileWebEnabled: ((ne = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ne.mobileWebEnabled) ?? !1,
1990
- minimumAmount: o((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.minimumAmount),
1991
- maximumAmount: o((ie = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ie.maximumAmount)
2055
+ minimumAmount: i((oe = e.mayaWithdrawalGatewaySettings) == null ? void 0 : oe.minimumAmount),
2056
+ maximumAmount: i((ie = e.mayaWithdrawalGatewaySettings) == null ? void 0 : ie.maximumAmount)
1992
2057
  },
1993
2058
  mayaApp: {
1994
2059
  androidEnabled: ((se = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : se.androidEnabled) ?? !1,
1995
- iosEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.iosEnabled) ?? !1,
1996
- webEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.webEnabled) ?? !1,
2060
+ iosEnabled: ((me = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : me.iosEnabled) ?? !1,
2061
+ webEnabled: ((de = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : de.webEnabled) ?? !1,
1997
2062
  mobileWebEnabled: ((ce = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ce.mobileWebEnabled) ?? !1,
1998
- minimumAmount: o((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.minimumAmount),
1999
- maximumAmount: o(
2063
+ minimumAmount: i((ue = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : ue.minimumAmount),
2064
+ maximumAmount: i(
2000
2065
  (le = e.mayaAppWithdrawalGatewaySettings) == null ? void 0 : le.maximumAmount,
2001
2066
  1e6
2002
2067
  )
@@ -2004,7 +2069,7 @@ class Tt {
2004
2069
  }
2005
2070
  },
2006
2071
  pointsClubSettings: {
2007
- multiplier: o((pe = e.pointsClubSettings) == null ? void 0 : pe.multiplier, 0)
2072
+ multiplier: i((pe = e.pointsClubSettings) == null ? void 0 : pe.multiplier, 0)
2008
2073
  }
2009
2074
  };
2010
2075
  }
@@ -2021,7 +2086,7 @@ class Tt {
2021
2086
  mobileNumber: e.mobileNumber ?? void 0,
2022
2087
  mobileNumberVerified: e.mobileNumberVerified ?? !1,
2023
2088
  mobileNumberVerificationRequired: e.mobileNumberVerificationRequired ?? !1,
2024
- validId: e.validId ?? void 0,
2089
+ validId: e.validId ? e.validId : void 0,
2025
2090
  verificationStatus: e.verificationStatus,
2026
2091
  transactionPassword: e.transactionPassword,
2027
2092
  secretAnswerSubmitted: e.secretAnswerSubmitted ?? !1,
@@ -2033,7 +2098,7 @@ class Tt {
2033
2098
  wallet(e) {
2034
2099
  return {
2035
2100
  ...e,
2036
- balance: o(e.balance, 0),
2101
+ balance: i(e.balance, 0),
2037
2102
  dateTimeCreated: new Date(e.dateTimeCreated),
2038
2103
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
2039
2104
  };
@@ -2041,22 +2106,14 @@ class Tt {
2041
2106
  verificationDetails(e) {
2042
2107
  return {
2043
2108
  ...e,
2044
- idFrontImage: {
2045
- ...e.idFrontImage,
2046
- url: e.idFrontImage.url ?? void 0,
2047
- dateTimeCreated: new Date(e.idFrontImage.dateTimeCreated)
2048
- },
2049
- selfieImage: {
2050
- ...e.selfieImage,
2051
- url: e.selfieImage.url ?? void 0,
2052
- dateTimeCreated: new Date(e.selfieImage.dateTimeCreated)
2053
- }
2109
+ selfieImage: this.file(e.selfieImage),
2110
+ idFrontImage: this.file(e.idFrontImage)
2054
2111
  };
2055
2112
  }
2056
2113
  profileCompletion(e) {
2057
2114
  return {
2058
2115
  ...e,
2059
- completionPercentage: o(e, 0)
2116
+ completionPercentage: i(e, 0)
2060
2117
  };
2061
2118
  }
2062
2119
  announcement(e) {
@@ -2071,9 +2128,9 @@ class Tt {
2071
2128
  withdrawalRecord(e) {
2072
2129
  return {
2073
2130
  ...e,
2074
- amount: o(e.amount, 0),
2075
- netAmount: o(e.netAmount, 0),
2076
- fee: o(e.fee, 0),
2131
+ amount: i(e.amount, 0),
2132
+ netAmount: i(e.netAmount, 0),
2133
+ fee: i(e.fee, 0),
2077
2134
  reference: e.reference ?? void 0,
2078
2135
  bank: e.bank ?? void 0,
2079
2136
  recipientMobileNumber: e.recipientMobileNumber ?? void 0,
@@ -2084,22 +2141,18 @@ class Tt {
2084
2141
  }
2085
2142
  deposit(e) {
2086
2143
  return {
2087
- ...e,
2088
- fee: o(e.fee, 0),
2089
- amount: o(e.amount, 0),
2090
- netAmount: o(e.netAmount, 0),
2091
- reference: e.reference ?? void 0,
2092
- checkoutUrl: e.checkoutUrl ?? void 0,
2093
- dateTimeCreated: new Date(e.dateTimeCreated),
2094
- dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
2144
+ id: e.id,
2145
+ type: e.type,
2146
+ status: e.status,
2147
+ checkoutUrl: e.checkoutUrl ?? void 0
2095
2148
  };
2096
2149
  }
2097
2150
  depositRecord(e) {
2098
2151
  return {
2099
2152
  ...e,
2100
- amount: o(e.amount, 0),
2101
- fee: o(e.fee, 0),
2102
- netAmount: o(e.netAmount, 0),
2153
+ amount: i(e.amount, 0),
2154
+ fee: i(e.fee, 0),
2155
+ netAmount: i(e.netAmount, 0),
2103
2156
  reference: e.reference ?? void 0,
2104
2157
  dateTimeCreated: new Date(e.dateTimeCreated),
2105
2158
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
@@ -2109,12 +2162,12 @@ class Tt {
2109
2162
  var t;
2110
2163
  return {
2111
2164
  ...e,
2112
- bet: o(e.bet, 0),
2113
- payout: o(e.payout, 0),
2114
- jackpotContribution: o(e.jackpotContribution, 0),
2115
- jackpotPayout: o(e.jackpotPayout, 0),
2116
- winloss: o(e.winloss),
2117
- validBet: o(e.validBet, 0),
2165
+ bet: i(e.bet, 0),
2166
+ payout: i(e.payout, 0),
2167
+ jackpotContribution: i(e.jackpotContribution, 0),
2168
+ jackpotPayout: i(e.jackpotPayout, 0),
2169
+ winloss: i(e.winloss),
2170
+ validBet: i(e.validBet, 0),
2118
2171
  vendorRoundId: e.vendorRoundId ?? void 0,
2119
2172
  game: this.game(e.game),
2120
2173
  dateTimeSettled: e.dateTimeSettled ? new Date(e.dateTimeSettled) : void 0,
@@ -2132,9 +2185,9 @@ class Tt {
2132
2185
  return {
2133
2186
  ...e,
2134
2187
  game: this.game(e.game),
2135
- bet: o(e.bet, 0),
2136
- payout: o(e.payout, 0),
2137
- validBet: o(e.validBet, 0),
2188
+ bet: i(e.bet, 0),
2189
+ payout: i(e.payout, 0),
2190
+ validBet: i(e.validBet, 0),
2138
2191
  dateTimeSettled: new Date(e.dateTimeSettled),
2139
2192
  dateTimeCreated: new Date(e.dateTimeCreated)
2140
2193
  };
@@ -2142,9 +2195,9 @@ class Tt {
2142
2195
  transactionRecord(e) {
2143
2196
  return {
2144
2197
  ...e,
2145
- amount: o(e.amount, 0),
2198
+ amount: i(e.amount, 0),
2146
2199
  content: e.content ?? void 0,
2147
- currentBalance: o(e.currentBalance, 0),
2200
+ currentBalance: i(e.currentBalance, 0),
2148
2201
  dateTimeCreated: new Date(e.dateTimeCreated)
2149
2202
  };
2150
2203
  }
@@ -2165,12 +2218,9 @@ class Tt {
2165
2218
  promo(e) {
2166
2219
  return {
2167
2220
  ...e,
2168
- banner: {
2169
- ...e.banner,
2170
- dateTimeCreated: new Date(e.banner.dateTimeCreated)
2171
- },
2172
- maximumBonusAmount: o(e.maximumBonusAmount),
2173
- minimumBonusAmount: o(e.minimumBonusAmount),
2221
+ banner: this.file(e.banner),
2222
+ maximumBonusAmount: i(e.maximumBonusAmount),
2223
+ minimumBonusAmount: i(e.minimumBonusAmount),
2174
2224
  activationEndDateTime: new Date(e.activationEndDateTime),
2175
2225
  activationStartDateTime: new Date(e.activationStartDateTime),
2176
2226
  dateTimeCreated: new Date(e.dateTimeCreated),
@@ -2180,10 +2230,7 @@ class Tt {
2180
2230
  cashback(e) {
2181
2231
  return {
2182
2232
  ...e,
2183
- banner: {
2184
- ...e.banner,
2185
- dateTimeCreated: new Date(e.banner.dateTimeCreated)
2186
- },
2233
+ banner: this.file(e.banner),
2187
2234
  activationEndDateTime: new Date(e.activationEndDateTime),
2188
2235
  activationStartDateTime: new Date(e.activationStartDateTime),
2189
2236
  dateTimeCreated: new Date(e.dateTimeCreated),
@@ -2197,22 +2244,22 @@ class Tt {
2197
2244
  /* deposit here does not have an id and depositNumber field */
2198
2245
  deposit: e.deposit ? {
2199
2246
  ...e.deposit,
2200
- fee: o(e.deposit.fee, 0),
2201
- amount: o(e.deposit.amount, 0),
2202
- netAmount: o(e.deposit.netAmount, 0),
2247
+ fee: i(e.deposit.fee, 0),
2248
+ amount: i(e.deposit.amount, 0),
2249
+ netAmount: i(e.deposit.netAmount, 0),
2203
2250
  reference: e.deposit.reference ?? void 0,
2204
2251
  dateTimeCreated: new Date(e.deposit.dateTimeCreated),
2205
2252
  dateTimeLastUpdated: new Date(e.deposit.dateTimeLastUpdated)
2206
2253
  } : void 0,
2207
- balance: o(e.balance, 0),
2208
- amount: o(e.amount, 0),
2254
+ balance: i(e.balance, 0),
2255
+ amount: i(e.amount, 0),
2209
2256
  expiration: new Date(e.expiration),
2210
- turnoverRequirement: o(e.turnoverRequirement, 0),
2211
- currentTurnoverRequirementContribution: o(
2257
+ turnoverRequirement: i(e.turnoverRequirement, 0),
2258
+ currentTurnoverRequirementContribution: i(
2212
2259
  e.currentTurnoverRequirementContribution,
2213
2260
  0
2214
2261
  ),
2215
- currentTurnoverRequirementContributionPercentage: o(
2262
+ currentTurnoverRequirementContributionPercentage: i(
2216
2263
  e.currentTurnoverRequirementContributionPercentage,
2217
2264
  0
2218
2265
  ),
@@ -2223,7 +2270,7 @@ class Tt {
2223
2270
  cashbackBonus(e) {
2224
2271
  return {
2225
2272
  id: e.id,
2226
- balance: o(e.balance, 0),
2273
+ balance: i(e.balance, 0),
2227
2274
  cashback: this.cashback(e.cashback),
2228
2275
  dateTimeCreated: new Date(e.dateTimeCreated),
2229
2276
  dateTimeLastUpdated: new Date(e.dateTimeLastUpdated)
@@ -2239,27 +2286,29 @@ class Tt {
2239
2286
  pointsWallet(e) {
2240
2287
  return {
2241
2288
  id: e.id,
2242
- points: o(e.points, 0),
2289
+ points: i(e.points, 0),
2243
2290
  account: e.account,
2244
2291
  dateTimeCreated: new Date(e.dateTimeCreated)
2245
2292
  };
2246
2293
  }
2247
2294
  }
2248
- class Mt {
2295
+ class Nt {
2249
2296
  constructor(e) {
2250
- m(this, "gameService");
2251
- m(this, "fileService");
2252
- m(this, "walletService");
2253
- m(this, "reportService");
2254
- m(this, "portalService");
2255
- m(this, "accountService");
2256
- m(this, "sessionManager");
2257
- m(this, "transformer");
2258
- m(this, "logger");
2297
+ d(this, "gameService");
2298
+ d(this, "fileService");
2299
+ d(this, "walletService");
2300
+ d(this, "reportService");
2301
+ d(this, "portalService");
2302
+ d(this, "accountService");
2303
+ d(this, "sessionManager");
2304
+ d(this, "transformer");
2305
+ d(this, "logger");
2259
2306
  const t = e.environment === "development";
2260
- this.sessionManager = new Ct({
2261
- ...e,
2262
- url: t ? "https://auth.development.opexa.io" : "https://auth.opexa.io"
2307
+ this.sessionManager = new Tt({
2308
+ authUrl: t ? "https://auth.development.opexa.io" : "https://auth.opexa.io",
2309
+ walletUrl: t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2310
+ platform: e.platform,
2311
+ log: e.log
2263
2312
  });
2264
2313
  const a = {
2265
2314
  middlewares: [this.authMiddleware],
@@ -2270,37 +2319,37 @@ class Mt {
2270
2319
  }
2271
2320
  }
2272
2321
  };
2273
- this.gameService = new we(
2274
- new b(
2322
+ this.gameService = new Et(
2323
+ new E(
2275
2324
  t ? "https://game.development.opexa.io/graphql" : "https://game.opexa.io/graphql",
2276
2325
  a
2277
2326
  )
2278
- ), this.fileService = new ht(
2279
- new b(
2327
+ ), this.fileService = new yt(
2328
+ new E(
2280
2329
  t ? "https://file.development.opexa.io/graphql" : "https://file.opexa.io/graphql",
2281
2330
  a
2282
2331
  )
2283
- ), this.walletService = new bt(
2284
- new b(
2332
+ ), this.walletService = new Ae(
2333
+ new E(
2285
2334
  t ? "https://wallet.development.opexa.io/graphql" : "https://wallet.opexa.io/graphql",
2286
2335
  a
2287
2336
  )
2288
- ), this.reportService = new wt(
2289
- new b(
2337
+ ), this.reportService = new bt(
2338
+ new E(
2290
2339
  t ? "https://report.development.opexa.io/graphql" : "https://report.opexa.io/graphql",
2291
2340
  a
2292
2341
  )
2293
- ), this.accountService = new pt(
2294
- new b(
2342
+ ), this.accountService = new ht(
2343
+ new E(
2295
2344
  t ? "https://account.development.opexa.io/graphql" : "https://account.opexa.io/graphql",
2296
2345
  a
2297
2346
  )
2298
- ), this.portalService = new gt(
2299
- new b(
2347
+ ), this.portalService = new At(
2348
+ new E(
2300
2349
  t ? "https://portal.development.opexa.io/graphql" : "https://portal.opexa.io/graphql",
2301
2350
  a
2302
2351
  )
2303
- ), this.transformer = new Tt(e), this.logger = new ye({
2352
+ ), this.transformer = new vt(e), this.logger = new Se({
2304
2353
  enabled: e.log ?? !1
2305
2354
  });
2306
2355
  }
@@ -2316,7 +2365,7 @@ class Mt {
2316
2365
  case "NAME_AND_PASSWORD": {
2317
2366
  const t = await this.sessionManager.create({
2318
2367
  ...e,
2319
- password: await p(e.password)
2368
+ password: await w(e.password)
2320
2369
  });
2321
2370
  return t.ok ? t.data ? {
2322
2371
  ok: !0,
@@ -2376,7 +2425,7 @@ class Mt {
2376
2425
  return await this.sessionManager.createFromAuthenticator({
2377
2426
  type: "SECURITY_QUESTION",
2378
2427
  token: e.token,
2379
- secretAnswer: await p(e.secretAnswer)
2428
+ secretAnswer: await w(e.secretAnswer)
2380
2429
  });
2381
2430
  default:
2382
2431
  return {
@@ -2416,13 +2465,13 @@ class Mt {
2416
2465
  * ```
2417
2466
  */
2418
2467
  watchSession(e) {
2419
- const t = e.interval ?? 3e4, a = e.onInvalid;
2420
- let r = null;
2421
- const s = () => setTimeout(async () => {
2422
- await this.sessionManager.verify() || await a(), r = s();
2468
+ const t = St(e.interval ?? 3e4, 3e4, 6e4);
2469
+ let a = null;
2470
+ const r = () => setTimeout(async () => {
2471
+ await this.sessionManager.verify() || await e.onInvalid(), a = r();
2423
2472
  }, t);
2424
- return r = s(), function() {
2425
- r && clearTimeout(r);
2473
+ return a = r(), function() {
2474
+ a && clearTimeout(a);
2426
2475
  };
2427
2476
  }
2428
2477
  async session() {
@@ -2487,15 +2536,15 @@ class Mt {
2487
2536
  * ```
2488
2537
  */
2489
2538
  async createAccount(e) {
2490
- const t = e.id ?? h.generate(w.Account).toString(), a = await this.accountService.registerMemberAccount({
2539
+ const t = e.id ?? b.generate(g.Account).toString(), a = await this.accountService.registerMemberAccount({
2491
2540
  input: {
2492
2541
  id: t,
2493
2542
  name: e.name,
2494
2543
  birthDay: typeof e.dateOfBirth == "string" ? e.dateOfBirth : e.dateOfBirth.toISOString(),
2495
- password: await p(e.password),
2544
+ password: await w(e.password),
2496
2545
  mobileNumber: this.addAreaCode(e.mobileNumber),
2497
2546
  domain: e.domain,
2498
- btag: e.btag
2547
+ btag: e.referralCode
2499
2548
  },
2500
2549
  verificationCode: e.verificationCode,
2501
2550
  reCAPTCHAResponse: e.reCAPTCHAResponse
@@ -2523,12 +2572,12 @@ class Mt {
2523
2572
  id: e,
2524
2573
  data: {
2525
2574
  ...t,
2526
- password: t.password ? await p(t.password) : void 0,
2527
- transactionPassword: t.transactionPassword ? await p(t.transactionPassword) : void 0,
2575
+ password: t.password ? await w(t.password) : void 0,
2576
+ transactionPassword: t.transactionPassword ? await w(t.transactionPassword) : void 0,
2528
2577
  ...t.mobileNumber && {
2529
2578
  mobileNumber: this.addAreaCode(t.mobileNumber)
2530
2579
  },
2531
- secretAnswer: t.secretAnswer ? await p(t.secretAnswer) : void 0
2580
+ secretAnswer: t.secretAnswer ? await w(t.secretAnswer) : void 0
2532
2581
  }
2533
2582
  }
2534
2583
  });
@@ -2569,7 +2618,7 @@ class Mt {
2569
2618
  * ```
2570
2619
  */
2571
2620
  async submitVerificationDetails(e) {
2572
- const t = e.id ?? h.generate(w.Verification).toString(), a = await this.accountService.createMemberVerification({
2621
+ const t = e.id ?? b.generate(g.Verification).toString(), a = await this.accountService.createMemberVerification({
2573
2622
  input: {
2574
2623
  id: t,
2575
2624
  ...e
@@ -2606,7 +2655,7 @@ class Mt {
2606
2655
  return await this.accountService.resetPassword({
2607
2656
  input: {
2608
2657
  mobileNumber: this.addAreaCode(e.mobileNumber),
2609
- newPassword: await p(e.newPassword)
2658
+ newPassword: await w(e.newPassword)
2610
2659
  },
2611
2660
  verificationCode: e.verificationCode
2612
2661
  });
@@ -2693,13 +2742,13 @@ class Mt {
2693
2742
  * ```
2694
2743
  */
2695
2744
  async createWithdrawal(e) {
2696
- const t = e.id ?? h.generate(w.Withdrawal).toString();
2745
+ const t = e.id ?? b.generate(g.Withdrawal).toString();
2697
2746
  if (e.type === "BANK") {
2698
2747
  const a = await this.walletService.createBankWithdrawal({
2699
2748
  input: {
2700
2749
  id: t,
2701
2750
  amount: e.amount.toString(),
2702
- transactionPassword: await p(e.transactionPassword)
2751
+ transactionPassword: await w(e.transactionPassword)
2703
2752
  }
2704
2753
  });
2705
2754
  if (!a.ok) return a;
@@ -2709,7 +2758,7 @@ class Mt {
2709
2758
  input: {
2710
2759
  id: t,
2711
2760
  amount: e.amount.toString(),
2712
- transactionPassword: await p(e.transactionPassword),
2761
+ transactionPassword: await w(e.transactionPassword),
2713
2762
  recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
2714
2763
  }
2715
2764
  });
@@ -2720,7 +2769,7 @@ class Mt {
2720
2769
  input: {
2721
2770
  id: t,
2722
2771
  amount: e.amount.toString(),
2723
- transactionPassword: await p(e.transactionPassword),
2772
+ transactionPassword: await w(e.transactionPassword),
2724
2773
  recipientMobileNumber: this.addAreaCode(e.recipientMobileNumber)
2725
2774
  }
2726
2775
  });
@@ -2731,7 +2780,7 @@ class Mt {
2731
2780
  input: {
2732
2781
  id: t,
2733
2782
  amount: e.amount.toString(),
2734
- transactionPassword: await p(e.transactionPassword)
2783
+ transactionPassword: await w(e.transactionPassword)
2735
2784
  }
2736
2785
  });
2737
2786
  if (!a.ok) return a;
@@ -2779,7 +2828,7 @@ class Mt {
2779
2828
  * ```
2780
2829
  */
2781
2830
  async createDeposit(e) {
2782
- const t = e.id ?? h.generate(w.Deposit).toString();
2831
+ const t = e.id ?? b.generate(g.Deposit).toString();
2783
2832
  if (e.type === "MAYA") {
2784
2833
  const a = await this.walletService.createMayaDeposit({
2785
2834
  input: {
@@ -2933,6 +2982,21 @@ class Mt {
2933
2982
  * ========================================
2934
2983
  */
2935
2984
  async games(e) {
2985
+ const t = await this.walletService.games(e);
2986
+ return t.ok ? {
2987
+ ok: !0,
2988
+ data: {
2989
+ games: t.data.edges.map(({ cursor: a, node: r }) => ({
2990
+ ...this.transformer.transform.game(r),
2991
+ cursor: a
2992
+ })),
2993
+ totalCount: t.data.totalCount,
2994
+ hasNextPage: t.data.pageInfo.hasNextPage,
2995
+ endCursor: t.data.pageInfo.endCursor ?? void 0
2996
+ }
2997
+ } : t;
2998
+ }
2999
+ async games__legacy(e) {
2936
3000
  const t = await this.gameService.games(e);
2937
3001
  return t.ok ? {
2938
3002
  ok: !0,
@@ -2948,32 +3012,31 @@ class Mt {
2948
3012
  } : t;
2949
3013
  }
2950
3014
  async gamesByName(e) {
2951
- const t = await this.gameService.gamesByName(e);
3015
+ const t = await this.walletService.gamesByName(e);
2952
3016
  return t.ok ? {
2953
3017
  ok: !0,
2954
3018
  data: t.data.map(this.transformer.transform.game)
2955
3019
  } : t;
2956
3020
  }
2957
- async gamesByName__next(e) {
2958
- const t = await this.walletService.gamesByName(e);
3021
+ async gamesByName__legacy(e) {
3022
+ const t = await this.gameService.gamesByName(e);
2959
3023
  return t.ok ? {
2960
3024
  ok: !0,
2961
3025
  data: t.data.map(this.transformer.transform.game)
2962
3026
  } : t;
2963
3027
  }
2964
- async games__next(e) {
2965
- const t = await this.walletService.games(e);
3028
+ async gameSession(e) {
3029
+ const t = await this.walletService.gameSession({ id: e });
2966
3030
  return t.ok ? {
2967
3031
  ok: !0,
2968
- data: {
2969
- games: t.data.edges.map(({ cursor: a, node: r }) => ({
2970
- ...this.transformer.transform.game(r),
2971
- cursor: a
2972
- })),
2973
- totalCount: t.data.totalCount,
2974
- endCursor: t.data.pageInfo.endCursor ?? void 0,
2975
- hasNextPage: t.data.pageInfo.hasNextPage
2976
- }
3032
+ data: t.data ? this.transformer.transform.gameSession(t.data) : null
3033
+ } : t;
3034
+ }
3035
+ async gameSession__legacy(e) {
3036
+ const t = await this.gameService.gameSession({ id: e });
3037
+ return t.ok ? {
3038
+ ok: !0,
3039
+ data: t.data ? this.transformer.transform.gameSession(t.data) : null
2977
3040
  } : t;
2978
3041
  }
2979
3042
  /**
@@ -2992,7 +3055,7 @@ class Mt {
2992
3055
  * ```
2993
3056
  */
2994
3057
  async createGameSession(e) {
2995
- const t = e.id ?? h.generate(w.GameSession).toString(), a = await this.gameService.createGameSession({
3058
+ const t = e.id ?? b.generate(g.GameSession).toString(), a = await this.walletService.createGameSession({
2996
3059
  input: {
2997
3060
  id: t,
2998
3061
  game: e.game
@@ -3000,23 +3063,8 @@ class Mt {
3000
3063
  });
3001
3064
  return a.ok ? { ok: !0, data: { id: t } } : a;
3002
3065
  }
3003
- /**
3004
- * @example
3005
- * ```ts
3006
- * const res = await sdk.createGameSession({
3007
- * id: ObjectId.generate(ObjectType.GameSession).toString(),
3008
- * game: game.id,
3009
- * });
3010
- *
3011
- * if (!res.ok) {
3012
- * window.alert(res.error.message);
3013
- * } else {
3014
- * // Do something
3015
- * }
3016
- * ```
3017
- */
3018
- async createGameSession__next(e) {
3019
- const t = e.id ?? h.generate(w.GameSession).toString(), a = await this.walletService.createGameSession({
3066
+ async createGameSession__legacy(e) {
3067
+ const t = e.id ?? b.generate(g.GameSession).toString(), a = await this.gameService.createGameSession({
3020
3068
  input: {
3021
3069
  id: t,
3022
3070
  game: e.game
@@ -3024,26 +3072,12 @@ class Mt {
3024
3072
  });
3025
3073
  return a.ok ? { ok: !0, data: { id: t } } : a;
3026
3074
  }
3027
- async gameSession(e) {
3028
- const t = await this.gameService.gameSession({ id: e });
3029
- return t.ok ? {
3030
- ok: !0,
3031
- data: t.data ? this.transformer.transform.gameSession(t.data) : null
3032
- } : t;
3033
- }
3034
- async gameSession__next(e) {
3035
- const t = await this.walletService.gameSession({ id: e });
3036
- return t.ok ? {
3037
- ok: !0,
3038
- data: t.data ? this.transformer.transform.gameSession(t.data) : null
3039
- } : t;
3040
- }
3041
3075
  async endGameSession(e) {
3042
- return await this.gameService.endGameSession({ input: { id: e } });
3043
- }
3044
- async endGameSession__next(e) {
3045
3076
  return await this.walletService.endGameSession({ input: { id: e } });
3046
3077
  }
3078
+ async endGameSession__legacy(e) {
3079
+ return await this.gameService.endGameSession({ input: { id: e } });
3080
+ }
3047
3081
  /*
3048
3082
  * ========================================
3049
3083
  * File
@@ -3072,7 +3106,7 @@ class Mt {
3072
3106
  * ```
3073
3107
  */
3074
3108
  async uploadImageFile(e) {
3075
- const t = e.id ?? h.generate(w.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3109
+ const t = e.id ?? b.generate(g.File).toString(), a = await this.fileService.uploadPrivateImageFile({
3076
3110
  input: {
3077
3111
  id: t,
3078
3112
  file: e.file
@@ -3104,8 +3138,8 @@ class Mt {
3104
3138
  }
3105
3139
  }
3106
3140
  export {
3107
- It as ObjectId,
3108
- w as ObjectType,
3109
- Mt as Sdk
3141
+ Gt as ObjectId,
3142
+ g as ObjectType,
3143
+ Nt as Sdk
3110
3144
  };
3111
3145
  //# sourceMappingURL=index.mjs.map