@jetthai/cuora 1.1.83-cash → 1.1.83
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 +0 -20
- package/dist/bundle.mjs +827 -79
- package/package.json +1 -1
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/fafafa_activity.js +11 -35
- package/src/machine/activity/index.js +0 -2
- package/src/machine/activity/ranking_activity.js +2 -31
- package/src/machine/activity/specify_bets_activity.js +3 -44
- package/src/machine/activity/specify_turnover_activity.js +3 -44
- package/src/machine/deposit/index.js +0 -2
- package/src/machine/game.js +285 -0
- package/src/machine/game_favorite.js +123 -0
- package/src/machine/game_favorite_v2.js +2 -6
- package/src/machine/game_v2.js +381 -0
- package/src/machine/game_v2_1.js +9 -35
- package/src/machine/index.js +6 -2
- package/src/machine/user_info.js +2 -8
- package/src/request/request.js +5 -9
- package/src/util/index.js +1 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -215
- package/src/machine/deposit/qrcode_v_cash.js +0 -280
- package/src/machine/reward_cash.js +0 -220
- package/src/machine/withdraw/withdraw_activity.js +0 -383
- package/src/util/math.js +0 -4
package/dist/bundle.mjs
CHANGED
|
@@ -3614,7 +3614,7 @@ var common$1 = {
|
|
|
3614
3614
|
getAnnouncements: () => ({ url: 'getAnnouncements', method: 'get', isPublic: true }),
|
|
3615
3615
|
};
|
|
3616
3616
|
|
|
3617
|
-
var game = {
|
|
3617
|
+
var game$1 = {
|
|
3618
3618
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3619
3619
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
3620
3620
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
@@ -3934,7 +3934,7 @@ var form = {
|
|
|
3934
3934
|
upload: (formData) => ({ url: 'upload', method: 'post', params: formData, isFormData: true }),
|
|
3935
3935
|
};
|
|
3936
3936
|
|
|
3937
|
-
var index$2 = { activity: api, auth: auth$1, common: common$1, game, mailbox, payment, user, form };
|
|
3937
|
+
var index$2 = { activity: api, auth: auth$1, common: common$1, game: game$1, mailbox, payment, user, form };
|
|
3938
3938
|
|
|
3939
3939
|
/*! *****************************************************************************
|
|
3940
3940
|
Copyright (c) Microsoft Corporation.
|
|
@@ -17154,13 +17154,672 @@ function error () {
|
|
|
17154
17154
|
)
|
|
17155
17155
|
}
|
|
17156
17156
|
|
|
17157
|
+
// const UAParser = require('ua-parser-js')
|
|
17158
|
+
|
|
17159
|
+
function game (request) {
|
|
17160
|
+
return createMachine(
|
|
17161
|
+
{
|
|
17162
|
+
id: 'game',
|
|
17163
|
+
type: 'parallel',
|
|
17164
|
+
context: {
|
|
17165
|
+
roomId: null,
|
|
17166
|
+
room: null,
|
|
17167
|
+
list: [],
|
|
17168
|
+
gameList: [],
|
|
17169
|
+
// play params
|
|
17170
|
+
game: {
|
|
17171
|
+
provider: null,
|
|
17172
|
+
game_id: null,
|
|
17173
|
+
game_type: null,
|
|
17174
|
+
mapping_id: null,
|
|
17175
|
+
portrait: null,
|
|
17176
|
+
},
|
|
17177
|
+
lang: 'en_US',
|
|
17178
|
+
isMobile: new UAParser().getResult().device.type,
|
|
17179
|
+
gameURL: null,
|
|
17180
|
+
// game database
|
|
17181
|
+
sha: {
|
|
17182
|
+
category: null,
|
|
17183
|
+
status: null,
|
|
17184
|
+
},
|
|
17185
|
+
isCategoryChanged: false,
|
|
17186
|
+
isStatusChanged: false,
|
|
17187
|
+
statusMap: {},
|
|
17188
|
+
optionMap: {},
|
|
17189
|
+
},
|
|
17190
|
+
states: {
|
|
17191
|
+
flow: {
|
|
17192
|
+
initial: 'idle',
|
|
17193
|
+
states: {
|
|
17194
|
+
idle: {
|
|
17195
|
+
enter: 'clearGameInfo',
|
|
17196
|
+
on: {
|
|
17197
|
+
SET_ROOM: {
|
|
17198
|
+
target: 'loading',
|
|
17199
|
+
actions: 'setRoom',
|
|
17200
|
+
cond: (context, event) => {
|
|
17201
|
+
return context.room?.id !== event.data?.id
|
|
17202
|
+
},
|
|
17203
|
+
},
|
|
17204
|
+
ENTER_GAME: {
|
|
17205
|
+
target: 'connecting',
|
|
17206
|
+
actions: ['setGameInfo', 'setLang'],
|
|
17207
|
+
},
|
|
17208
|
+
},
|
|
17209
|
+
},
|
|
17210
|
+
loading: {
|
|
17211
|
+
invoke: {
|
|
17212
|
+
src: 'getRoomItems',
|
|
17213
|
+
onDone: {
|
|
17214
|
+
target: 'idle',
|
|
17215
|
+
actions: 'setList',
|
|
17216
|
+
},
|
|
17217
|
+
onError: {
|
|
17218
|
+
target: 'idle',
|
|
17219
|
+
actions: assign({ list: [] }),
|
|
17220
|
+
},
|
|
17221
|
+
},
|
|
17222
|
+
},
|
|
17223
|
+
connecting: {
|
|
17224
|
+
invoke: {
|
|
17225
|
+
src: 'connectGame',
|
|
17226
|
+
onDone: {
|
|
17227
|
+
target: 'playing',
|
|
17228
|
+
actions: 'setGameURL',
|
|
17229
|
+
},
|
|
17230
|
+
onError: {
|
|
17231
|
+
target: 'idle',
|
|
17232
|
+
},
|
|
17233
|
+
},
|
|
17234
|
+
},
|
|
17235
|
+
playing: {
|
|
17236
|
+
on: {
|
|
17237
|
+
EXIT_GAME: {
|
|
17238
|
+
target: 'disconnect',
|
|
17239
|
+
},
|
|
17240
|
+
},
|
|
17241
|
+
},
|
|
17242
|
+
disconnect: {
|
|
17243
|
+
invoke: {
|
|
17244
|
+
src: 'disconnectGame',
|
|
17245
|
+
onDone: {
|
|
17246
|
+
target: 'idle',
|
|
17247
|
+
},
|
|
17248
|
+
onError: {
|
|
17249
|
+
target: 'idle',
|
|
17250
|
+
},
|
|
17251
|
+
},
|
|
17252
|
+
},
|
|
17253
|
+
},
|
|
17254
|
+
},
|
|
17255
|
+
timer: {
|
|
17256
|
+
initial: 'fetchingGameSHA',
|
|
17257
|
+
states: {
|
|
17258
|
+
fetchingGameSHA: {
|
|
17259
|
+
invoke: {
|
|
17260
|
+
src: 'fetchGameSHA',
|
|
17261
|
+
onDone: {
|
|
17262
|
+
target: 'checking',
|
|
17263
|
+
actions: 'setGameSHA',
|
|
17264
|
+
},
|
|
17265
|
+
onError: {
|
|
17266
|
+
target: 'pending',
|
|
17267
|
+
},
|
|
17268
|
+
},
|
|
17269
|
+
},
|
|
17270
|
+
checking: {
|
|
17271
|
+
always: [
|
|
17272
|
+
{ target: 'updatingStatus', cond: 'isStatusChanged' },
|
|
17273
|
+
{ target: 'updatingCategory', cond: 'isCategoryChanged' },
|
|
17274
|
+
{ target: 'pending' },
|
|
17275
|
+
],
|
|
17276
|
+
},
|
|
17277
|
+
updatingStatus: {
|
|
17278
|
+
invoke: {
|
|
17279
|
+
src: 'fetchStatus',
|
|
17280
|
+
onDone: {
|
|
17281
|
+
target: 'updatingOption',
|
|
17282
|
+
actions: ['setStatus'],
|
|
17283
|
+
},
|
|
17284
|
+
onError: {
|
|
17285
|
+
target: 'pending',
|
|
17286
|
+
},
|
|
17287
|
+
},
|
|
17288
|
+
},
|
|
17289
|
+
updatingOption: {
|
|
17290
|
+
invoke: {
|
|
17291
|
+
src: 'fetchOption',
|
|
17292
|
+
onDone: {
|
|
17293
|
+
target: 'updatingCategory',
|
|
17294
|
+
actions: 'mergeOption',
|
|
17295
|
+
},
|
|
17296
|
+
onError: {
|
|
17297
|
+
target: 'pending',
|
|
17298
|
+
},
|
|
17299
|
+
},
|
|
17300
|
+
},
|
|
17301
|
+
updatingCategory: {
|
|
17302
|
+
invoke: {
|
|
17303
|
+
src: 'getRoomItems',
|
|
17304
|
+
onDone: {
|
|
17305
|
+
target: 'pending',
|
|
17306
|
+
actions: 'setList',
|
|
17307
|
+
},
|
|
17308
|
+
onError: {
|
|
17309
|
+
target: 'pending',
|
|
17310
|
+
},
|
|
17311
|
+
},
|
|
17312
|
+
},
|
|
17313
|
+
pending: {
|
|
17314
|
+
after: {
|
|
17315
|
+
20000: {
|
|
17316
|
+
target: 'fetchingGameSHA',
|
|
17317
|
+
},
|
|
17318
|
+
},
|
|
17319
|
+
},
|
|
17320
|
+
},
|
|
17321
|
+
},
|
|
17322
|
+
},
|
|
17323
|
+
},
|
|
17324
|
+
{
|
|
17325
|
+
actions: {
|
|
17326
|
+
setRoomId: assign((context, event) => {
|
|
17327
|
+
return { roomId: event.roomId }
|
|
17328
|
+
}),
|
|
17329
|
+
setRoom: assign((context, event) => {
|
|
17330
|
+
return {
|
|
17331
|
+
room: event.data,
|
|
17332
|
+
roomId: event.data.id,
|
|
17333
|
+
}
|
|
17334
|
+
}),
|
|
17335
|
+
setList: assign((context, event) => {
|
|
17336
|
+
const { statusMap, optionMap } = context;
|
|
17337
|
+
const { list = [] } = event.data;
|
|
17338
|
+
const gameList = list
|
|
17339
|
+
.map((item) => {
|
|
17340
|
+
if (item.id) {
|
|
17341
|
+
item.room = true;
|
|
17342
|
+
return item
|
|
17343
|
+
}
|
|
17344
|
+
|
|
17345
|
+
const code = item.g;
|
|
17346
|
+
if (!code || !optionMap[code]) {
|
|
17347
|
+
return
|
|
17348
|
+
}
|
|
17349
|
+
|
|
17350
|
+
return {
|
|
17351
|
+
...optionMap[code],
|
|
17352
|
+
code,
|
|
17353
|
+
system_enable: statusMap[code][0],
|
|
17354
|
+
}
|
|
17355
|
+
})
|
|
17356
|
+
.filter((item) => item && !item.header)
|
|
17357
|
+
.sort((a, b) => a.system_enable - b.system_enable);
|
|
17358
|
+
return { list, gameList }
|
|
17359
|
+
}),
|
|
17360
|
+
setGameURL: assign({
|
|
17361
|
+
gameURL: (context, event) => {
|
|
17362
|
+
return event.data.gameURL
|
|
17363
|
+
},
|
|
17364
|
+
}),
|
|
17365
|
+
clearGameInfo: assign((context, event) => {
|
|
17366
|
+
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
17367
|
+
}),
|
|
17368
|
+
setGameInfo: assign((context, event) => {
|
|
17369
|
+
const { provider, game_id, game_type, mapping_id, portrait } = event.data.game;
|
|
17370
|
+
return { game: { provider, game_id, game_type, mapping_id, portrait } }
|
|
17371
|
+
}),
|
|
17372
|
+
setLang: assign((context, event) => {
|
|
17373
|
+
const lang = event.data.locale.replace('-', '_');
|
|
17374
|
+
return { lang }
|
|
17375
|
+
}),
|
|
17376
|
+
setGameSHA: assign((context, event) => {
|
|
17377
|
+
const { sha } = context;
|
|
17378
|
+
const newSha = event.data;
|
|
17379
|
+
return {
|
|
17380
|
+
sha: newSha,
|
|
17381
|
+
isCategoryChanged: !sha.category || sha.category !== newSha.category,
|
|
17382
|
+
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17383
|
+
}
|
|
17384
|
+
}),
|
|
17385
|
+
setStatus: assign((context, event) => {
|
|
17386
|
+
return {
|
|
17387
|
+
statusMap: event.data,
|
|
17388
|
+
}
|
|
17389
|
+
}),
|
|
17390
|
+
mergeOption: assign((context, event) => {
|
|
17391
|
+
const { optionMap } = context;
|
|
17392
|
+
return {
|
|
17393
|
+
optionMap: { ...optionMap, ...event.data },
|
|
17394
|
+
}
|
|
17395
|
+
}),
|
|
17396
|
+
},
|
|
17397
|
+
guards: {
|
|
17398
|
+
isCategoryChanged: (context, event) => context.isCategoryChanged,
|
|
17399
|
+
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17400
|
+
},
|
|
17401
|
+
services: {
|
|
17402
|
+
getRoomItems: async (context, event) => {
|
|
17403
|
+
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
17404
|
+
},
|
|
17405
|
+
connectGame: async (context, event) => {
|
|
17406
|
+
const { lang, isMobile } = context;
|
|
17407
|
+
const { provider, game_id, game_type, mapping_id } = context.game;
|
|
17408
|
+
const params = {
|
|
17409
|
+
provider_id: provider,
|
|
17410
|
+
game_id: game_id,
|
|
17411
|
+
gametype_id: game_type,
|
|
17412
|
+
mapping_id: mapping_id,
|
|
17413
|
+
is_demo: false,
|
|
17414
|
+
is_mobile: isMobile,
|
|
17415
|
+
lang,
|
|
17416
|
+
return_url: window.location.href,
|
|
17417
|
+
};
|
|
17418
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17419
|
+
return { gameURL: redirect_url }
|
|
17420
|
+
},
|
|
17421
|
+
disconnectGame: async (context, event) => {
|
|
17422
|
+
const uid_site = event.data;
|
|
17423
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id: context.game.provider }))
|
|
17424
|
+
},
|
|
17425
|
+
fetchOption: async (context, event) => {
|
|
17426
|
+
return await request.send(game$1.getOptionMap())
|
|
17427
|
+
},
|
|
17428
|
+
fetchGameSHA: async (context, event) => {
|
|
17429
|
+
return await request.send(game$1.getGameSHA())
|
|
17430
|
+
},
|
|
17431
|
+
fetchStatus: async (context, event) => {
|
|
17432
|
+
return await request.send(game$1.getGameStatus())
|
|
17433
|
+
},
|
|
17434
|
+
},
|
|
17435
|
+
}
|
|
17436
|
+
)
|
|
17437
|
+
}
|
|
17438
|
+
|
|
17157
17439
|
const MY_FAVORITE = 'MyFavorite';
|
|
17158
17440
|
const GAME_SEARCH = 'GameSearch';
|
|
17159
17441
|
|
|
17160
|
-
var constant = /*#__PURE__*/Object.freeze({
|
|
17161
|
-
__proto__: null,
|
|
17162
|
-
MY_FAVORITE: MY_FAVORITE,
|
|
17163
|
-
GAME_SEARCH: GAME_SEARCH
|
|
17442
|
+
var constant = /*#__PURE__*/Object.freeze({
|
|
17443
|
+
__proto__: null,
|
|
17444
|
+
MY_FAVORITE: MY_FAVORITE,
|
|
17445
|
+
GAME_SEARCH: GAME_SEARCH
|
|
17446
|
+
});
|
|
17447
|
+
|
|
17448
|
+
function game_v2 (request) {
|
|
17449
|
+
return createMachine(
|
|
17450
|
+
{
|
|
17451
|
+
id: 'game',
|
|
17452
|
+
type: 'parallel',
|
|
17453
|
+
context: {
|
|
17454
|
+
room: null,
|
|
17455
|
+
index: 0,
|
|
17456
|
+
content: {
|
|
17457
|
+
data: [],
|
|
17458
|
+
timestamp: null,
|
|
17459
|
+
parentCategoryId: null,
|
|
17460
|
+
totalPage: 1,
|
|
17461
|
+
},
|
|
17462
|
+
addition: {
|
|
17463
|
+
data: [],
|
|
17464
|
+
timestamp: null,
|
|
17465
|
+
totalPage: 1,
|
|
17466
|
+
},
|
|
17467
|
+
// play params
|
|
17468
|
+
game: {
|
|
17469
|
+
providerId: null,
|
|
17470
|
+
gameId: null,
|
|
17471
|
+
gameTypeId: null,
|
|
17472
|
+
mappingId: null,
|
|
17473
|
+
portrait: null,
|
|
17474
|
+
},
|
|
17475
|
+
lang: 'en_US',
|
|
17476
|
+
isMobile: new UAParser().getResult().device.type,
|
|
17477
|
+
gameURL: null,
|
|
17478
|
+
...oldContext$1,
|
|
17479
|
+
},
|
|
17480
|
+
states: {
|
|
17481
|
+
flow: {
|
|
17482
|
+
initial: 'idle',
|
|
17483
|
+
states: {
|
|
17484
|
+
idle: {
|
|
17485
|
+
enter: 'clearGameInfo',
|
|
17486
|
+
on: {
|
|
17487
|
+
ENTER_ROOM: {
|
|
17488
|
+
target: 'loading',
|
|
17489
|
+
cond: 'isDifferentRoom',
|
|
17490
|
+
actions: ['setRoom', 'resetContent'],
|
|
17491
|
+
},
|
|
17492
|
+
NEXT_PAGE: {
|
|
17493
|
+
target: 'loading',
|
|
17494
|
+
cond: 'hasNext',
|
|
17495
|
+
actions: 'increaseIndex',
|
|
17496
|
+
},
|
|
17497
|
+
ENTER_GAME: {
|
|
17498
|
+
target: 'connecting',
|
|
17499
|
+
actions: ['setGameInfo', 'setLang'],
|
|
17500
|
+
},
|
|
17501
|
+
},
|
|
17502
|
+
},
|
|
17503
|
+
loading: {
|
|
17504
|
+
invoke: {
|
|
17505
|
+
src: 'getPageContent',
|
|
17506
|
+
onDone: {
|
|
17507
|
+
target: 'idle',
|
|
17508
|
+
actions: 'appendContent',
|
|
17509
|
+
},
|
|
17510
|
+
onError: {
|
|
17511
|
+
target: 'idle',
|
|
17512
|
+
},
|
|
17513
|
+
},
|
|
17514
|
+
},
|
|
17515
|
+
connecting: {
|
|
17516
|
+
invoke: {
|
|
17517
|
+
src: 'connectGame',
|
|
17518
|
+
onDone: {
|
|
17519
|
+
target: 'playing',
|
|
17520
|
+
actions: 'setGameURL',
|
|
17521
|
+
},
|
|
17522
|
+
onError: {
|
|
17523
|
+
target: 'idle',
|
|
17524
|
+
},
|
|
17525
|
+
},
|
|
17526
|
+
},
|
|
17527
|
+
playing: {
|
|
17528
|
+
on: {
|
|
17529
|
+
EXIT_GAME: {
|
|
17530
|
+
target: 'disconnect',
|
|
17531
|
+
},
|
|
17532
|
+
},
|
|
17533
|
+
},
|
|
17534
|
+
disconnect: {
|
|
17535
|
+
invoke: {
|
|
17536
|
+
src: 'disconnectGame',
|
|
17537
|
+
onDone: {
|
|
17538
|
+
target: 'idle',
|
|
17539
|
+
},
|
|
17540
|
+
onError: {
|
|
17541
|
+
target: 'idle',
|
|
17542
|
+
},
|
|
17543
|
+
},
|
|
17544
|
+
},
|
|
17545
|
+
},
|
|
17546
|
+
},
|
|
17547
|
+
timer: {
|
|
17548
|
+
initial: 'pending',
|
|
17549
|
+
states: {
|
|
17550
|
+
pending: {
|
|
17551
|
+
after: {
|
|
17552
|
+
20000: [
|
|
17553
|
+
{
|
|
17554
|
+
target: 'updating',
|
|
17555
|
+
cond: 'hasRoom',
|
|
17556
|
+
},
|
|
17557
|
+
{
|
|
17558
|
+
target: 'pending',
|
|
17559
|
+
},
|
|
17560
|
+
],
|
|
17561
|
+
},
|
|
17562
|
+
},
|
|
17563
|
+
updating: {
|
|
17564
|
+
invoke: {
|
|
17565
|
+
src: 'updatePageContent',
|
|
17566
|
+
onDone: {
|
|
17567
|
+
target: 'pending',
|
|
17568
|
+
actions: 'swapContent',
|
|
17569
|
+
},
|
|
17570
|
+
onError: {
|
|
17571
|
+
target: 'pending',
|
|
17572
|
+
},
|
|
17573
|
+
},
|
|
17574
|
+
},
|
|
17575
|
+
},
|
|
17576
|
+
},
|
|
17577
|
+
oldTimer: {
|
|
17578
|
+
initial: 'fetchingGameSHA',
|
|
17579
|
+
states: {
|
|
17580
|
+
fetchingGameSHA: {
|
|
17581
|
+
invoke: {
|
|
17582
|
+
src: 'fetchGameSHA',
|
|
17583
|
+
onDone: {
|
|
17584
|
+
target: 'checking',
|
|
17585
|
+
actions: 'setGameSHA',
|
|
17586
|
+
},
|
|
17587
|
+
onError: {
|
|
17588
|
+
target: 'pending',
|
|
17589
|
+
},
|
|
17590
|
+
},
|
|
17591
|
+
},
|
|
17592
|
+
checking: {
|
|
17593
|
+
always: [{ target: 'updatingStatus', cond: 'isStatusChanged' }, { target: 'pending' }],
|
|
17594
|
+
},
|
|
17595
|
+
updatingStatus: {
|
|
17596
|
+
invoke: {
|
|
17597
|
+
src: 'fetchStatus',
|
|
17598
|
+
onDone: {
|
|
17599
|
+
target: 'updatingOption',
|
|
17600
|
+
actions: ['setStatus'],
|
|
17601
|
+
},
|
|
17602
|
+
onError: {
|
|
17603
|
+
target: 'pending',
|
|
17604
|
+
},
|
|
17605
|
+
},
|
|
17606
|
+
},
|
|
17607
|
+
updatingOption: {
|
|
17608
|
+
invoke: {
|
|
17609
|
+
src: 'fetchOption',
|
|
17610
|
+
onDone: {
|
|
17611
|
+
target: 'pending',
|
|
17612
|
+
actions: 'mergeOption',
|
|
17613
|
+
},
|
|
17614
|
+
onError: {
|
|
17615
|
+
target: 'pending',
|
|
17616
|
+
},
|
|
17617
|
+
},
|
|
17618
|
+
},
|
|
17619
|
+
pending: {
|
|
17620
|
+
after: {
|
|
17621
|
+
20000: {
|
|
17622
|
+
target: 'fetchingGameSHA',
|
|
17623
|
+
},
|
|
17624
|
+
},
|
|
17625
|
+
},
|
|
17626
|
+
},
|
|
17627
|
+
},
|
|
17628
|
+
},
|
|
17629
|
+
},
|
|
17630
|
+
{
|
|
17631
|
+
actions: {
|
|
17632
|
+
setFavoriteList: assign((context, event) => {
|
|
17633
|
+
return {
|
|
17634
|
+
favoriteList: event.data.data || [],
|
|
17635
|
+
}
|
|
17636
|
+
}),
|
|
17637
|
+
setRoom: assign((context, event) => {
|
|
17638
|
+
return {
|
|
17639
|
+
room: event.data,
|
|
17640
|
+
}
|
|
17641
|
+
}),
|
|
17642
|
+
resetContent: assign((context, event) => {
|
|
17643
|
+
return {
|
|
17644
|
+
index: 0,
|
|
17645
|
+
content: {
|
|
17646
|
+
data: [],
|
|
17647
|
+
timestamp: null,
|
|
17648
|
+
parentCategoryId: null,
|
|
17649
|
+
totalPage: 1,
|
|
17650
|
+
},
|
|
17651
|
+
addition: {
|
|
17652
|
+
data: [],
|
|
17653
|
+
timestamp: null,
|
|
17654
|
+
totalPage: 1,
|
|
17655
|
+
},
|
|
17656
|
+
}
|
|
17657
|
+
}),
|
|
17658
|
+
appendContent: assign((context, event) => {
|
|
17659
|
+
const { room, favoriteList } = context;
|
|
17660
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17661
|
+
return
|
|
17662
|
+
} else {
|
|
17663
|
+
const [content, addition] = event.data;
|
|
17664
|
+
return {
|
|
17665
|
+
content: {
|
|
17666
|
+
...context.content,
|
|
17667
|
+
...content,
|
|
17668
|
+
data: context.content.data.concat(content.data),
|
|
17669
|
+
},
|
|
17670
|
+
addition: {
|
|
17671
|
+
...context.addition,
|
|
17672
|
+
...addition,
|
|
17673
|
+
data: context.addition.data.concat(addition.data),
|
|
17674
|
+
},
|
|
17675
|
+
}
|
|
17676
|
+
}
|
|
17677
|
+
}),
|
|
17678
|
+
swapContent: assign((context, event) => {
|
|
17679
|
+
const [content, addition] = event.data;
|
|
17680
|
+
let result = {};
|
|
17681
|
+
if (content?.data?.length) {
|
|
17682
|
+
result.content = content;
|
|
17683
|
+
}
|
|
17684
|
+
if (addition?.data?.length) {
|
|
17685
|
+
result.addition = addition;
|
|
17686
|
+
}
|
|
17687
|
+
return result
|
|
17688
|
+
}),
|
|
17689
|
+
increaseIndex: assign((context, event) => {
|
|
17690
|
+
return {
|
|
17691
|
+
index: context.index + 1,
|
|
17692
|
+
}
|
|
17693
|
+
}),
|
|
17694
|
+
setGameURL: assign({
|
|
17695
|
+
gameURL: (context, event) => {
|
|
17696
|
+
return event.data.gameURL
|
|
17697
|
+
},
|
|
17698
|
+
}),
|
|
17699
|
+
clearGameInfo: assign((context, event) => {
|
|
17700
|
+
return { game: { providerId: null, gameId: null, gameTypeId: null, mappingId: null } }
|
|
17701
|
+
}),
|
|
17702
|
+
setGameInfo: assign((context, event) => {
|
|
17703
|
+
const { providerId, gameId, gameTypeId, mappingId, portrait } = event.data.game;
|
|
17704
|
+
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0 } }
|
|
17705
|
+
}),
|
|
17706
|
+
setLang: assign((context, event) => {
|
|
17707
|
+
const lang = event.data.locale.replace('-', '_');
|
|
17708
|
+
return { lang }
|
|
17709
|
+
}),
|
|
17710
|
+
...oldActions$1,
|
|
17711
|
+
},
|
|
17712
|
+
guards: {
|
|
17713
|
+
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
17714
|
+
hasNext: (context, event) => context.index < context?.content?.totalPage - 1,
|
|
17715
|
+
hasRoom: (context, event) => context.room?.categoryId,
|
|
17716
|
+
...oldGuards$1,
|
|
17717
|
+
},
|
|
17718
|
+
services: {
|
|
17719
|
+
getPageContent: async (context, event) => {
|
|
17720
|
+
const { room, index } = context;
|
|
17721
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17722
|
+
return
|
|
17723
|
+
} else {
|
|
17724
|
+
const param = { categoryId: room.categoryId, index };
|
|
17725
|
+
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17726
|
+
}
|
|
17727
|
+
},
|
|
17728
|
+
updatePageContent: async (context, event) => {
|
|
17729
|
+
const { room, content, index } = context;
|
|
17730
|
+
if (room.categoryId === GAME_SEARCH) {
|
|
17731
|
+
return
|
|
17732
|
+
} else {
|
|
17733
|
+
return await Promise.all([
|
|
17734
|
+
request.send(
|
|
17735
|
+
game$1.getListCategoryByRange({
|
|
17736
|
+
categoryId: room.categoryId,
|
|
17737
|
+
end: index,
|
|
17738
|
+
timestamp: content.timestamp,
|
|
17739
|
+
})
|
|
17740
|
+
),
|
|
17741
|
+
request.send(
|
|
17742
|
+
game$1.getListAdditionByRange({
|
|
17743
|
+
categoryId: room.categoryId,
|
|
17744
|
+
end: index,
|
|
17745
|
+
timestamp: content.timestamp,
|
|
17746
|
+
})
|
|
17747
|
+
),
|
|
17748
|
+
])
|
|
17749
|
+
}
|
|
17750
|
+
},
|
|
17751
|
+
connectGame: async (context, event) => {
|
|
17752
|
+
const { lang, isMobile } = context;
|
|
17753
|
+
const { providerId, gameId, gameTypeId, mappingId } = context.game;
|
|
17754
|
+
const params = {
|
|
17755
|
+
provider_id: providerId,
|
|
17756
|
+
game_id: gameId,
|
|
17757
|
+
gametype_id: gameTypeId,
|
|
17758
|
+
mapping_id: mappingId,
|
|
17759
|
+
is_demo: false,
|
|
17760
|
+
is_mobile: isMobile,
|
|
17761
|
+
lang,
|
|
17762
|
+
return_url: window.location.href,
|
|
17763
|
+
};
|
|
17764
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17765
|
+
return { gameURL: redirect_url }
|
|
17766
|
+
},
|
|
17767
|
+
disconnectGame: async (context, event) => {
|
|
17768
|
+
const uid_site = event.data;
|
|
17769
|
+
const provider_id = context.game.providerId;
|
|
17770
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17771
|
+
},
|
|
17772
|
+
...oldServices$1(request),
|
|
17773
|
+
},
|
|
17774
|
+
}
|
|
17775
|
+
)
|
|
17776
|
+
}
|
|
17777
|
+
|
|
17778
|
+
const oldContext$1 = {
|
|
17779
|
+
sha: {
|
|
17780
|
+
status: null,
|
|
17781
|
+
},
|
|
17782
|
+
isStatusChanged: false,
|
|
17783
|
+
statusMap: {},
|
|
17784
|
+
optionMap: {},
|
|
17785
|
+
};
|
|
17786
|
+
|
|
17787
|
+
const oldActions$1 = {
|
|
17788
|
+
setGameSHA: assign((context, event) => {
|
|
17789
|
+
const { sha } = context;
|
|
17790
|
+
const newSha = event.data;
|
|
17791
|
+
return {
|
|
17792
|
+
sha: newSha,
|
|
17793
|
+
isStatusChanged: !sha.status || sha.status !== newSha.status,
|
|
17794
|
+
}
|
|
17795
|
+
}),
|
|
17796
|
+
setStatus: assign((context, event) => {
|
|
17797
|
+
return {
|
|
17798
|
+
statusMap: event.data,
|
|
17799
|
+
}
|
|
17800
|
+
}),
|
|
17801
|
+
mergeOption: assign((context, event) => {
|
|
17802
|
+
const { optionMap } = context;
|
|
17803
|
+
return {
|
|
17804
|
+
optionMap: { ...optionMap, ...event.data },
|
|
17805
|
+
}
|
|
17806
|
+
}),
|
|
17807
|
+
};
|
|
17808
|
+
|
|
17809
|
+
const oldGuards$1 = {
|
|
17810
|
+
isStatusChanged: (context, event) => context.isStatusChanged,
|
|
17811
|
+
};
|
|
17812
|
+
|
|
17813
|
+
const oldServices$1 = (request) => ({
|
|
17814
|
+
fetchOption: async (context, event) => {
|
|
17815
|
+
return await request.send(game$1.getOptionMap())
|
|
17816
|
+
},
|
|
17817
|
+
fetchGameSHA: async (context, event) => {
|
|
17818
|
+
return await request.send(game$1.getGameSHA())
|
|
17819
|
+
},
|
|
17820
|
+
fetchStatus: async (context, event) => {
|
|
17821
|
+
return await request.send(game$1.getGameStatus())
|
|
17822
|
+
},
|
|
17164
17823
|
});
|
|
17165
17824
|
|
|
17166
17825
|
// 對應 intersectionObserver 版本
|
|
@@ -17186,7 +17845,6 @@ function game_v2_1 (request) {
|
|
|
17186
17845
|
timestamp: null,
|
|
17187
17846
|
totalPage: 0,
|
|
17188
17847
|
},
|
|
17189
|
-
staticData: [],
|
|
17190
17848
|
// play params
|
|
17191
17849
|
game: {
|
|
17192
17850
|
providerId: null,
|
|
@@ -17207,9 +17865,6 @@ function game_v2_1 (request) {
|
|
|
17207
17865
|
idle: {
|
|
17208
17866
|
enter: 'clearGameInfo',
|
|
17209
17867
|
on: {
|
|
17210
|
-
SET_STATIC_DATA: {
|
|
17211
|
-
actions: 'setStaticData',
|
|
17212
|
-
},
|
|
17213
17868
|
SET_ADDITION_ENABLE: {
|
|
17214
17869
|
actions: 'setAdditionEnable',
|
|
17215
17870
|
},
|
|
@@ -17369,11 +18024,6 @@ function game_v2_1 (request) {
|
|
|
17369
18024
|
},
|
|
17370
18025
|
{
|
|
17371
18026
|
actions: {
|
|
17372
|
-
setStaticData: assign((context, event) => {
|
|
17373
|
-
return {
|
|
17374
|
-
staticData: event.data,
|
|
17375
|
-
}
|
|
17376
|
-
}),
|
|
17377
18027
|
setAdditionEnable: assign((context, event) => {
|
|
17378
18028
|
return {
|
|
17379
18029
|
additionEnable: event.data,
|
|
@@ -17390,13 +18040,17 @@ function game_v2_1 (request) {
|
|
|
17390
18040
|
isLastPage: index >= content?.totalPage - 1,
|
|
17391
18041
|
}
|
|
17392
18042
|
}),
|
|
18043
|
+
setFavoriteList: assign((context, event) => {
|
|
18044
|
+
return {
|
|
18045
|
+
favoriteList: event.data.data || [],
|
|
18046
|
+
}
|
|
18047
|
+
}),
|
|
17393
18048
|
setRoom: assign((context, event) => {
|
|
17394
18049
|
return {
|
|
17395
18050
|
room: event.data,
|
|
17396
18051
|
}
|
|
17397
18052
|
}),
|
|
17398
18053
|
resetContent: assign((context, event) => {
|
|
17399
|
-
console.log('resetContent');
|
|
17400
18054
|
return {
|
|
17401
18055
|
loadable: false,
|
|
17402
18056
|
isLastPage: false,
|
|
@@ -17488,44 +18142,32 @@ function game_v2_1 (request) {
|
|
|
17488
18142
|
},
|
|
17489
18143
|
services: {
|
|
17490
18144
|
getPageContent: async (context, event) => {
|
|
17491
|
-
const { room, index, additionEnable
|
|
18145
|
+
const { room, index, additionEnable } = context;
|
|
17492
18146
|
if (room.categoryId === GAME_SEARCH) {
|
|
17493
18147
|
return
|
|
17494
|
-
} else if (!request.getToken()) {
|
|
17495
|
-
const list = staticData.find((data) => data.category == room.categoryId)?.info || [];
|
|
17496
|
-
|
|
17497
|
-
return [
|
|
17498
|
-
{
|
|
17499
|
-
data: list.slice(index * 20, (index + 1) * 20),
|
|
17500
|
-
totalPage: Math.ceil(list.length / 20),
|
|
17501
|
-
timestamp: Math.floor(Date.now() / 1000),
|
|
17502
|
-
},
|
|
17503
|
-
]
|
|
17504
18148
|
} else if (additionEnable) {
|
|
17505
18149
|
const param = { categoryId: room.categoryId, index };
|
|
17506
|
-
return await Promise.all([request.send(game.getListCategory(param)), request.send(game.getListAddition(param))])
|
|
18150
|
+
return await Promise.all([request.send(game$1.getListCategory(param)), request.send(game$1.getListAddition(param))])
|
|
17507
18151
|
} else {
|
|
17508
18152
|
const param = { categoryId: room.categoryId, index };
|
|
17509
|
-
return await Promise.all([request.send(game.getListCategory(param))])
|
|
18153
|
+
return await Promise.all([request.send(game$1.getListCategory(param))])
|
|
17510
18154
|
}
|
|
17511
18155
|
},
|
|
17512
18156
|
updatePageContent: async (context, event) => {
|
|
17513
18157
|
const { room, content, index, additionEnable } = context;
|
|
17514
18158
|
if (room.categoryId === GAME_SEARCH) {
|
|
17515
18159
|
return
|
|
17516
|
-
} else if (!request.getToken()) {
|
|
17517
|
-
return []
|
|
17518
18160
|
} else if (additionEnable) {
|
|
17519
18161
|
return await Promise.all([
|
|
17520
18162
|
request.send(
|
|
17521
|
-
game.getListCategoryByRange({
|
|
18163
|
+
game$1.getListCategoryByRange({
|
|
17522
18164
|
categoryId: room.categoryId,
|
|
17523
18165
|
end: index,
|
|
17524
18166
|
timestamp: content.timestamp,
|
|
17525
18167
|
})
|
|
17526
18168
|
),
|
|
17527
18169
|
request.send(
|
|
17528
|
-
game.getListAdditionByRange({
|
|
18170
|
+
game$1.getListAdditionByRange({
|
|
17529
18171
|
categoryId: room.categoryId,
|
|
17530
18172
|
end: index,
|
|
17531
18173
|
timestamp: content.timestamp,
|
|
@@ -17535,7 +18177,7 @@ function game_v2_1 (request) {
|
|
|
17535
18177
|
} else {
|
|
17536
18178
|
return await Promise.all([
|
|
17537
18179
|
request.send(
|
|
17538
|
-
game.getListCategoryByRange({
|
|
18180
|
+
game$1.getListCategoryByRange({
|
|
17539
18181
|
categoryId: room.categoryId,
|
|
17540
18182
|
end: index,
|
|
17541
18183
|
timestamp: content.timestamp,
|
|
@@ -17558,13 +18200,13 @@ function game_v2_1 (request) {
|
|
|
17558
18200
|
lang,
|
|
17559
18201
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}/return` : window.location.href, // For providers to return.
|
|
17560
18202
|
};
|
|
17561
|
-
const { redirect_url } = await request.send(game.playGame(params));
|
|
18203
|
+
const { redirect_url } = await request.send(game$1.playGame(params));
|
|
17562
18204
|
return { gameURL: redirect_url }
|
|
17563
18205
|
},
|
|
17564
18206
|
disconnectGame: async (context, event) => {
|
|
17565
18207
|
const uid_site = event.data;
|
|
17566
18208
|
const provider_id = context.game.providerId;
|
|
17567
|
-
return await request.send(game.logoutGame({ uid_site, provider_id }))
|
|
18209
|
+
return await request.send(game$1.logoutGame({ uid_site, provider_id }))
|
|
17568
18210
|
},
|
|
17569
18211
|
...oldServices(request),
|
|
17570
18212
|
},
|
|
@@ -17609,26 +18251,137 @@ const oldGuards = {
|
|
|
17609
18251
|
|
|
17610
18252
|
const oldServices = (request) => ({
|
|
17611
18253
|
fetchOption: async (context, event) => {
|
|
17612
|
-
|
|
17613
|
-
return await request.send(game.getOptionMap())
|
|
17614
|
-
}
|
|
18254
|
+
return await request.send(game$1.getOptionMap())
|
|
17615
18255
|
},
|
|
17616
18256
|
fetchGameSHA: async (context, event) => {
|
|
17617
|
-
|
|
17618
|
-
return await request.send(game.getGameSHA())
|
|
17619
|
-
} else {
|
|
17620
|
-
return {
|
|
17621
|
-
status: null,
|
|
17622
|
-
}
|
|
17623
|
-
}
|
|
18257
|
+
return await request.send(game$1.getGameSHA())
|
|
17624
18258
|
},
|
|
17625
18259
|
fetchStatus: async (context, event) => {
|
|
17626
|
-
|
|
17627
|
-
return await request.send(game.getGameStatus())
|
|
17628
|
-
}
|
|
18260
|
+
return await request.send(game$1.getGameStatus())
|
|
17629
18261
|
},
|
|
17630
18262
|
});
|
|
17631
18263
|
|
|
18264
|
+
function game_favorite (request) {
|
|
18265
|
+
return createMachine(
|
|
18266
|
+
{
|
|
18267
|
+
id: 'favorite',
|
|
18268
|
+
type: 'parallel',
|
|
18269
|
+
context: {
|
|
18270
|
+
list: [],
|
|
18271
|
+
},
|
|
18272
|
+
states: {
|
|
18273
|
+
fetching: {
|
|
18274
|
+
initial: 'disable',
|
|
18275
|
+
states: {
|
|
18276
|
+
disable: {},
|
|
18277
|
+
enable: {
|
|
18278
|
+
invoke: {
|
|
18279
|
+
src: 'fetchList',
|
|
18280
|
+
onDone: {
|
|
18281
|
+
actions: 'setList',
|
|
18282
|
+
},
|
|
18283
|
+
onError: {
|
|
18284
|
+
actions: assign({ list: [] }),
|
|
18285
|
+
},
|
|
18286
|
+
},
|
|
18287
|
+
},
|
|
18288
|
+
},
|
|
18289
|
+
},
|
|
18290
|
+
adding: {
|
|
18291
|
+
initial: 'disable',
|
|
18292
|
+
states: {
|
|
18293
|
+
disable: {},
|
|
18294
|
+
enable: {
|
|
18295
|
+
invoke: {
|
|
18296
|
+
src: 'add',
|
|
18297
|
+
onDone: {},
|
|
18298
|
+
onError: {
|
|
18299
|
+
actions: 'removeFromList',
|
|
18300
|
+
},
|
|
18301
|
+
},
|
|
18302
|
+
},
|
|
18303
|
+
},
|
|
18304
|
+
},
|
|
18305
|
+
removing: {
|
|
18306
|
+
initial: 'disable',
|
|
18307
|
+
states: {
|
|
18308
|
+
disable: {},
|
|
18309
|
+
enable: {
|
|
18310
|
+
invoke: {
|
|
18311
|
+
src: 'remove',
|
|
18312
|
+
onDone: {},
|
|
18313
|
+
onError: {
|
|
18314
|
+
actions: 'addToList',
|
|
18315
|
+
},
|
|
18316
|
+
},
|
|
18317
|
+
},
|
|
18318
|
+
},
|
|
18319
|
+
},
|
|
18320
|
+
},
|
|
18321
|
+
on: {
|
|
18322
|
+
FETCH_LIST: {
|
|
18323
|
+
target: 'fetching.enable',
|
|
18324
|
+
},
|
|
18325
|
+
ADD: {
|
|
18326
|
+
target: 'adding.enable',
|
|
18327
|
+
actions: 'addToList',
|
|
18328
|
+
cond: 'isNotExist',
|
|
18329
|
+
},
|
|
18330
|
+
REMOVE: {
|
|
18331
|
+
target: 'removing.enable',
|
|
18332
|
+
actions: 'removeFromList',
|
|
18333
|
+
cond: 'isExist',
|
|
18334
|
+
},
|
|
18335
|
+
},
|
|
18336
|
+
},
|
|
18337
|
+
{
|
|
18338
|
+
actions: {
|
|
18339
|
+
setList: assign((context, event) => {
|
|
18340
|
+
return {
|
|
18341
|
+
list: event.data,
|
|
18342
|
+
}
|
|
18343
|
+
}),
|
|
18344
|
+
addToList: assign((context, event) => {
|
|
18345
|
+
return {
|
|
18346
|
+
list: [...context.list, event.data],
|
|
18347
|
+
}
|
|
18348
|
+
}),
|
|
18349
|
+
removeFromList: assign((context, event) => {
|
|
18350
|
+
return {
|
|
18351
|
+
list: context.list.filter((item) => item !== event.data),
|
|
18352
|
+
}
|
|
18353
|
+
}),
|
|
18354
|
+
},
|
|
18355
|
+
guards: {
|
|
18356
|
+
isExist: (context, event) => context.list.includes(event.data),
|
|
18357
|
+
isNotExist: (context, event) => !context.list.includes(event.data),
|
|
18358
|
+
},
|
|
18359
|
+
services: {
|
|
18360
|
+
add: async (context, event) => {
|
|
18361
|
+
try {
|
|
18362
|
+
return await request.send(game$1.addFavoriteGame(event.data))
|
|
18363
|
+
} catch (error) {
|
|
18364
|
+
throw event.data
|
|
18365
|
+
}
|
|
18366
|
+
},
|
|
18367
|
+
remove: async (context, event) => {
|
|
18368
|
+
try {
|
|
18369
|
+
return await request.send(game$1.removeFavoriteGame(event.data))
|
|
18370
|
+
} catch (error) {
|
|
18371
|
+
throw event.data
|
|
18372
|
+
}
|
|
18373
|
+
},
|
|
18374
|
+
fetchList: async (context, event) => {
|
|
18375
|
+
const main = await request.send(game$1.getGameCategory({}));
|
|
18376
|
+
const room = main.list.find((item) => item.category === 'SYSTEM_MY_FAVORITE');
|
|
18377
|
+
const favorite = await request.send(game$1.getGameCategory({ id: room.id }));
|
|
18378
|
+
return favorite.list.map((item) => item.g)
|
|
18379
|
+
},
|
|
18380
|
+
},
|
|
18381
|
+
}
|
|
18382
|
+
)
|
|
18383
|
+
}
|
|
18384
|
+
|
|
17632
18385
|
function game_favorite_v2 (request) {
|
|
17633
18386
|
return createMachine(
|
|
17634
18387
|
{
|
|
@@ -17723,7 +18476,7 @@ function game_favorite_v2 (request) {
|
|
|
17723
18476
|
services: {
|
|
17724
18477
|
add: async (context, event) => {
|
|
17725
18478
|
try {
|
|
17726
|
-
await request.send(game.addListFavorite(event.data.gameCode));
|
|
18479
|
+
await request.send(game$1.addListFavorite(event.data.gameCode));
|
|
17727
18480
|
return event.data
|
|
17728
18481
|
} catch (error) {
|
|
17729
18482
|
throw event.data
|
|
@@ -17731,19 +18484,15 @@ function game_favorite_v2 (request) {
|
|
|
17731
18484
|
},
|
|
17732
18485
|
remove: async (context, event) => {
|
|
17733
18486
|
try {
|
|
17734
|
-
await request.send(game.removeListFavorite(event.data.gameCode));
|
|
18487
|
+
await request.send(game$1.removeListFavorite(event.data.gameCode));
|
|
17735
18488
|
return event.data
|
|
17736
18489
|
} catch (error) {
|
|
17737
18490
|
throw event.data
|
|
17738
18491
|
}
|
|
17739
18492
|
},
|
|
17740
18493
|
fetchList: async (context, event) => {
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
return data
|
|
17744
|
-
} else {
|
|
17745
|
-
return []
|
|
17746
|
-
}
|
|
18494
|
+
const { data } = await request.send(game$1.getListMyFavorite());
|
|
18495
|
+
return data
|
|
17747
18496
|
},
|
|
17748
18497
|
},
|
|
17749
18498
|
}
|
|
@@ -17975,17 +18724,17 @@ function game_search (request) {
|
|
|
17975
18724
|
services: {
|
|
17976
18725
|
fetchTags: async (context, event) => {
|
|
17977
18726
|
const { keyword } = context;
|
|
17978
|
-
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
18727
|
+
const { result } = await request.send(game$1.getGameTags({ q: keyword }));
|
|
17979
18728
|
return result
|
|
17980
18729
|
},
|
|
17981
18730
|
fetchGames: async (context, event) => {
|
|
17982
18731
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
17983
|
-
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18732
|
+
const { traceId, result } = await request.send(game$1.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
17984
18733
|
return { traceId, result }
|
|
17985
18734
|
},
|
|
17986
18735
|
sendTrace: async (context, event) => {
|
|
17987
18736
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context;
|
|
17988
|
-
return await request.send(game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
18737
|
+
return await request.send(game$1.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }))
|
|
17989
18738
|
},
|
|
17990
18739
|
},
|
|
17991
18740
|
}
|
|
@@ -18318,16 +19067,16 @@ function game_search_v2 (request) {
|
|
|
18318
19067
|
services: {
|
|
18319
19068
|
fetchTags: async (context, event) => {
|
|
18320
19069
|
const { keyword } = context;
|
|
18321
|
-
const { result } = await request.send(game.getGameTags({ q: keyword }));
|
|
19070
|
+
const { result } = await request.send(game$1.getGameTags({ q: keyword }));
|
|
18322
19071
|
return result
|
|
18323
19072
|
},
|
|
18324
19073
|
fetchInitialData: async (context, event) => {
|
|
18325
|
-
const data = await request.send(game.getGameSearchHome());
|
|
19074
|
+
const data = await request.send(game$1.getGameSearchHome());
|
|
18326
19075
|
return data
|
|
18327
19076
|
},
|
|
18328
19077
|
fetchGames: async (context, event) => {
|
|
18329
19078
|
const { tagId, tagIndex, keyword, click, clickDefault } = context;
|
|
18330
|
-
const { traceId, result } = await request.send(game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
19079
|
+
const { traceId, result } = await request.send(game$1.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault }));
|
|
18331
19080
|
return { traceId, result }
|
|
18332
19081
|
},
|
|
18333
19082
|
sendTrace: async (context, event) => {
|
|
@@ -18349,7 +19098,7 @@ function game_search_v2 (request) {
|
|
|
18349
19098
|
id = null;
|
|
18350
19099
|
}
|
|
18351
19100
|
return await request.send(
|
|
18352
|
-
game.setGameSearchTrace({
|
|
19101
|
+
game$1.setGameSearchTrace({
|
|
18353
19102
|
traceId,
|
|
18354
19103
|
tagId: id,
|
|
18355
19104
|
tagIndex,
|
|
@@ -18430,12 +19179,12 @@ function game_hot_new (request) {
|
|
|
18430
19179
|
},
|
|
18431
19180
|
services: {
|
|
18432
19181
|
getRoomItems: async (context, event) => {
|
|
18433
|
-
return await request.send(game.getGameCategory({ id: context.roomId }))
|
|
19182
|
+
return await request.send(game$1.getGameCategory({ id: context.roomId }))
|
|
18434
19183
|
},
|
|
18435
19184
|
getGames: async (context, event) => {
|
|
18436
19185
|
const [resHot, resNew] = await Promise.all([
|
|
18437
|
-
request.send(game.getGameCategory({ id: context.hot.id })),
|
|
18438
|
-
request.send(game.getGameCategory({ id: context.new.id })),
|
|
19186
|
+
request.send(game$1.getGameCategory({ id: context.hot.id })),
|
|
19187
|
+
request.send(game$1.getGameCategory({ id: context.new.id })),
|
|
18439
19188
|
]);
|
|
18440
19189
|
const hotGames = resHot?.list?.map?.((item) => item.g);
|
|
18441
19190
|
const newGames = resNew?.list?.map?.((item) => item.g);
|
|
@@ -19275,7 +20024,7 @@ function side (request) {
|
|
|
19275
20024
|
},
|
|
19276
20025
|
services: {
|
|
19277
20026
|
getRoomItems: async (context, event) => {
|
|
19278
|
-
return await request.send(game.getGameCategory({ id: context.room?.id }))
|
|
20027
|
+
return await request.send(game$1.getGameCategory({ id: context.room?.id }))
|
|
19279
20028
|
},
|
|
19280
20029
|
},
|
|
19281
20030
|
}
|
|
@@ -19439,10 +20188,10 @@ function side_v2 (request) {
|
|
|
19439
20188
|
},
|
|
19440
20189
|
services: {
|
|
19441
20190
|
getMenu: async (context, event) => {
|
|
19442
|
-
return await request.send(game.getListRoot())
|
|
20191
|
+
return await request.send(game$1.getListRoot())
|
|
19443
20192
|
},
|
|
19444
20193
|
fetchUpdateMenu: async (context, event) => {
|
|
19445
|
-
return await request.send(game.getListRoot({ timestamp: context.menu.timestamp }))
|
|
20194
|
+
return await request.send(game$1.getListRoot({ timestamp: context.menu.timestamp }))
|
|
19446
20195
|
},
|
|
19447
20196
|
},
|
|
19448
20197
|
}
|
|
@@ -27028,6 +27777,9 @@ var index$1 = {
|
|
|
27028
27777
|
common,
|
|
27029
27778
|
deposit,
|
|
27030
27779
|
error,
|
|
27780
|
+
game,
|
|
27781
|
+
game_v2,
|
|
27782
|
+
game_favorite,
|
|
27031
27783
|
game_favorite_v2,
|
|
27032
27784
|
game_search,
|
|
27033
27785
|
game_search_v2,
|
|
@@ -27081,8 +27833,8 @@ class Request {
|
|
|
27081
27833
|
this.axios.interceptors.request.use((axiosConfig) => {
|
|
27082
27834
|
axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version;
|
|
27083
27835
|
axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform;
|
|
27084
|
-
if (this.
|
|
27085
|
-
axiosConfig.headers.Authorization = this.
|
|
27836
|
+
if (storage.get(this.key)) {
|
|
27837
|
+
axiosConfig.headers.Authorization = storage.get(this.key);
|
|
27086
27838
|
}
|
|
27087
27839
|
return axiosConfig
|
|
27088
27840
|
});
|
|
@@ -27110,7 +27862,7 @@ class Request {
|
|
|
27110
27862
|
async send(req, customToken) {
|
|
27111
27863
|
try {
|
|
27112
27864
|
const cancelToken = customToken || this.source.token;
|
|
27113
|
-
this._checkToken(req);
|
|
27865
|
+
this._checkToken(req, storage.get(this.key));
|
|
27114
27866
|
const requestConfig = this._createConfig(req, cancelToken);
|
|
27115
27867
|
const { data } = await this.axios.request(requestConfig);
|
|
27116
27868
|
return data
|
|
@@ -27156,16 +27908,12 @@ class Request {
|
|
|
27156
27908
|
}
|
|
27157
27909
|
}
|
|
27158
27910
|
|
|
27159
|
-
_checkToken(req) {
|
|
27160
|
-
if (!req.isPublic && !
|
|
27911
|
+
_checkToken(req, token) {
|
|
27912
|
+
if (!req.isPublic && !token) {
|
|
27161
27913
|
console.error(req);
|
|
27162
27914
|
throw { code: 'ERR_A103', url: req.url }
|
|
27163
27915
|
}
|
|
27164
27916
|
}
|
|
27165
|
-
|
|
27166
|
-
getToken() {
|
|
27167
|
-
return storage.get(this.key)
|
|
27168
|
-
}
|
|
27169
27917
|
}
|
|
27170
27918
|
|
|
27171
27919
|
// const urljoin = require('url-join')
|