@opexa/portal-sdk 0.54.4 → 0.54.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3098,11 +3098,14 @@ var AccountService = class {
3098
3098
  };
3099
3099
  }
3100
3100
  async registerMemberAccount(variables) {
3101
- const { reCAPTCHAResponse, ...others } = variables;
3101
+ const { reCAPTCHAResponse, domain, ...others } = variables;
3102
3102
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION, others, {
3103
3103
  headers: {
3104
3104
  ...reCAPTCHAResponse && {
3105
3105
  "google-recaptcha-response": reCAPTCHAResponse
3106
+ },
3107
+ ...domain && {
3108
+ Domain: domain
3106
3109
  }
3107
3110
  }
3108
3111
  });
@@ -3118,7 +3121,7 @@ var AccountService = class {
3118
3121
  };
3119
3122
  }
3120
3123
  async registerMemberAccountViaMobile(variables) {
3121
- const { reCAPTCHAResponse, testPass, ...others } = variables;
3124
+ const { reCAPTCHAResponse, domain, testPass, ...others } = variables;
3122
3125
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_VIA_MOBILE_MUTATION, others, {
3123
3126
  headers: {
3124
3127
  ...reCAPTCHAResponse && {
@@ -3126,6 +3129,9 @@ var AccountService = class {
3126
3129
  },
3127
3130
  ...testPass && {
3128
3131
  "test-pass": testPass
3132
+ },
3133
+ ...domain && {
3134
+ Domain: domain
3129
3135
  }
3130
3136
  }
3131
3137
  });
@@ -3143,11 +3149,14 @@ var AccountService = class {
3143
3149
  };
3144
3150
  }
3145
3151
  async registerMemberAccount__next(variables) {
3146
- const { reCAPTCHAResponse, ...others } = variables;
3152
+ const { reCAPTCHAResponse, domain, ...others } = variables;
3147
3153
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_MUTATION__NEXT, others, {
3148
3154
  headers: {
3149
3155
  ...reCAPTCHAResponse && {
3150
3156
  "google-recaptcha-response": reCAPTCHAResponse
3157
+ },
3158
+ ...domain && {
3159
+ Domain: domain
3151
3160
  }
3152
3161
  }
3153
3162
  });
@@ -3163,10 +3172,14 @@ var AccountService = class {
3163
3172
  };
3164
3173
  }
3165
3174
  async registerMemberAccountByName(variables) {
3166
- const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION, variables, {
3175
+ const { reCAPTCHAResponse, domain, ...others } = variables;
3176
+ const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_NAME_MUTATION, others, {
3167
3177
  headers: {
3168
- ...variables.reCAPTCHAResponse && {
3169
- "google-recaptcha-response": variables.reCAPTCHAResponse
3178
+ ...reCAPTCHAResponse && {
3179
+ "google-recaptcha-response": reCAPTCHAResponse
3180
+ },
3181
+ ...domain && {
3182
+ Domain: domain
3170
3183
  }
3171
3184
  }
3172
3185
  });
@@ -3387,7 +3400,14 @@ var AccountService = class {
3387
3400
  };
3388
3401
  }
3389
3402
  async registerMayaMemberAccount(variables) {
3390
- const res = await this.client.request(REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION, variables);
3403
+ const { domain, ...others } = variables;
3404
+ const res = await this.client.request(REGISTER_MAYA_MEMBER_ACCOUNT_MUTATION, others, {
3405
+ headers: {
3406
+ ...domain && {
3407
+ Domain: domain
3408
+ }
3409
+ }
3410
+ });
3391
3411
  if (!res.ok) return res;
3392
3412
  if (res.data.registerMayaMemberAccount) {
3393
3413
  return {
@@ -3429,7 +3449,7 @@ var AccountService = class {
3429
3449
  return res.ok ? { ok: true, data: res.data.pointsClubSettings } : res;
3430
3450
  }
3431
3451
  async registerMemberAccountByMobileNumber(variables) {
3432
- const { reCAPTCHAResponse, ...others } = variables;
3452
+ const { reCAPTCHAResponse, domain, ...others } = variables;
3433
3453
  const res = await this.client.request(REGISTER_MEMBER_ACCOUNT_BY_MOBILE_NUMBER_MUTATION, others, {
3434
3454
  headers: {
3435
3455
  ...variables.reCAPTCHAResponse && {
@@ -3437,6 +3457,9 @@ var AccountService = class {
3437
3457
  },
3438
3458
  ...variables.testPass && {
3439
3459
  "test-pass": "true"
3460
+ },
3461
+ ...domain && {
3462
+ Domain: domain
3440
3463
  }
3441
3464
  }
3442
3465
  });
@@ -4058,7 +4081,14 @@ var GameService = class {
4058
4081
  };
4059
4082
  }
4060
4083
  async createGameSession(variables) {
4061
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, variables);
4084
+ const { domain, ...others } = variables;
4085
+ const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
4086
+ headers: {
4087
+ ...domain && {
4088
+ Domain: domain
4089
+ }
4090
+ }
4091
+ });
4062
4092
  if (!res.ok) return res;
4063
4093
  if (res.data.createGameSession) {
4064
4094
  return {
@@ -4475,11 +4505,14 @@ var WalletService = class {
4475
4505
  return res.ok ? { ok: res.ok, data: res.data.node } : res;
4476
4506
  }
4477
4507
  async createGCashDeposit(variables) {
4478
- const { reCAPTCHAResponse, ...others } = variables;
4508
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4479
4509
  const res = await this.client.request(CREATE_GCASH_DEPOSIT_MUTATION, others, {
4480
4510
  headers: {
4481
4511
  ...reCAPTCHAResponse && {
4482
4512
  "google-recaptcha-response": reCAPTCHAResponse
4513
+ },
4514
+ ...domain && {
4515
+ Domain: domain
4483
4516
  }
4484
4517
  }
4485
4518
  });
@@ -4495,11 +4528,14 @@ var WalletService = class {
4495
4528
  };
4496
4529
  }
4497
4530
  async createGCashWebpayDeposit(variables) {
4498
- const { reCAPTCHAResponse, ...others } = variables;
4531
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4499
4532
  const res = await this.client.request(CREATE_GCASH_WEBPAY_DEPOSIT_MUTATION, others, {
4500
4533
  headers: {
4501
4534
  ...reCAPTCHAResponse && {
4502
4535
  "google-recaptcha-response": reCAPTCHAResponse
4536
+ },
4537
+ ...domain && {
4538
+ Domain: domain
4503
4539
  }
4504
4540
  }
4505
4541
  });
@@ -4517,11 +4553,14 @@ var WalletService = class {
4517
4553
  };
4518
4554
  }
4519
4555
  async createMayaWebpayDeposit(variables) {
4520
- const { reCAPTCHAResponse, ...others } = variables;
4556
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4521
4557
  const res = await this.client.request(CREATE_MAYA_WEBPAY_DEPOSIT_MUTATION, others, {
4522
4558
  headers: {
4523
4559
  ...reCAPTCHAResponse && {
4524
4560
  "google-recaptcha-response": reCAPTCHAResponse
4561
+ },
4562
+ ...domain && {
4563
+ Domain: domain
4525
4564
  }
4526
4565
  }
4527
4566
  });
@@ -4539,11 +4578,14 @@ var WalletService = class {
4539
4578
  };
4540
4579
  }
4541
4580
  async createMayaDeposit(variables) {
4542
- const { reCAPTCHAResponse, ...others } = variables;
4581
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4543
4582
  const res = await this.client.request(CREATE_MAYA_DEPOSIT_MUTATION, others, {
4544
4583
  headers: {
4545
4584
  ...reCAPTCHAResponse && {
4546
4585
  "google-recaptcha-response": reCAPTCHAResponse
4586
+ },
4587
+ ...domain && {
4588
+ Domain: domain
4547
4589
  }
4548
4590
  }
4549
4591
  });
@@ -4559,7 +4601,14 @@ var WalletService = class {
4559
4601
  };
4560
4602
  }
4561
4603
  async createTestDeposit(variables) {
4562
- const res = await this.client.request(CREATE_TEST_DEPOSIT_MUTATION, variables);
4604
+ const { domain, ...others } = variables;
4605
+ const res = await this.client.request(CREATE_TEST_DEPOSIT_MUTATION, others, {
4606
+ headers: {
4607
+ ...domain && {
4608
+ Domain: domain
4609
+ }
4610
+ }
4611
+ });
4563
4612
  if (!res.ok) return res;
4564
4613
  if (res.data.createTestDeposit) {
4565
4614
  return {
@@ -4572,11 +4621,14 @@ var WalletService = class {
4572
4621
  };
4573
4622
  }
4574
4623
  async createAIOQRPHDeposit(variables) {
4575
- const { reCAPTCHAResponse, ...others } = variables;
4624
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4576
4625
  const res = await this.client.request(CREATE_AIO_QRPH_DEPOSIT_MUTATION, others, {
4577
4626
  headers: {
4578
4627
  ...reCAPTCHAResponse && {
4579
4628
  "google-recaptcha-response": reCAPTCHAResponse
4629
+ },
4630
+ ...domain && {
4631
+ Domain: domain
4580
4632
  }
4581
4633
  }
4582
4634
  });
@@ -4592,11 +4644,14 @@ var WalletService = class {
4592
4644
  };
4593
4645
  }
4594
4646
  async createAiOGCashDeposit(variables) {
4595
- const { reCAPTCHAResponse, ...others } = variables;
4647
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4596
4648
  const res = await this.client.request(CREATE_AIO_GCASH_DEPOSIT_MUTATION, others, {
4597
4649
  headers: {
4598
4650
  ...reCAPTCHAResponse && {
4599
4651
  "google-recaptcha-response": reCAPTCHAResponse
4652
+ },
4653
+ ...domain && {
4654
+ Domain: domain
4600
4655
  }
4601
4656
  }
4602
4657
  });
@@ -4612,11 +4667,14 @@ var WalletService = class {
4612
4667
  };
4613
4668
  }
4614
4669
  async createAiOPayMayaDeposit(variables) {
4615
- const { reCAPTCHAResponse, ...others } = variables;
4670
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4616
4671
  const res = await this.client.request(CREATE_AIO_PAY_MAYA_DEPOSIT_MUTATION, others, {
4617
4672
  headers: {
4618
4673
  ...reCAPTCHAResponse && {
4619
4674
  "google-recaptcha-response": reCAPTCHAResponse
4675
+ },
4676
+ ...domain && {
4677
+ Domain: domain
4620
4678
  }
4621
4679
  }
4622
4680
  });
@@ -4634,11 +4692,14 @@ var WalletService = class {
4634
4692
  };
4635
4693
  }
4636
4694
  async createAiOGrabPayDeposit(variables) {
4637
- const { reCAPTCHAResponse, ...others } = variables;
4695
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4638
4696
  const res = await this.client.request(CREATE_AIO_GRAB_PAY_DEPOSIT_MUTATION, others, {
4639
4697
  headers: {
4640
4698
  ...reCAPTCHAResponse && {
4641
4699
  "google-recaptcha-response": reCAPTCHAResponse
4700
+ },
4701
+ ...domain && {
4702
+ Domain: domain
4642
4703
  }
4643
4704
  }
4644
4705
  });
@@ -4656,11 +4717,14 @@ var WalletService = class {
4656
4717
  };
4657
4718
  }
4658
4719
  async createAiOPalawanPayDeposit(variables) {
4659
- const { reCAPTCHAResponse, ...others } = variables;
4720
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4660
4721
  const res = await this.client.request(CREATE_AIO_PALAWAN_PAY_DEPOSIT_MUTATION, others, {
4661
4722
  headers: {
4662
4723
  ...reCAPTCHAResponse && {
4663
4724
  "google-recaptcha-response": reCAPTCHAResponse
4725
+ },
4726
+ ...domain && {
4727
+ Domain: domain
4664
4728
  }
4665
4729
  }
4666
4730
  });
@@ -4678,11 +4742,14 @@ var WalletService = class {
4678
4742
  };
4679
4743
  }
4680
4744
  async createAIOOnlineBankDeposit(variables) {
4681
- const { reCAPTCHAResponse, ...others } = variables;
4745
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4682
4746
  const res = await this.client.request(CREATE_AIO_ONLINE_BANK_DEPOSIT_MUTATION, others, {
4683
4747
  headers: {
4684
4748
  ...reCAPTCHAResponse && {
4685
4749
  "google-recaptcha-response": reCAPTCHAResponse
4750
+ },
4751
+ ...domain && {
4752
+ Domain: domain
4686
4753
  }
4687
4754
  }
4688
4755
  });
@@ -4700,11 +4767,14 @@ var WalletService = class {
4700
4767
  };
4701
4768
  }
4702
4769
  async createManualBankDeposit(variables) {
4703
- const { reCAPTCHAResponse, ...others } = variables;
4770
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4704
4771
  const res = await this.client.request(CREATE_MANUAL_BANK_DEPOSIT_MUTATION, others, {
4705
4772
  headers: {
4706
4773
  ...reCAPTCHAResponse && {
4707
4774
  "google-recaptcha-response": reCAPTCHAResponse
4775
+ },
4776
+ ...domain && {
4777
+ Domain: domain
4708
4778
  }
4709
4779
  }
4710
4780
  });
@@ -4722,11 +4792,14 @@ var WalletService = class {
4722
4792
  };
4723
4793
  }
4724
4794
  async createManualUPIDeposit(variables) {
4725
- const { reCAPTCHAResponse, ...others } = variables;
4795
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4726
4796
  const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
4727
4797
  headers: {
4728
4798
  ...reCAPTCHAResponse && {
4729
4799
  "google-recaptcha-response": reCAPTCHAResponse
4800
+ },
4801
+ ...domain && {
4802
+ Domain: domain
4730
4803
  }
4731
4804
  }
4732
4805
  });
@@ -4742,11 +4815,14 @@ var WalletService = class {
4742
4815
  };
4743
4816
  }
4744
4817
  async createMayaAppDeposit(variables) {
4745
- const { reCAPTCHAResponse, ...others } = variables;
4818
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4746
4819
  const res = await this.client.request(CREATE_MAYA_APP_DEPOSIT_MUTATION, others, {
4747
4820
  headers: {
4748
4821
  ...reCAPTCHAResponse && {
4749
4822
  "google-recaptcha-response": reCAPTCHAResponse
4823
+ },
4824
+ ...domain && {
4825
+ Domain: domain
4750
4826
  }
4751
4827
  }
4752
4828
  });
@@ -4762,11 +4838,14 @@ var WalletService = class {
4762
4838
  };
4763
4839
  }
4764
4840
  async createManualUpiDeposit(variables) {
4765
- const { reCAPTCHAResponse, ...others } = variables;
4841
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4766
4842
  const res = await this.client.request(CREATE_MANUAL_UPI_DEPOSIT_MUTATION, others, {
4767
4843
  headers: {
4768
4844
  ...reCAPTCHAResponse && {
4769
4845
  "google-recaptcha-response": reCAPTCHAResponse
4846
+ },
4847
+ ...domain && {
4848
+ Domain: domain
4770
4849
  }
4771
4850
  }
4772
4851
  });
@@ -4782,11 +4861,14 @@ var WalletService = class {
4782
4861
  };
4783
4862
  }
4784
4863
  async createGCashWithdrawal(variables) {
4785
- const { reCAPTCHAResponse, ...others } = variables;
4864
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4786
4865
  const res = await this.client.request(CREATE_GCASH_WITHDRAWAL_MUTATION, others, {
4787
4866
  headers: {
4788
4867
  ...reCAPTCHAResponse && {
4789
4868
  "google-recaptcha-response": reCAPTCHAResponse
4869
+ },
4870
+ ...domain && {
4871
+ Domain: domain
4790
4872
  }
4791
4873
  }
4792
4874
  });
@@ -4802,11 +4884,14 @@ var WalletService = class {
4802
4884
  };
4803
4885
  }
4804
4886
  async createGCashStandardCashInWithdrawal(variables) {
4805
- const { reCAPTCHAResponse, ...others } = variables;
4887
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4806
4888
  const res = await this.client.request(CREATE_GCASH_STANDARD_CASHIN_WITHDRAWAL_MUTATION, others, {
4807
4889
  headers: {
4808
4890
  ...reCAPTCHAResponse && {
4809
4891
  "google-recaptcha-response": reCAPTCHAResponse
4892
+ },
4893
+ ...domain && {
4894
+ Domain: domain
4810
4895
  }
4811
4896
  }
4812
4897
  });
@@ -4824,11 +4909,14 @@ var WalletService = class {
4824
4909
  };
4825
4910
  }
4826
4911
  async createMayaWithdrawal(variables) {
4827
- const { reCAPTCHAResponse, ...others } = variables;
4912
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4828
4913
  const res = await this.client.request(CREATE_MAYA_WITHDRAWAL_MUTATION, others, {
4829
4914
  headers: {
4830
4915
  ...reCAPTCHAResponse && {
4831
4916
  "google-recaptcha-response": reCAPTCHAResponse
4917
+ },
4918
+ ...domain && {
4919
+ Domain: domain
4832
4920
  }
4833
4921
  }
4834
4922
  });
@@ -4844,11 +4932,14 @@ var WalletService = class {
4844
4932
  };
4845
4933
  }
4846
4934
  async createMayaAppWithdrawal(variables) {
4847
- const { reCAPTCHAResponse, ...others } = variables;
4935
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4848
4936
  const res = await this.client.request(CREATE_MAYA_APP_WITHDRAWAL_MUTATION, others, {
4849
4937
  headers: {
4850
4938
  ...reCAPTCHAResponse && {
4851
4939
  "google-recaptcha-response": reCAPTCHAResponse
4940
+ },
4941
+ ...domain && {
4942
+ Domain: domain
4852
4943
  }
4853
4944
  }
4854
4945
  });
@@ -4866,11 +4957,14 @@ var WalletService = class {
4866
4957
  };
4867
4958
  }
4868
4959
  async createBankWithdrawal(variables) {
4869
- const { reCAPTCHAResponse, ...others } = variables;
4960
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4870
4961
  const res = await this.client.request(CREATE_BANK_WITHDRAWAL_MUTATION, others, {
4871
4962
  headers: {
4872
4963
  ...reCAPTCHAResponse && {
4873
4964
  "google-recaptcha-response": reCAPTCHAResponse
4965
+ },
4966
+ ...domain && {
4967
+ Domain: domain
4874
4968
  }
4875
4969
  }
4876
4970
  });
@@ -4886,11 +4980,14 @@ var WalletService = class {
4886
4980
  };
4887
4981
  }
4888
4982
  async createAIOInstapayWithdrawal(variables) {
4889
- const { reCAPTCHAResponse, ...others } = variables;
4983
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4890
4984
  const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION, others, {
4891
4985
  headers: {
4892
4986
  ...reCAPTCHAResponse && {
4893
4987
  "google-recaptcha-response": reCAPTCHAResponse
4988
+ },
4989
+ ...domain && {
4990
+ Domain: domain
4894
4991
  }
4895
4992
  }
4896
4993
  });
@@ -4908,11 +5005,14 @@ var WalletService = class {
4908
5005
  };
4909
5006
  }
4910
5007
  async createAIOInstapayWithdrawal_next(variables) {
4911
- const { reCAPTCHAResponse, ...others } = variables;
5008
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4912
5009
  const res = await this.client.request(CREATE_AIO_INSTAPAY_WITHDRAWAL_MUTATION_NEXT, others, {
4913
5010
  headers: {
4914
5011
  ...reCAPTCHAResponse && {
4915
5012
  "google-recaptcha-response": reCAPTCHAResponse
5013
+ },
5014
+ ...domain && {
5015
+ Domain: domain
4916
5016
  }
4917
5017
  }
4918
5018
  });
@@ -4930,11 +5030,14 @@ var WalletService = class {
4930
5030
  };
4931
5031
  }
4932
5032
  async createManualUpiWithdrawal(variables) {
4933
- const { reCAPTCHAResponse, ...others } = variables;
5033
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4934
5034
  const res = await this.client.request(CREATE_MANUAL_UPI_WITHDRAWAL_MUTATION, others, {
4935
5035
  headers: {
4936
5036
  ...reCAPTCHAResponse && {
4937
5037
  "google-recaptcha-response": reCAPTCHAResponse
5038
+ },
5039
+ ...domain && {
5040
+ Domain: domain
4938
5041
  }
4939
5042
  }
4940
5043
  });
@@ -4952,11 +5055,14 @@ var WalletService = class {
4952
5055
  };
4953
5056
  }
4954
5057
  async createManualBankWithdrawal(variables) {
4955
- const { reCAPTCHAResponse, ...others } = variables;
5058
+ const { reCAPTCHAResponse, domain, ...others } = variables;
4956
5059
  const res = await this.client.request(CREATE_MANUAL_BANK_WITHDRAWAL_MUTATION, others, {
4957
5060
  headers: {
4958
5061
  ...reCAPTCHAResponse && {
4959
5062
  "google-recaptcha-response": reCAPTCHAResponse
5063
+ },
5064
+ ...domain && {
5065
+ Domain: domain
4960
5066
  }
4961
5067
  }
4962
5068
  });
@@ -5011,7 +5117,14 @@ var WalletService = class {
5011
5117
  return res.ok ? { ok: true, data: res.data.node } : res;
5012
5118
  }
5013
5119
  async createGameSession(variables) {
5014
- const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, variables);
5120
+ const { domain, ...others } = variables;
5121
+ const res = await this.client.request(CREATE_GAME_SESSION_MUTATION, others, {
5122
+ headers: {
5123
+ ...domain && {
5124
+ Domain: domain
5125
+ }
5126
+ }
5127
+ });
5015
5128
  if (!res.ok) return res;
5016
5129
  if (res.data.createGameSession) {
5017
5130
  return {
@@ -5178,10 +5291,7 @@ var WalletService = class {
5178
5291
  };
5179
5292
  }
5180
5293
  async cabinetWithdrawal(variables) {
5181
- const res = await this.client.request(
5182
- CABINET_WITHDRAWAL_QUERY,
5183
- variables
5184
- );
5294
+ const res = await this.client.request(CABINET_WITHDRAWAL_QUERY, variables);
5185
5295
  return res.ok ? { ok: res.ok, data: res.data.node } : res;
5186
5296
  }
5187
5297
  async redeemVoucher(variables) {
@@ -5705,8 +5815,8 @@ function pollable(func, config) {
5705
5815
  };
5706
5816
  }
5707
5817
 
5708
- // src/sdk/session-manager.ts
5709
- var SessionManager = class {
5818
+ // src/sdk/session-manager-cookie.ts
5819
+ var SessionManagerCookie = class {
5710
5820
  logger;
5711
5821
  storageKey = "session";
5712
5822
  platformStorageKey = "session/platform";
@@ -5717,10 +5827,6 @@ var SessionManager = class {
5717
5827
  this.authService = config.authService;
5718
5828
  this.walletService = config.walletService;
5719
5829
  this.logger = config.logger;
5720
- if (config.sessionPrefix) {
5721
- this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
5722
- this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
5723
- }
5724
5830
  }
5725
5831
  get refreshing() {
5726
5832
  return this._refreshing;
@@ -5729,16 +5835,6 @@ var SessionManager = class {
5729
5835
  this._refreshing = value;
5730
5836
  }
5731
5837
  async create(input) {
5732
- if (this.isServer) {
5733
- this.logger.warn("'localStorage' is not available on the server.");
5734
- return {
5735
- ok: false,
5736
- error: {
5737
- name: "UnknownError",
5738
- message: "Server sign in is not supported."
5739
- }
5740
- };
5741
- }
5742
5838
  if (input.type === "MAYA") {
5743
5839
  localStorage.setItem(this.platformStorageKey, "MAYA");
5744
5840
  const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
@@ -5765,13 +5861,14 @@ var SessionManager = class {
5765
5861
  })();
5766
5862
  if (!r1.ok) return r1;
5767
5863
  const now2 = /* @__PURE__ */ new Date();
5768
- localStorage.setItem(
5864
+ cookies.set(
5769
5865
  this.storageKey,
5770
5866
  JSON.stringify({
5771
5867
  ...r1.data,
5772
5868
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5773
5869
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5774
- })
5870
+ }),
5871
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5775
5872
  );
5776
5873
  return {
5777
5874
  ok: true,
@@ -5782,13 +5879,16 @@ var SessionManager = class {
5782
5879
  const res2 = await this.authService.createSession(input);
5783
5880
  if (res2.ok) {
5784
5881
  const now2 = /* @__PURE__ */ new Date();
5785
- localStorage.setItem(
5882
+ cookies.set(
5786
5883
  this.storageKey,
5787
5884
  JSON.stringify({
5788
5885
  ...res2.data,
5789
5886
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5790
5887
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5791
- })
5888
+ }),
5889
+ {
5890
+ expires: subMinutes(addDays(now2, 30), 2).getTime()
5891
+ }
5792
5892
  );
5793
5893
  return {
5794
5894
  ok: true,
@@ -5800,18 +5900,18 @@ var SessionManager = class {
5800
5900
  if (input.type === "SOCIALS" || input.type === "TOKEN") {
5801
5901
  const res2 = await this.authService.createSession({
5802
5902
  type: "SOCIALS",
5803
- token: input.token,
5804
- channel: input.channel
5903
+ token: input.token
5805
5904
  });
5806
5905
  if (res2.ok) {
5807
5906
  const now2 = /* @__PURE__ */ new Date();
5808
- localStorage.setItem(
5907
+ cookies.set(
5809
5908
  this.storageKey,
5810
5909
  JSON.stringify({
5811
5910
  ...res2.data,
5812
5911
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5813
5912
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5814
- })
5913
+ }),
5914
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5815
5915
  );
5816
5916
  return {
5817
5917
  ok: true,
@@ -5825,13 +5925,14 @@ var SessionManager = class {
5825
5925
  const res2 = await this.authService.createSession(input);
5826
5926
  if (res2.ok) {
5827
5927
  const now2 = /* @__PURE__ */ new Date();
5828
- localStorage.setItem(
5928
+ cookies.set(
5829
5929
  this.storageKey,
5830
5930
  JSON.stringify({
5831
5931
  ...res2.data,
5832
5932
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
5833
5933
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
5834
- })
5934
+ }),
5935
+ { expires: subMinutes(addDays(now2, 30), 2).getTime() }
5835
5936
  );
5836
5937
  return {
5837
5938
  ok: true,
@@ -5851,13 +5952,14 @@ var SessionManager = class {
5851
5952
  };
5852
5953
  }
5853
5954
  const now = /* @__PURE__ */ new Date();
5854
- localStorage.setItem(
5955
+ cookies.set(
5855
5956
  this.storageKey,
5856
5957
  JSON.stringify({
5857
5958
  ...res.data,
5858
5959
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5859
5960
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5860
- })
5961
+ }),
5962
+ {}
5861
5963
  );
5862
5964
  return {
5863
5965
  ok: true,
@@ -5869,15 +5971,18 @@ var SessionManager = class {
5869
5971
  if (res.ok) {
5870
5972
  const now = /* @__PURE__ */ new Date();
5871
5973
  if (this.isServer) {
5872
- this.logger.warn("'localStorage' is not available on the server.");
5974
+ this.logger.warn("'client cookies' is not available on the server.");
5873
5975
  } else {
5874
- localStorage.setItem(
5976
+ cookies.set(
5875
5977
  this.storageKey,
5876
5978
  JSON.stringify({
5877
5979
  ...res.data,
5878
5980
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5879
5981
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5880
- })
5982
+ }),
5983
+ {
5984
+ expires: subMinutes(addDays(now, 30), 2).getTime()
5985
+ }
5881
5986
  );
5882
5987
  }
5883
5988
  return { ok: true };
@@ -5887,7 +5992,7 @@ var SessionManager = class {
5887
5992
  }
5888
5993
  async get() {
5889
5994
  if (this.isServer) {
5890
- this.logger.warn("'localStorage' is not available on the server.");
5995
+ this.logger.warn("'client cookies' is not available on the server.");
5891
5996
  return {
5892
5997
  ok: true,
5893
5998
  data: null
@@ -5897,7 +6002,7 @@ var SessionManager = class {
5897
6002
  await sleep(1e3);
5898
6003
  return await this.get();
5899
6004
  }
5900
- const val = localStorage.getItem(this.storageKey);
6005
+ const val = cookies.get(this.storageKey);
5901
6006
  if (!val) {
5902
6007
  return {
5903
6008
  ok: true,
@@ -5911,7 +6016,7 @@ var SessionManager = class {
5911
6016
  const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
5912
6017
  if (isAfter(now, refreshTokenExpiresAt)) {
5913
6018
  this.logger.warn("Session expired. Logging out..");
5914
- localStorage.removeItem(this.storageKey);
6019
+ cookies.remove(this.storageKey);
5915
6020
  return {
5916
6021
  ok: false,
5917
6022
  error: {
@@ -5928,7 +6033,7 @@ var SessionManager = class {
5928
6033
  if (!res.ok) {
5929
6034
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
5930
6035
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
5931
- localStorage.removeItem(this.storageKey);
6036
+ cookies.remove(this.storageKey);
5932
6037
  return {
5933
6038
  ok: false,
5934
6039
  error: res.error
@@ -5949,7 +6054,9 @@ var SessionManager = class {
5949
6054
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
5950
6055
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
5951
6056
  };
5952
- localStorage.setItem(this.storageKey, JSON.stringify(obj));
6057
+ cookies.set(this.storageKey, JSON.stringify(obj), {
6058
+ expires: subMinutes(addDays(now, 30), 2).getTime()
6059
+ });
5953
6060
  }
5954
6061
  return {
5955
6062
  ok: true,
@@ -5967,13 +6074,13 @@ var SessionManager = class {
5967
6074
  }
5968
6075
  async refresh() {
5969
6076
  if (this.isServer) {
5970
- this.logger.warn("'localStorage' is not available on the server.");
6077
+ this.logger.warn("'client cookies' is not available on the server.");
5971
6078
  return {
5972
6079
  ok: true,
5973
6080
  data: null
5974
6081
  };
5975
6082
  }
5976
- const val = localStorage.getItem(this.storageKey);
6083
+ const val = cookies.get(this.storageKey);
5977
6084
  if (!val) {
5978
6085
  return {
5979
6086
  ok: true,
@@ -5990,7 +6097,7 @@ var SessionManager = class {
5990
6097
  if (!res.ok) {
5991
6098
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
5992
6099
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
5993
- localStorage.removeItem(this.storageKey);
6100
+ cookies.remove(this.storageKey);
5994
6101
  return {
5995
6102
  ok: false,
5996
6103
  error: res.error
@@ -6011,7 +6118,9 @@ var SessionManager = class {
6011
6118
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6012
6119
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6013
6120
  };
6014
- localStorage.setItem(this.storageKey, JSON.stringify(obj));
6121
+ cookies.set(this.storageKey, JSON.stringify(obj), {
6122
+ expires: subMinutes(addDays(now, 30), 2).getTime()
6123
+ });
6015
6124
  return {
6016
6125
  ok: true,
6017
6126
  data: obj
@@ -6028,18 +6137,18 @@ var SessionManager = class {
6028
6137
  }
6029
6138
  async destroy() {
6030
6139
  if (this.isServer) {
6031
- this.logger.warn("'localStorage' is not available on the server.");
6140
+ this.logger.warn("'client cookies' is not available on the server.");
6032
6141
  return;
6033
6142
  }
6034
6143
  const res = await this.get();
6035
6144
  if (res.data?.accessToken) {
6036
6145
  await this.authService.destroySession(res.data.accessToken);
6037
6146
  }
6038
- localStorage.removeItem(this.storageKey);
6147
+ cookies.remove(this.storageKey);
6039
6148
  }
6040
6149
  async verify() {
6041
6150
  if (this.isServer) {
6042
- this.logger.warn("'localStorage' is not available on the server.");
6151
+ this.logger.warn("'client cookies' is not available on the server.");
6043
6152
  return true;
6044
6153
  }
6045
6154
  const s = await this.get();
@@ -6049,13 +6158,13 @@ var SessionManager = class {
6049
6158
  if (!s.data) return true;
6050
6159
  const v = await this.authService.verifySession(s.data.accessToken);
6051
6160
  if (!v) {
6052
- localStorage.removeItem(this.storageKey);
6161
+ cookies.remove(this.storageKey);
6053
6162
  }
6054
6163
  return v;
6055
6164
  }
6056
6165
  get onMaya() {
6057
6166
  if (this.isServer) {
6058
- this.logger.warn("'localStorage' is not available on the server.");
6167
+ this.logger.warn("'client cookies' is not available on the server.");
6059
6168
  return false;
6060
6169
  }
6061
6170
  return localStorage.getItem(this.platformStorageKey) === "MAYA";
@@ -6071,7 +6180,9 @@ var SessionManager = class {
6071
6180
  return typeof window === "undefined";
6072
6181
  }
6073
6182
  };
6074
- var SessionManagerCookie = class {
6183
+
6184
+ // src/sdk/session-manager.ts
6185
+ var SessionManager = class {
6075
6186
  logger;
6076
6187
  storageKey = "session";
6077
6188
  platformStorageKey = "session/platform";
@@ -6082,6 +6193,10 @@ var SessionManagerCookie = class {
6082
6193
  this.authService = config.authService;
6083
6194
  this.walletService = config.walletService;
6084
6195
  this.logger = config.logger;
6196
+ if (config.sessionPrefix) {
6197
+ this.storageKey = `${config.sessionPrefix}/${this.storageKey}`;
6198
+ this.platformStorageKey = `${config.sessionPrefix}/${this.platformStorageKey}`;
6199
+ }
6085
6200
  }
6086
6201
  get refreshing() {
6087
6202
  return this._refreshing;
@@ -6090,6 +6205,16 @@ var SessionManagerCookie = class {
6090
6205
  this._refreshing = value;
6091
6206
  }
6092
6207
  async create(input) {
6208
+ if (this.isServer) {
6209
+ this.logger.warn("'localStorage' is not available on the server.");
6210
+ return {
6211
+ ok: false,
6212
+ error: {
6213
+ name: "UnknownError",
6214
+ message: "Server sign in is not supported."
6215
+ }
6216
+ };
6217
+ }
6093
6218
  if (input.type === "MAYA") {
6094
6219
  localStorage.setItem(this.platformStorageKey, "MAYA");
6095
6220
  const f0 = () => this.walletService.mayaSession({ id: input.sessionId });
@@ -6116,14 +6241,13 @@ var SessionManagerCookie = class {
6116
6241
  })();
6117
6242
  if (!r1.ok) return r1;
6118
6243
  const now2 = /* @__PURE__ */ new Date();
6119
- cookies.set(
6244
+ localStorage.setItem(
6120
6245
  this.storageKey,
6121
6246
  JSON.stringify({
6122
6247
  ...r1.data,
6123
6248
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
6124
6249
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
6125
- }),
6126
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6250
+ })
6127
6251
  );
6128
6252
  return {
6129
6253
  ok: true,
@@ -6134,16 +6258,13 @@ var SessionManagerCookie = class {
6134
6258
  const res2 = await this.authService.createSession(input);
6135
6259
  if (res2.ok) {
6136
6260
  const now2 = /* @__PURE__ */ new Date();
6137
- cookies.set(
6261
+ localStorage.setItem(
6138
6262
  this.storageKey,
6139
6263
  JSON.stringify({
6140
6264
  ...res2.data,
6141
6265
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
6142
6266
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
6143
- }),
6144
- {
6145
- expires: subMinutes(addDays(now2, 30), 2).getTime()
6146
- }
6267
+ })
6147
6268
  );
6148
6269
  return {
6149
6270
  ok: true,
@@ -6155,18 +6276,18 @@ var SessionManagerCookie = class {
6155
6276
  if (input.type === "SOCIALS" || input.type === "TOKEN") {
6156
6277
  const res2 = await this.authService.createSession({
6157
6278
  type: "SOCIALS",
6158
- token: input.token
6279
+ token: input.token,
6280
+ channel: input.channel
6159
6281
  });
6160
6282
  if (res2.ok) {
6161
6283
  const now2 = /* @__PURE__ */ new Date();
6162
- cookies.set(
6284
+ localStorage.setItem(
6163
6285
  this.storageKey,
6164
6286
  JSON.stringify({
6165
6287
  ...res2.data,
6166
6288
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
6167
6289
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
6168
- }),
6169
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6290
+ })
6170
6291
  );
6171
6292
  return {
6172
6293
  ok: true,
@@ -6180,14 +6301,13 @@ var SessionManagerCookie = class {
6180
6301
  const res2 = await this.authService.createSession(input);
6181
6302
  if (res2.ok) {
6182
6303
  const now2 = /* @__PURE__ */ new Date();
6183
- cookies.set(
6304
+ localStorage.setItem(
6184
6305
  this.storageKey,
6185
6306
  JSON.stringify({
6186
6307
  ...res2.data,
6187
6308
  accessTokenExpiresAt: addMinutes(now2, 8).getTime(),
6188
6309
  refreshTokenExpiresAt: subMinutes(addDays(now2, 30), 2).getTime()
6189
- }),
6190
- { expires: subMinutes(addDays(now2, 30), 2).getTime() }
6310
+ })
6191
6311
  );
6192
6312
  return {
6193
6313
  ok: true,
@@ -6207,14 +6327,13 @@ var SessionManagerCookie = class {
6207
6327
  };
6208
6328
  }
6209
6329
  const now = /* @__PURE__ */ new Date();
6210
- cookies.set(
6330
+ localStorage.setItem(
6211
6331
  this.storageKey,
6212
6332
  JSON.stringify({
6213
6333
  ...res.data,
6214
6334
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6215
6335
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6216
- }),
6217
- {}
6336
+ })
6218
6337
  );
6219
6338
  return {
6220
6339
  ok: true,
@@ -6226,18 +6345,15 @@ var SessionManagerCookie = class {
6226
6345
  if (res.ok) {
6227
6346
  const now = /* @__PURE__ */ new Date();
6228
6347
  if (this.isServer) {
6229
- this.logger.warn("'client cookies' is not available on the server.");
6348
+ this.logger.warn("'localStorage' is not available on the server.");
6230
6349
  } else {
6231
- cookies.set(
6350
+ localStorage.setItem(
6232
6351
  this.storageKey,
6233
6352
  JSON.stringify({
6234
6353
  ...res.data,
6235
6354
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6236
6355
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6237
- }),
6238
- {
6239
- expires: subMinutes(addDays(now, 30), 2).getTime()
6240
- }
6356
+ })
6241
6357
  );
6242
6358
  }
6243
6359
  return { ok: true };
@@ -6247,7 +6363,7 @@ var SessionManagerCookie = class {
6247
6363
  }
6248
6364
  async get() {
6249
6365
  if (this.isServer) {
6250
- this.logger.warn("'client cookies' is not available on the server.");
6366
+ this.logger.warn("'localStorage' is not available on the server.");
6251
6367
  return {
6252
6368
  ok: true,
6253
6369
  data: null
@@ -6257,7 +6373,7 @@ var SessionManagerCookie = class {
6257
6373
  await sleep(1e3);
6258
6374
  return await this.get();
6259
6375
  }
6260
- const val = cookies.get(this.storageKey);
6376
+ const val = localStorage.getItem(this.storageKey);
6261
6377
  if (!val) {
6262
6378
  return {
6263
6379
  ok: true,
@@ -6271,7 +6387,7 @@ var SessionManagerCookie = class {
6271
6387
  const refreshTokenExpiresAt = new Date(obj.refreshTokenExpiresAt);
6272
6388
  if (isAfter(now, refreshTokenExpiresAt)) {
6273
6389
  this.logger.warn("Session expired. Logging out..");
6274
- cookies.remove(this.storageKey);
6390
+ localStorage.removeItem(this.storageKey);
6275
6391
  return {
6276
6392
  ok: false,
6277
6393
  error: {
@@ -6288,7 +6404,7 @@ var SessionManagerCookie = class {
6288
6404
  if (!res.ok) {
6289
6405
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
6290
6406
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
6291
- cookies.remove(this.storageKey);
6407
+ localStorage.removeItem(this.storageKey);
6292
6408
  return {
6293
6409
  ok: false,
6294
6410
  error: res.error
@@ -6309,9 +6425,7 @@ var SessionManagerCookie = class {
6309
6425
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6310
6426
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6311
6427
  };
6312
- cookies.set(this.storageKey, JSON.stringify(obj), {
6313
- expires: subMinutes(addDays(now, 30), 2).getTime()
6314
- });
6428
+ localStorage.setItem(this.storageKey, JSON.stringify(obj));
6315
6429
  }
6316
6430
  return {
6317
6431
  ok: true,
@@ -6329,13 +6443,13 @@ var SessionManagerCookie = class {
6329
6443
  }
6330
6444
  async refresh() {
6331
6445
  if (this.isServer) {
6332
- this.logger.warn("'client cookies' is not available on the server.");
6446
+ this.logger.warn("'localStorage' is not available on the server.");
6333
6447
  return {
6334
6448
  ok: true,
6335
6449
  data: null
6336
6450
  };
6337
6451
  }
6338
- const val = cookies.get(this.storageKey);
6452
+ const val = localStorage.getItem(this.storageKey);
6339
6453
  if (!val) {
6340
6454
  return {
6341
6455
  ok: true,
@@ -6352,7 +6466,7 @@ var SessionManagerCookie = class {
6352
6466
  if (!res.ok) {
6353
6467
  this.logger.error(`Failed to refresh session: ${res.error.message}`);
6354
6468
  if (res.error.name === "InvalidTokenError" || res.error.name === "AccountBlacklistedError" || res.error.name === "VerificationLockedError") {
6355
- cookies.remove(this.storageKey);
6469
+ localStorage.removeItem(this.storageKey);
6356
6470
  return {
6357
6471
  ok: false,
6358
6472
  error: res.error
@@ -6373,9 +6487,7 @@ var SessionManagerCookie = class {
6373
6487
  accessTokenExpiresAt: addMinutes(now, 8).getTime(),
6374
6488
  refreshTokenExpiresAt: subMinutes(addDays(now, 30), 2).getTime()
6375
6489
  };
6376
- cookies.set(this.storageKey, JSON.stringify(obj), {
6377
- expires: subMinutes(addDays(now, 30), 2).getTime()
6378
- });
6490
+ localStorage.setItem(this.storageKey, JSON.stringify(obj));
6379
6491
  return {
6380
6492
  ok: true,
6381
6493
  data: obj
@@ -6392,18 +6504,18 @@ var SessionManagerCookie = class {
6392
6504
  }
6393
6505
  async destroy() {
6394
6506
  if (this.isServer) {
6395
- this.logger.warn("'client cookies' is not available on the server.");
6507
+ this.logger.warn("'localStorage' is not available on the server.");
6396
6508
  return;
6397
6509
  }
6398
6510
  const res = await this.get();
6399
6511
  if (res.data?.accessToken) {
6400
6512
  await this.authService.destroySession(res.data.accessToken);
6401
6513
  }
6402
- cookies.remove(this.storageKey);
6514
+ localStorage.removeItem(this.storageKey);
6403
6515
  }
6404
6516
  async verify() {
6405
6517
  if (this.isServer) {
6406
- this.logger.warn("'client cookies' is not available on the server.");
6518
+ this.logger.warn("'localStorage' is not available on the server.");
6407
6519
  return true;
6408
6520
  }
6409
6521
  const s = await this.get();
@@ -6413,13 +6525,13 @@ var SessionManagerCookie = class {
6413
6525
  if (!s.data) return true;
6414
6526
  const v = await this.authService.verifySession(s.data.accessToken);
6415
6527
  if (!v) {
6416
- cookies.remove(this.storageKey);
6528
+ localStorage.removeItem(this.storageKey);
6417
6529
  }
6418
6530
  return v;
6419
6531
  }
6420
6532
  get onMaya() {
6421
6533
  if (this.isServer) {
6422
- this.logger.warn("'client cookies' is not available on the server.");
6534
+ this.logger.warn("'localStorage' is not available on the server.");
6423
6535
  return false;
6424
6536
  }
6425
6537
  return localStorage.getItem(this.platformStorageKey) === "MAYA";
@@ -8157,6 +8269,23 @@ var Sdk = class {
8157
8269
  get middleware() {
8158
8270
  return this._middleware;
8159
8271
  }
8272
+ initWebDomain() {
8273
+ if (typeof window === "undefined") return;
8274
+ if (Capacitor.isNativePlatform()) return;
8275
+ const searchParams = new URLSearchParams(window.location.search);
8276
+ const hostname = window.location.hostname;
8277
+ const market = searchParams.get("market");
8278
+ if (market) {
8279
+ sessionStorage.setItem("domain", `${hostname}/${market}`);
8280
+ } else if (sessionStorage.getItem("domain") == null) {
8281
+ sessionStorage.setItem("domain", hostname);
8282
+ }
8283
+ }
8284
+ get webDomain() {
8285
+ if (typeof window === "undefined") return null;
8286
+ if (Capacitor.isNativePlatform()) return null;
8287
+ return sessionStorage.getItem("domain");
8288
+ }
8160
8289
  /*
8161
8290
  *=============================================
8162
8291
  * ADS
@@ -8234,7 +8363,7 @@ var Sdk = class {
8234
8363
  request.headers.set("Domain", this.memberDomain);
8235
8364
  return request;
8236
8365
  }
8237
- const domain = typeof window === "undefined" ? null : !Capacitor.isNativePlatform() ? null : Capacitor.getPlatform() === "ios" ? `ios/${this.config.platform}`.toLowerCase() : Capacitor.getPlatform() === "android" ? `android/${this.config.platform}`.toLowerCase() : null;
8366
+ const domain = typeof window === "undefined" ? request.headers.get("Domain") : !Capacitor.isNativePlatform() ? request.headers.get("Domain") : Capacitor.getPlatform() === "ios" ? `ios/${this.config.platform}`.toLowerCase() : Capacitor.getPlatform() === "android" ? `android/${this.config.platform}`.toLowerCase() : request.headers.get("Domain");
8238
8367
  if (domain) {
8239
8368
  request.headers.set("Domain", domain);
8240
8369
  return request;
@@ -8535,7 +8664,10 @@ var Sdk = class {
8535
8664
  },
8536
8665
  referralCode: input.referralCode,
8537
8666
  verificationCode: input.verificationCode,
8538
- reCAPTCHAResponse: input.reCAPTCHAResponse
8667
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8668
+ ...this.webDomain && {
8669
+ domain: this.webDomain
8670
+ }
8539
8671
  });
8540
8672
  return res.ok ? { ok: true, data: { id } } : res;
8541
8673
  }
@@ -8559,7 +8691,10 @@ var Sdk = class {
8559
8691
  referralCode: input.referralCode,
8560
8692
  verificationCode: input.verificationCode,
8561
8693
  reCAPTCHAResponse: input.reCAPTCHAResponse,
8562
- testPass: input.testPass
8694
+ testPass: input.testPass,
8695
+ ...this.webDomain && {
8696
+ domain: this.webDomain
8697
+ }
8563
8698
  });
8564
8699
  return res2.ok ? { ok: true, data: { id } } : res2;
8565
8700
  }
@@ -8574,7 +8709,10 @@ var Sdk = class {
8574
8709
  },
8575
8710
  mobileNumberVerificationCode: input.mobileVerificationCode,
8576
8711
  testPass: input.testPass,
8577
- reCAPTCHAResponse: input.reCAPTCHAResponse
8712
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8713
+ ...this.webDomain && {
8714
+ domain: this.webDomain
8715
+ }
8578
8716
  }
8579
8717
  );
8580
8718
  return res2.ok ? { ok: true, data: { id } } : res2;
@@ -8589,7 +8727,10 @@ var Sdk = class {
8589
8727
  password: await sha256(input.password),
8590
8728
  mobileNumber: input.mobileNumber ? addAreaCode(input.mobileNumber, await this.locale) : void 0
8591
8729
  },
8592
- reCAPTCHAResponse: input.reCAPTCHAResponse
8730
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8731
+ ...this.webDomain && {
8732
+ domain: this.webDomain
8733
+ }
8593
8734
  });
8594
8735
  return res2.ok ? { ok: true, data: { id } } : res2;
8595
8736
  }
@@ -8599,7 +8740,10 @@ var Sdk = class {
8599
8740
  name: input.name,
8600
8741
  password: await sha256(input.password)
8601
8742
  },
8602
- reCAPTCHAResponse: input.reCAPTCHAResponse
8743
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8744
+ ...this.webDomain && {
8745
+ domain: this.webDomain
8746
+ }
8603
8747
  });
8604
8748
  return res.ok ? { ok: true, data: { id } } : res;
8605
8749
  }
@@ -8609,6 +8753,9 @@ var Sdk = class {
8609
8753
  name: input.name,
8610
8754
  password: await sha256(input.password),
8611
8755
  domain: input.domain
8756
+ },
8757
+ ...this.webDomain && {
8758
+ domain: this.webDomain
8612
8759
  }
8613
8760
  });
8614
8761
  }
@@ -8807,7 +8954,10 @@ var Sdk = class {
8807
8954
  amount: input.amount.toString(),
8808
8955
  transactionPassword: await sha256(input.transactionPassword)
8809
8956
  },
8810
- reCAPTCHAResponse: input.reCAPTCHAResponse
8957
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8958
+ ...this.webDomain && {
8959
+ domain: this.webDomain
8960
+ }
8811
8961
  });
8812
8962
  if (!res.ok) return res;
8813
8963
  }
@@ -8831,7 +8981,10 @@ var Sdk = class {
8831
8981
  await this.locale
8832
8982
  )
8833
8983
  },
8834
- reCAPTCHAResponse: input.reCAPTCHAResponse
8984
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
8985
+ ...this.webDomain && {
8986
+ domain: this.webDomain
8987
+ }
8835
8988
  });
8836
8989
  if (!res.ok) return res;
8837
8990
  }
@@ -8846,7 +8999,10 @@ var Sdk = class {
8846
8999
  await this.locale
8847
9000
  )
8848
9001
  },
8849
- reCAPTCHAResponse: input.reCAPTCHAResponse
9002
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9003
+ ...this.webDomain && {
9004
+ domain: this.webDomain
9005
+ }
8850
9006
  });
8851
9007
  if (!res.ok) return res;
8852
9008
  }
@@ -8861,7 +9017,10 @@ var Sdk = class {
8861
9017
  await this.locale
8862
9018
  )
8863
9019
  },
8864
- reCAPTCHAResponse: input.reCAPTCHAResponse
9020
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9021
+ ...this.webDomain && {
9022
+ domain: this.webDomain
9023
+ }
8865
9024
  });
8866
9025
  if (!res.ok) return res;
8867
9026
  }
@@ -8872,7 +9031,10 @@ var Sdk = class {
8872
9031
  amount: input.amount.toString(),
8873
9032
  transactionPassword: await sha256(input.transactionPassword)
8874
9033
  },
8875
- reCAPTCHAResponse: input.reCAPTCHAResponse
9034
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9035
+ ...this.webDomain && {
9036
+ domain: this.webDomain
9037
+ }
8876
9038
  });
8877
9039
  if (!res.ok) return res;
8878
9040
  }
@@ -8886,7 +9048,10 @@ var Sdk = class {
8886
9048
  accountName: input.accountName,
8887
9049
  transactionPassword: await sha256(input.transactionPassword)
8888
9050
  },
8889
- reCAPTCHAResponse: input.reCAPTCHAResponse
9051
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9052
+ ...this.webDomain && {
9053
+ domain: this.webDomain
9054
+ }
8890
9055
  });
8891
9056
  if (!res.ok) return res;
8892
9057
  }
@@ -8900,7 +9065,10 @@ var Sdk = class {
8900
9065
  transactionPassword: await sha256(input.transactionPassword),
8901
9066
  accountName: input.accountName
8902
9067
  },
8903
- reCAPTCHAResponse: input.reCAPTCHAResponse
9068
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9069
+ ...this.webDomain && {
9070
+ domain: this.webDomain
9071
+ }
8904
9072
  });
8905
9073
  if (!res.ok) return res;
8906
9074
  }
@@ -8911,7 +9079,10 @@ var Sdk = class {
8911
9079
  amount: input.amount.toString(),
8912
9080
  upiId: input.upiId
8913
9081
  },
8914
- reCAPTCHAResponse: input.reCAPTCHAResponse
9082
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9083
+ ...this.webDomain && {
9084
+ domain: this.webDomain
9085
+ }
8915
9086
  });
8916
9087
  if (!res.ok) return res;
8917
9088
  }
@@ -8924,7 +9095,10 @@ var Sdk = class {
8924
9095
  bankAccountNumber: input.bankAccountNumber,
8925
9096
  bankIFSCCode: input.bankIFSCCode
8926
9097
  },
8927
- reCAPTCHAResponse: input.reCAPTCHAResponse
9098
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9099
+ ...this.webDomain && {
9100
+ domain: this.webDomain
9101
+ }
8928
9102
  });
8929
9103
  if (!res.ok) return res;
8930
9104
  }
@@ -8971,6 +9145,9 @@ var Sdk = class {
8971
9145
  id,
8972
9146
  amount: input.amount.toString(),
8973
9147
  promo: input.promo
9148
+ },
9149
+ ...this.webDomain && {
9150
+ domain: this.webDomain
8974
9151
  }
8975
9152
  });
8976
9153
  if (!res.ok) return res;
@@ -8982,7 +9159,10 @@ var Sdk = class {
8982
9159
  amount: input.amount.toString(),
8983
9160
  promo: input.promo
8984
9161
  },
8985
- reCAPTCHAResponse: input.reCAPTCHAResponse
9162
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9163
+ ...this.webDomain && {
9164
+ domain: this.webDomain
9165
+ }
8986
9166
  });
8987
9167
  if (!res.ok) return res;
8988
9168
  }
@@ -8993,7 +9173,10 @@ var Sdk = class {
8993
9173
  amount: input.amount.toString(),
8994
9174
  promo: input.promo
8995
9175
  },
8996
- reCAPTCHAResponse: input.reCAPTCHAResponse
9176
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9177
+ ...this.webDomain && {
9178
+ domain: this.webDomain
9179
+ }
8997
9180
  });
8998
9181
  if (!res.ok) return res;
8999
9182
  }
@@ -9004,7 +9187,10 @@ var Sdk = class {
9004
9187
  amount: input.amount.toString(),
9005
9188
  promo: input.promo
9006
9189
  },
9007
- reCAPTCHAResponse: input.reCAPTCHAResponse
9190
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9191
+ ...this.webDomain && {
9192
+ domain: this.webDomain
9193
+ }
9008
9194
  });
9009
9195
  if (!res.ok) return res;
9010
9196
  }
@@ -9016,7 +9202,10 @@ var Sdk = class {
9016
9202
  promo: input.promo,
9017
9203
  redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
9018
9204
  },
9019
- reCAPTCHAResponse: input.reCAPTCHAResponse
9205
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9206
+ ...this.webDomain && {
9207
+ domain: this.webDomain
9208
+ }
9020
9209
  });
9021
9210
  if (!res.ok) return res;
9022
9211
  }
@@ -9028,7 +9217,10 @@ var Sdk = class {
9028
9217
  promo: input.promo,
9029
9218
  redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
9030
9219
  },
9031
- reCAPTCHAResponse: input.reCAPTCHAResponse
9220
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9221
+ ...this.webDomain && {
9222
+ domain: this.webDomain
9223
+ }
9032
9224
  });
9033
9225
  if (!res.ok) return res;
9034
9226
  }
@@ -9040,7 +9232,10 @@ var Sdk = class {
9040
9232
  promo: input.promo,
9041
9233
  redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
9042
9234
  },
9043
- reCAPTCHAResponse: input.reCAPTCHAResponse
9235
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9236
+ ...this.webDomain && {
9237
+ domain: this.webDomain
9238
+ }
9044
9239
  });
9045
9240
  if (!res.ok) return res;
9046
9241
  }
@@ -9052,7 +9247,10 @@ var Sdk = class {
9052
9247
  promo: input.promo,
9053
9248
  redirectUrl: `${ENDPOINTS[environment].opexapay}/aio/success?redirectUrl=${input.redirectUrl}?deposit=${id}`
9054
9249
  },
9055
- reCAPTCHAResponse: input.reCAPTCHAResponse
9250
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9251
+ ...this.webDomain && {
9252
+ domain: this.webDomain
9253
+ }
9056
9254
  });
9057
9255
  if (!res.ok) return res;
9058
9256
  }
@@ -9063,7 +9261,10 @@ var Sdk = class {
9063
9261
  amount: input.amount.toString(),
9064
9262
  promo: input.promo
9065
9263
  },
9066
- reCAPTCHAResponse: input.reCAPTCHAResponse
9264
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9265
+ ...this.webDomain && {
9266
+ domain: this.webDomain
9267
+ }
9067
9268
  });
9068
9269
  if (!res.ok) return res;
9069
9270
  }
@@ -9074,7 +9275,10 @@ var Sdk = class {
9074
9275
  amount: input.amount.toString(),
9075
9276
  promo: input.promo
9076
9277
  },
9077
- reCAPTCHAResponse: input.reCAPTCHAResponse
9278
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9279
+ ...this.webDomain && {
9280
+ domain: this.webDomain
9281
+ }
9078
9282
  });
9079
9283
  if (!res.ok) return res;
9080
9284
  }
@@ -9087,7 +9291,10 @@ var Sdk = class {
9087
9291
  referenceImage: input.referenceImage,
9088
9292
  promo: input.promo
9089
9293
  },
9090
- reCAPTCHAResponse: input.reCAPTCHAResponse
9294
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9295
+ ...this.webDomain && {
9296
+ domain: this.webDomain
9297
+ }
9091
9298
  });
9092
9299
  if (!res.ok) return res;
9093
9300
  }
@@ -9099,7 +9306,10 @@ var Sdk = class {
9099
9306
  referenceImage: input.referenceId,
9100
9307
  promo: input.promo
9101
9308
  },
9102
- reCAPTCHAResponse: input.reCAPTCHAResponse
9309
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9310
+ ...this.webDomain && {
9311
+ domain: this.webDomain
9312
+ }
9103
9313
  });
9104
9314
  if (!res.ok) return res;
9105
9315
  }
@@ -9112,7 +9322,10 @@ var Sdk = class {
9112
9322
  cancelRedirectionUrl: input.cancelRedirectionUrl,
9113
9323
  successRedirectionUrl: input.successRedirectionUrl
9114
9324
  },
9115
- reCAPTCHAResponse: input.reCAPTCHAResponse
9325
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9326
+ ...this.webDomain && {
9327
+ domain: this.webDomain
9328
+ }
9116
9329
  });
9117
9330
  if (!res.ok) return res;
9118
9331
  }
@@ -9124,7 +9337,10 @@ var Sdk = class {
9124
9337
  promo: input.promo,
9125
9338
  redirectUrl: input.redirectUrl
9126
9339
  },
9127
- reCAPTCHAResponse: input.reCAPTCHAResponse
9340
+ reCAPTCHAResponse: input.reCAPTCHAResponse,
9341
+ ...this.webDomain && {
9342
+ domain: this.webDomain
9343
+ }
9128
9344
  });
9129
9345
  if (!res.ok) return res;
9130
9346
  }
@@ -9508,12 +9724,18 @@ var Sdk = class {
9508
9724
  input: {
9509
9725
  id,
9510
9726
  game: input.reference
9727
+ },
9728
+ ...this.webDomain && {
9729
+ domain: this.webDomain
9511
9730
  }
9512
9731
  }) : await this.gameService.createGameSession({
9513
9732
  input: {
9514
9733
  id,
9515
9734
  game: input.reference,
9516
9735
  homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
9736
+ },
9737
+ ...this.webDomain && {
9738
+ domain: this.webDomain
9517
9739
  }
9518
9740
  });
9519
9741
  return res.ok ? { ok: true, data: { id } } : res;
@@ -9546,12 +9768,18 @@ var Sdk = class {
9546
9768
  }
9547
9769
  const { provider, reference } = res0.data;
9548
9770
  const res1 = NEW_GAME_PROVIDERS.includes(provider) ? await this.walletService.createGameSession({
9549
- input: { id, game: reference }
9771
+ input: { id, game: reference },
9772
+ ...this.webDomain && {
9773
+ domain: this.webDomain
9774
+ }
9550
9775
  }) : await this.gameService.createGameSession({
9551
9776
  input: {
9552
9777
  id,
9553
9778
  game: reference,
9554
9779
  homepageUrl: typeof window === "undefined" ? void 0 : input.homepageUrl
9780
+ },
9781
+ ...this.webDomain && {
9782
+ domain: this.webDomain
9555
9783
  }
9556
9784
  });
9557
9785
  return res1.ok ? { ok: true, data: { id } } : res1;