valtech-components 4.0.490 → 4.0.491
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/esm2022/lib/components/organisms/mini-games/chessimals-challenge-progress.service.mjs +24 -3
- package/esm2022/lib/components/organisms/mini-games/chessimals-game.component.mjs +17 -1
- package/esm2022/lib/components/organisms/mini-games/mini-games.i18n.mjs +65 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +104 -3
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/mini-games/chessimals-challenge-progress.service.d.ts +3 -0
- package/lib/components/organisms/mini-games/chessimals-game.component.d.ts +2 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
package/esm2022/lib/version.mjs
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Current version of valtech-components.
|
|
3
3
|
* This is automatically updated during the publish process.
|
|
4
4
|
*/
|
|
5
|
-
export const VERSION = '4.0.
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export const VERSION = '4.0.491';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUcsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDdXJyZW50IHZlcnNpb24gb2YgdmFsdGVjaC1jb21wb25lbnRzLlxuICogVGhpcyBpcyBhdXRvbWF0aWNhbGx5IHVwZGF0ZWQgZHVyaW5nIHRoZSBwdWJsaXNoIHByb2Nlc3MuXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gJzQuMC40OTEnO1xuIl19
|
|
@@ -59,7 +59,7 @@ import fixWebmDuration from 'fix-webm-duration';
|
|
|
59
59
|
* Current version of valtech-components.
|
|
60
60
|
* This is automatically updated during the publish process.
|
|
61
61
|
*/
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.491';
|
|
63
63
|
|
|
64
64
|
// Control de estado de refresco (singleton a nivel de módulo)
|
|
65
65
|
let isRefreshing = false;
|
|
@@ -62556,8 +62556,9 @@ class ChessimalsChallengeProgressService {
|
|
|
62556
62556
|
subscriber.next(this.readLocalActiveRun());
|
|
62557
62557
|
const unsubscribe = onSnapshot(activeQuery, (snapshot) => {
|
|
62558
62558
|
const run = snapshot.docs[0]?.data();
|
|
62559
|
-
this.
|
|
62560
|
-
|
|
62559
|
+
const next = this.newestActiveRun(this.readLocalActiveRun(), run);
|
|
62560
|
+
this.writeLocalActiveRun(next);
|
|
62561
|
+
subscriber.next(next);
|
|
62561
62562
|
}, () => subscriber.next(this.readLocalActiveRun()));
|
|
62562
62563
|
return unsubscribe;
|
|
62563
62564
|
});
|
|
@@ -62744,6 +62745,26 @@ class ChessimalsChallengeProgressService {
|
|
|
62744
62745
|
// Local persistence is only a refresh fallback.
|
|
62745
62746
|
}
|
|
62746
62747
|
}
|
|
62748
|
+
newestActiveRun(local, remote) {
|
|
62749
|
+
if (local?.status !== 'active')
|
|
62750
|
+
return remote?.status === 'active' ? remote : undefined;
|
|
62751
|
+
if (remote?.status !== 'active')
|
|
62752
|
+
return local;
|
|
62753
|
+
if (local.id !== remote.id)
|
|
62754
|
+
return this.runTime(local) >= this.runTime(remote) ? local : remote;
|
|
62755
|
+
if (this.runProgressScore(local) > this.runProgressScore(remote))
|
|
62756
|
+
return local;
|
|
62757
|
+
if (this.runProgressScore(remote) > this.runProgressScore(local))
|
|
62758
|
+
return remote;
|
|
62759
|
+
return this.runTime(local) >= this.runTime(remote) ? local : remote;
|
|
62760
|
+
}
|
|
62761
|
+
runProgressScore(run) {
|
|
62762
|
+
return run.currentRound * 100 + run.wins * 10 - run.losses;
|
|
62763
|
+
}
|
|
62764
|
+
runTime(run) {
|
|
62765
|
+
const value = Date.parse(run.updatedAt);
|
|
62766
|
+
return Number.isFinite(value) ? value : 0;
|
|
62767
|
+
}
|
|
62747
62768
|
withoutUndefined(value) {
|
|
62748
62769
|
return Object.entries(value).reduce((acc, [key, entry]) => {
|
|
62749
62770
|
if (entry !== undefined)
|
|
@@ -63261,6 +63282,38 @@ const MINI_GAMES_I18N = {
|
|
|
63261
63282
|
chessimalsChallengeVoiceWonBody: '{bot} ajusta su plan. El siguiente rival no va a regalar diagonales.',
|
|
63262
63283
|
chessimalsChallengeVoiceLostTitle: 'Te ganó el pulso',
|
|
63263
63284
|
chessimalsChallengeVoiceLostBody: '{bot} se queda enfrente. La revancha pide una captura más limpia.',
|
|
63285
|
+
chessimalsChallengeVoiceWonSproutTitle: 'Encontraste el sendero',
|
|
63286
|
+
chessimalsChallengeVoiceWonSproutBody: '{bot} sonríe bajito. Ya no te va a dejar tanto aire por los bordes.',
|
|
63287
|
+
chessimalsChallengeVoiceLostSproutTitle: 'Te dejó respirar de más',
|
|
63288
|
+
chessimalsChallengeVoiceLostSproutBody: '{bot} probó una ruta simple y bastó. La revancha empieza cerrando el centro.',
|
|
63289
|
+
chessimalsChallengeVoiceWonSentinelTitle: 'Rompiste el muro',
|
|
63290
|
+
chessimalsChallengeVoiceWonSentinelBody: '{bot} aprieta el escudo. El próximo bloqueo va a llegar antes.',
|
|
63291
|
+
chessimalsChallengeVoiceLostSentinelTitle: 'El muro aguantó',
|
|
63292
|
+
chessimalsChallengeVoiceLostSentinelBody: '{bot} te frenó sin prisa. Necesitas cambiar el ritmo antes de chocar.',
|
|
63293
|
+
chessimalsChallengeVoiceWonHunterTitle: 'Le negaste la presa',
|
|
63294
|
+
chessimalsChallengeVoiceWonHunterBody: '{bot} guarda el blanco. La próxima diagonal tendrá trampa.',
|
|
63295
|
+
chessimalsChallengeVoiceLostHunterTitle: 'Cayó la trampa',
|
|
63296
|
+
chessimalsChallengeVoiceLostHunterBody: '{bot} encontró captura limpia. Mira dos diagonales antes de avanzar.',
|
|
63297
|
+
chessimalsChallengeVoiceWonJumperTitle: 'Le cortaste el salto',
|
|
63298
|
+
chessimalsChallengeVoiceWonJumperBody: '{bot} cambia de pata. Sus poderes van a buscar huecos raros.',
|
|
63299
|
+
chessimalsChallengeVoiceLostJumperTitle: 'Saltó donde dolía',
|
|
63300
|
+
chessimalsChallengeVoiceLostJumperBody: '{bot} abrió una ruta torcida. La revancha pide cubrir las casillas largas.',
|
|
63301
|
+
chessimalsChallengeVoiceWonPredatorTitle: 'Domaste el rugido',
|
|
63302
|
+
chessimalsChallengeVoiceWonPredatorBody: '{bot} retrocede un paso. Ahora va a forzar capturas con menos aviso.',
|
|
63303
|
+
chessimalsChallengeVoiceLostPredatorTitle: 'Te cazó el avance',
|
|
63304
|
+
chessimalsChallengeVoiceLostPredatorBody: '{bot} olió el peón suelto. No le regales piezas aisladas.',
|
|
63305
|
+
chessimalsChallengeVoiceWonOracleTitle: 'Le rompiste el cálculo',
|
|
63306
|
+
chessimalsChallengeVoiceWonOracleBody: '{bot} recalcula en silencio. La siguiente línea va a pelear el centro.',
|
|
63307
|
+
chessimalsChallengeVoiceLostOracleTitle: 'Vio la línea antes',
|
|
63308
|
+
chessimalsChallengeVoiceLostOracleBody: '{bot} leyó tu plan. Varía el primer avance y no repitas diagonales.',
|
|
63309
|
+
chessimalsChallengeVoiceWonSprinterTitle: 'Le ganaste la carrera',
|
|
63310
|
+
chessimalsChallengeVoiceWonSprinterBody: '{bot} mira la fila final. Desde ahora cada tempo cuenta doble.',
|
|
63311
|
+
chessimalsChallengeVoiceLostSprinterTitle: 'Llegó medio paso antes',
|
|
63312
|
+
chessimalsChallengeVoiceLostSprinterBody: '{bot} aceleró sin mirar atrás. Bloquea sus peones antes de perseguir.',
|
|
63313
|
+
chessimalsChallengeVoiceWonChampionTitle: 'El trono crujió',
|
|
63314
|
+
chessimalsChallengeVoiceWonChampionBody: '{bot} inclina la corona. Nadie cruza la última fila por accidente.',
|
|
63315
|
+
chessimalsChallengeVoiceLostChampionTitle: 'La corona pesó',
|
|
63316
|
+
chessimalsChallengeVoiceLostChampionBody: '{bot} cerró la mesa. Para tumbarlo necesitas paciencia y una captura decisiva.',
|
|
63264
63317
|
chessimalsChallengeVoiceCompletedTitle: 'Ruta domada',
|
|
63265
63318
|
chessimalsChallengeVoiceCompletedBody: '{bot} cae y la mesa queda tuya. Desafío completo.',
|
|
63266
63319
|
chessimalsChallengeVoiceFailedTitle: 'La ruta se cerró',
|
|
@@ -63919,6 +63972,38 @@ const MINI_GAMES_I18N = {
|
|
|
63919
63972
|
chessimalsChallengeVoiceWonBody: '{bot} adjusts their plan. The next rival will not give away diagonals.',
|
|
63920
63973
|
chessimalsChallengeVoiceLostTitle: 'They won the pulse',
|
|
63921
63974
|
chessimalsChallengeVoiceLostBody: '{bot} stays across the board. The rematch asks for a cleaner capture.',
|
|
63975
|
+
chessimalsChallengeVoiceWonSproutTitle: 'You found the path',
|
|
63976
|
+
chessimalsChallengeVoiceWonSproutBody: '{bot} gives a small grin. The edges will not stay that open.',
|
|
63977
|
+
chessimalsChallengeVoiceLostSproutTitle: 'They let you breathe too long',
|
|
63978
|
+
chessimalsChallengeVoiceLostSproutBody: '{bot} tried a simple route and it was enough. Start the rematch by closing the center.',
|
|
63979
|
+
chessimalsChallengeVoiceWonSentinelTitle: 'You broke the wall',
|
|
63980
|
+
chessimalsChallengeVoiceWonSentinelBody: '{bot} tightens the shield. The next block will arrive sooner.',
|
|
63981
|
+
chessimalsChallengeVoiceLostSentinelTitle: 'The wall held',
|
|
63982
|
+
chessimalsChallengeVoiceLostSentinelBody: '{bot} stopped you without rushing. Change the rhythm before you crash again.',
|
|
63983
|
+
chessimalsChallengeVoiceWonHunterTitle: 'You denied the prey',
|
|
63984
|
+
chessimalsChallengeVoiceWonHunterBody: '{bot} keeps the target in mind. The next diagonal will be baited.',
|
|
63985
|
+
chessimalsChallengeVoiceLostHunterTitle: 'The trap landed',
|
|
63986
|
+
chessimalsChallengeVoiceLostHunterBody: '{bot} found a clean capture. Read two diagonals before stepping forward.',
|
|
63987
|
+
chessimalsChallengeVoiceWonJumperTitle: 'You cut the leap',
|
|
63988
|
+
chessimalsChallengeVoiceWonJumperBody: '{bot} changes footing. Their powers will hunt for strange gaps.',
|
|
63989
|
+
chessimalsChallengeVoiceLostJumperTitle: 'They jumped where it hurt',
|
|
63990
|
+
chessimalsChallengeVoiceLostJumperBody: '{bot} opened a crooked route. Cover the long squares in the rematch.',
|
|
63991
|
+
chessimalsChallengeVoiceWonPredatorTitle: 'You tamed the roar',
|
|
63992
|
+
chessimalsChallengeVoiceWonPredatorBody: '{bot} steps back. Now the captures will come with less warning.',
|
|
63993
|
+
chessimalsChallengeVoiceLostPredatorTitle: 'They hunted your advance',
|
|
63994
|
+
chessimalsChallengeVoiceLostPredatorBody: '{bot} smelled the loose pawn. Do not leave isolated pieces behind.',
|
|
63995
|
+
chessimalsChallengeVoiceWonOracleTitle: 'You broke the calculation',
|
|
63996
|
+
chessimalsChallengeVoiceWonOracleBody: '{bot} recalculates in silence. The next line will fight for the center.',
|
|
63997
|
+
chessimalsChallengeVoiceLostOracleTitle: 'They saw the line first',
|
|
63998
|
+
chessimalsChallengeVoiceLostOracleBody: '{bot} read your plan. Vary the first step and do not repeat diagonals.',
|
|
63999
|
+
chessimalsChallengeVoiceWonSprinterTitle: 'You won the race',
|
|
64000
|
+
chessimalsChallengeVoiceWonSprinterBody: '{bot} looks at the back row. Every tempo counts double now.',
|
|
64001
|
+
chessimalsChallengeVoiceLostSprinterTitle: 'They arrived half a step early',
|
|
64002
|
+
chessimalsChallengeVoiceLostSprinterBody: '{bot} accelerated without looking back. Block their pawns before chasing.',
|
|
64003
|
+
chessimalsChallengeVoiceWonChampionTitle: 'The throne cracked',
|
|
64004
|
+
chessimalsChallengeVoiceWonChampionBody: '{bot} tips the crown. Nobody crosses the back row by accident.',
|
|
64005
|
+
chessimalsChallengeVoiceLostChampionTitle: 'The crown was heavy',
|
|
64006
|
+
chessimalsChallengeVoiceLostChampionBody: '{bot} closed the table. To topple them, you need patience and one decisive capture.',
|
|
63922
64007
|
chessimalsChallengeVoiceCompletedTitle: 'Route cleared',
|
|
63923
64008
|
chessimalsChallengeVoiceCompletedBody: '{bot} falls and the table is yours. Challenge complete.',
|
|
63924
64009
|
chessimalsChallengeVoiceFailedTitle: 'The route closed',
|
|
@@ -67590,6 +67675,11 @@ class ChessimalsGameComponent {
|
|
|
67590
67675
|
return this.t('chessimalsChallengeVoiceCompletedTitle');
|
|
67591
67676
|
if (phase === 'failed')
|
|
67592
67677
|
return this.t('chessimalsChallengeVoiceFailedTitle');
|
|
67678
|
+
const bot = this.challengeLastBot() ?? this.activeChallengeBot();
|
|
67679
|
+
const result = this.challengeLastWon() ? 'Won' : 'Lost';
|
|
67680
|
+
const botTitle = this.challengeVoiceText(bot, result, 'Title');
|
|
67681
|
+
if (botTitle)
|
|
67682
|
+
return botTitle;
|
|
67593
67683
|
return this.challengeLastWon()
|
|
67594
67684
|
? this.t('chessimalsChallengeVoiceWonTitle')
|
|
67595
67685
|
: this.t('chessimalsChallengeVoiceLostTitle');
|
|
@@ -67597,6 +67687,10 @@ class ChessimalsGameComponent {
|
|
|
67597
67687
|
challengeRivalVoiceBody() {
|
|
67598
67688
|
const bot = this.challengeLastBot() ?? this.activeChallengeBot();
|
|
67599
67689
|
const botName = bot ? this.challengeBotName(bot) : this.t('chessimalsBotName');
|
|
67690
|
+
const result = this.challengeLastWon() ? 'Won' : 'Lost';
|
|
67691
|
+
const botBody = this.challengeVoiceText(bot, result, 'Body');
|
|
67692
|
+
if (botBody)
|
|
67693
|
+
return botBody.replace('{bot}', botName);
|
|
67600
67694
|
const key = this.challengePhase() === 'completed'
|
|
67601
67695
|
? 'chessimalsChallengeVoiceCompletedBody'
|
|
67602
67696
|
: this.challengePhase() === 'failed'
|
|
@@ -67606,6 +67700,13 @@ class ChessimalsGameComponent {
|
|
|
67606
67700
|
: 'chessimalsChallengeVoiceLostBody';
|
|
67607
67701
|
return this.t(key).replace('{bot}', botName);
|
|
67608
67702
|
}
|
|
67703
|
+
challengeVoiceText(bot, result, part) {
|
|
67704
|
+
if (!bot)
|
|
67705
|
+
return undefined;
|
|
67706
|
+
const key = `chessimalsChallengeVoice${result}${this.capitalize(bot.id)}${part}`;
|
|
67707
|
+
const text = this.t(key);
|
|
67708
|
+
return text === key ? undefined : text;
|
|
67709
|
+
}
|
|
67609
67710
|
challengeNextRivalLabel() {
|
|
67610
67711
|
return this.challengeLastWon()
|
|
67611
67712
|
? this.t('chessimalsChallengeNextRivalLabel')
|