@jetthai/cuora 1.1.13-4 → 1.1.13

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/bundle.mjs CHANGED
@@ -3845,15 +3845,6 @@ var payment = {
3845
3845
  method: 'post',
3846
3846
  params: { transferType: 'WITHDRAW', amount },
3847
3847
  }),
3848
- getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
3849
- applyPromotions: ({ promotionsNo, amount }) => ({
3850
- url: `payment/v2/bankWallet/promotion/apply`,
3851
- method: 'post',
3852
- params: {
3853
- promotionsNo,
3854
- amount,
3855
- },
3856
- }),
3857
3848
  };
3858
3849
 
3859
3850
  var user = {
@@ -16278,13 +16269,11 @@ function manual_vn (request) {
16278
16269
  }
16279
16270
 
16280
16271
  function loadcard_vn (request) {
16281
- const { appSecret } = request.config;
16282
16272
  return createMachine(
16283
16273
  {
16284
16274
  id: 'loadcard',
16285
16275
  initial: 'loading',
16286
16276
  context: {
16287
- siteConfig: null,
16288
16277
  cards: [],
16289
16278
  options: [],
16290
16279
 
@@ -16295,7 +16284,7 @@ function loadcard_vn (request) {
16295
16284
 
16296
16285
  calculation: null,
16297
16286
 
16298
- paymentDetail: [],
16287
+ paymentDetails: [],
16299
16288
  currentCategory: 'loadcard',
16300
16289
  currentMethod: null,
16301
16290
  currentPayment: null,
@@ -16305,127 +16294,15 @@ function loadcard_vn (request) {
16305
16294
  invoke: {
16306
16295
  src: 'fetchInitData',
16307
16296
  onDone: {
16308
- target: 'checking',
16309
- actions: ['setInitData', 'preset'],
16297
+ target: 'loaded',
16298
+ actions: 'setInitData',
16310
16299
  },
16311
16300
  onError: {
16312
16301
  target: 'fail',
16313
16302
  },
16314
16303
  },
16315
16304
  },
16316
- checking: {
16317
- always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
16318
- },
16319
- promotionApplyMode: {
16320
- initial: 'loaded',
16321
- states: {
16322
- loaded: {
16323
- entry: 'reset',
16324
- on: {
16325
- SELECT_CARD: {
16326
- actions: 'setCard',
16327
- },
16328
- SELECT_AMOUNT: {
16329
- target: 'submittable',
16330
- actions: 'setAmount',
16331
- },
16332
- },
16333
- },
16334
- submittable: {
16335
- on: {
16336
- SELECT_AMOUNT: {
16337
- actions: 'setAmount',
16338
- },
16339
- CONFIRM: {
16340
- target: 'debouncing',
16341
- },
16342
- BACK: {
16343
- target: 'loaded',
16344
- },
16345
- },
16346
- },
16347
- debouncing: {
16348
- on: {
16349
- SELECT_AMOUNT: {
16350
- target: 'debouncing',
16351
- actions: 'setAmount',
16352
- },
16353
- BACK: {
16354
- target: 'loaded',
16355
- },
16356
- },
16357
- after: {
16358
- 1000: {
16359
- target: 'calculating',
16360
- },
16361
- },
16362
- },
16363
- calculable: {
16364
- entry: 'clearCalculation',
16365
- on: {
16366
- SELECT_AMOUNT: {
16367
- target: 'debouncing',
16368
- actions: 'setAmount',
16369
- },
16370
- CALCULATE: {
16371
- target: 'debouncing',
16372
- },
16373
- BACK: {
16374
- target: 'loaded',
16375
- },
16376
- },
16377
- },
16378
- calculating: {
16379
- invoke: {
16380
- src: 'fetchCalculation',
16381
- onDone: {
16382
- target: 'cardInfo',
16383
- actions: 'setCalculation',
16384
- },
16385
- onError: {
16386
- target: 'calculable',
16387
- },
16388
- },
16389
- },
16390
- cardInfo: {
16391
- on: {
16392
- INPUT_CARD_NUMBER: {
16393
- actions: 'setCardNumber',
16394
- },
16395
- INPUT_SERIAL_NUMBER: {
16396
- actions: 'setSerialNumber',
16397
- },
16398
- SUBMIT: {
16399
- target: 'submitting',
16400
- cond: 'isSubmittable',
16401
- },
16402
- SELECT_CARD: {
16403
- target: 'loaded',
16404
- actions: 'setCard',
16405
- },
16406
- },
16407
- },
16408
- submitting: {
16409
- invoke: {
16410
- src: 'submitDeposit',
16411
- onDone: {
16412
- target: 'submitted',
16413
- },
16414
- onError: {
16415
- target: 'cardInfo',
16416
- },
16417
- },
16418
- },
16419
- submitted: {
16420
- on: {
16421
- BACK: {
16422
- target: 'loaded',
16423
- },
16424
- },
16425
- },
16426
- },
16427
- },
16428
- defaultMode: {
16305
+ loaded: {
16429
16306
  entry: 'reset',
16430
16307
  on: {
16431
16308
  SELECT_CARD: {
@@ -16444,7 +16321,7 @@ function loadcard_vn (request) {
16444
16321
  actions: 'setAmount',
16445
16322
  },
16446
16323
  BACK: {
16447
- target: 'defaultMode',
16324
+ target: 'loaded',
16448
16325
  },
16449
16326
  },
16450
16327
  after: {
@@ -16465,7 +16342,7 @@ function loadcard_vn (request) {
16465
16342
  target: 'debouncing',
16466
16343
  },
16467
16344
  BACK: {
16468
- target: 'defaultMode',
16345
+ target: 'loaded',
16469
16346
  },
16470
16347
  },
16471
16348
  },
@@ -16491,7 +16368,7 @@ function loadcard_vn (request) {
16491
16368
  target: 'cardInfo',
16492
16369
  },
16493
16370
  BACK: {
16494
- target: 'defaultMode',
16371
+ target: 'loaded',
16495
16372
  },
16496
16373
  CLEAR_CALCULATION: {
16497
16374
  target: 'debouncing',
@@ -16512,7 +16389,7 @@ function loadcard_vn (request) {
16512
16389
  cond: 'isSubmittable',
16513
16390
  },
16514
16391
  SELECT_CARD: {
16515
- target: 'defaultMode',
16392
+ target: 'loaded',
16516
16393
  actions: 'setCard',
16517
16394
  },
16518
16395
  },
@@ -16531,7 +16408,7 @@ function loadcard_vn (request) {
16531
16408
  submitted: {
16532
16409
  on: {
16533
16410
  BACK: {
16534
- target: 'defaultMode',
16411
+ target: 'loaded',
16535
16412
  },
16536
16413
  },
16537
16414
  },
@@ -16548,22 +16425,16 @@ function loadcard_vn (request) {
16548
16425
  }
16549
16426
  }),
16550
16427
  setInitData: assign((context, event) => {
16551
- const { paymentDetail } = event.data;
16552
- const cards = paymentDetail.filter((element) => element.category === context.currentCategory);
16428
+ const paymentDetails = event.data;
16429
+ const cards = paymentDetails.filter((element) => element.category === context.currentCategory);
16553
16430
  return {
16554
- paymentDetail,
16431
+ paymentDetails,
16555
16432
  cards,
16556
16433
  selectedCard: cards[0],
16557
16434
  currentMethod: cards[0].method,
16558
16435
  options: cards[0].optional,
16559
16436
  }
16560
16437
  }),
16561
- preset: assign((context, event) => {
16562
- const { siteConfig } = event.data;
16563
- return {
16564
- siteConfig,
16565
- }
16566
- }),
16567
16438
  setCard: assign((context, event) => {
16568
16439
  return {
16569
16440
  selectedCard: event.data,
@@ -16596,9 +16467,6 @@ function loadcard_vn (request) {
16596
16467
  }),
16597
16468
  },
16598
16469
  guards: {
16599
- isPromotionApplyMode: (context, event) => {
16600
- return context.siteConfig?.promotionApplyMode === '1'
16601
- },
16602
16470
  isSubmittable: (context, event) => {
16603
16471
  const { cardNumber, serialNumber } = context;
16604
16472
  return cardNumber && serialNumber
@@ -16606,12 +16474,7 @@ function loadcard_vn (request) {
16606
16474
  },
16607
16475
  services: {
16608
16476
  fetchInitData: async (context, event) => {
16609
- const [{ config }, paymentDetail = []] = await Promise.all([
16610
- request.send(common$1.getConfig({ appSecret })),
16611
- request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
16612
- ]);
16613
- const siteConfig = JSON.parse(window.atob(config));
16614
- return { siteConfig, paymentDetail }
16477
+ return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
16615
16478
  },
16616
16479
  fetchCalculation: async (context, event) => {
16617
16480
  const { currentMethod, selectedAmount } = context;
@@ -16844,13 +16707,11 @@ function qrcode_vn (request) {
16844
16707
  }
16845
16708
 
16846
16709
  function qrcode_v2 (request) {
16847
- const { appSecret } = request.config;
16848
16710
  return createMachine(
16849
16711
  {
16850
16712
  id: 'qrcode',
16851
16713
  initial: 'loading',
16852
16714
  context: {
16853
- siteConfig: null,
16854
16715
  qrcodes: null,
16855
16716
  options: null,
16856
16717
 
@@ -16859,7 +16720,7 @@ function qrcode_v2 (request) {
16859
16720
 
16860
16721
  calculation: null,
16861
16722
 
16862
- paymentDetail: [],
16723
+ paymentDetails: [],
16863
16724
  currentCategory: 'qrcode',
16864
16725
  currentMethod: null,
16865
16726
 
@@ -16872,152 +16733,15 @@ function qrcode_v2 (request) {
16872
16733
  invoke: {
16873
16734
  src: 'fetchInitData',
16874
16735
  onDone: {
16875
- target: 'checking',
16876
- actions: ['setInitData', 'preset'],
16736
+ target: 'loaded',
16737
+ actions: 'setInitData',
16877
16738
  },
16878
16739
  onError: {
16879
16740
  target: 'fail',
16880
16741
  },
16881
16742
  },
16882
16743
  },
16883
- checking: {
16884
- always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
16885
- },
16886
- promotionApplyMode: {
16887
- initial: 'loaded',
16888
- states: {
16889
- loaded: {
16890
- entry: 'reset',
16891
- on: {
16892
- SELECT_QRCODE: {
16893
- actions: 'setQrcode',
16894
- },
16895
- SELECT_AMOUNT: [
16896
- {
16897
- target: 'submittable',
16898
- actions: 'addAmount',
16899
- cond: (context, event) => context.grandTotalEnable === 1,
16900
- },
16901
- {
16902
- target: 'submittable',
16903
- actions: 'setAmount',
16904
- },
16905
- ],
16906
- KEY_IN: {
16907
- actions: 'setAmount',
16908
- },
16909
- },
16910
- },
16911
- submittable: {
16912
- on: {
16913
- SELECT_AMOUNT: [
16914
- {
16915
- actions: 'addAmount',
16916
- cond: (context, event) => context.grandTotalEnable === 1,
16917
- },
16918
- {
16919
- actions: 'setAmount',
16920
- },
16921
- ],
16922
- KEY_IN: {
16923
- actions: 'setAmount',
16924
- },
16925
- CONFIRM: {
16926
- target: 'debouncing',
16927
- },
16928
- BACK: {
16929
- target: 'loaded',
16930
- },
16931
- },
16932
- },
16933
- debouncing: {
16934
- on: {
16935
- SELECT_AMOUNT: [
16936
- {
16937
- target: 'debouncing',
16938
- actions: 'addAmount',
16939
- cond: (context, event) => context.grandTotalEnable === 1,
16940
- },
16941
- {
16942
- target: 'debouncing',
16943
- actions: 'setAmount',
16944
- },
16945
- ],
16946
- KEY_IN: {
16947
- target: 'debouncing',
16948
- actions: 'setAmount',
16949
- },
16950
- BACK: {
16951
- target: 'loaded',
16952
- },
16953
- },
16954
- after: {
16955
- 1000: {
16956
- target: 'calculating',
16957
- },
16958
- },
16959
- },
16960
- calculable: {
16961
- entry: 'clearCalculation',
16962
- on: {
16963
- SELECT_AMOUNT: [
16964
- {
16965
- target: 'debouncing',
16966
- actions: 'addAmount',
16967
- cond: (context, event) => context.grandTotalEnable === 1,
16968
- },
16969
- {
16970
- target: 'debouncing',
16971
- actions: 'setAmount',
16972
- },
16973
- ],
16974
- KEY_IN: {
16975
- target: 'debouncing',
16976
- actions: 'setAmount',
16977
- },
16978
- CALCULATE: {
16979
- target: 'debouncing',
16980
- },
16981
- BACK: {
16982
- target: 'loaded',
16983
- },
16984
- },
16985
- },
16986
- calculating: {
16987
- invoke: {
16988
- src: 'fetchCalculation',
16989
- onDone: {
16990
- target: 'submitting',
16991
- actions: 'setCalculation',
16992
- },
16993
- onError: {
16994
- target: 'calculable',
16995
- },
16996
- },
16997
- },
16998
- submitting: {
16999
- invoke: {
17000
- src: 'submitDeposit',
17001
- onDone: {
17002
- target: 'submitted',
17003
- actions: 'setResult',
17004
- },
17005
- onError: {
17006
- target: 'submittable',
17007
- },
17008
- },
17009
- },
17010
- submitted: {
17011
- on: {
17012
- SELECT_QRCODE: {
17013
- target: 'loaded',
17014
- actions: 'setQrcode',
17015
- },
17016
- },
17017
- },
17018
- },
17019
- },
17020
- defaultMode: {
16744
+ loaded: {
17021
16745
  entry: 'reset',
17022
16746
  on: {
17023
16747
  SELECT_QRCODE: {
@@ -17058,7 +16782,7 @@ function qrcode_v2 (request) {
17058
16782
  actions: 'setAmount',
17059
16783
  },
17060
16784
  BACK: {
17061
- target: 'defaultMode',
16785
+ target: 'loaded',
17062
16786
  },
17063
16787
  },
17064
16788
  after: {
@@ -17090,7 +16814,7 @@ function qrcode_v2 (request) {
17090
16814
  target: 'debouncing',
17091
16815
  },
17092
16816
  BACK: {
17093
- target: 'defaultMode',
16817
+ target: 'loaded',
17094
16818
  },
17095
16819
  },
17096
16820
  },
@@ -17127,7 +16851,7 @@ function qrcode_v2 (request) {
17127
16851
  target: 'submitting',
17128
16852
  },
17129
16853
  BACK: {
17130
- target: 'defaultMode',
16854
+ target: 'loaded',
17131
16855
  },
17132
16856
  CLEAR_CALCULATION: {
17133
16857
  target: 'debouncing',
@@ -17150,7 +16874,7 @@ function qrcode_v2 (request) {
17150
16874
  submitted: {
17151
16875
  on: {
17152
16876
  SELECT_QRCODE: {
17153
- target: 'defaultMode',
16877
+ target: 'loaded',
17154
16878
  actions: 'setQrcode',
17155
16879
  },
17156
16880
  },
@@ -17166,11 +16890,11 @@ function qrcode_v2 (request) {
17166
16890
  }
17167
16891
  }),
17168
16892
  setInitData: assign((context, event) => {
17169
- const { paymentDetail } = event.data;
17170
- const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory);
16893
+ const paymentDetails = event.data;
16894
+ const qrcodes = paymentDetails.filter((element) => element.category === context.currentCategory);
17171
16895
 
17172
16896
  return {
17173
- paymentDetail,
16897
+ paymentDetails,
17174
16898
  qrcodes,
17175
16899
  selectedQrcode: qrcodes[0],
17176
16900
  currentMethod: qrcodes[0].method,
@@ -17178,12 +16902,6 @@ function qrcode_v2 (request) {
17178
16902
  grandTotalEnable: qrcodes[0].grandTotalEnable,
17179
16903
  }
17180
16904
  }),
17181
- preset: assign((context, event) => {
17182
- const { siteConfig } = event.data;
17183
- return {
17184
- siteConfig,
17185
- }
17186
- }),
17187
16905
  setQrcode: assign((context, event) => {
17188
16906
  return {
17189
16907
  selectedQrcode: event.data,
@@ -17214,19 +16932,9 @@ function qrcode_v2 (request) {
17214
16932
  }
17215
16933
  }),
17216
16934
  },
17217
- guards: {
17218
- isPromotionApplyMode: (context, event) => {
17219
- return context.siteConfig?.promotionApplyMode === '1'
17220
- },
17221
- },
17222
16935
  services: {
17223
16936
  fetchInitData: async (context, event) => {
17224
- const [{ config }, paymentDetail = []] = await Promise.all([
17225
- request.send(common$1.getConfig({ appSecret })),
17226
- request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
17227
- ]);
17228
- const siteConfig = JSON.parse(window.atob(config));
17229
- return { siteConfig, paymentDetail }
16937
+ return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
17230
16938
  },
17231
16939
  fetchCalculation: async (context, event) => {
17232
16940
  const { currentMethod, selectedAmount } = context;
@@ -18120,13 +17828,11 @@ function crypto (request) {
18120
17828
  }
18121
17829
 
18122
17830
  function crypto_button (request) {
18123
- const { appSecret } = request.config;
18124
17831
  return createMachine(
18125
17832
  {
18126
17833
  id: 'crypro_button',
18127
17834
  initial: 'loading',
18128
17835
  context: {
18129
- siteConfig: null,
18130
17836
  paymentDetails: [],
18131
17837
 
18132
17838
  channels: [],
@@ -18150,127 +17856,17 @@ function crypto_button (request) {
18150
17856
  states: {
18151
17857
  loading: {
18152
17858
  invoke: {
18153
- src: 'fetchInitData',
17859
+ src: 'fetchPayments',
18154
17860
  onDone: {
18155
- target: 'checking',
18156
- actions: ['setInitData', 'preset'],
17861
+ target: 'loaded',
17862
+ actions: 'setCryptos',
18157
17863
  },
18158
17864
  onError: {
18159
17865
  target: 'fail',
18160
17866
  },
18161
17867
  },
18162
17868
  },
18163
- checking: {
18164
- always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
18165
- },
18166
- promotionApplyMode: {
18167
- initial: 'loaded',
18168
- states: {
18169
- loaded: {
18170
- entry: 'reset',
18171
- on: {
18172
- SET_CHANNEL: {
18173
- actions: 'setChannel',
18174
- },
18175
- SET_CRYPTO: {
18176
- actions: 'setCrypto',
18177
- },
18178
- SET_NETWORK: {
18179
- actions: 'setNetwork',
18180
- },
18181
- SET_ADDRESS: {
18182
- actions: 'setAddress',
18183
- },
18184
- CONFIRM: {
18185
- target: 'selecting',
18186
- cond: 'isConfirmable',
18187
- },
18188
- },
18189
- },
18190
- selecting: {
18191
- entry: 'reset',
18192
- on: {
18193
- SELECT_AMOUNT: [
18194
- {
18195
- actions: 'addAmount',
18196
- cond: (context, event) => context.grandTotalEnable === 1,
18197
- },
18198
- {
18199
- actions: 'setAmount',
18200
- },
18201
- ],
18202
- KEY_IN: {
18203
- actions: 'setAmount',
18204
- },
18205
- SUBMIT: {
18206
- target: 'debouncing',
18207
- },
18208
- BACK: {
18209
- target: 'loaded',
18210
- },
18211
- CLEAR_ALL: {
18212
- actions: 'reset',
18213
- },
18214
- },
18215
- },
18216
- debouncing: {
18217
- on: {
18218
- SELECT_AMOUNT: [
18219
- {
18220
- target: 'debouncing',
18221
- actions: 'addAmount',
18222
- cond: (context, event) => context.grandTotalEnable === 1,
18223
- },
18224
- {
18225
- target: 'debouncing',
18226
- actions: 'setAmount',
18227
- },
18228
- ],
18229
- KEY_IN: {
18230
- target: 'debouncing',
18231
- actions: 'setAmount',
18232
- },
18233
- BACK: {
18234
- target: 'loaded',
18235
- },
18236
- CLEAR_ALL: {
18237
- actions: 'reset',
18238
- },
18239
- },
18240
- after: {
18241
- 1000: {
18242
- target: 'calculating',
18243
- },
18244
- },
18245
- },
18246
- calculating: {
18247
- invoke: {
18248
- src: 'fetchCalculation',
18249
- onDone: {
18250
- target: 'submitting',
18251
- actions: 'setCalculation',
18252
- },
18253
- onError: {
18254
- target: 'selecting',
18255
- actions: 'reset',
18256
- },
18257
- },
18258
- },
18259
- submitting: {
18260
- invoke: {
18261
- src: 'submitDeposit',
18262
- onDone: {
18263
- target: '#crypro_button.submitted',
18264
- actions: 'setResult',
18265
- },
18266
- onError: {
18267
- target: 'selecting',
18268
- },
18269
- },
18270
- },
18271
- },
18272
- },
18273
- defaultMode: {
17869
+ loaded: {
18274
17870
  on: {
18275
17871
  SET_CHANNEL: {
18276
17872
  actions: 'setChannel',
@@ -18310,7 +17906,7 @@ function crypto_button (request) {
18310
17906
  actions: 'setAmount',
18311
17907
  },
18312
17908
  BACK: {
18313
- target: 'defaultMode',
17909
+ target: 'loaded',
18314
17910
  },
18315
17911
  },
18316
17912
  },
@@ -18405,9 +18001,8 @@ function crypto_button (request) {
18405
18001
  calculation: null,
18406
18002
  }
18407
18003
  }),
18408
- setInitData: assign((context, event) => {
18409
- const { paymentDetail } = event.data;
18410
- const cryptos = paymentDetail?.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
18004
+ setCryptos: assign((context, event) => {
18005
+ const cryptos = event.data?.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
18411
18006
  const currentPayment = cryptos.find((element) => element.category === context.currentCategory);
18412
18007
  const channels = cryptos.map((item, i) => ({ ...item, label: `Channel ${padStart_1(String(i + 1), 2, '0')}`, icon: 'channel' }));
18413
18008
  const defaultNetworks =
@@ -18431,12 +18026,6 @@ function crypto_button (request) {
18431
18026
  options,
18432
18027
  }
18433
18028
  }),
18434
- preset: assign((context, event) => {
18435
- const { siteConfig } = event.data;
18436
- return {
18437
- siteConfig,
18438
- }
18439
- }),
18440
18029
  setChannel: assign((context, event) => {
18441
18030
  const { cryptos } = context;
18442
18031
  const selectedCrypto = cryptos.find((crypto) => crypto.method === event.data.value);
@@ -18516,9 +18105,6 @@ function crypto_button (request) {
18516
18105
  }),
18517
18106
  },
18518
18107
  guards: {
18519
- isPromotionApplyMode: (context, event) => {
18520
- return context.siteConfig?.promotionApplyMode === '1'
18521
- },
18522
18108
  isConfirmable: (context, event) => {
18523
18109
  const { selectedCrypto, selectedNetwork } = context;
18524
18110
  return selectedCrypto && selectedNetwork
@@ -18529,13 +18115,8 @@ function crypto_button (request) {
18529
18115
  },
18530
18116
  },
18531
18117
  services: {
18532
- fetchInitData: async (context, event) => {
18533
- const [{ config }, paymentDetail = []] = await Promise.all([
18534
- request.send(common$1.getConfig({ appSecret })),
18535
- request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
18536
- ]);
18537
- const siteConfig = JSON.parse(window.atob(config));
18538
- return { siteConfig, paymentDetail }
18118
+ fetchPayments: async (context, event) => {
18119
+ return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
18539
18120
  },
18540
18121
  fetchCalculation: async (context, event) => {
18541
18122
  const { selectedCrypto, selectedAmount } = context;
@@ -20107,142 +19688,6 @@ function vip_table (request) {
20107
19688
  )
20108
19689
  }
20109
19690
 
20110
- function promotions (request) {
20111
- return createMachine(
20112
- {
20113
- id: 'promotions',
20114
- initial: 'loading',
20115
- context: {
20116
- noBonus: {
20117
- promotionsNo: 'No Bonus',
20118
- title: 'No Bonus',
20119
- adSmallUrl: [
20120
- {
20121
- url: '~/assets/images/deposit/deposit_img_nobonus_normal.png',
20122
- name: 'No Bonus',
20123
- },
20124
- ],
20125
- descrip: 'no_bonus',
20126
- minimumAmount: 0,
20127
- turnoverLimitMultiple: 1,
20128
- promotionDetail: [],
20129
- withdrawLimitDetail: [],
20130
- limitGameDetail: [],
20131
- },
20132
- oldTargetTurnoverLimit: 0,
20133
- newTargetTurnoverLimit: 0,
20134
- promotionsList: [],
20135
- selectedPromo: {},
20136
- joinedPromotion: null,
20137
- },
20138
- states: {
20139
- loading: {
20140
- invoke: {
20141
- src: 'fetchInitData',
20142
- onDone: {
20143
- target: 'loaded',
20144
- actions: 'setInitData',
20145
- },
20146
- onError: {
20147
- target: 'fail',
20148
- },
20149
- },
20150
- },
20151
- loaded: {
20152
- on: {
20153
- SELECT_PROMO: {
20154
- actions: ['reset', 'setSelectedPromo'],
20155
- },
20156
- SET_AMOUNT: {
20157
- actions: 'setAmount',
20158
- },
20159
- JOIN: {
20160
- target: 'check',
20161
- cond: 'isValidAmount',
20162
- },
20163
- },
20164
- },
20165
- check: {
20166
- entry: 'preset',
20167
- on: {
20168
- CONFIRM: {
20169
- target: 'joinning',
20170
- },
20171
- BACK: {
20172
- target: 'loaded',
20173
- },
20174
- },
20175
- },
20176
- joinning: {
20177
- invoke: {
20178
- src: 'applyPromotion',
20179
- onDone: {
20180
- target: 'joined',
20181
- },
20182
- onError: {
20183
- target: 'fail',
20184
- },
20185
- },
20186
- },
20187
- joined: {},
20188
- fail: {},
20189
- },
20190
- },
20191
- {
20192
- actions: {
20193
- setInitData: assign((context, event) => {
20194
- const { userInfo, promotionsList } = event.data;
20195
- const { noBonus } = context;
20196
- return {
20197
- promotionsList,
20198
- userInfo,
20199
- selectedPromo: noBonus,
20200
- }
20201
- }),
20202
- setSelectedPromo: assign((context, event) => {
20203
- return {
20204
- selectedPromo: event.data,
20205
- }
20206
- }),
20207
- setAmount: assign((context, event) => {
20208
- return {
20209
- amount: event.data,
20210
- }
20211
- }),
20212
- reset: assign((context, event) => {
20213
- return {
20214
- amount: null,
20215
- }
20216
- }),
20217
- preset: assign((context, event) => {
20218
- const { userInfo, selectedPromo, amount } = context;
20219
- const { turnoverLimitMultiple } = selectedPromo;
20220
- return {
20221
- oldTargetTurnoverLimit: userInfo.target_withdraw_limit,
20222
- newTargetTurnoverLimit: parseFloat(`${amount}`) * parseFloat(`${turnoverLimitMultiple}`),
20223
- }
20224
- }),
20225
- },
20226
- guards: {
20227
- isValidAmount: (context, event) => {
20228
- const { selectedPromo, amount } = context;
20229
- return selectedPromo.minimumAmount <= amount
20230
- },
20231
- },
20232
- services: {
20233
- fetchInitData: async (context, event) => {
20234
- const [userInfo, promotionsList] = await Promise.all([request.send(user.getUserInfo()), request.send(payment.getPromotionsList())]);
20235
- return { userInfo, promotionsList }
20236
- },
20237
- applyPromotion: async (context, event) => {
20238
- const { selectedPromo, amount } = context;
20239
- return await request.send(payment.applyPromotions({ promotionsNo: selectedPromo.promotionsNo, amount: parseFloat(amount) }))
20240
- },
20241
- },
20242
- }
20243
- )
20244
- }
20245
-
20246
19691
  var index$1 = {
20247
19692
  ...activity,
20248
19693
  auth,
@@ -20280,7 +19725,6 @@ var index$1 = {
20280
19725
  auth_otp_v2,
20281
19726
  auth_otp_v3,
20282
19727
  vip_table,
20283
- promotions,
20284
19728
  };
20285
19729
 
20286
19730
  // const pickBy = require('lodash/pickBy')