@jetthai/cuora 1.1.74-2 → 1.1.74-cash
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/.husky/pre-commit +1 -1
- package/CHANGELOG.md +4 -2
- package/dist/bundle.mjs +105 -865
- package/package.json +1 -1
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/fafafa_activity.js +12 -0
- package/src/machine/activity/specify_turnover_activity.js +14 -1
- package/src/machine/auth.js +3 -3
- package/src/machine/deposit/loadcard_vn.js +5 -17
- package/src/machine/game_favorite_v2.js +6 -2
- package/src/machine/game_v2_1.js +36 -9
- package/src/machine/index.js +0 -6
- package/src/machine/user_sign_up.js +3 -3
- package/src/request/request.js +9 -5
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_v2.js +0 -381
package/dist/bundle.mjs
CHANGED
|
@@ -3613,7 +3613,7 @@ var common$1 = {
|
|
|
3613
3613
|
getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
|
|
3614
3614
|
};
|
|
3615
3615
|
|
|
3616
|
-
var game
|
|
3616
|
+
var game = {
|
|
3617
3617
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3618
3618
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
3619
3619
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
@@ -3928,7 +3928,7 @@ var form = {
|
|
|
3928
3928
|
upload: (formData) => ({ url: 'upload', method: 'post', params: formData, isFormData: true }),
|
|
3929
3929
|
};
|
|
3930
3930
|
|
|
3931
|
-
var index$2 = { activity: api, auth: auth$1, common: common$1, game
|
|
3931
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3932
3932
|
|
|
3933
3933
|
/*! *****************************************************************************
|
|
3934
3934
|
Copyright (c) Microsoft Corporation.
|
|
@@ -15698,11 +15698,11 @@ function auth (request) {
|
|
|
15698
15698
|
const referralObj = {};
|
|
15699
15699
|
if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
|
|
15700
15700
|
referralObj.referralCode = referralCode;
|
|
15701
|
+
} else {
|
|
15702
|
+
(referralObj.channel = storage.get('channel') || defaultChannel || channel),
|
|
15703
|
+
(referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel);
|
|
15701
15704
|
}
|
|
15702
15705
|
|
|
15703
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel;
|
|
15704
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
|
|
15705
|
-
|
|
15706
15706
|
const redirectURL = urljoin(
|
|
15707
15707
|
request.config.fullURL,
|
|
15708
15708
|
'login?' +
|
|
@@ -17026,699 +17026,40 @@ function error () {
|
|
|
17026
17026
|
},
|
|
17027
17027
|
},
|
|
17028
17028
|
{
|
|
17029
|
-
actions: {
|
|
17030
|
-
setError: assign((context, event) => {
|
|
17031
|
-
return { error: event.data }
|
|
17032
|
-
}),
|
|
17033
|
-
solveError: assign({ error: null }),
|
|
17034
|
-
setUnfinishedGame: assign((context, event) => {
|
|
17035
|
-
return {
|
|
17036
|
-
gameCode: context.error.extend.split(/_(.+)/)[1],
|
|
17037
|
-
}
|
|
17038
|
-
}),
|
|
17039
|
-
},
|
|
17040
|
-
guards: {
|
|
17041
|
-
isLogout: (context, event) => {
|
|
17042
|
-
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108', 'ERR_A113'].includes(context.error.code)
|
|
17043
|
-
},
|
|
17044
|
-
isNoBalance: (context, event) => {
|
|
17045
|
-
return context.error.code === 'ERR_G106'
|
|
17046
|
-
},
|
|
17047
|
-
isUnfinishedGame: (context, event) => {
|
|
17048
|
-
return context.error.extend?.includes?.('unfinished_')
|
|
17049
|
-
},
|
|
17050
|
-
},
|
|
17051
|
-
services: {},
|
|
17052
|
-
}
|
|
17053
|
-
)
|
|
17054
|
-
}
|
|
17055
|
-
|
|
17056
|
-
// const UAParser = require('ua-parser-js')
|
|
17057
|
-
|
|
17058
|
-
function game (request) {
|
|
17059
|
-
return createMachine(
|
|
17060
|
-
{
|
|
17061
|
-
id: 'game',
|
|
17062
|
-
type: 'parallel',
|
|
17063
|
-
context: {
|
|
17064
|
-
roomId: null,
|
|
17065
|
-
room: null,
|
|
17066
|
-
list: [],
|
|
17067
|
-
gameList: [],
|
|
17068
|
-
// play params
|
|
17069
|
-
game: {
|
|
17070
|
-
provider: null,
|
|
17071
|
-
game_id: null,
|
|
17072
|
-
game_type: null,
|
|
17073
|
-
mapping_id: null,
|
|
17074
|
-
portrait: null,
|
|
17075
|
-
},
|
|
17076
|
-
lang: 'en_US',
|
|
17077
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17078
|
-
gameURL: null,
|
|
17079
|
-
// game database
|
|
17080
|
-
sha: {
|
|
17081
|
-
category: null,
|
|
17082
|
-
status: null,
|
|
17083
|
-
},
|
|
17084
|
-
isCategoryChanged: false,
|
|
17085
|
-
isStatusChanged: false,
|
|
17086
|
-
statusMap: {},
|
|
17087
|
-
optionMap: {},
|
|
17088
|
-
},
|
|
17089
|
-
states: {
|
|
17090
|
-
flow: {
|
|
17091
|
-
initial: 'idle',
|
|
17092
|
-
states: {
|
|
17093
|
-
idle: {
|
|
17094
|
-
enter: 'clearGameInfo',
|
|
17095
|
-
on: {
|
|
17096
|
-
SET_ROOM: {
|
|
17097
|
-
target: 'loading',
|
|
17098
|
-
actions: 'setRoom',
|
|
17099
|
-
cond: (context, event) => {
|
|
17100
|
-
return context.room?.id !== event.data?.id
|
|
17101
|
-
},
|
|
17102
|
-
},
|
|
17103
|
-
ENTER_GAME: {
|
|
17104
|
-
target: 'connecting',
|
|
17105
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17106
|
-
},
|
|
17107
|
-
},
|
|
17108
|
-
},
|
|
17109
|
-
loading: {
|
|
17110
|
-
invoke: {
|
|
17111
|
-
src: 'getRoomItems',
|
|
17112
|
-
onDone: {
|
|
17113
|
-
target: 'idle',
|
|
17114
|
-
actions: 'setList',
|
|
17115
|
-
},
|
|
17116
|
-
onError: {
|
|
17117
|
-
target: 'idle',
|
|
17118
|
-
actions: assign({ list: [] }),
|
|
17119
|
-
},
|
|
17120
|
-
},
|
|
17121
|
-
},
|
|
17122
|
-
connecting: {
|
|
17123
|
-
invoke: {
|
|
17124
|
-
src: 'connectGame',
|
|
17125
|
-
onDone: {
|
|
17126
|
-
target: 'playing',
|
|
17127
|
-
actions: 'setGameURL',
|
|
17128
|
-
},
|
|
17129
|
-
onError: {
|
|
17130
|
-
target: 'idle',
|
|
17131
|
-
},
|
|
17132
|
-
},
|
|
17133
|
-
},
|
|
17134
|
-
playing: {
|
|
17135
|
-
on: {
|
|
17136
|
-
EXIT_GAME: {
|
|
17137
|
-
target: 'disconnect',
|
|
17138
|
-
},
|
|
17139
|
-
},
|
|
17140
|
-
},
|
|
17141
|
-
disconnect: {
|
|
17142
|
-
invoke: {
|
|
17143
|
-
src: 'disconnectGame',
|
|
17144
|
-
onDone: {
|
|
17145
|
-
target: 'idle',
|
|
17146
|
-
},
|
|
17147
|
-
onError: {
|
|
17148
|
-
target: 'idle',
|
|
17149
|
-
},
|
|
17150
|
-
},
|
|
17151
|
-
},
|
|
17152
|
-
},
|
|
17153
|
-
},
|
|
17154
|
-
timer: {
|
|
17155
|
-
initial: 'fetchingGameSHA',
|
|
17156
|
-
states: {
|
|
17157
|
-
fetchingGameSHA: {
|
|
17158
|
-
invoke: {
|
|
17159
|
-
src: 'fetchGameSHA',
|
|
17160
|
-
onDone: {
|
|
17161
|
-
target: 'checking',
|
|
17162
|
-
actions: 'setGameSHA',
|
|
17163
|
-
},
|
|
17164
|
-
onError: {
|
|
17165
|
-
target: 'pending',
|
|
17166
|
-
},
|
|
17167
|
-
},
|
|
17168
|
-
},
|
|
17169
|
-
checking: {
|
|
17170
|
-
always: [
|
|
17171
|
-
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17172
|
-
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17173
|
-
{ target: 'pending' },
|
|
17174
|
-
],
|
|
17175
|
-
},
|
|
17176
|
-
updatingStatus: {
|
|
17177
|
-
invoke: {
|
|
17178
|
-
src: 'fetchStatus',
|
|
17179
|
-
onDone: {
|
|
17180
|
-
target: 'updatingOption',
|
|
17181
|
-
actions: ['setStatus'],
|
|
17182
|
-
},
|
|
17183
|
-
onError: {
|
|
17184
|
-
target: 'pending',
|
|
17185
|
-
},
|
|
17186
|
-
},
|
|
17187
|
-
},
|
|
17188
|
-
updatingOption: {
|
|
17189
|
-
invoke: {
|
|
17190
|
-
src: 'fetchOption',
|
|
17191
|
-
onDone: {
|
|
17192
|
-
target: 'updatingCategory',
|
|
17193
|
-
actions: 'mergeOption',
|
|
17194
|
-
},
|
|
17195
|
-
onError: {
|
|
17196
|
-
target: 'pending',
|
|
17197
|
-
},
|
|
17198
|
-
},
|
|
17199
|
-
},
|
|
17200
|
-
updatingCategory: {
|
|
17201
|
-
invoke: {
|
|
17202
|
-
src: 'getRoomItems',
|
|
17203
|
-
onDone: {
|
|
17204
|
-
target: 'pending',
|
|
17205
|
-
actions: 'setList',
|
|
17206
|
-
},
|
|
17207
|
-
onError: {
|
|
17208
|
-
target: 'pending',
|
|
17209
|
-
},
|
|
17210
|
-
},
|
|
17211
|
-
},
|
|
17212
|
-
pending: {
|
|
17213
|
-
after: {
|
|
17214
|
-
20000: {
|
|
17215
|
-
target: 'fetchingGameSHA',
|
|
17216
|
-
},
|
|
17217
|
-
},
|
|
17218
|
-
},
|
|
17219
|
-
},
|
|
17220
|
-
},
|
|
17221
|
-
},
|
|
17222
|
-
},
|
|
17223
|
-
{
|
|
17224
|
-
actions: {
|
|
17225
|
-
setRoomId: assign((context, event) => {
|
|
17226
|
-
return { roomId: event.roomId }
|
|
17227
|
-
}),
|
|
17228
|
-
setRoom: assign((context, event) => {
|
|
17229
|
-
return {
|
|
17230
|
-
room: event.data,
|
|
17231
|
-
roomId: event.data.id,
|
|
17232
|
-
}
|
|
17233
|
-
}),
|
|
17234
|
-
setList: assign((context, event) => {
|
|
17235
|
-
const { statusMap, optionMap } = context;
|
|
17236
|
-
const { list = [] } = event.data;
|
|
17237
|
-
const gameList = list
|
|
17238
|
-
.map((item) => {
|
|
17239
|
-
if (item.id) {
|
|
17240
|
-
item.room = true;
|
|
17241
|
-
return item
|
|
17242
|
-
}
|
|
17243
|
-
|
|
17244
|
-
const code = item.g;
|
|
17245
|
-
if (!code || !optionMap[code]) {
|
|
17246
|
-
return
|
|
17247
|
-
}
|
|
17248
|
-
|
|
17249
|
-
return {
|
|
17250
|
-
...optionMap[code],
|
|
17251
|
-
code,
|
|
17252
|
-
system_enable: statusMap[code][0],
|
|
17253
|
-
}
|
|
17254
|
-
})
|
|
17255
|
-
.filter((item) => item && !item.header)
|
|
17256
|
-
.sort((a, b) => a.system_enable - b.system_enable);
|
|
17257
|
-
return { list, gameList }
|
|
17258
|
-
}),
|
|
17259
|
-
setGameURL: assign({
|
|
17260
|
-
gameURL: (context, event) => {
|
|
17261
|
-
return event.data.gameURL
|
|
17262
|
-
},
|
|
17263
|
-
}),
|
|
17264
|
-
clearGameInfo: assign((context, event) => {
|
|
17265
|
-
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
17266
|
-
}),
|
|
17267
|
-
setGameInfo: assign((context, event) => {
|
|
17268
|
-
const { provider, game_id, game_type, mapping_id, portrait } = event.data.game;
|
|
17269
|
-
return { game: { provider, game_id, game_type, mapping_id, portrait } }
|
|
17270
|
-
}),
|
|
17271
|
-
setLang: assign((context, event) => {
|
|
17272
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17273
|
-
return { lang }
|
|
17274
|
-
}),
|
|
17275
|
-
setGameSHA: assign((context, event) => {
|
|
17276
|
-
const { sha } = context;
|
|
17277
|
-
const newSha = event.data;
|
|
17278
|
-
return {
|
|
17279
|
-
sha: newSha,
|
|
17280
|
-
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17281
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17282
|
-
}
|
|
17283
|
-
}),
|
|
17284
|
-
setStatus: assign((context, event) => {
|
|
17285
|
-
return {
|
|
17286
|
-
statusMap: event.data,
|
|
17287
|
-
}
|
|
17288
|
-
}),
|
|
17289
|
-
mergeOption: assign((context, event) => {
|
|
17290
|
-
const { optionMap } = context;
|
|
17291
|
-
return {
|
|
17292
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17293
|
-
}
|
|
17294
|
-
}),
|
|
17295
|
-
},
|
|
17296
|
-
guards: {
|
|
17297
|
-
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17298
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17299
|
-
},
|
|
17300
|
-
services: {
|
|
17301
|
-
getRoomItems: async (context, event) => {
|
|
17302
|
-
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17303
|
-
},
|
|
17304
|
-
connectGame: async (context, event) => {
|
|
17305
|
-
const { lang, isMobile } = context;
|
|
17306
|
-
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17307
|
-
const params = {
|
|
17308
|
-
provider_id: provider,
|
|
17309
|
-
game_id: game_id,
|
|
17310
|
-
gametype_id: game_type,
|
|
17311
|
-
mapping_id: mapping_id,
|
|
17312
|
-
is_demo: false,
|
|
17313
|
-
is_mobile: isMobile,
|
|
17314
|
-
lang,
|
|
17315
|
-
return_url: window.location.href,
|
|
17316
|
-
};
|
|
17317
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17318
|
-
return { gameURL: redirect_url }
|
|
17319
|
-
},
|
|
17320
|
-
disconnectGame: async (context, event) => {
|
|
17321
|
-
const uid_site = event.data;
|
|
17322
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17323
|
-
},
|
|
17324
|
-
fetchOption: async (context, event) => {
|
|
17325
|
-
return await request.send(game$1.getOptionMap())
|
|
17326
|
-
},
|
|
17327
|
-
fetchGameSHA: async (context, event) => {
|
|
17328
|
-
return await request.send(game$1.getGameSHA())
|
|
17329
|
-
},
|
|
17330
|
-
fetchStatus: async (context, event) => {
|
|
17331
|
-
return await request.send(game$1.getGameStatus())
|
|
17332
|
-
},
|
|
17333
|
-
},
|
|
17334
|
-
}
|
|
17335
|
-
)
|
|
17336
|
-
}
|
|
17337
|
-
|
|
17338
|
-
const MY_FAVORITE = 'MyFavorite';
|
|
17339
|
-
const GAME_SEARCH = 'GameSearch';
|
|
17340
|
-
|
|
17341
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17342
|
-
__proto__: null,
|
|
17343
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17344
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17345
|
-
});
|
|
17346
|
-
|
|
17347
|
-
function game_v2 (request) {
|
|
17348
|
-
return createMachine(
|
|
17349
|
-
{
|
|
17350
|
-
id: 'game',
|
|
17351
|
-
type: 'parallel',
|
|
17352
|
-
context: {
|
|
17353
|
-
room: null,
|
|
17354
|
-
index: 0,
|
|
17355
|
-
content: {
|
|
17356
|
-
data: [],
|
|
17357
|
-
timestamp: null,
|
|
17358
|
-
parentCategoryId: null,
|
|
17359
|
-
totalPage: 1,
|
|
17360
|
-
},
|
|
17361
|
-
addition: {
|
|
17362
|
-
data: [],
|
|
17363
|
-
timestamp: null,
|
|
17364
|
-
totalPage: 1,
|
|
17365
|
-
},
|
|
17366
|
-
// play params
|
|
17367
|
-
game: {
|
|
17368
|
-
providerId: null,
|
|
17369
|
-
gameId: null,
|
|
17370
|
-
gameTypeId: null,
|
|
17371
|
-
mappingId: null,
|
|
17372
|
-
portrait: null,
|
|
17373
|
-
},
|
|
17374
|
-
lang: 'en_US',
|
|
17375
|
-
isMobile: new UAParser().getResult().device.type,
|
|
17376
|
-
gameURL: null,
|
|
17377
|
-
...oldContext$1,
|
|
17378
|
-
},
|
|
17379
|
-
states: {
|
|
17380
|
-
flow: {
|
|
17381
|
-
initial: 'idle',
|
|
17382
|
-
states: {
|
|
17383
|
-
idle: {
|
|
17384
|
-
enter: 'clearGameInfo',
|
|
17385
|
-
on: {
|
|
17386
|
-
ENTER_ROOM: {
|
|
17387
|
-
target: 'loading',
|
|
17388
|
-
cond: 'isDifferentRoom',
|
|
17389
|
-
actions: ['setRoom', 'resetContent'],
|
|
17390
|
-
},
|
|
17391
|
-
NEXT_PAGE: {
|
|
17392
|
-
target: 'loading',
|
|
17393
|
-
cond: 'hasNext',
|
|
17394
|
-
actions: 'increaseIndex',
|
|
17395
|
-
},
|
|
17396
|
-
ENTER_GAME: {
|
|
17397
|
-
target: 'connecting',
|
|
17398
|
-
actions: ['setGameInfo', 'setLang'],
|
|
17399
|
-
},
|
|
17400
|
-
},
|
|
17401
|
-
},
|
|
17402
|
-
loading: {
|
|
17403
|
-
invoke: {
|
|
17404
|
-
src: 'getPageContent',
|
|
17405
|
-
onDone: {
|
|
17406
|
-
target: 'idle',
|
|
17407
|
-
actions: 'appendContent',
|
|
17408
|
-
},
|
|
17409
|
-
onError: {
|
|
17410
|
-
target: 'idle',
|
|
17411
|
-
},
|
|
17412
|
-
},
|
|
17413
|
-
},
|
|
17414
|
-
connecting: {
|
|
17415
|
-
invoke: {
|
|
17416
|
-
src: 'connectGame',
|
|
17417
|
-
onDone: {
|
|
17418
|
-
target: 'playing',
|
|
17419
|
-
actions: 'setGameURL',
|
|
17420
|
-
},
|
|
17421
|
-
onError: {
|
|
17422
|
-
target: 'idle',
|
|
17423
|
-
},
|
|
17424
|
-
},
|
|
17425
|
-
},
|
|
17426
|
-
playing: {
|
|
17427
|
-
on: {
|
|
17428
|
-
EXIT_GAME: {
|
|
17429
|
-
target: 'disconnect',
|
|
17430
|
-
},
|
|
17431
|
-
},
|
|
17432
|
-
},
|
|
17433
|
-
disconnect: {
|
|
17434
|
-
invoke: {
|
|
17435
|
-
src: 'disconnectGame',
|
|
17436
|
-
onDone: {
|
|
17437
|
-
target: 'idle',
|
|
17438
|
-
},
|
|
17439
|
-
onError: {
|
|
17440
|
-
target: 'idle',
|
|
17441
|
-
},
|
|
17442
|
-
},
|
|
17443
|
-
},
|
|
17444
|
-
},
|
|
17445
|
-
},
|
|
17446
|
-
timer: {
|
|
17447
|
-
initial: 'pending',
|
|
17448
|
-
states: {
|
|
17449
|
-
pending: {
|
|
17450
|
-
after: {
|
|
17451
|
-
20000: [
|
|
17452
|
-
{
|
|
17453
|
-
target: 'updating',
|
|
17454
|
-
cond: 'hasRoom',
|
|
17455
|
-
},
|
|
17456
|
-
{
|
|
17457
|
-
target: 'pending',
|
|
17458
|
-
},
|
|
17459
|
-
],
|
|
17460
|
-
},
|
|
17461
|
-
},
|
|
17462
|
-
updating: {
|
|
17463
|
-
invoke: {
|
|
17464
|
-
src: 'updatePageContent',
|
|
17465
|
-
onDone: {
|
|
17466
|
-
target: 'pending',
|
|
17467
|
-
actions: 'swapContent',
|
|
17468
|
-
},
|
|
17469
|
-
onError: {
|
|
17470
|
-
target: 'pending',
|
|
17471
|
-
},
|
|
17472
|
-
},
|
|
17473
|
-
},
|
|
17474
|
-
},
|
|
17475
|
-
},
|
|
17476
|
-
oldTimer: {
|
|
17477
|
-
initial: 'fetchingGameSHA',
|
|
17478
|
-
states: {
|
|
17479
|
-
fetchingGameSHA: {
|
|
17480
|
-
invoke: {
|
|
17481
|
-
src: 'fetchGameSHA',
|
|
17482
|
-
onDone: {
|
|
17483
|
-
target: 'checking',
|
|
17484
|
-
actions: 'setGameSHA',
|
|
17485
|
-
},
|
|
17486
|
-
onError: {
|
|
17487
|
-
target: 'pending',
|
|
17488
|
-
},
|
|
17489
|
-
},
|
|
17490
|
-
},
|
|
17491
|
-
checking: {
|
|
17492
|
-
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17493
|
-
},
|
|
17494
|
-
updatingStatus: {
|
|
17495
|
-
invoke: {
|
|
17496
|
-
src: 'fetchStatus',
|
|
17497
|
-
onDone: {
|
|
17498
|
-
target: 'updatingOption',
|
|
17499
|
-
actions: ['setStatus'],
|
|
17500
|
-
},
|
|
17501
|
-
onError: {
|
|
17502
|
-
target: 'pending',
|
|
17503
|
-
},
|
|
17504
|
-
},
|
|
17505
|
-
},
|
|
17506
|
-
updatingOption: {
|
|
17507
|
-
invoke: {
|
|
17508
|
-
src: 'fetchOption',
|
|
17509
|
-
onDone: {
|
|
17510
|
-
target: 'pending',
|
|
17511
|
-
actions: 'mergeOption',
|
|
17512
|
-
},
|
|
17513
|
-
onError: {
|
|
17514
|
-
target: 'pending',
|
|
17515
|
-
},
|
|
17516
|
-
},
|
|
17517
|
-
},
|
|
17518
|
-
pending: {
|
|
17519
|
-
after: {
|
|
17520
|
-
20000: {
|
|
17521
|
-
target: 'fetchingGameSHA',
|
|
17522
|
-
},
|
|
17523
|
-
},
|
|
17524
|
-
},
|
|
17525
|
-
},
|
|
17526
|
-
},
|
|
17527
|
-
},
|
|
17528
|
-
},
|
|
17529
|
-
{
|
|
17530
|
-
actions: {
|
|
17531
|
-
setFavoriteList: assign((context, event) => {
|
|
17532
|
-
return {
|
|
17533
|
-
favoriteList: event.data.data || [],
|
|
17534
|
-
}
|
|
17535
|
-
}),
|
|
17536
|
-
setRoom: assign((context, event) => {
|
|
17537
|
-
return {
|
|
17538
|
-
room: event.data,
|
|
17539
|
-
}
|
|
17540
|
-
}),
|
|
17541
|
-
resetContent: assign((context, event) => {
|
|
17542
|
-
return {
|
|
17543
|
-
index: 0,
|
|
17544
|
-
content: {
|
|
17545
|
-
data: [],
|
|
17546
|
-
timestamp: null,
|
|
17547
|
-
parentCategoryId: null,
|
|
17548
|
-
totalPage: 1,
|
|
17549
|
-
},
|
|
17550
|
-
addition: {
|
|
17551
|
-
data: [],
|
|
17552
|
-
timestamp: null,
|
|
17553
|
-
totalPage: 1,
|
|
17554
|
-
},
|
|
17555
|
-
}
|
|
17556
|
-
}),
|
|
17557
|
-
appendContent: assign((context, event) => {
|
|
17558
|
-
const { room, favoriteList } = context;
|
|
17559
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17560
|
-
return
|
|
17561
|
-
} else {
|
|
17562
|
-
const [content, addition] = event.data;
|
|
17563
|
-
return {
|
|
17564
|
-
content: {
|
|
17565
|
-
...context.content,
|
|
17566
|
-
...content,
|
|
17567
|
-
data: context.content.data.concat(content.data),
|
|
17568
|
-
},
|
|
17569
|
-
addition: {
|
|
17570
|
-
...context.addition,
|
|
17571
|
-
...addition,
|
|
17572
|
-
data: context.addition.data.concat(addition.data),
|
|
17573
|
-
},
|
|
17574
|
-
}
|
|
17575
|
-
}
|
|
17576
|
-
}),
|
|
17577
|
-
swapContent: assign((context, event) => {
|
|
17578
|
-
const [content, addition] = event.data;
|
|
17579
|
-
let result = {};
|
|
17580
|
-
if (content?.data?.length) {
|
|
17581
|
-
result.content = content;
|
|
17582
|
-
}
|
|
17583
|
-
if (addition?.data?.length) {
|
|
17584
|
-
result.addition = addition;
|
|
17585
|
-
}
|
|
17586
|
-
return result
|
|
17029
|
+
actions: {
|
|
17030
|
+
setError: assign((context, event) => {
|
|
17031
|
+
return { error: event.data }
|
|
17587
17032
|
}),
|
|
17588
|
-
|
|
17033
|
+
solveError: assign({ error: null }),
|
|
17034
|
+
setUnfinishedGame: assign((context, event) => {
|
|
17589
17035
|
return {
|
|
17590
|
-
|
|
17036
|
+
gameCode: context.error.extend.split(/_(.+)/)[1],
|
|
17591
17037
|
}
|
|
17592
17038
|
}),
|
|
17593
|
-
setGameURL: assign({
|
|
17594
|
-
gameURL: (context, event) => {
|
|
17595
|
-
return event.data.gameURL
|
|
17596
|
-
},
|
|
17597
|
-
}),
|
|
17598
|
-
clearGameInfo: assign((context, event) => {
|
|
17599
|
-
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17600
|
-
}),
|
|
17601
|
-
setGameInfo: assign((context, event) => {
|
|
17602
|
-
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17603
|
-
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17604
|
-
}),
|
|
17605
|
-
setLang: assign((context, event) => {
|
|
17606
|
-
const lang = event.data.locale.replace('-', '_');
|
|
17607
|
-
return { lang }
|
|
17608
|
-
}),
|
|
17609
|
-
...oldActions$1,
|
|
17610
17039
|
},
|
|
17611
17040
|
guards: {
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
hasRoom: (context, event) => context.room?.categoryId,
|
|
17615
|
-
...oldGuards$1,
|
|
17616
|
-
},
|
|
17617
|
-
services: {
|
|
17618
|
-
getPageContent: async (context, event) => {
|
|
17619
|
-
const { room, index } = context;
|
|
17620
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17621
|
-
return
|
|
17622
|
-
} else {
|
|
17623
|
-
const param = { categoryId: room.categoryId, index };
|
|
17624
|
-
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17625
|
-
}
|
|
17626
|
-
},
|
|
17627
|
-
updatePageContent: async (context, event) => {
|
|
17628
|
-
const { room, content, index } = context;
|
|
17629
|
-
if (room.categoryId === GAME_SEARCH) {
|
|
17630
|
-
return
|
|
17631
|
-
} else {
|
|
17632
|
-
return await Promise.all([
|
|
17633
|
-
request.send(
|
|
17634
|
-
game$1.getListCategoryByRange({
|
|
17635
|
-
categoryId: room.categoryId,
|
|
17636
|
-
end: index,
|
|
17637
|
-
timestamp: content.timestamp,
|
|
17638
|
-
})
|
|
17639
|
-
),
|
|
17640
|
-
request.send(
|
|
17641
|
-
game$1.getListAdditionByRange({
|
|
17642
|
-
categoryId: room.categoryId,
|
|
17643
|
-
end: index,
|
|
17644
|
-
timestamp: content.timestamp,
|
|
17645
|
-
})
|
|
17646
|
-
),
|
|
17647
|
-
])
|
|
17648
|
-
}
|
|
17041
|
+
isLogout: (context, event) => {
|
|
17042
|
+
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108', 'ERR_A113'].includes(context.error.code)
|
|
17649
17043
|
},
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17653
|
-
const params = {
|
|
17654
|
-
provider_id: providerId,
|
|
17655
|
-
game_id: gameId,
|
|
17656
|
-
gametype_id: gameTypeId,
|
|
17657
|
-
mapping_id: mappingId,
|
|
17658
|
-
is_demo: false,
|
|
17659
|
-
is_mobile: isMobile,
|
|
17660
|
-
lang,
|
|
17661
|
-
return_url: window.location.href,
|
|
17662
|
-
};
|
|
17663
|
-
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17664
|
-
return { gameURL: redirect_url }
|
|
17044
|
+
isNoBalance: (context, event) => {
|
|
17045
|
+
return context.error.code === 'ERR_G106'
|
|
17665
17046
|
},
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
const provider_id = context.game.providerId;
|
|
17669
|
-
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17047
|
+
isUnfinishedGame: (context, event) => {
|
|
17048
|
+
return context.error.extend?.includes?.('unfinished_')
|
|
17670
17049
|
},
|
|
17671
|
-
...oldServices$1(request),
|
|
17672
17050
|
},
|
|
17051
|
+
services: {},
|
|
17673
17052
|
}
|
|
17674
17053
|
)
|
|
17675
17054
|
}
|
|
17676
17055
|
|
|
17677
|
-
const
|
|
17678
|
-
|
|
17679
|
-
status: null,
|
|
17680
|
-
},
|
|
17681
|
-
isStatusChanged: false,
|
|
17682
|
-
statusMap: {},
|
|
17683
|
-
optionMap: {},
|
|
17684
|
-
};
|
|
17685
|
-
|
|
17686
|
-
const oldActions$1 = {
|
|
17687
|
-
setGameSHA: assign((context, event) => {
|
|
17688
|
-
const { sha } = context;
|
|
17689
|
-
const newSha = event.data;
|
|
17690
|
-
return {
|
|
17691
|
-
sha: newSha,
|
|
17692
|
-
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17693
|
-
}
|
|
17694
|
-
}),
|
|
17695
|
-
setStatus: assign((context, event) => {
|
|
17696
|
-
return {
|
|
17697
|
-
statusMap: event.data,
|
|
17698
|
-
}
|
|
17699
|
-
}),
|
|
17700
|
-
mergeOption: assign((context, event) => {
|
|
17701
|
-
const { optionMap } = context;
|
|
17702
|
-
return {
|
|
17703
|
-
optionMap: { ...optionMap, ...event.data },
|
|
17704
|
-
}
|
|
17705
|
-
}),
|
|
17706
|
-
};
|
|
17707
|
-
|
|
17708
|
-
const oldGuards$1 = {
|
|
17709
|
-
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17710
|
-
};
|
|
17056
|
+
const MY_FAVORITE = 'MyFavorite';
|
|
17057
|
+
const GAME_SEARCH = 'GameSearch';
|
|
17711
17058
|
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
fetchGameSHA: async (context, event) => {
|
|
17717
|
-
return await request.send(game$1.getGameSHA())
|
|
17718
|
-
},
|
|
17719
|
-
fetchStatus: async (context, event) => {
|
|
17720
|
-
return await request.send(game$1.getGameStatus())
|
|
17721
|
-
},
|
|
17059
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17060
|
+
__proto__: null,
|
|
17061
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17062
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17722
17063
|
});
|
|
17723
17064
|
|
|
17724
17065
|
// 對應 intersectionObserver 版本
|
|
@@ -17744,6 +17085,7 @@ function game_v2_1 (request) {
|
|
|
17744
17085
|
timestamp: null,
|
|
17745
17086
|
totalPage: 0,
|
|
17746
17087
|
},
|
|
17088
|
+
staticData: [],
|
|
17747
17089
|
// play params
|
|
17748
17090
|
game: {
|
|
17749
17091
|
providerId: null,
|
|
@@ -17764,6 +17106,9 @@ function game_v2_1 (request) {
|
|
|
17764
17106
|
idle: {
|
|
17765
17107
|
enter: 'clearGameInfo',
|
|
17766
17108
|
on: {
|
|
17109
|
+
SET_STATIC_DATA: {
|
|
17110
|
+
actions: 'setStaticData',
|
|
17111
|
+
},
|
|
17767
17112
|
SET_ADDITION_ENABLE: {
|
|
17768
17113
|
actions: 'setAdditionEnable',
|
|
17769
17114
|
},
|
|
@@ -17923,6 +17268,11 @@ function game_v2_1 (request) {
|
|
|
17923
17268
|
},
|
|
17924
17269
|
{
|
|
17925
17270
|
actions: {
|
|
17271
|
+
setStaticData: assign((context, event) => {
|
|
17272
|
+
return {
|
|
17273
|
+
staticData: event.data,
|
|
17274
|
+
}
|
|
17275
|
+
}),
|
|
17926
17276
|
setAdditionEnable: assign((context, event) => {
|
|
17927
17277
|
return {
|
|
17928
17278
|
additionEnable: event.data,
|
|
@@ -17940,17 +17290,13 @@ function game_v2_1 (request) {
|
|
|
17940
17290
|
isLastPage: index >= content?.totalPage - 1,
|
|
17941
17291
|
}
|
|
17942
17292
|
}),
|
|
17943
|
-
setFavoriteList: assign((context, event) => {
|
|
17944
|
-
return {
|
|
17945
|
-
favoriteList: event.data.data || [],
|
|
17946
|
-
}
|
|
17947
|
-
}),
|
|
17948
17293
|
setRoom: assign((context, event) => {
|
|
17949
17294
|
return {
|
|
17950
17295
|
room: event.data,
|
|
17951
17296
|
}
|
|
17952
17297
|
}),
|
|
17953
17298
|
resetContent: assign((context, event) => {
|
|
17299
|
+
console.log('resetContent');
|
|
17954
17300
|
return {
|
|
17955
17301
|
loadable: false,
|
|
17956
17302
|
isLastPage: false,
|
|
@@ -18042,32 +17388,44 @@ function game_v2_1 (request) {
|
|
|
18042
17388
|
},
|
|
18043
17389
|
services: {
|
|
18044
17390
|
getPageContent: async (context, event) => {
|
|
18045
|
-
const { room, index, additionEnable } = context;
|
|
17391
|
+
const { room, index, additionEnable, staticData } = context;
|
|
18046
17392
|
if (room.categoryId === GAME_SEARCH) {
|
|
18047
17393
|
return
|
|
17394
|
+
} else if (!request.getToken()) {
|
|
17395
|
+
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17396
|
+
|
|
17397
|
+
return [
|
|
17398
|
+
{
|
|
17399
|
+
data: list.slice(index * 20, (index + 1) * 20),
|
|
17400
|
+
totalPage: Math.ceil(list.length / 20),
|
|
17401
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
17402
|
+
},
|
|
17403
|
+
]
|
|
18048
17404
|
} else if (additionEnable) {
|
|
18049
17405
|
const param = { categoryId: room.categoryId, index };
|
|
18050
|
-
return await Promise.all([request.send(game
|
|
17406
|
+
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18051
17407
|
} else {
|
|
18052
17408
|
const param = { categoryId: room.categoryId, index };
|
|
18053
|
-
return await Promise.all([request.send(game
|
|
17409
|
+
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18054
17410
|
}
|
|
18055
17411
|
},
|
|
18056
17412
|
updatePageContent: async (context, event) => {
|
|
18057
17413
|
const { room, content, index, additionEnable } = context;
|
|
18058
17414
|
if (room.categoryId === GAME_SEARCH) {
|
|
18059
17415
|
return
|
|
17416
|
+
} else if (!request.getToken()) {
|
|
17417
|
+
return []
|
|
18060
17418
|
} else if (additionEnable) {
|
|
18061
17419
|
return await Promise.all([
|
|
18062
17420
|
request.send(
|
|
18063
|
-
game
|
|
17421
|
+
game.getListCategoryByRange({
|
|
18064
17422
|
categoryId: room.categoryId,
|
|
18065
17423
|
end: index,
|
|
18066
17424
|
timestamp: content.timestamp,
|
|
18067
17425
|
})
|
|
18068
17426
|
),
|
|
18069
17427
|
request.send(
|
|
18070
|
-
game
|
|
17428
|
+
game.getListAdditionByRange({
|
|
18071
17429
|
categoryId: room.categoryId,
|
|
18072
17430
|
end: index,
|
|
18073
17431
|
timestamp: content.timestamp,
|
|
@@ -18077,7 +17435,7 @@ function game_v2_1 (request) {
|
|
|
18077
17435
|
} else {
|
|
18078
17436
|
return await Promise.all([
|
|
18079
17437
|
request.send(
|
|
18080
|
-
game
|
|
17438
|
+
game.getListCategoryByRange({
|
|
18081
17439
|
categoryId: room.categoryId,
|
|
18082
17440
|
end: index,
|
|
18083
17441
|
timestamp: content.timestamp,
|
|
@@ -18099,13 +17457,13 @@ function game_v2_1 (request) {
|
|
|
18099
17457
|
lang,
|
|
18100
17458
|
return_url: window.location.href,
|
|
18101
17459
|
};
|
|
18102
|
-
const { redirect_url } = await request.send(game
|
|
17460
|
+
const { redirect_url } = await request.send(game.playGame(params));
|
|
18103
17461
|
return { gameURL: redirect_url }
|
|
18104
17462
|
},
|
|
18105
17463
|
disconnectGame: async (context, event) => {
|
|
18106
17464
|
const uid_site = event.data;
|
|
18107
17465
|
const provider_id = context.game.providerId;
|
|
18108
|
-
return await request.send(game
|
|
17466
|
+
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18109
17467
|
},
|
|
18110
17468
|
...oldServices(request),
|
|
18111
17469
|
},
|
|
@@ -18150,137 +17508,26 @@ const oldGuards = {
|
|
|
18150
17508
|
|
|
18151
17509
|
const oldServices = (request) => ({
|
|
18152
17510
|
fetchOption: async (context, event) => {
|
|
18153
|
-
|
|
17511
|
+
if (request.getToken()) {
|
|
17512
|
+
return await request.send(game.getOptionMap())
|
|
17513
|
+
}
|
|
18154
17514
|
},
|
|
18155
17515
|
fetchGameSHA: async (context, event) => {
|
|
18156
|
-
|
|
17516
|
+
if (request.getToken()) {
|
|
17517
|
+
return await request.send(game.getGameSHA())
|
|
17518
|
+
} else {
|
|
17519
|
+
return {
|
|
17520
|
+
status: null,
|
|
17521
|
+
}
|
|
17522
|
+
}
|
|
18157
17523
|
},
|
|
18158
17524
|
fetchStatus: async (context, event) => {
|
|
18159
|
-
|
|
17525
|
+
if (request.getToken()) {
|
|
17526
|
+
return await request.send(game.getGameStatus())
|
|
17527
|
+
}
|
|
18160
17528
|
},
|
|
18161
17529
|
});
|
|
18162
17530
|
|
|
18163
|
-
function game_favorite (request) {
|
|
18164
|
-
return createMachine(
|
|
18165
|
-
{
|
|
18166
|
-
id: 'favorite',
|
|
18167
|
-
type: 'parallel',
|
|
18168
|
-
context: {
|
|
18169
|
-
list: [],
|
|
18170
|
-
},
|
|
18171
|
-
states: {
|
|
18172
|
-
fetching: {
|
|
18173
|
-
initial: 'disable',
|
|
18174
|
-
states: {
|
|
18175
|
-
disable: {},
|
|
18176
|
-
enable: {
|
|
18177
|
-
invoke: {
|
|
18178
|
-
src: 'fetchList',
|
|
18179
|
-
onDone: {
|
|
18180
|
-
actions: 'setList',
|
|
18181
|
-
},
|
|
18182
|
-
onError: {
|
|
18183
|
-
actions: assign({ list: [] }),
|
|
18184
|
-
},
|
|
18185
|
-
},
|
|
18186
|
-
},
|
|
18187
|
-
},
|
|
18188
|
-
},
|
|
18189
|
-
adding: {
|
|
18190
|
-
initial: 'disable',
|
|
18191
|
-
states: {
|
|
18192
|
-
disable: {},
|
|
18193
|
-
enable: {
|
|
18194
|
-
invoke: {
|
|
18195
|
-
src: 'add',
|
|
18196
|
-
onDone: {},
|
|
18197
|
-
onError: {
|
|
18198
|
-
actions: 'removeFromList',
|
|
18199
|
-
},
|
|
18200
|
-
},
|
|
18201
|
-
},
|
|
18202
|
-
},
|
|
18203
|
-
},
|
|
18204
|
-
removing: {
|
|
18205
|
-
initial: 'disable',
|
|
18206
|
-
states: {
|
|
18207
|
-
disable: {},
|
|
18208
|
-
enable: {
|
|
18209
|
-
invoke: {
|
|
18210
|
-
src: 'remove',
|
|
18211
|
-
onDone: {},
|
|
18212
|
-
onError: {
|
|
18213
|
-
actions: 'addToList',
|
|
18214
|
-
},
|
|
18215
|
-
},
|
|
18216
|
-
},
|
|
18217
|
-
},
|
|
18218
|
-
},
|
|
18219
|
-
},
|
|
18220
|
-
on: {
|
|
18221
|
-
FETCH_LIST: {
|
|
18222
|
-
target: 'fetching.enable',
|
|
18223
|
-
},
|
|
18224
|
-
ADD: {
|
|
18225
|
-
target: 'adding.enable',
|
|
18226
|
-
actions: 'addToList',
|
|
18227
|
-
cond: 'isNotExist',
|
|
18228
|
-
},
|
|
18229
|
-
REMOVE: {
|
|
18230
|
-
target: 'removing.enable',
|
|
18231
|
-
actions: 'removeFromList',
|
|
18232
|
-
cond: 'isExist',
|
|
18233
|
-
},
|
|
18234
|
-
},
|
|
18235
|
-
},
|
|
18236
|
-
{
|
|
18237
|
-
actions: {
|
|
18238
|
-
setList: assign((context, event) => {
|
|
18239
|
-
return {
|
|
18240
|
-
list: event.data,
|
|
18241
|
-
}
|
|
18242
|
-
}),
|
|
18243
|
-
addToList: assign((context, event) => {
|
|
18244
|
-
return {
|
|
18245
|
-
list: [...context.list, event.data],
|
|
18246
|
-
}
|
|
18247
|
-
}),
|
|
18248
|
-
removeFromList: assign((context, event) => {
|
|
18249
|
-
return {
|
|
18250
|
-
list: context.list.filter((item) => item !== event.data),
|
|
18251
|
-
}
|
|
18252
|
-
}),
|
|
18253
|
-
},
|
|
18254
|
-
guards: {
|
|
18255
|
-
isExist: (context, event) => context.list.includes(event.data),
|
|
18256
|
-
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18257
|
-
},
|
|
18258
|
-
services: {
|
|
18259
|
-
add: async (context, event) => {
|
|
18260
|
-
try {
|
|
18261
|
-
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18262
|
-
} catch (error) {
|
|
18263
|
-
throw event.data
|
|
18264
|
-
}
|
|
18265
|
-
},
|
|
18266
|
-
remove: async (context, event) => {
|
|
18267
|
-
try {
|
|
18268
|
-
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18269
|
-
} catch (error) {
|
|
18270
|
-
throw event.data
|
|
18271
|
-
}
|
|
18272
|
-
},
|
|
18273
|
-
fetchList: async (context, event) => {
|
|
18274
|
-
const main = await request.send(game$1.getGameCategory({}));
|
|
18275
|
-
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18276
|
-
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18277
|
-
return favorite.list.map((item) => item.g)
|
|
18278
|
-
},
|
|
18279
|
-
},
|
|
18280
|
-
}
|
|
18281
|
-
)
|
|
18282
|
-
}
|
|
18283
|
-
|
|
18284
17531
|
function game_favorite_v2 (request) {
|
|
18285
17532
|
return createMachine(
|
|
18286
17533
|
{
|
|
@@ -18375,7 +17622,7 @@ function game_favorite_v2 (request) {
|
|
|
18375
17622
|
services: {
|
|
18376
17623
|
add: async (context, event) => {
|
|
18377
17624
|
try {
|
|
18378
|
-
await request.send(game
|
|
17625
|
+
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18379
17626
|
return event.data
|
|
18380
17627
|
} catch (error) {
|
|
18381
17628
|
throw event.data
|
|
@@ -18383,15 +17630,19 @@ function game_favorite_v2 (request) {
|
|
|
18383
17630
|
},
|
|
18384
17631
|
remove: async (context, event) => {
|
|
18385
17632
|
try {
|
|
18386
|
-
await request.send(game
|
|
17633
|
+
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18387
17634
|
return event.data
|
|
18388
17635
|
} catch (error) {
|
|
18389
17636
|
throw event.data
|
|
18390
17637
|
}
|
|
18391
17638
|
},
|
|
18392
17639
|
fetchList: async (context, event) => {
|
|
18393
|
-
|
|
18394
|
-
|
|
17640
|
+
if (request.getToken()) {
|
|
17641
|
+
const { data } = await request.send(game.getListMyFavorite());
|
|
17642
|
+
return data
|
|
17643
|
+
} else {
|
|
17644
|
+
return []
|
|
17645
|
+
}
|
|
18395
17646
|
},
|
|
18396
17647
|
},
|
|
18397
17648
|
}
|
|
@@ -18623,17 +17874,17 @@ function game_search (request) {
|
|
|
18623
17874
|
services: {
|
|
18624
17875
|
fetchTags: async (context, event) => {
|
|
18625
17876
|
const { keyword } = context;
|
|
18626
|
-
const { result } = await request.send(game
|
|
17877
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18627
17878
|
return result
|
|
18628
17879
|
},
|
|
18629
17880
|
fetchGames: async (context, event) => {
|
|
18630
17881
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18631
|
-
const { traceId, result } = await request.send(game
|
|
17882
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18632
17883
|
return { traceId, result }
|
|
18633
17884
|
},
|
|
18634
17885
|
sendTrace: async (context, event) => {
|
|
18635
17886
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
18636
|
-
return await request.send(game
|
|
17887
|
+
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18637
17888
|
},
|
|
18638
17889
|
},
|
|
18639
17890
|
}
|
|
@@ -18966,16 +18217,16 @@ function game_search_v2 (request) {
|
|
|
18966
18217
|
services: {
|
|
18967
18218
|
fetchTags: async (context, event) => {
|
|
18968
18219
|
const { keyword } = context;
|
|
18969
|
-
const { result } = await request.send(game
|
|
18220
|
+
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18970
18221
|
return result
|
|
18971
18222
|
},
|
|
18972
18223
|
fetchInitialData: async (context, event) => {
|
|
18973
|
-
const data = await request.send(game
|
|
18224
|
+
const data = await request.send(game.getGameSearchHome());
|
|
18974
18225
|
return data
|
|
18975
18226
|
},
|
|
18976
18227
|
fetchGames: async (context, event) => {
|
|
18977
18228
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18978
|
-
const { traceId, result } = await request.send(game
|
|
18229
|
+
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18979
18230
|
return { traceId, result }
|
|
18980
18231
|
},
|
|
18981
18232
|
sendTrace: async (context, event) => {
|
|
@@ -18997,7 +18248,7 @@ function game_search_v2 (request) {
|
|
|
18997
18248
|
id = null;
|
|
18998
18249
|
}
|
|
18999
18250
|
return await request.send(
|
|
19000
|
-
game
|
|
18251
|
+
game.setGameSearchTrace({
|
|
19001
18252
|
traceId,
|
|
19002
18253
|
tagId: id,
|
|
19003
18254
|
tagIndex,
|
|
@@ -19078,12 +18329,12 @@ function game_hot_new (request) {
|
|
|
19078
18329
|
},
|
|
19079
18330
|
services: {
|
|
19080
18331
|
getRoomItems: async (context, event) => {
|
|
19081
|
-
return await request.send(game
|
|
18332
|
+
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19082
18333
|
},
|
|
19083
18334
|
getGames: async (context, event) => {
|
|
19084
18335
|
const [resHot, resNew] = await Promise.all([
|
|
19085
|
-
request.send(game
|
|
19086
|
-
request.send(game
|
|
18336
|
+
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18337
|
+
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19087
18338
|
]);
|
|
19088
18339
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
19089
18340
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -19923,7 +19174,7 @@ function side (request) {
|
|
|
19923
19174
|
},
|
|
19924
19175
|
services: {
|
|
19925
19176
|
getRoomItems: async (context, event) => {
|
|
19926
|
-
return await request.send(game
|
|
19177
|
+
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
19927
19178
|
},
|
|
19928
19179
|
},
|
|
19929
19180
|
}
|
|
@@ -20087,10 +19338,10 @@ function side_v2 (request) {
|
|
|
20087
19338
|
},
|
|
20088
19339
|
services: {
|
|
20089
19340
|
getMenu: async (context, event) => {
|
|
20090
|
-
return await request.send(game
|
|
19341
|
+
return await request.send(game.getListRoot())
|
|
20091
19342
|
},
|
|
20092
19343
|
fetchUpdateMenu: async (context, event) => {
|
|
20093
|
-
return await request.send(game
|
|
19344
|
+
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20094
19345
|
},
|
|
20095
19346
|
},
|
|
20096
19347
|
}
|
|
@@ -20320,11 +19571,11 @@ function user_sign_up (request) {
|
|
|
20320
19571
|
const referralObj = {};
|
|
20321
19572
|
if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
|
|
20322
19573
|
referralObj.referralCode = referralCode;
|
|
19574
|
+
} else {
|
|
19575
|
+
(referralObj.channel = storage.get('channel') || defaultChannel || channel),
|
|
19576
|
+
(referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel);
|
|
20323
19577
|
}
|
|
20324
19578
|
|
|
20325
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel;
|
|
20326
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel;
|
|
20327
|
-
|
|
20328
19579
|
return await request.send(
|
|
20329
19580
|
auth$1.register({
|
|
20330
19581
|
...signUpData,
|
|
@@ -23246,7 +22497,7 @@ function loadcard_vn (request) {
|
|
|
23246
22497
|
actions: 'setAmount',
|
|
23247
22498
|
},
|
|
23248
22499
|
CONFIRM: {
|
|
23249
|
-
target: '
|
|
22500
|
+
target: 'calculating',
|
|
23250
22501
|
},
|
|
23251
22502
|
BACK: {
|
|
23252
22503
|
target: 'loaded',
|
|
@@ -23272,22 +22523,10 @@ function loadcard_vn (request) {
|
|
|
23272
22523
|
calculating: {
|
|
23273
22524
|
invoke: {
|
|
23274
22525
|
src: 'fetchCalculation',
|
|
23275
|
-
onDone:
|
|
23276
|
-
|
|
23277
|
-
|
|
23278
|
-
|
|
23279
|
-
cond: 'jumpLinkEnable',
|
|
23280
|
-
},
|
|
23281
|
-
{
|
|
23282
|
-
target: 'cardInfo',
|
|
23283
|
-
actions: 'setCalculation',
|
|
23284
|
-
cond: 'isFreeWalletMode',
|
|
23285
|
-
},
|
|
23286
|
-
{
|
|
23287
|
-
target: 'calculated',
|
|
23288
|
-
actions: 'setCalculation',
|
|
23289
|
-
},
|
|
23290
|
-
],
|
|
22526
|
+
onDone: {
|
|
22527
|
+
target: 'calculated',
|
|
22528
|
+
actions: 'setCalculation',
|
|
22529
|
+
},
|
|
23291
22530
|
onError: {
|
|
23292
22531
|
target: 'calculable',
|
|
23293
22532
|
},
|
|
@@ -27645,9 +26884,6 @@ var index$1 = {
|
|
|
27645
26884
|
common,
|
|
27646
26885
|
deposit,
|
|
27647
26886
|
error,
|
|
27648
|
-
game,
|
|
27649
|
-
game_v2,
|
|
27650
|
-
game_favorite,
|
|
27651
26887
|
game_favorite_v2,
|
|
27652
26888
|
game_search,
|
|
27653
26889
|
game_search_v2,
|
|
@@ -27701,8 +26937,8 @@ class Request {
|
|
|
27701
26937
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
27702
26938
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
27703
26939
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
27704
|
-
if (
|
|
27705
|
-
axiosConfig.headers.Authorization =
|
|
26940
|
+
if (this.getToken()) {
|
|
26941
|
+
axiosConfig.headers.Authorization = this.getToken();
|
|
27706
26942
|
}
|
|
27707
26943
|
return axiosConfig
|
|
27708
26944
|
});
|
|
@@ -27730,7 +26966,7 @@ class Request {
|
|
|
27730
26966
|
async send(req, customToken) {
|
|
27731
26967
|
try {
|
|
27732
26968
|
const cancelToken = customToken || this.source.token;
|
|
27733
|
-
this._checkToken(req
|
|
26969
|
+
this._checkToken(req);
|
|
27734
26970
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
27735
26971
|
const { data } = await this.axios.request(requestConfig);
|
|
27736
26972
|
return data
|
|
@@ -27776,12 +27012,16 @@ class Request {
|
|
|
27776
27012
|
}
|
|
27777
27013
|
}
|
|
27778
27014
|
|
|
27779
|
-
_checkToken(req
|
|
27780
|
-
if (!req.isPublic && !
|
|
27015
|
+
_checkToken(req) {
|
|
27016
|
+
if (!req.isPublic && !this.getToken()) {
|
|
27781
27017
|
console.error(req);
|
|
27782
27018
|
throw { code: 'ERR_A103', url: req.url }
|
|
27783
27019
|
}
|
|
27784
27020
|
}
|
|
27021
|
+
|
|
27022
|
+
getToken() {
|
|
27023
|
+
return storage.get(this.key)
|
|
27024
|
+
}
|
|
27785
27025
|
}
|
|
27786
27026
|
|
|
27787
27027
|
// const urljoin = require('url-join')
|