@minicode-dev/chat 0.1.15 → 0.1.17
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/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/dist/chunks/{BattleshipGameCard-8H-sBCsv.js → BattleshipGameCard-DwNzgH5G.js} +199 -199
- package/dist/chunks/{BattleshipGameCard-8H-sBCsv.js.map → BattleshipGameCard-DwNzgH5G.js.map} +1 -1
- package/dist/chunks/{BattleshipPrototype-CmQd5AUO.js → BattleshipPrototype-CSQxQJt5.js} +52 -52
- package/dist/chunks/{BattleshipPrototype-CmQd5AUO.js.map → BattleshipPrototype-CSQxQJt5.js.map} +1 -1
- package/dist/chunks/{ChatContext-CVW58bzC.js → ChatContext-D5rqvt5D.js} +2 -2
- package/dist/chunks/{ChatContext-CVW58bzC.js.map → ChatContext-D5rqvt5D.js.map} +1 -1
- package/dist/chunks/RacingLiveGameCard-_wvhDRlG.js +1873 -0
- package/dist/chunks/RacingLiveGameCard-_wvhDRlG.js.map +1 -0
- package/dist/chunks/{TanksGameCard-DnCufSH6.js → TanksGameCard-B-gtDYYg.js} +137 -137
- package/dist/chunks/{TanksGameCard-DnCufSH6.js.map → TanksGameCard-B-gtDYYg.js.map} +1 -1
- package/dist/chunks/{TanksLiveGameCard-D_27Jomp.js → TanksLiveGameCard-DXgd1J2Y.js} +392 -392
- package/dist/chunks/{TanksLiveGameCard-D_27Jomp.js.map → TanksLiveGameCard-DXgd1J2Y.js.map} +1 -1
- package/dist/chunks/{avalancheScene3d-CIE2WKQn.js → avalancheScene3d-CNbQyGUd.js} +2 -2
- package/dist/chunks/{avalancheScene3d-CIE2WKQn.js.map → avalancheScene3d-CNbQyGUd.js.map} +1 -1
- package/dist/chunks/{connect4Sounds-BqEHULjv.js → connect4Sounds-3a6h7gUC.js} +8 -8
- package/dist/chunks/{connect4Sounds-BqEHULjv.js.map → connect4Sounds-3a6h7gUC.js.map} +1 -1
- package/dist/chunks/createLiveScene-jrzyQogh.js +756 -0
- package/dist/chunks/{createLiveScene-MTGRv8rx.js.map → createLiveScene-jrzyQogh.js.map} +1 -1
- package/dist/chunks/createRaceScene-C-aw0dlX.js +291 -0
- package/dist/chunks/createRaceScene-C-aw0dlX.js.map +1 -0
- package/dist/chunks/{createTankScene-yhX6la27.js → createTankScene-6asWHKFf.js} +123 -125
- package/dist/chunks/{createTankScene-yhX6la27.js.map → createTankScene-6asWHKFf.js.map} +1 -1
- package/dist/chunks/fx-BNJvJYOu.js +871 -0
- package/dist/chunks/fx-BNJvJYOu.js.map +1 -0
- package/dist/chunks/{games-Bl_8raG6.js → games-D_9SiSBT.js} +708 -697
- package/dist/chunks/games-D_9SiSBT.js.map +1 -0
- package/dist/chunks/tank-DIn6Jyt8.js +605 -0
- package/dist/chunks/tank-DIn6Jyt8.js.map +1 -0
- package/dist/chunks/{tanks-live-BcKmrhnV.js → tanks-live-BRhYW4MG.js} +36 -36
- package/dist/chunks/{tanks-live-BcKmrhnV.js.map → tanks-live-BRhYW4MG.js.map} +1 -1
- package/dist/chunks/{tanksSounds-DTnidbiq.js → tanksSounds-tYPzje61.js} +4 -4
- package/dist/chunks/{tanksSounds-DTnidbiq.js.map → tanksSounds-tYPzje61.js.map} +1 -1
- package/dist/chunks/track-C1TWWT19.js +557 -0
- package/dist/chunks/track-C1TWWT19.js.map +1 -0
- package/dist/index.js +4236 -4020
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/index.d.ts +3 -1
- package/package.json +1 -1
- package/dist/chunks/RacingLiveGameCard-8j9QLnxW.js +0 -1654
- package/dist/chunks/RacingLiveGameCard-8j9QLnxW.js.map +0 -1
- package/dist/chunks/createLiveScene-MTGRv8rx.js +0 -758
- package/dist/chunks/createRaceScene-BiEtQsVs.js +0 -306
- package/dist/chunks/createRaceScene-BiEtQsVs.js.map +0 -1
- package/dist/chunks/decor-CyyCnmct.js +0 -418
- package/dist/chunks/decor-CyyCnmct.js.map +0 -1
- package/dist/chunks/fx-1ZwzmPWj.js +0 -458
- package/dist/chunks/fx-1ZwzmPWj.js.map +0 -1
- package/dist/chunks/games-Bl_8raG6.js.map +0 -1
- package/dist/chunks/rolldown-runtime-CGnMp29N.js +0 -10
- package/dist/chunks/tank-DjEQ4FXF.js +0 -553
- package/dist/chunks/tank-DjEQ4FXF.js.map +0 -1
- package/dist/chunks/track-BcnnpnAm.js +0 -259
- package/dist/chunks/track-BcnnpnAm.js.map +0 -1
- package/dist/chunks/util-DwI9bfS7.js +0 -57
- package/dist/chunks/util-DwI9bfS7.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, l as i, o as a, p as o, s, u as c } from "./games-
|
|
2
|
-
import { t as l } from "./ChatContext-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, l as i, o as a, p as o, s, u as c } from "./games-D_9SiSBT.js";
|
|
2
|
+
import { t as l } from "./ChatContext-D5rqvt5D.js";
|
|
3
3
|
import { r as u } from "./connectionStore-DwgIUl30.js";
|
|
4
4
|
import { c as d, l as f, t as p } from "./gameStatus-BChd29yI.js";
|
|
5
|
-
import { o as m } from "./connect4Sounds-
|
|
5
|
+
import { o as m } from "./connect4Sounds-3a6h7gUC.js";
|
|
6
6
|
import { t as h } from "./webglSupport-2WjPEPZ_.js";
|
|
7
|
-
import { l as g, n as _, o as v, r as y, s as b, t as ee } from "./tanksSounds-
|
|
7
|
+
import { l as g, n as _, o as v, r as y, s as b, t as ee } from "./tanksSounds-tYPzje61.js";
|
|
8
8
|
import { memo as x, useCallback as S, useContext as C, useEffect as w, useRef as T, useState as E, useSyncExternalStore as D } from "react";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronDown as j, Crosshair as te, Flag as ne, Layers as M, RotateCcw as re, Swords as ie, Video as N, Wind as ae, X as oe } from "lucide-react";
|
|
11
11
|
// src/games/tanks/logic/selectors.js
|
|
12
12
|
var P = 2500;
|
|
13
13
|
function se(e) {
|
|
@@ -389,37 +389,37 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
389
389
|
grid: 0,
|
|
390
390
|
factor: 0,
|
|
391
391
|
canvas: null
|
|
392
|
-
}, h = [], g = [], _ = [], v = [], y = [], b = [], ee = [], x = null, S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Set(), w = (e) => S.get(String(e)), T = /* @__PURE__ */ new Set(), E = 0, D = 0,
|
|
392
|
+
}, h = [], g = [], _ = [], v = [], y = [], b = [], ee = [], x = null, S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Set(), w = (e) => S.get(String(e)), T = /* @__PURE__ */ new Set(), E = 0, D = 0, O = 1, k = 0, A = 0, j = !1, te = Promise.resolve(), ne = () => !!i?.hidden, M = (e, t) => {
|
|
393
393
|
try {
|
|
394
394
|
n?.({
|
|
395
395
|
type: e,
|
|
396
396
|
...t
|
|
397
397
|
});
|
|
398
398
|
} catch {}
|
|
399
|
-
},
|
|
399
|
+
}, re = () => U[u] || U.high, ie = () => {
|
|
400
400
|
let e = K(l?.size, 160);
|
|
401
401
|
if (d === "overview" || !l) return J(E, D, e, { origin: r });
|
|
402
|
-
let t = w(l.activeId) ||
|
|
402
|
+
let t = w(l.activeId) || N(l.activeId);
|
|
403
403
|
return J(E, D, e, {
|
|
404
404
|
origin: r,
|
|
405
405
|
zoom: 2,
|
|
406
406
|
cx: t?.x,
|
|
407
407
|
cz: t?.z
|
|
408
408
|
});
|
|
409
|
-
},
|
|
409
|
+
}, N = (e) => l?.tanks?.find((t) => String(t.id) === String(e)) || null, ae = (e, t) => {
|
|
410
410
|
if (!l?.heights) return 0;
|
|
411
411
|
let n = K(l.size, 160), i = r === "corner" ? 0 : -n / 2, a = l.grid || Math.round(Math.sqrt(l.heights.length));
|
|
412
412
|
return Ce(l.heights, a, (e - i) / n * (a - 1), (t - i) / n * (a - 1));
|
|
413
|
-
},
|
|
414
|
-
|
|
413
|
+
}, oe = () => T.size > 0 || g.length || _.length || v.length || y.length || b.length || !!(x && x.left > 0), P = () => {
|
|
414
|
+
k || j || ne() || !a?.requestAnimationFrame || (k = a.requestAnimationFrame(se));
|
|
415
415
|
};
|
|
416
416
|
function se(e) {
|
|
417
|
-
if (
|
|
418
|
-
let t =
|
|
419
|
-
|
|
417
|
+
if (k = 0, j) return;
|
|
418
|
+
let t = A ? G(e - A, 0, 50) : 16;
|
|
419
|
+
A = e, ce(t), Z(), oe() && !ne() ? P() : A = 0;
|
|
420
420
|
}
|
|
421
421
|
let F = (e, t) => new Promise((n) => {
|
|
422
|
-
|
|
422
|
+
j ? n() : (T.add({
|
|
423
423
|
elapsed: 0,
|
|
424
424
|
duration: Math.max(1, e / c),
|
|
425
425
|
step: t,
|
|
@@ -438,7 +438,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
438
438
|
let n = e / 1e3, r = l?.wind || {};
|
|
439
439
|
if (g = g.filter((t) => (t.life -= e, t.x += t.vx * n, t.z += t.vz * n, t.vx *= .94, t.vz *= .94, t.life > 0)), y = y.filter((t) => (t.life -= e, t.x += K(r.x) * .25 * n, t.z += K(r.z) * .25 * n, t.r += 1.2 * n, t.life > 0)), _ = _.filter((t) => (t.life -= e) > 0), v = v.filter((t) => (t.life -= e) > 0), b = b.filter((t) => (t.life -= e) > 0), x?.left > 0 && (x.left -= e, x.next -= e, x.next <= 0 && !t)) {
|
|
440
440
|
x.next = 450;
|
|
441
|
-
let e = w(x.id) ||
|
|
441
|
+
let e = w(x.id) || N(x.id);
|
|
442
442
|
e && (_.push({
|
|
443
443
|
x: e.x,
|
|
444
444
|
z: e.z,
|
|
@@ -456,7 +456,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
function I(e, t, n, r, i = 10) {
|
|
459
|
-
let a = Math.floor(me *
|
|
459
|
+
let a = Math.floor(me * re().particles) - g.length;
|
|
460
460
|
for (let o = 0; o < Math.min(n, a); o += 1) {
|
|
461
461
|
let n = Math.random() * Math.PI * 2, a = i * (.4 + Math.random() * .8), s = 500 + Math.random() * 600;
|
|
462
462
|
g.push({
|
|
@@ -515,7 +515,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
515
515
|
function le() {
|
|
516
516
|
let e = l?.heights;
|
|
517
517
|
if (!e || !i) return null;
|
|
518
|
-
let t = l.grid || Math.round(Math.sqrt(e.length)), n =
|
|
518
|
+
let t = l.grid || Math.round(Math.sqrt(e.length)), n = re().terrain;
|
|
519
519
|
if (m.canvas && m.heights === e && m.grid === t && m.factor === n) return m.canvas;
|
|
520
520
|
let r = Math.min(400, (t - 1) * n + 1), a = we(e, t, r, { size: K(l.size, 160) }), o = m.canvas && m.canvas.width === r ? m.canvas : i.createElement("canvas");
|
|
521
521
|
o.width = r, o.height = r;
|
|
@@ -562,7 +562,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
562
562
|
function pe(e) {
|
|
563
563
|
if (!p || p.length < 2) return;
|
|
564
564
|
let t = 1, n = p.map((e) => {
|
|
565
|
-
let n = Math.max(0, e.y -
|
|
565
|
+
let n = Math.max(0, e.y - ae(e.x, e.z));
|
|
566
566
|
return t = Math.max(t, n), n;
|
|
567
567
|
});
|
|
568
568
|
s.save(), s.setLineDash([5, 4]), s.lineWidth = 2, s.lineCap = "round";
|
|
@@ -591,7 +591,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
591
591
|
let n = Oe(t, r), o = Y(n.x, n.z, e);
|
|
592
592
|
a && (s.strokeStyle = `rgba(255,240,200,${(r - i) / 19 * .7})`, s.lineWidth = 1.5, s.beginPath(), s.moveTo(a.x, a.y), s.lineTo(o.x, o.y), s.stroke()), a = o;
|
|
593
593
|
}
|
|
594
|
-
let o = Math.max(0, r.y -
|
|
594
|
+
let o = Math.max(0, r.y - ae(r.x, r.z)), c = Y(r.x, r.z, e), l = Math.min(o * .35 * e.scale, 40);
|
|
595
595
|
s.fillStyle = "rgba(0,0,0,0.35)", s.beginPath(), s.ellipse(c.x + l, c.y + l, 3, 2, 0, 0, Math.PI * 2), s.fill(), a && (s.strokeStyle = "rgba(255,240,200,0.7)", s.beginPath(), s.moveTo(a.x, a.y), s.lineTo(c.x, c.y), s.stroke());
|
|
596
596
|
let u = G(2.5 + o * .06, 2.5, 7);
|
|
597
597
|
s.fillStyle = "#fff3c4", s.beginPath(), s.arc(c.x, c.y, u, 0, Math.PI * 2), s.fill(), s.strokeStyle = "#3a2a12", s.lineWidth = 1, s.stroke();
|
|
@@ -631,15 +631,15 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
function Z() {
|
|
634
|
-
if (s && E && D && !
|
|
635
|
-
if (s.setTransform(
|
|
636
|
-
let e =
|
|
634
|
+
if (s && E && D && !j) try {
|
|
635
|
+
if (s.setTransform(O, 0, 0, O, 0, 0), s.fillStyle = "#18211a", s.fillRect(0, 0, E, D), !l) return;
|
|
636
|
+
let e = ie(), t = Y(e.minX, e.minZ, e), n = e.size * e.scale, r = le();
|
|
637
637
|
r ? (s.imageSmoothingEnabled = !0, s.drawImage(r, t.x, t.y, n, n)) : (s.fillStyle = "#4c7a3e", s.fillRect(t.x, t.y, n, n)), s.strokeStyle = "rgba(0,0,0,0.5)", s.lineWidth = 1, s.strokeRect(t.x, t.y, n, n), fe(e), ue(e), de(e), pe(e), (l.tanks || []).forEach((t) => z(t, e)), ee.forEach((t) => W(e, t)), X(e), je();
|
|
638
638
|
} catch {}
|
|
639
639
|
}
|
|
640
640
|
async function Me(e) {
|
|
641
|
-
if (
|
|
642
|
-
let n = e.tankId, r =
|
|
641
|
+
if (j || !e) return;
|
|
642
|
+
let n = e.tankId, r = N(n), i = (e.movePath || []).filter((e) => e && Number.isFinite(e.x) && Number.isFinite(e.z)), a = r || i[0] || {
|
|
643
643
|
x: 0,
|
|
644
644
|
z: 0
|
|
645
645
|
}, o = {
|
|
@@ -652,21 +652,21 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
652
652
|
};
|
|
653
653
|
if (S.set(String(n), o), i.length > 1 && De(i) > .05) {
|
|
654
654
|
let e = De(i), r = 0;
|
|
655
|
-
if (
|
|
655
|
+
if (M("engine_start", { tankId: n }), await F(t ? 50 : 350), M("move_start", { tankId: n }), await F(G(e / he * 1e3, 400, 3500), (e, n) => {
|
|
656
656
|
let a = Ee(i, q(e));
|
|
657
657
|
if (a && (a.heading != null && (o.yaw += xe(o.hullYaw, a.heading), o.hullYaw = a.heading), o.x = a.x, o.y = a.y, o.z = a.z, r += n || 0, r > 110 && !t)) {
|
|
658
658
|
r = 0;
|
|
659
659
|
let e = ye(o.hullYaw);
|
|
660
660
|
I(a.x - e.x * 3, a.z - e.z * 3, 1, ["#8c7a5c"], 2);
|
|
661
661
|
}
|
|
662
|
-
}),
|
|
662
|
+
}), M("move_end", { tankId: n }), j) return;
|
|
663
663
|
}
|
|
664
664
|
let s = K(e.yaw, o.yaw), c = Math.abs(xe(o.yaw, s));
|
|
665
665
|
if (c > 1) {
|
|
666
666
|
let e = o.yaw;
|
|
667
|
-
if (
|
|
667
|
+
if (M("turret_start", { tankId: n }), await F(G(c / ge * 1e3, 200, 1500), (t) => {
|
|
668
668
|
o.yaw = Se(e, s, q(t));
|
|
669
|
-
}),
|
|
669
|
+
}), M("turret_end", { tankId: n }), j) return;
|
|
670
670
|
}
|
|
671
671
|
o.yaw = s, o.pitch = K(e.pitch, o.pitch);
|
|
672
672
|
let l = e.damage || {}, u = /* @__PURE__ */ new Set(), d = [...e.craters || []].filter((e) => Number.isFinite(e?.x) && Number.isFinite(e?.z)), f = ye(o.yaw), p = {
|
|
@@ -677,7 +677,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
677
677
|
state: "waiting",
|
|
678
678
|
f: 0
|
|
679
679
|
})), g = (e) => {
|
|
680
|
-
e.state = "flying", e.bomblet || (
|
|
680
|
+
e.state = "flying", e.bomblet || (M("fire", {
|
|
681
681
|
tankId: n,
|
|
682
682
|
shot: e.index
|
|
683
683
|
}), v.push({
|
|
@@ -692,7 +692,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
692
692
|
r: 1,
|
|
693
693
|
life: 900,
|
|
694
694
|
max: 900
|
|
695
|
-
}), e.count >= 2 &&
|
|
695
|
+
}), e.count >= 2 && M("projectile_start", {
|
|
696
696
|
tankId: n,
|
|
697
697
|
shot: e.index
|
|
698
698
|
}));
|
|
@@ -702,7 +702,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
702
702
|
...r,
|
|
703
703
|
kind: "terrain"
|
|
704
704
|
};
|
|
705
|
-
if (
|
|
705
|
+
if (M("impact", {
|
|
706
706
|
kind: i.kind,
|
|
707
707
|
tankId: i.tankId,
|
|
708
708
|
shot: n
|
|
@@ -715,14 +715,14 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
715
715
|
}), I(i.x, i.z, 4, ["#ffe9a8", "#cfcfcf"], 6);
|
|
716
716
|
else if (i.kind !== "out") {
|
|
717
717
|
if (L(i.x, i.z, t.radius, !1), i.kind === "tank" && i.tankId != null) {
|
|
718
|
-
|
|
718
|
+
M("tank_hit", {
|
|
719
719
|
tankId: i.tankId,
|
|
720
720
|
shot: n
|
|
721
721
|
});
|
|
722
722
|
let e = l[i.tankId];
|
|
723
723
|
if (Number.isFinite(e) && e > 0 && !u.has(String(i.tankId))) {
|
|
724
724
|
u.add(String(i.tankId));
|
|
725
|
-
let t = w(i.tankId) ||
|
|
725
|
+
let t = w(i.tankId) || N(i.tankId) || i;
|
|
726
726
|
b.push({
|
|
727
727
|
x: t.x,
|
|
728
728
|
z: t.z,
|
|
@@ -749,11 +749,11 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
749
749
|
samples: e.shot.samples,
|
|
750
750
|
f: e.f
|
|
751
751
|
}));
|
|
752
|
-
}), ee = [],
|
|
752
|
+
}), ee = [], j) return;
|
|
753
753
|
}
|
|
754
754
|
h.push(...d), Object.entries(l).forEach(([e, t]) => {
|
|
755
755
|
if (u.has(e) || !Number.isFinite(t) || t <= 0) return;
|
|
756
|
-
let n = w(e) ||
|
|
756
|
+
let n = w(e) || N(e);
|
|
757
757
|
n && b.push({
|
|
758
758
|
x: n.x,
|
|
759
759
|
z: n.z,
|
|
@@ -765,13 +765,13 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
765
765
|
});
|
|
766
766
|
let x = e.destroyed || [];
|
|
767
767
|
if (x.forEach((e) => {
|
|
768
|
-
let t = w(e) ||
|
|
769
|
-
|
|
768
|
+
let t = w(e) || N(e);
|
|
769
|
+
M("big_explosion", { tankId: e }), t && L(t.x, t.z, 6, !0), M("destroyed", { tankId: e }), C.add(String(e));
|
|
770
770
|
}), x.length) {
|
|
771
771
|
let e = 0;
|
|
772
772
|
await F(1600, (t, n) => {
|
|
773
773
|
e += n || 0, !(e < 140) && (e = 0, x.forEach((e) => {
|
|
774
|
-
let t = w(e) ||
|
|
774
|
+
let t = w(e) || N(e);
|
|
775
775
|
t && y.push({
|
|
776
776
|
x: t.x + (Math.random() - .5) * 2,
|
|
777
777
|
z: t.z + (Math.random() - .5) * 2,
|
|
@@ -782,7 +782,7 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
782
782
|
}));
|
|
783
783
|
});
|
|
784
784
|
} else await F(500);
|
|
785
|
-
|
|
785
|
+
j || (e.world && Ne(e.world, !0), S.delete(String(n)), P(), Z());
|
|
786
786
|
}
|
|
787
787
|
function Ne(e, t) {
|
|
788
788
|
e && (!t && l && e.heights !== l.heights && (h = []), l = e, (e.tanks || []).forEach((e) => {
|
|
@@ -790,15 +790,15 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
790
790
|
}));
|
|
791
791
|
}
|
|
792
792
|
function Q() {
|
|
793
|
-
if (!o ||
|
|
793
|
+
if (!o || j) return;
|
|
794
794
|
let t = e?.getBoundingClientRect?.() || {
|
|
795
795
|
width: e?.clientWidth || 0,
|
|
796
796
|
height: e?.clientHeight || 0
|
|
797
797
|
};
|
|
798
|
-
E = Math.max(0, Math.floor(t.width)), D = Math.max(0, Math.floor(t.height)),
|
|
798
|
+
E = Math.max(0, Math.floor(t.width)), D = Math.max(0, Math.floor(t.height)), O = Math.min(re().dpr, a?.devicePixelRatio || 1), o.width = Math.max(1, Math.round(E * O)), o.height = Math.max(1, Math.round(D * O)), Z();
|
|
799
799
|
}
|
|
800
800
|
let Pe = () => {
|
|
801
|
-
|
|
801
|
+
ne() ? (k && a?.cancelAnimationFrame && a.cancelAnimationFrame(k), k = 0, A = 0) : P();
|
|
802
802
|
};
|
|
803
803
|
i?.addEventListener("visibilitychange", Pe);
|
|
804
804
|
let Fe = null;
|
|
@@ -817,8 +817,8 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
817
817
|
p = Ae(e), Z();
|
|
818
818
|
},
|
|
819
819
|
playTurn(e) {
|
|
820
|
-
let t =
|
|
821
|
-
return
|
|
820
|
+
let t = te.then(() => Me(e)).catch(() => {});
|
|
821
|
+
return te = t, t;
|
|
822
822
|
},
|
|
823
823
|
setCameraMode(e) {
|
|
824
824
|
d = e || "overview", Z();
|
|
@@ -835,8 +835,8 @@ function je(e, { reducedMotion: t = !1, onEvent: n, origin: r = "corner" } = {})
|
|
|
835
835
|
},
|
|
836
836
|
resize: Q,
|
|
837
837
|
dispose() {
|
|
838
|
-
if (!
|
|
839
|
-
|
|
838
|
+
if (!j) {
|
|
839
|
+
j = !0, k && a?.cancelAnimationFrame && a.cancelAnimationFrame(k), k = 0, T.forEach((e) => e.resolve()), T.clear(), Fe?.disconnect(), a?.removeEventListener("resize", Q), i?.removeEventListener("visibilitychange", Pe), g = [], _ = [], v = [], y = [], b = [], h = [], ee = [], m = {
|
|
840
840
|
heights: null,
|
|
841
841
|
grid: 0,
|
|
842
842
|
factor: 0,
|
|
@@ -869,23 +869,23 @@ function Le(t, ...n) {
|
|
|
869
869
|
});
|
|
870
870
|
}
|
|
871
871
|
function Re({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
|
|
872
|
-
return e?.status === "requesting" ? /* @__PURE__ */
|
|
872
|
+
return e?.status === "requesting" ? /* @__PURE__ */ k("div", {
|
|
873
873
|
className: "chat-game-sync",
|
|
874
874
|
role: "status",
|
|
875
875
|
children: "Sincronizando partida…"
|
|
876
|
-
}) : /* @__PURE__ */
|
|
876
|
+
}) : /* @__PURE__ */ A("div", {
|
|
877
877
|
className: "chat-game-sync",
|
|
878
878
|
role: "alert",
|
|
879
879
|
children: [
|
|
880
|
-
e?.message && /* @__PURE__ */
|
|
881
|
-
e?.status === "incompatible" && e.offer && /* @__PURE__ */
|
|
880
|
+
e?.message && /* @__PURE__ */ k("span", { children: e.message }),
|
|
881
|
+
e?.status === "incompatible" && e.offer && /* @__PURE__ */ k("button", {
|
|
882
882
|
type: "button",
|
|
883
883
|
className: "chat-game-action chat-game-action--primary",
|
|
884
884
|
disabled: !t,
|
|
885
885
|
onClick: r,
|
|
886
886
|
children: "Usar estado del anfitrión"
|
|
887
887
|
}),
|
|
888
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ k("button", {
|
|
889
889
|
type: "button",
|
|
890
890
|
className: "chat-game-action",
|
|
891
891
|
disabled: !t,
|
|
@@ -896,26 +896,26 @@ function Re({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
|
|
|
896
896
|
});
|
|
897
897
|
}
|
|
898
898
|
function ze({ label: e, hp: t, color: n, active: r }) {
|
|
899
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ A("div", {
|
|
900
900
|
className: `tk-hp tk-hp--${n}${r ? " is-active" : ""}`,
|
|
901
901
|
children: [
|
|
902
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ k("span", {
|
|
903
903
|
className: "tk-hp-label",
|
|
904
904
|
children: e
|
|
905
905
|
}),
|
|
906
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ k("span", {
|
|
907
907
|
className: "tk-hp-track",
|
|
908
908
|
role: "meter",
|
|
909
909
|
"aria-valuemin": 0,
|
|
910
910
|
"aria-valuemax": 100,
|
|
911
911
|
"aria-valuenow": t,
|
|
912
912
|
"aria-label": `Vida de ${e}`,
|
|
913
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ k("span", {
|
|
914
914
|
className: "tk-hp-fill",
|
|
915
915
|
style: { width: `${t}%` }
|
|
916
916
|
})
|
|
917
917
|
}),
|
|
918
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ k("strong", { children: t })
|
|
919
919
|
]
|
|
920
920
|
});
|
|
921
921
|
}
|
|
@@ -940,7 +940,7 @@ function Be(e, t, n, r) {
|
|
|
940
940
|
o("none");
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
|
-
return o("loading"), u || !h() ? f() : import("./createTankScene-
|
|
943
|
+
return o("loading"), u || !h() ? f() : import("./createTankScene-6asWHKFf.js").then(({ createTankScene: e }) => {
|
|
944
944
|
if (!r) try {
|
|
945
945
|
d(e(n, s), "3d");
|
|
946
946
|
} catch {
|
|
@@ -968,29 +968,29 @@ function Be(e, t, n, r) {
|
|
|
968
968
|
}
|
|
969
969
|
function Ve({ game: e, currentUserId: t }) {
|
|
970
970
|
let n = e.logic?.tanks.map((e) => e.hp) ?? [100, 100];
|
|
971
|
-
return /* @__PURE__ */
|
|
971
|
+
return /* @__PURE__ */ A("section", {
|
|
972
972
|
className: "chat-game-card chat-game-card--history tk-card tk-card--history",
|
|
973
973
|
"aria-label": "Partida de Tanques de guerra",
|
|
974
974
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ k("header", {
|
|
976
976
|
className: "chat-game-header",
|
|
977
|
-
children: /* @__PURE__ */
|
|
977
|
+
children: /* @__PURE__ */ A("div", {
|
|
978
978
|
className: "chat-game-heading",
|
|
979
|
-
children: [/* @__PURE__ */
|
|
979
|
+
children: [/* @__PURE__ */ k("span", {
|
|
980
980
|
className: "chat-game-eyebrow",
|
|
981
981
|
children: "MINIJUEGOS · 2 JUGADORES"
|
|
982
|
-
}), /* @__PURE__ */
|
|
982
|
+
}), /* @__PURE__ */ A("h3", { children: ["Tanques de guerra ", /* @__PURE__ */ k(ie, {
|
|
983
983
|
size: 13,
|
|
984
984
|
"aria-hidden": "true"
|
|
985
985
|
})] })]
|
|
986
986
|
})
|
|
987
987
|
}),
|
|
988
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ k("p", {
|
|
989
989
|
className: "chat-game-status",
|
|
990
990
|
role: "status",
|
|
991
991
|
children: p(e, t)
|
|
992
992
|
}),
|
|
993
|
-
e.logic && /* @__PURE__ */
|
|
993
|
+
e.logic && /* @__PURE__ */ A("p", {
|
|
994
994
|
className: "tk-history-score",
|
|
995
995
|
children: [
|
|
996
996
|
"Verde ",
|
|
@@ -1167,78 +1167,78 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1167
1167
|
firstPlayerId: e.firstPlayerId === e.hostId ? e.guestId : e.hostId,
|
|
1168
1168
|
rematchOf: e.gameId
|
|
1169
1169
|
}), Fe = !l && !K ? "Sin conexión · esperando reconexión" : e.pending ? "Enviando…" : p(e, r), Ve = e.logic?.tanks ?? [], He = Ve[U], $ = e.logic ? R(e).wind : null, Ue = $ ? Math.hypot($.x, $.z) : 0, We = $ ? Math.round(Math.atan2($.z, $.x) * 180 / Math.PI) : 0, Ge = e.status === "invited" && !W && Date.now() - Date.parse(e.createdAt) > Me;
|
|
1170
|
-
return /* @__PURE__ */
|
|
1170
|
+
return /* @__PURE__ */ A("section", {
|
|
1171
1171
|
className: `chat-game-card tk-card${q ? " chat-game-card--my-turn" : ""}${i ? ` chat-game-card--${i}` : ""}`,
|
|
1172
1172
|
"aria-label": "Partida de Tanques de guerra",
|
|
1173
1173
|
children: [
|
|
1174
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ A("header", {
|
|
1175
1175
|
className: "chat-game-header",
|
|
1176
1176
|
children: [
|
|
1177
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ A("div", {
|
|
1178
1178
|
className: "chat-game-heading",
|
|
1179
|
-
children: [/* @__PURE__ */
|
|
1179
|
+
children: [/* @__PURE__ */ k("span", {
|
|
1180
1180
|
className: "chat-game-eyebrow",
|
|
1181
1181
|
children: "MINIJUEGOS · 2 JUGADORES"
|
|
1182
|
-
}), /* @__PURE__ */
|
|
1182
|
+
}), /* @__PURE__ */ A("h3", { children: ["Tanques de guerra ", /* @__PURE__ */ k(ie, {
|
|
1183
1183
|
size: 13,
|
|
1184
1184
|
"aria-hidden": "true"
|
|
1185
1185
|
})] })]
|
|
1186
1186
|
}),
|
|
1187
|
-
i === "panel" && /* @__PURE__ */
|
|
1188
|
-
o && /* @__PURE__ */
|
|
1187
|
+
i === "panel" && /* @__PURE__ */ k(m, { manager: ee() }),
|
|
1188
|
+
o && /* @__PURE__ */ k("button", {
|
|
1189
1189
|
className: "chat-game-close",
|
|
1190
1190
|
type: "button",
|
|
1191
1191
|
"aria-label": "Minimizar tablero",
|
|
1192
1192
|
title: "Minimizar tablero",
|
|
1193
1193
|
onClick: o,
|
|
1194
|
-
children: /* @__PURE__ */
|
|
1194
|
+
children: /* @__PURE__ */ k(j, {
|
|
1195
1195
|
size: 16,
|
|
1196
1196
|
"aria-hidden": "true"
|
|
1197
1197
|
})
|
|
1198
1198
|
}),
|
|
1199
|
-
G && !K && /* @__PURE__ */
|
|
1199
|
+
G && !K && /* @__PURE__ */ k("button", {
|
|
1200
1200
|
className: "chat-game-close",
|
|
1201
1201
|
type: "button",
|
|
1202
1202
|
"aria-label": "Finalizar partida para ambos jugadores",
|
|
1203
1203
|
title: "Finalizar partida para ambos",
|
|
1204
1204
|
disabled: !l,
|
|
1205
1205
|
onClick: () => J("act", t, "game_end"),
|
|
1206
|
-
children: /* @__PURE__ */
|
|
1206
|
+
children: /* @__PURE__ */ k(oe, {
|
|
1207
1207
|
size: 16,
|
|
1208
1208
|
"aria-hidden": "true"
|
|
1209
1209
|
})
|
|
1210
1210
|
}),
|
|
1211
|
-
s && /* @__PURE__ */
|
|
1211
|
+
s && /* @__PURE__ */ k("button", {
|
|
1212
1212
|
className: "chat-game-close",
|
|
1213
1213
|
type: "button",
|
|
1214
1214
|
"aria-label": "Cerrar tablero y volver al chat",
|
|
1215
1215
|
title: "Cerrar tablero",
|
|
1216
1216
|
onClick: s,
|
|
1217
|
-
children: /* @__PURE__ */
|
|
1217
|
+
children: /* @__PURE__ */ k(oe, {
|
|
1218
1218
|
size: 16,
|
|
1219
1219
|
"aria-hidden": "true"
|
|
1220
1220
|
})
|
|
1221
1221
|
})
|
|
1222
1222
|
]
|
|
1223
1223
|
}),
|
|
1224
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ k("p", {
|
|
1225
1225
|
className: "chat-game-status",
|
|
1226
1226
|
role: "status",
|
|
1227
1227
|
children: Fe
|
|
1228
1228
|
}),
|
|
1229
|
-
e.status === "invited" && /* @__PURE__ */
|
|
1229
|
+
e.status === "invited" && /* @__PURE__ */ A("div", {
|
|
1230
1230
|
className: "tk-invite",
|
|
1231
1231
|
children: [
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
W && /* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ k("p", { children: "Duelo de artillería por turnos: mueve tu tanque, apunta la torreta, elige la potencia y destruye al rival. 100 HP cada uno." }),
|
|
1233
|
+
W && /* @__PURE__ */ A("div", {
|
|
1234
1234
|
className: "chat-game-actions",
|
|
1235
|
-
children: [/* @__PURE__ */
|
|
1235
|
+
children: [/* @__PURE__ */ k("button", {
|
|
1236
1236
|
type: "button",
|
|
1237
1237
|
className: "chat-game-action chat-game-action--primary",
|
|
1238
1238
|
disabled: !l || e.pending,
|
|
1239
1239
|
onClick: () => J("act", t, "game_accept"),
|
|
1240
1240
|
children: "Aceptar duelo"
|
|
1241
|
-
}), /* @__PURE__ */
|
|
1241
|
+
}), /* @__PURE__ */ k("button", {
|
|
1242
1242
|
type: "button",
|
|
1243
1243
|
className: "chat-game-action",
|
|
1244
1244
|
disabled: !l || e.pending,
|
|
@@ -1246,16 +1246,16 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1246
1246
|
children: "Rechazar"
|
|
1247
1247
|
})]
|
|
1248
1248
|
}),
|
|
1249
|
-
Ge && /* @__PURE__ */
|
|
1249
|
+
Ge && /* @__PURE__ */ k("p", {
|
|
1250
1250
|
className: "tk-hint",
|
|
1251
1251
|
children: "¿No responde? Tu contacto puede necesitar actualizar la app para jugar a Tanques."
|
|
1252
1252
|
})
|
|
1253
1253
|
]
|
|
1254
1254
|
}),
|
|
1255
|
-
z && /* @__PURE__ */
|
|
1255
|
+
z && /* @__PURE__ */ A("div", {
|
|
1256
1256
|
className: "tk-stage-wrap",
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ k("div", {
|
|
1259
1259
|
ref: u,
|
|
1260
1260
|
className: `tk-stage${q ? " is-aiming" : ""}`,
|
|
1261
1261
|
tabIndex: 0,
|
|
@@ -1267,42 +1267,42 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1267
1267
|
onPointerCancel: Oe,
|
|
1268
1268
|
onKeyDown: ke
|
|
1269
1269
|
}),
|
|
1270
|
-
V === "loading" && /* @__PURE__ */
|
|
1270
|
+
V === "loading" && /* @__PURE__ */ k("div", {
|
|
1271
1271
|
className: "tk-stage-note",
|
|
1272
1272
|
role: "status",
|
|
1273
1273
|
children: "Cargando campo de batalla…"
|
|
1274
1274
|
}),
|
|
1275
|
-
V === "none" && /* @__PURE__ */
|
|
1275
|
+
V === "none" && /* @__PURE__ */ k("div", {
|
|
1276
1276
|
className: "tk-stage-note",
|
|
1277
1277
|
role: "alert",
|
|
1278
1278
|
children: "No se pudo dibujar el campo de batalla."
|
|
1279
1279
|
}),
|
|
1280
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ A("div", {
|
|
1281
1281
|
className: "tk-hud",
|
|
1282
1282
|
children: [
|
|
1283
|
-
/* @__PURE__ */
|
|
1283
|
+
/* @__PURE__ */ k(ze, {
|
|
1284
1284
|
label: U === 0 ? "Tú" : "Verde",
|
|
1285
1285
|
hp: Ve[0]?.hp ?? 100,
|
|
1286
1286
|
color: le[0],
|
|
1287
1287
|
active: e.turnId === ve[0]
|
|
1288
1288
|
}),
|
|
1289
|
-
/* @__PURE__ */
|
|
1289
|
+
/* @__PURE__ */ k(ze, {
|
|
1290
1290
|
label: U === 1 ? "Tú" : "Rojo",
|
|
1291
1291
|
hp: Ve[1]?.hp ?? 100,
|
|
1292
1292
|
color: le[1],
|
|
1293
1293
|
active: e.turnId === ve[1]
|
|
1294
1294
|
}),
|
|
1295
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ A("div", {
|
|
1296
1296
|
className: "tk-hud-meta",
|
|
1297
1297
|
children: [
|
|
1298
|
-
$ && /* @__PURE__ */
|
|
1298
|
+
$ && /* @__PURE__ */ A("span", {
|
|
1299
1299
|
title: "Viento",
|
|
1300
1300
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1301
|
+
/* @__PURE__ */ k(ae, {
|
|
1302
1302
|
size: 12,
|
|
1303
1303
|
"aria-hidden": "true"
|
|
1304
1304
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1305
|
+
/* @__PURE__ */ k("i", {
|
|
1306
1306
|
className: "tk-wind-arrow",
|
|
1307
1307
|
style: { transform: `rotate(${We}deg)` },
|
|
1308
1308
|
"aria-hidden": "true",
|
|
@@ -1312,13 +1312,13 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1312
1312
|
" m/s²"
|
|
1313
1313
|
]
|
|
1314
1314
|
}),
|
|
1315
|
-
e.logic && /* @__PURE__ */
|
|
1315
|
+
e.logic && /* @__PURE__ */ A("span", { children: [
|
|
1316
1316
|
"Disparo ",
|
|
1317
1317
|
Math.min(e.logic.shots + 1, e.logic.maxShots),
|
|
1318
1318
|
"/",
|
|
1319
1319
|
e.logic.maxShots
|
|
1320
1320
|
] }),
|
|
1321
|
-
e.status === "active" && !C && /* @__PURE__ */
|
|
1321
|
+
e.status === "active" && !C && /* @__PURE__ */ A("span", {
|
|
1322
1322
|
className: Se <= 10 ? "tk-timer is-low" : "tk-timer",
|
|
1323
1323
|
children: [Se, "s"]
|
|
1324
1324
|
})
|
|
@@ -1326,25 +1326,25 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1326
1326
|
})
|
|
1327
1327
|
]
|
|
1328
1328
|
}),
|
|
1329
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ A("div", {
|
|
1330
1330
|
className: "tk-stage-tools",
|
|
1331
|
-
children: [/* @__PURE__ */
|
|
1331
|
+
children: [/* @__PURE__ */ A("button", {
|
|
1332
1332
|
type: "button",
|
|
1333
1333
|
className: "chat-game-action",
|
|
1334
1334
|
"aria-pressed": P === "aim",
|
|
1335
1335
|
onClick: () => se(P === "aim" ? "overview" : "aim"),
|
|
1336
1336
|
title: "Cambiar cámara",
|
|
1337
|
-
children: [/* @__PURE__ */
|
|
1337
|
+
children: [/* @__PURE__ */ k(N, {
|
|
1338
1338
|
size: 14,
|
|
1339
1339
|
"aria-hidden": "true"
|
|
1340
1340
|
}), P === "aim" ? "Vista general" : "Cámara de apuntado"]
|
|
1341
|
-
}), V !== "loading" && /* @__PURE__ */
|
|
1341
|
+
}), V !== "loading" && /* @__PURE__ */ A("button", {
|
|
1342
1342
|
type: "button",
|
|
1343
1343
|
className: "chat-game-action",
|
|
1344
1344
|
"aria-pressed": _e,
|
|
1345
1345
|
onClick: () => b(!_e),
|
|
1346
1346
|
title: "Cambiar vista",
|
|
1347
|
-
children: [/* @__PURE__ */ M
|
|
1347
|
+
children: [/* @__PURE__ */ k(M, {
|
|
1348
1348
|
size: 14,
|
|
1349
1349
|
"aria-hidden": "true"
|
|
1350
1350
|
}), _e ? "Vista 3D" : "Vista 2D"]
|
|
@@ -1352,22 +1352,22 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1352
1352
|
})
|
|
1353
1353
|
]
|
|
1354
1354
|
}),
|
|
1355
|
-
q && x && He && /* @__PURE__ */
|
|
1355
|
+
q && x && He && /* @__PURE__ */ A("div", {
|
|
1356
1356
|
className: "tk-controls",
|
|
1357
1357
|
"aria-label": "Controles del disparo",
|
|
1358
1358
|
children: [
|
|
1359
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ A("label", {
|
|
1360
1360
|
className: "tk-control",
|
|
1361
|
-
children: [/* @__PURE__ */
|
|
1361
|
+
children: [/* @__PURE__ */ A("span", { children: [
|
|
1362
1362
|
"Mover ",
|
|
1363
|
-
/* @__PURE__ */
|
|
1363
|
+
/* @__PURE__ */ A("strong", { children: [(x.move * .5).toFixed(1), " m"] }),
|
|
1364
1364
|
" ",
|
|
1365
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ A("small", { children: [
|
|
1366
1366
|
"combustible ",
|
|
1367
1367
|
Math.floor(He.fuel / 1e5),
|
|
1368
1368
|
" m"
|
|
1369
1369
|
] })
|
|
1370
|
-
] }), /* @__PURE__ */
|
|
1370
|
+
] }), /* @__PURE__ */ k("input", {
|
|
1371
1371
|
type: "range",
|
|
1372
1372
|
min: n.move[0],
|
|
1373
1373
|
max: n.move[1],
|
|
@@ -1376,9 +1376,9 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1376
1376
|
"aria-valuetext": `${(x.move * .5).toFixed(1)} metros`
|
|
1377
1377
|
})]
|
|
1378
1378
|
}),
|
|
1379
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ A("label", {
|
|
1380
1380
|
className: "tk-control",
|
|
1381
|
-
children: [/* @__PURE__ */
|
|
1381
|
+
children: [/* @__PURE__ */ A("span", { children: ["Torreta ", /* @__PURE__ */ A("strong", { children: [x.yaw, "°"] })] }), /* @__PURE__ */ k("input", {
|
|
1382
1382
|
type: "range",
|
|
1383
1383
|
min: n.yaw[0],
|
|
1384
1384
|
max: n.yaw[1],
|
|
@@ -1387,9 +1387,9 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1387
1387
|
"aria-valuetext": `${x.yaw} grados`
|
|
1388
1388
|
})]
|
|
1389
1389
|
}),
|
|
1390
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ A("label", {
|
|
1391
1391
|
className: "tk-control",
|
|
1392
|
-
children: [/* @__PURE__ */
|
|
1392
|
+
children: [/* @__PURE__ */ A("span", { children: ["Elevación ", /* @__PURE__ */ A("strong", { children: [x.pitch, "°"] })] }), /* @__PURE__ */ k("input", {
|
|
1393
1393
|
type: "range",
|
|
1394
1394
|
min: n.pitch[0],
|
|
1395
1395
|
max: n.pitch[1],
|
|
@@ -1398,9 +1398,9 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1398
1398
|
"aria-valuetext": `${x.pitch} grados`
|
|
1399
1399
|
})]
|
|
1400
1400
|
}),
|
|
1401
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ A("label", {
|
|
1402
1402
|
className: "tk-control",
|
|
1403
|
-
children: [/* @__PURE__ */
|
|
1403
|
+
children: [/* @__PURE__ */ A("span", { children: ["Potencia ", /* @__PURE__ */ k("strong", { children: x.power })] }), /* @__PURE__ */ k("input", {
|
|
1404
1404
|
type: "range",
|
|
1405
1405
|
min: n.power[0],
|
|
1406
1406
|
max: n.power[1],
|
|
@@ -1409,13 +1409,13 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1409
1409
|
"aria-valuetext": `Potencia ${x.power}`
|
|
1410
1410
|
})]
|
|
1411
1411
|
}),
|
|
1412
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ k("div", {
|
|
1413
1413
|
className: "tk-ammo",
|
|
1414
1414
|
role: "radiogroup",
|
|
1415
1415
|
"aria-label": "Munición",
|
|
1416
1416
|
children: Object.keys(c).map((e) => {
|
|
1417
1417
|
let t = c[e].cost === 0 ? "∞" : He.ammo[e] ?? 0;
|
|
1418
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ A("button", {
|
|
1419
1419
|
type: "button",
|
|
1420
1420
|
role: "radio",
|
|
1421
1421
|
"aria-checked": x.ammo === e,
|
|
@@ -1425,46 +1425,46 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1425
1425
|
children: [
|
|
1426
1426
|
Ne[e],
|
|
1427
1427
|
" ",
|
|
1428
|
-
/* @__PURE__ */
|
|
1428
|
+
/* @__PURE__ */ k("small", { children: t })
|
|
1429
1429
|
]
|
|
1430
1430
|
}, e);
|
|
1431
1431
|
})
|
|
1432
1432
|
}),
|
|
1433
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ A("button", {
|
|
1434
1434
|
type: "button",
|
|
1435
1435
|
className: "tk-fire",
|
|
1436
1436
|
disabled: !l || e.pending,
|
|
1437
1437
|
onClick: we,
|
|
1438
|
-
children: [/* @__PURE__ */
|
|
1438
|
+
children: [/* @__PURE__ */ k(te, {
|
|
1439
1439
|
size: 18,
|
|
1440
1440
|
"aria-hidden": "true"
|
|
1441
1441
|
}), "DISPARAR"]
|
|
1442
1442
|
})
|
|
1443
1443
|
]
|
|
1444
1444
|
}),
|
|
1445
|
-
e.status === "conflict" && /* @__PURE__ */
|
|
1445
|
+
e.status === "conflict" && /* @__PURE__ */ A(O, { children: [e.error && /* @__PURE__ */ k("p", {
|
|
1446
1446
|
className: "chat-game-error",
|
|
1447
1447
|
role: "alert",
|
|
1448
1448
|
children: e.error
|
|
1449
|
-
}), /* @__PURE__ */
|
|
1449
|
+
}), /* @__PURE__ */ k(Re, {
|
|
1450
1450
|
sync: e.sync,
|
|
1451
1451
|
connected: l,
|
|
1452
1452
|
onResync: () => J("requestResync", t),
|
|
1453
1453
|
onAdoptOffer: () => J("adoptResyncOffer", t)
|
|
1454
1454
|
})] }),
|
|
1455
|
-
e.status !== "conflict" && e.error && /* @__PURE__ */
|
|
1455
|
+
e.status !== "conflict" && e.error && /* @__PURE__ */ k("p", {
|
|
1456
1456
|
className: "chat-game-error",
|
|
1457
1457
|
role: "alert",
|
|
1458
1458
|
children: e.error
|
|
1459
1459
|
}),
|
|
1460
|
-
F && /* @__PURE__ */
|
|
1460
|
+
F && /* @__PURE__ */ k("p", {
|
|
1461
1461
|
className: "chat-game-error",
|
|
1462
1462
|
role: "alert",
|
|
1463
1463
|
children: F
|
|
1464
1464
|
}),
|
|
1465
|
-
e.pendingEvent && !e.pending && /* @__PURE__ */
|
|
1465
|
+
e.pendingEvent && !e.pending && /* @__PURE__ */ k("div", {
|
|
1466
1466
|
className: "chat-game-actions",
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1467
|
+
children: /* @__PURE__ */ k("button", {
|
|
1468
1468
|
type: "button",
|
|
1469
1469
|
className: "chat-game-action chat-game-action--primary",
|
|
1470
1470
|
disabled: !l,
|
|
@@ -1472,26 +1472,26 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1472
1472
|
children: "Reintentar envío"
|
|
1473
1473
|
})
|
|
1474
1474
|
}),
|
|
1475
|
-
e.status === "active" && G && /* @__PURE__ */
|
|
1475
|
+
e.status === "active" && G && /* @__PURE__ */ k("div", {
|
|
1476
1476
|
className: "chat-game-actions tk-secondary",
|
|
1477
|
-
children: I ? /* @__PURE__ */
|
|
1477
|
+
children: I ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
1478
1478
|
type: "button",
|
|
1479
1479
|
className: "chat-game-action chat-game-action--danger",
|
|
1480
1480
|
onClick: () => {
|
|
1481
1481
|
L(!1), J("tkResign", t);
|
|
1482
1482
|
},
|
|
1483
1483
|
children: "Confirmar rendición"
|
|
1484
|
-
}), /* @__PURE__ */
|
|
1484
|
+
}), /* @__PURE__ */ k("button", {
|
|
1485
1485
|
type: "button",
|
|
1486
1486
|
className: "chat-game-action",
|
|
1487
1487
|
onClick: () => L(!1),
|
|
1488
1488
|
children: "Cancelar"
|
|
1489
|
-
})] }) : /* @__PURE__ */
|
|
1489
|
+
})] }) : /* @__PURE__ */ A("button", {
|
|
1490
1490
|
type: "button",
|
|
1491
1491
|
className: "chat-game-action",
|
|
1492
1492
|
disabled: !l || !!e.pendingEvent,
|
|
1493
1493
|
onClick: () => L(!0),
|
|
1494
|
-
children: [/* @__PURE__ */
|
|
1494
|
+
children: [/* @__PURE__ */ k(ne, {
|
|
1495
1495
|
size: 14,
|
|
1496
1496
|
"aria-hidden": "true"
|
|
1497
1497
|
}), "Rendirse"]
|
|
@@ -1501,14 +1501,14 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1501
1501
|
"won",
|
|
1502
1502
|
"draw",
|
|
1503
1503
|
"closed"
|
|
1504
|
-
].includes(e.status) && G && /* @__PURE__ */
|
|
1504
|
+
].includes(e.status) && G && /* @__PURE__ */ k("div", {
|
|
1505
1505
|
className: "chat-game-actions",
|
|
1506
|
-
children: /* @__PURE__ */
|
|
1506
|
+
children: /* @__PURE__ */ A("button", {
|
|
1507
1507
|
type: "button",
|
|
1508
1508
|
className: "chat-game-action chat-game-action--primary",
|
|
1509
1509
|
disabled: !l,
|
|
1510
1510
|
onClick: je,
|
|
1511
|
-
children: [/* @__PURE__ */
|
|
1511
|
+
children: [/* @__PURE__ */ k(re, {
|
|
1512
1512
|
size: 14,
|
|
1513
1513
|
"aria-hidden": "true"
|
|
1514
1514
|
}), "Revancha"]
|
|
@@ -1519,10 +1519,10 @@ function He({ game: e, gameKey: t, currentUserId: r, variant: i, onMinimize: o,
|
|
|
1519
1519
|
}
|
|
1520
1520
|
function $({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: a }) {
|
|
1521
1521
|
let o = e((e) => e.games[t]);
|
|
1522
|
-
return o ? r === "history" ? /* @__PURE__ */
|
|
1522
|
+
return o ? r === "history" ? /* @__PURE__ */ k(Ve, {
|
|
1523
1523
|
game: o,
|
|
1524
1524
|
currentUserId: n
|
|
1525
|
-
}) : /* @__PURE__ */
|
|
1525
|
+
}) : /* @__PURE__ */ k(He, {
|
|
1526
1526
|
game: o,
|
|
1527
1527
|
gameKey: t,
|
|
1528
1528
|
currentUserId: n,
|
|
@@ -1534,4 +1534,4 @@ function $({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i,
|
|
|
1534
1534
|
var Ue = x($);
|
|
1535
1535
|
export { Ue as default };
|
|
1536
1536
|
|
|
1537
|
-
//# sourceMappingURL=TanksGameCard-
|
|
1537
|
+
//# sourceMappingURL=TanksGameCard-B-gtDYYg.js.map
|