@minicode-dev/chat 0.1.7 → 0.1.8

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.
Files changed (37) hide show
  1. package/README.md +25 -0
  2. package/dist/chunks/{BattleshipGameCard-CAWHxqJE.js → BattleshipGameCard-BFqA0cjT.js} +247 -246
  3. package/dist/chunks/{BattleshipGameCard-CAWHxqJE.js.map → BattleshipGameCard-BFqA0cjT.js.map} +1 -1
  4. package/dist/chunks/{ChatContext-CUiEAMKK.js → ChatContext-dty_KPDX.js} +2 -2
  5. package/dist/chunks/{ChatContext-CUiEAMKK.js.map → ChatContext-dty_KPDX.js.map} +1 -1
  6. package/dist/chunks/TanksGameCard-D0n-lzTs.js +1535 -0
  7. package/dist/chunks/TanksGameCard-D0n-lzTs.js.map +1 -0
  8. package/dist/chunks/TanksLiveGameCard-BmNRXP66.js +849 -0
  9. package/dist/chunks/TanksLiveGameCard-BmNRXP66.js.map +1 -0
  10. package/dist/chunks/WebRtcLab-B7xBlJy1.js +510 -0
  11. package/dist/chunks/WebRtcLab-B7xBlJy1.js.map +1 -0
  12. package/dist/chunks/{connect4Sounds-BDXQAvU1.js → connect4Sounds-BN7d_TM2.js} +654 -618
  13. package/dist/chunks/connect4Sounds-BN7d_TM2.js.map +1 -0
  14. package/dist/chunks/createLiveScene-CtYPcOPo.js +364 -0
  15. package/dist/chunks/createLiveScene-CtYPcOPo.js.map +1 -0
  16. package/dist/chunks/createPeerLink-qei05vpV.js +478 -0
  17. package/dist/chunks/createPeerLink-qei05vpV.js.map +1 -0
  18. package/dist/chunks/createTankScene-CV7Brxmt.js +685 -0
  19. package/dist/chunks/createTankScene-CV7Brxmt.js.map +1 -0
  20. package/dist/chunks/fx-BHsl4S_J.js +1470 -0
  21. package/dist/chunks/fx-BHsl4S_J.js.map +1 -0
  22. package/dist/chunks/gameStatus-Cu1Z8un9.js +69 -0
  23. package/dist/chunks/gameStatus-Cu1Z8un9.js.map +1 -0
  24. package/dist/chunks/signalFaults-Dv2YjjKy.js +36 -0
  25. package/dist/chunks/signalFaults-Dv2YjjKy.js.map +1 -0
  26. package/dist/chunks/tanksSounds-C99OD2xD.js +177 -0
  27. package/dist/chunks/tanksSounds-C99OD2xD.js.map +1 -0
  28. package/dist/index.js +1861 -1829
  29. package/dist/index.js.map +1 -1
  30. package/dist/styles.css +1 -1
  31. package/index.d.ts +61 -0
  32. package/package.json +1 -1
  33. package/dist/chunks/TanksGameCard-BEnXTz_J.js +0 -1705
  34. package/dist/chunks/TanksGameCard-BEnXTz_J.js.map +0 -1
  35. package/dist/chunks/connect4Sounds-BDXQAvU1.js.map +0 -1
  36. package/dist/chunks/createTankScene-BuliAxwR.js +0 -2150
  37. package/dist/chunks/createTankScene-BuliAxwR.js.map +0 -1
@@ -1,15 +1,16 @@
1
- import { C as e, a as t, h as n, m as r, o as i, s as a, t as o, u as s, v as c, y as l } from "./connect4Sounds-BDXQAvU1.js";
2
- import { l as u, n as d, s as f, t as p } from "./board-DXKuIZ1I.js";
1
+ import { a as e, d as t, o as n, s as r, t as i } from "./connect4Sounds-BN7d_TM2.js";
2
+ import { l as a, n as o, s, t as c } from "./board-DXKuIZ1I.js";
3
+ import { c as l, f as u, i as d, l as f, t as p } from "./gameStatus-Cu1Z8un9.js";
3
4
  import "../index.js";
4
5
  import { t as ee } from "./webglSupport-2WjPEPZ_.js";
5
6
  import { memo as m, useCallback as h, useEffect as g, useId as te, useMemo as _, useRef as v, useState as y } from "react";
6
7
  import { Anchor as ne, Check as re, ChevronDown as ie, Crosshair as ae, LocateFixed as oe, Maximize2 as se, Minimize2 as ce, Radar as le, RotateCw as ue, ShieldCheck as b, Shuffle as de, TriangleAlert as fe, Waves as pe, X as me } from "lucide-react";
7
8
  import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
8
9
  // src/games/battleship/sound/battleshipSounds.js
9
- var C = "ocean_ambient_loop", w = t({
10
+ var C = "ocean_ambient_loop", w = e({
10
11
  id: "battleship",
11
- baseUrl: () => l("battleship_audio_pack/assets"),
12
- settingsFrom: o,
12
+ baseUrl: () => r("battleship_audio_pack/assets"),
13
+ settingsFrom: i,
13
14
  sounds: Object.fromEntries([
14
15
  "cannon_fire",
15
16
  "projectile_flyby",
@@ -42,14 +43,14 @@ var C = "ocean_ambient_loop", w = t({
42
43
  defeat: .4,
43
44
  [C]: .22
44
45
  }
45
- }), T = () => typeof document < "u" && document.hidden;
46
- function E(e) {
47
- T() || w.play(e);
46
+ }), ge = () => typeof document < "u" && document.hidden;
47
+ function T(e) {
48
+ ge() || w.play(e);
48
49
  }
49
- function ge(e, t, n) {
50
+ function _e(e, t, n) {
50
51
  e.forEach(({ name: e, at: r }) => {
51
52
  let i = () => {
52
- T() || w.play(e, { key: t(e) });
53
+ ge() || w.play(e, { key: t(e) });
53
54
  };
54
55
  if (r <= 0) {
55
56
  i();
@@ -61,26 +62,26 @@ function ge(e, t, n) {
61
62
  n.add(a);
62
63
  });
63
64
  }
64
- var D = 0, O = () => {
65
- D > 0 && !T() ? w.startLoop(C) : w.stopLoop(C);
65
+ var E = 0, D = () => {
66
+ E > 0 && !ge() ? w.startLoop(C) : w.stopLoop(C);
66
67
  };
67
- function _e() {
68
- D += 1, D === 1 && document.addEventListener("visibilitychange", O), O();
68
+ function ve() {
69
+ E += 1, E === 1 && document.addEventListener("visibilitychange", D), D();
69
70
  let e = !1;
70
71
  return () => {
71
- e || (e = !0, --D, D === 0 && document.removeEventListener("visibilitychange", O), O());
72
+ e || (e = !0, --E, E === 0 && document.removeEventListener("visibilitychange", D), D());
72
73
  };
73
74
  }
74
75
  // src/games/battleship/sound/cues.js
75
- var ve = "cruiser", ye = (e, t) => e.row === t.row && e.col === t.col, k = (e, t, n) => e.cells.filter((e) => t?.[e.row]?.[e.col] === "hit" && !(n && ye(e, n))).length;
76
- function be(e, t, n) {
76
+ var ye = "cruiser", be = (e, t) => e.row === t.row && e.col === t.col, O = (e, t, n) => e.cells.filter((e) => t?.[e.row]?.[e.col] === "hit" && !(n && be(e, n))).length;
77
+ function xe(e, t, n) {
77
78
  if (n?.result !== "hit") return !1;
78
- let r = (e || []).find((e) => e.id === ve);
79
- if (!r?.cells?.some((e) => ye(e, n))) return !1;
80
- let i = k(r, t, n), a = k(r, t);
79
+ let r = (e || []).find((e) => e.id === ye);
80
+ if (!r?.cells?.some((e) => be(e, n))) return !1;
81
+ let i = O(r, t, n), a = O(r, t);
81
82
  return i < 2 && a >= 2;
82
83
  }
83
- function xe({ incoming: e }) {
84
+ function Se({ incoming: e }) {
84
85
  return e ? [{
85
86
  name: "projectile_flyby",
86
87
  at: 0
@@ -92,7 +93,7 @@ function xe({ incoming: e }) {
92
93
  at: 180
93
94
  }];
94
95
  }
95
- function Se({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
96
+ function Ce({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
96
97
  let a = e === "hit" ? t ? [{
97
98
  name: "ship_heavy_hit",
98
99
  at: 0
@@ -115,25 +116,25 @@ function Se({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
115
116
  }), a;
116
117
  }
117
118
  // src/games/battleship/BattleshipGameCard.jsx
118
- var A = "ABCDEFGHIJ", Ce = {
119
+ var k = "ABCDEFGHIJ", we = {
119
120
  carrier: "portaaviones",
120
121
  battleship: "acorazado",
121
122
  cruiser: "crucero",
122
123
  submarine: "submarino",
123
124
  destroyer: "destructor"
124
- }, we = [
125
+ }, Te = [
125
126
  "placement",
126
127
  "active",
127
128
  "won",
128
129
  "conflict",
129
130
  "closed"
130
- ], Te = 400, Ee = Array.from({ length: 10 }, () => Array(10).fill(null)), j = (e) => e ? `${A[e.row]}${e.col + 1}` : "—", De = (e, t) => !!(e && t && e.row === t.row && e.col === t.col), M = (e) => !!e && Number.isInteger(e.row) && Number.isInteger(e.col) && e.row >= 0 && e.row < 10 && e.col >= 0 && e.col < 10, Oe = (e) => Ce[e] || "barco", ke = (e, t) => e?.[t.row]?.[t.col] ?? null, Ae = (e, t) => e.find((e) => e.cells?.some((e) => De(e, t))), je = (e) => e.charAt(0).toUpperCase() + e.slice(1), Me = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, N = (t, ...n) => Promise.resolve().then(() => e.getState()[t]?.(...n)).catch(() => {});
131
- function Ne(e) {
132
- let t = d();
131
+ ], Ee = 400, De = Array.from({ length: 10 }, () => Array(10).fill(null)), A = (e) => e ? `${k[e.row]}${e.col + 1}` : "—", Oe = (e, t) => !!(e && t && e.row === t.row && e.col === t.col), j = (e) => !!e && Number.isInteger(e.row) && Number.isInteger(e.col) && e.row >= 0 && e.row < 10 && e.col >= 0 && e.col < 10, ke = (e) => we[e] || "barco", Ae = (e, t) => e?.[t.row]?.[t.col] ?? null, je = (e, t) => e.find((e) => e.cells?.some((e) => Oe(e, t))), Me = (e) => e.charAt(0).toUpperCase() + e.slice(1), Ne = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, M = (e, ...n) => Promise.resolve().then(() => t.getState()[e]?.(...n)).catch(() => {});
132
+ function Pe(e) {
133
+ let t = o();
133
134
  for (let n of e || []) {
134
135
  let e = n.cells?.[0];
135
136
  if (!e) continue;
136
- let r = f(t, {
137
+ let r = s(t, {
137
138
  shipId: n.id,
138
139
  row: e.row,
139
140
  col: e.col,
@@ -143,13 +144,13 @@ function Ne(e) {
143
144
  }
144
145
  return t;
145
146
  }
146
- function Pe(e, t, n) {
147
+ function Fe(e, t, n) {
147
148
  return Array.from({ length: t }, (t, r) => ({
148
149
  row: e.row + (n === "vertical" ? r : 0),
149
150
  col: e.col + (n === "horizontal" ? r : 0)
150
- })).filter(M);
151
+ })).filter(j);
151
152
  }
152
- function Fe(e) {
153
+ function Ie(e) {
153
154
  let t = 0, n = 0;
154
155
  for (let r of e || []) for (let e of r || []) e && (t += 1), e === "hit" && (n += 1);
155
156
  return {
@@ -157,7 +158,7 @@ function Fe(e) {
157
158
  hits: n
158
159
  };
159
160
  }
160
- function Ie({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
161
+ function Le({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
161
162
  return e?.status === "requesting" ? /* @__PURE__ */ x("div", {
162
163
  className: "chat-game-sync",
163
164
  role: "status",
@@ -184,8 +185,8 @@ function Ie({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
184
185
  ]
185
186
  });
186
187
  }
187
- function Le({ game: e }) {
188
- let t = s(e);
188
+ function Re({ game: e }) {
189
+ let t = d(e);
189
190
  return t ? /* @__PURE__ */ S("span", {
190
191
  className: `bs-badge bs-badge--${e.verification}`,
191
192
  children: [
@@ -201,7 +202,7 @@ function Le({ game: e }) {
201
202
  ]
202
203
  }) : null;
203
204
  }
204
- function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
205
+ function ze({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
205
206
  let a = /* @__PURE__ */ new Map();
206
207
  e.ships.forEach((e) => e.cells.forEach((t) => a.set(`${t.row}-${t.col}`, e)));
207
208
  let o = new Set((e.preview?.cells || []).map((e) => `${e.row}-${e.col}`));
@@ -220,11 +221,11 @@ function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
220
221
  d?.sunk && "is-sunk",
221
222
  f && `is-${f}`,
222
223
  o.has(u) && (e.preview.valid ? "is-preview" : "is-invalid"),
223
- De(t, {
224
+ Oe(t, {
224
225
  row: c,
225
226
  col: l
226
227
  }) && "is-selected",
227
- De(n, {
228
+ Oe(n, {
228
229
  row: c,
229
230
  col: l
230
231
  }) && "is-cursor"
@@ -235,7 +236,7 @@ function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
235
236
  tabIndex: -1,
236
237
  className: p,
237
238
  disabled: !e.interactive,
238
- "aria-label": `${A[c]}${l + 1}${f === "hit" ? ", impacto" : f === "miss" ? ", agua" : ""}${d ? ", barco" : ""}`,
239
+ "aria-label": `${k[c]}${l + 1}${f === "hit" ? ", impacto" : f === "miss" ? ", agua" : ""}${d ? ", barco" : ""}`,
239
240
  onMouseEnter: () => i({
240
241
  row: c,
241
242
  col: l
@@ -249,13 +250,13 @@ function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
249
250
  }, c))
250
251
  });
251
252
  }
252
- function P({ game: e, currentUserId: t, status: r }) {
253
- let { total: i, hits: a } = Fe(e.targetShots), o = e.sunkEnemyShips?.length || 0, s = [
253
+ function N({ game: e, currentUserId: t, status: n }) {
254
+ let { total: r, hits: i } = Ie(e.targetShots), a = e.sunkEnemyShips?.length || 0, o = [
254
255
  "active",
255
256
  "won",
256
257
  "closed",
257
258
  "conflict"
258
- ].includes(e.status) && i > 0, c = e.status === "won" && n(t, e.winnerId);
259
+ ].includes(e.status) && r > 0, s = e.status === "won" && f(t, e.winnerId);
259
260
  return /* @__PURE__ */ S("section", {
260
261
  className: "chat-game-card chat-game-card--history bs-card bs-card--history",
261
262
  "aria-label": "Partida de Batalla Naval",
@@ -275,210 +276,210 @@ function P({ game: e, currentUserId: t, status: r }) {
275
276
  })
276
277
  }),
277
278
  /* @__PURE__ */ x("p", {
278
- className: `chat-game-status${c ? " bs-status--win" : ""}`,
279
- children: r
279
+ className: `chat-game-status${s ? " bs-status--win" : ""}`,
280
+ children: n
280
281
  }),
281
- s && /* @__PURE__ */ S("p", {
282
+ o && /* @__PURE__ */ S("p", {
282
283
  className: "bs-history-stats",
283
284
  children: [
284
285
  "Disparos ",
285
- i,
286
+ r,
286
287
  " · Impactos ",
287
- a,
288
+ i,
288
289
  " · Hundidos ",
289
- o,
290
+ a,
290
291
  "/",
291
- p.length
292
+ c.length
292
293
  ]
293
294
  }),
294
- /* @__PURE__ */ x(Le, { game: e })
295
+ /* @__PURE__ */ x(Re, { game: e })
295
296
  ]
296
297
  });
297
298
  }
298
- function F({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: o }) {
299
- let s = e((e) => e.games[t]), l = c() === "connected";
300
- if (!s) return null;
301
- let u = a(s, n);
302
- return r === "history" ? /* @__PURE__ */ x(P, {
303
- game: s,
299
+ function P({ gameKey: e, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: a }) {
300
+ let o = t((t) => t.games[e]), s = u() === "connected";
301
+ if (!o) return null;
302
+ let c = p(o, n);
303
+ return r === "history" ? /* @__PURE__ */ x(N, {
304
+ game: o,
304
305
  currentUserId: n,
305
- status: u
306
- }) : /* @__PURE__ */ x(ze, {
307
- game: s,
308
- gameKey: t,
306
+ status: c
307
+ }) : /* @__PURE__ */ x(Be, {
308
+ game: o,
309
+ gameKey: e,
309
310
  currentUserId: n,
310
- connected: l,
311
- status: u,
311
+ connected: s,
312
+ status: c,
312
313
  variant: r,
313
314
  onMinimize: i,
314
- onDismiss: o
315
+ onDismiss: a
315
316
  });
316
317
  }
317
- function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, variant: c, onMinimize: l, onDismiss: d }) {
318
- let f = v(null), m = v(null), b = v(!1), C = v(void 0), T = v({
318
+ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, variant: s, onMinimize: u, onDismiss: d }) {
319
+ let p = v(null), m = v(null), b = v(!1), C = v(void 0), ge = v({
319
320
  cell: null,
320
321
  time: 0
321
- }), D = v({}), O = v(/* @__PURE__ */ new Set()), ve = v(e.status), ye = te(), [k, A] = y("idle"), [Ce, P] = y("own"), [F, ze] = y(null), [I, Be] = y(null), [L, Ve] = y(null), [R, He] = y("horizontal"), [Ue, We] = y(null), [Ge, Ke] = y(!1), [z, qe] = y(!1), [Je, Ye] = y(!1), [Xe, Ze] = y(null), Qe = n(a, e.hostId), $e = n(a, e.guestId), et = Qe || $e, tt = r(e), B = e.status === "placement", nt = e.status === "active" || e.status === "won", rt = e.status === "active" && n(a, e.turnId), it = !o || !!e.pending || !!e.pendingEvent, V = rt && !e.pendingShot && !it && !e.error && !Je, H = B && !e.myReady && !it, U = we.includes(e.status) && (e.status !== "closed" || (e.myFleet?.length ?? 0) > 0), W = k === "ready", G = _(() => e.myFleet || [], [e.myFleet]), K = e.incomingShots || Ee, q = e.targetShots || Ee, at = _(() => Ne(G), [G]), ot = _(() => new Set(G.map((e) => e.id)), [G]), st = p.every((e) => ot.has(e.id)), J = p.find((e) => e.id === Ue && !ot.has(e.id)) || p.find((e) => !ot.has(e.id)) || null, ct = _(() => G.map((e) => ({
322
+ }), E = v({}), D = v(/* @__PURE__ */ new Set()), ye = v(e.status), be = te(), [O, k] = y("idle"), [we, N] = y("own"), [P, Be] = y(null), [F, Ve] = y(null), [I, He] = y(null), [L, Ue] = y("horizontal"), [We, Ge] = y(null), [Ke, qe] = y(!1), [R, Je] = y(!1), [Ye, Xe] = y(!1), [Ze, Qe] = y(null), $e = f(r, e.hostId), et = f(r, e.guestId), tt = $e || et, nt = l(e), z = e.status === "placement", rt = e.status === "active" || e.status === "won", it = e.status === "active" && f(r, e.turnId), at = !i || !!e.pending || !!e.pendingEvent, B = it && !e.pendingShot && !at && !e.error && !Ye, V = z && !e.myReady && !at, H = Te.includes(e.status) && (e.status !== "closed" || (e.myFleet?.length ?? 0) > 0), U = O === "ready", W = _(() => e.myFleet || [], [e.myFleet]), G = e.incomingShots || De, K = e.targetShots || De, ot = _(() => Pe(W), [W]), q = _(() => new Set(W.map((e) => e.id)), [W]), st = c.every((e) => q.has(e.id)), J = c.find((e) => e.id === We && !q.has(e.id)) || c.find((e) => !q.has(e.id)) || null, ct = _(() => W.map((e) => ({
322
323
  ...e,
323
- sunk: !!e.cells?.length && e.cells.every((e) => ke(K, e) === "hit")
324
- })), [G, K]), lt = _(() => (e.sunkEnemyShips || []).filter((e) => e?.cells?.length).map((e) => ({
324
+ sunk: !!e.cells?.length && e.cells.every((e) => Ae(G, e) === "hit")
325
+ })), [W, G]), lt = _(() => (e.sunkEnemyShips || []).filter((e) => e?.cells?.length).map((e) => ({
325
326
  ...e,
326
327
  size: e.size ?? e.cells.length,
327
328
  sunk: !0
328
- })), [e.sunkEnemyShips]), { total: ut, hits: dt } = _(() => Fe(q), [q]), ft = _(() => {
329
+ })), [e.sunkEnemyShips]), { total: ut, hits: dt } = _(() => Ie(K), [K]), ft = _(() => {
329
330
  let e = [];
330
- return q.forEach((t, n) => t?.forEach((t, r) => {
331
+ return K.forEach((t, n) => t?.forEach((t, r) => {
331
332
  t === "hit" && e.push({
332
333
  row: n,
333
334
  col: r
334
335
  });
335
336
  })), e;
336
- }, [q]), Y = B ? "own" : Ce, X = F || I, pt = _(() => {
337
- if (!H || !J || !X) return null;
338
- let e = u(at, {
337
+ }, [K]), Y = z ? "own" : we, X = P || F, pt = _(() => {
338
+ if (!V || !J || !X) return null;
339
+ let e = a(ot, {
339
340
  shipId: J.id,
340
341
  row: X.row,
341
342
  col: X.col,
342
- orientation: R
343
+ orientation: L
343
344
  });
344
345
  return {
345
- cells: e.ok ? e.ship.cells : Pe(X, J.size, R),
346
+ cells: e.ok ? e.ship.cells : Fe(X, J.size, L),
346
347
  valid: e.ok
347
348
  };
348
349
  }, [
349
- H,
350
+ V,
350
351
  J,
351
352
  X,
352
- at,
353
- R
353
+ ot,
354
+ L
354
355
  ]), mt = h((e, t) => {
355
356
  if (e === "target") {
356
- let e = t ? q.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : q;
357
+ let e = t ? K.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : K;
357
358
  return {
358
359
  mode: "target",
359
- ships: t ? lt.map((e) => Ae([e], t) ? {
360
+ ships: t ? lt.map((e) => je([e], t) ? {
360
361
  ...e,
361
362
  sunk: !1
362
363
  } : e) : lt,
363
364
  shots: e,
364
365
  preview: null,
365
- interactive: V
366
+ interactive: B
366
367
  };
367
368
  }
368
- let n = t ? K.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : K;
369
+ let n = t ? G.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : G;
369
370
  return {
370
371
  mode: "own",
371
- ships: t ? ct.map((e) => Ae([e], t) ? {
372
+ ships: t ? ct.map((e) => je([e], t) ? {
372
373
  ...e,
373
374
  sunk: !1
374
375
  } : e) : ct,
375
376
  shots: n,
376
- preview: B ? pt : null,
377
- interactive: H
377
+ preview: z ? pt : null,
378
+ interactive: V
378
379
  };
379
380
  }, [
380
- q,
381
- lt,
382
381
  K,
382
+ lt,
383
+ G,
383
384
  ct,
384
- B,
385
+ z,
385
386
  pt,
386
- V,
387
- H
388
- ]), ht = _(() => mt(Y), [mt, Y]), Z = h((e, t = "info") => Ze({
387
+ B,
388
+ V
389
+ ]), ht = _(() => mt(Y), [mt, Y]), Z = h((e, t = "info") => Qe({
389
390
  text: e,
390
391
  kind: t,
391
392
  id: Date.now()
392
- }), []), gt = h((e = L) => {
393
- V && M(e) && (ke(q, e) ? Z(`Ya disparaste en ${j(e)}`) : (Ve(null), m.current?.selectCell?.(null), E("ui_click"), N("bsFire", t, {
393
+ }), []), gt = h((e = I) => {
394
+ B && j(e) && (Ae(K, e) ? Z(`Ya disparaste en ${A(e)}`) : (He(null), m.current?.selectCell?.(null), T("ui_click"), M("bsFire", t, {
394
395
  row: e.row,
395
396
  col: e.col
396
397
  })));
397
398
  }, [
398
- V,
399
- L,
400
- q,
399
+ B,
400
+ I,
401
+ K,
401
402
  t,
402
403
  Z
403
404
  ]), _t = h((e) => {
404
- if (!H || !M(e)) return;
405
- let n = Ae(G, e);
405
+ if (!V || !j(e)) return;
406
+ let n = je(W, e);
406
407
  if (n) {
407
- We(n.id), n.orientation && He(n.orientation), E("ui_click"), N("bsRemoveShip", t, n.id);
408
+ Ge(n.id), n.orientation && Ue(n.orientation), T("ui_click"), M("bsRemoveShip", t, n.id);
408
409
  return;
409
410
  }
410
411
  if (!J) return;
411
- let r = u(at, {
412
+ let r = a(ot, {
412
413
  shipId: J.id,
413
414
  row: e.row,
414
415
  col: e.col,
415
- orientation: R
416
+ orientation: L
416
417
  });
417
- r.ok ? (We(null), E("ship_place"), N("bsPlaceShip", t, {
418
+ r.ok ? (Ge(null), T("ship_place"), M("bsPlaceShip", t, {
418
419
  shipId: J.id,
419
420
  row: e.row,
420
421
  col: e.col,
421
- orientation: R
422
+ orientation: L
422
423
  })) : Z(r.reason === "overlap" ? "Se superpone con otro barco" : "No cabe en esa posición", "miss");
423
424
  }, [
424
- H,
425
- G,
425
+ V,
426
+ W,
426
427
  J,
427
- at,
428
- R,
428
+ ot,
429
+ L,
429
430
  t,
430
431
  Z
431
432
  ]), vt = h((e) => {
432
- if (!M(e)) return;
433
- if (Be(e), B) {
433
+ if (!j(e)) return;
434
+ if (Ve(e), z) {
434
435
  _t(e);
435
436
  return;
436
437
  }
437
- if (Y !== "target" || !V) return;
438
- let t = Date.now(), n = T.current;
439
- T.current = {
438
+ if (Y !== "target" || !B) return;
439
+ let t = Date.now(), n = ge.current;
440
+ ge.current = {
440
441
  cell: e,
441
442
  time: t
442
- }, De(n.cell, e) && t - n.time < Te ? gt(e) : ke(q, e) ? Z(`Ya disparaste en ${j(e)}`) : (Ve(e), m.current?.selectCell?.(e));
443
+ }, Oe(n.cell, e) && t - n.time < Ee ? gt(e) : Ae(K, e) ? Z(`Ya disparaste en ${A(e)}`) : (He(e), m.current?.selectCell?.(e));
443
444
  }, [
444
- B,
445
+ z,
445
446
  _t,
446
447
  Y,
447
- V,
448
+ B,
448
449
  gt,
449
- q,
450
+ K,
450
451
  Z
451
452
  ]);
452
- D.current = {
453
+ E.current = {
453
454
  selectCell: vt,
454
- setHovered: ze
455
+ setHovered: Be
455
456
  }, g(() => {
456
- let e = f.current;
457
- if (!U || !e) return;
457
+ let e = p.current;
458
+ if (!H || !e) return;
458
459
  if (!ee()) {
459
- A("fallback");
460
+ k("fallback");
460
461
  return;
461
462
  }
462
463
  let t = !1, n = null;
463
- return A("loading"), import("./createBattleScene-L4ZRWDED.js").then(({ createBattleScene: r }) => {
464
+ return k("loading"), import("./createBattleScene-L4ZRWDED.js").then(({ createBattleScene: r }) => {
464
465
  t || (n = r(e, {
465
466
  quality: "auto",
466
- reducedMotion: Me(),
467
+ reducedMotion: Ne(),
467
468
  onCellHover: (e) => {
468
- t || D.current.setHovered(M(e) ? {
469
+ t || E.current.setHovered(j(e) ? {
469
470
  row: e.row,
470
471
  col: e.col
471
472
  } : null);
472
473
  },
473
474
  onCellSelect: (e) => {
474
- t || D.current.selectCell(M(e) ? {
475
+ t || E.current.selectCell(j(e) ? {
475
476
  row: e.row,
476
477
  col: e.col
477
478
  } : null);
478
479
  }
479
- }), m.current = n, A("ready"));
480
+ }), m.current = n, k("ready"));
480
481
  }).catch((e) => {
481
- t || (console.error("[battleship] No se pudo iniciar la escena", e), A("fallback"));
482
+ t || (console.error("[battleship] No se pudo iniciar la escena", e), k("fallback"));
482
483
  }), () => {
483
484
  t = !0, m.current = null;
484
485
  try {
@@ -487,24 +488,24 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
487
488
  console.error("[battleship] Error al liberar la escena", e);
488
489
  }
489
490
  };
490
- }, [U]), g(() => {
491
+ }, [H]), g(() => {
491
492
  w.preload();
492
- let e = O.current;
493
+ let e = D.current;
493
494
  return () => {
494
495
  e.forEach(clearTimeout), e.clear();
495
496
  };
496
497
  }, []);
497
- let yt = U && !tt;
498
- g(() => yt ? _e() : void 0, [yt]), g(() => {
499
- let t = ve.current;
500
- ve.current = e.status, t === "placement" && e.status === "active" && ge([{
498
+ let yt = H && !nt;
499
+ g(() => yt ? ve() : void 0, [yt]), g(() => {
500
+ let t = ye.current;
501
+ ye.current = e.status, t === "placement" && e.status === "active" && _e([{
501
502
  name: "sonar_ping",
502
503
  at: 0
503
- }], () => `${e.gameId}:start`, O.current);
504
+ }], () => `${e.gameId}:start`, D.current);
504
505
  }, [e.status, e.gameId]);
505
506
  let Q = e.lastShot;
506
507
  g(() => {
507
- if (!W && k !== "fallback") return;
508
+ if (!U && O !== "fallback") return;
508
509
  let t = Q?.eventId ?? null;
509
510
  if (C.current === void 0) {
510
511
  C.current = t;
@@ -512,85 +513,85 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
512
513
  }
513
514
  if (!t || t === C.current) return;
514
515
  C.current = t;
515
- let r = !n(Q.by, a), i = {
516
+ let n = !f(Q.by, r), i = {
516
517
  row: Q.row,
517
518
  col: Q.col
518
- }, o = j(i), s = typeof Q.sunk == "string" ? Q.sunk : Q.sunk ? Ae(r ? G : e.sunkEnemyShips || [], i)?.id : null, c = r ? Q.sunk ? `Te hundieron el ${Oe(s)}` : Q.result === "hit" ? `El rival impactó en ${o}` : `El rival falló: agua en ${o}` : Q.sunk ? `¡Hundiste el ${Oe(s)}!` : Q.result === "hit" ? `¡Impacto en ${o}!` : `Agua en ${o}`, l = Q.result === "hit" ? "hit" : "miss", u = r ? "own" : "target", d = r && be(G, e.incomingShots, Q), f = Se({
519
+ }, a = A(i), o = typeof Q.sunk == "string" ? Q.sunk : Q.sunk ? je(n ? W : e.sunkEnemyShips || [], i)?.id : null, s = n ? Q.sunk ? `Te hundieron el ${ke(o)}` : Q.result === "hit" ? `El rival impactó en ${a}` : `El rival falló: agua en ${a}` : Q.sunk ? `¡Hundiste el ${ke(o)}!` : Q.result === "hit" ? `¡Impacto en ${a}!` : `Agua en ${a}`, c = Q.result === "hit" ? "hit" : "miss", l = n ? "own" : "target", u = n && xe(W, e.incomingShots, Q), d = Ce({
519
520
  result: Q.result,
520
521
  sunk: !!Q.sunk,
521
522
  defeated: !!Q.defeated,
522
- won: !r,
523
- cruiserAlarm: d
524
- }), p = (n) => n === "cruiser_damage_alarm" ? `${e.gameId}:cruiser` : n === "victory" || n === "defeat" ? `${e.gameId}:end` : t, ee = O.current;
525
- P(u);
523
+ won: !n,
524
+ cruiserAlarm: u
525
+ }), p = (n) => n === "cruiser_damage_alarm" ? `${e.gameId}:cruiser` : n === "victory" || n === "defeat" ? `${e.gameId}:end` : t, ee = D.current;
526
+ N(l);
526
527
  let h = m.current;
527
528
  if (!h?.playShot) {
528
- ge(f, p, ee), Z(c, l);
529
+ _e(d, p, ee), Z(s, c);
529
530
  return;
530
531
  }
531
- ge(xe({ incoming: r }), p, ee), b.current = !0, Ye(!0);
532
+ _e(Se({ incoming: n }), p, ee), b.current = !0, Xe(!0);
532
533
  let g = !1;
533
534
  try {
534
- h.setView(mt(u, i));
535
+ h.setView(mt(l, i));
535
536
  } catch {}
536
- let te = Me() ? 0 : 600;
537
+ let te = Ne() ? 0 : 600;
537
538
  return Promise.resolve(h.playShot({
538
539
  row: i.row,
539
540
  col: i.col,
540
541
  result: Q.result,
541
542
  sunk: !!Q.sunk,
542
- incoming: r
543
- })).catch(() => {}).then(() => (ge(f, p, ee), g || Z(c, l), new Promise((e) => setTimeout(e, te)))).then(() => {
544
- g || (b.current = !1, Ye(!1));
543
+ incoming: n
544
+ })).catch(() => {}).then(() => (_e(d, p, ee), g || Z(s, c), new Promise((e) => setTimeout(e, te)))).then(() => {
545
+ g || (b.current = !1, Xe(!1));
545
546
  }), () => {
546
- g = !0, b.current = !1, Ye(!1);
547
+ g = !0, b.current = !1, Xe(!1);
547
548
  };
548
549
  }, [
549
- W,
550
- k,
550
+ U,
551
+ O,
551
552
  Q?.eventId
552
553
  ]), g(() => {
553
- Je || e.status !== "active" || P(rt ? "target" : "own");
554
+ Ye || e.status !== "active" || N(it ? "target" : "own");
554
555
  }, [
555
- rt,
556
+ it,
556
557
  e.status,
557
- Je
558
+ Ye
558
559
  ]), g(() => {
559
- V || Ve(null);
560
- }, [V]), g(() => {
561
- if (W && !b.current) try {
560
+ B || He(null);
561
+ }, [B]), g(() => {
562
+ if (U && !b.current) try {
562
563
  m.current?.setView(ht);
563
564
  } catch (e) {
564
565
  console.error("[battleship] setView", e);
565
566
  }
566
567
  }, [
567
- W,
568
+ U,
568
569
  ht,
569
- Je
570
+ Ye
570
571
  ]), g(() => {
571
- W && m.current?.selectCell?.(Y === "target" ? L : null);
572
+ U && m.current?.selectCell?.(Y === "target" ? I : null);
572
573
  }, [
573
- W,
574
- L,
574
+ U,
575
+ I,
575
576
  Y
576
577
  ]), g(() => {
577
- if (!W) return;
578
+ if (!U) return;
578
579
  let e = m.current;
579
- e?.setRadarVisible?.(Ge && Y === "target"), e?.setRadarContacts?.(ft);
580
+ e?.setRadarVisible?.(Ke && Y === "target"), e?.setRadarContacts?.(ft);
580
581
  }, [
581
- W,
582
- Ge,
582
+ U,
583
+ Ke,
583
584
  Y,
584
585
  ft
585
586
  ]);
586
587
  let bt = () => {
587
- E("ship_rotate"), He((e) => e === "horizontal" ? "vertical" : "horizontal");
588
+ T("ship_rotate"), Ue((e) => e === "horizontal" ? "vertical" : "horizontal");
588
589
  }, xt = () => {
589
- st && H && (E("ui_click"), N("bsReady", t));
590
+ st && V && (T("ui_click"), M("bsReady", t));
590
591
  }, $ = (e) => (...t) => {
591
- E("ui_click"), e(...t);
592
+ T("ui_click"), e(...t);
592
593
  }, St = () => {
593
- E(Ge ? "ui_click" : "sonar_ping"), Ke((e) => !e);
594
+ T(Ke ? "ui_click" : "sonar_ping"), qe((e) => !e);
594
595
  }, Ct = (e) => {
595
596
  if (e.target !== e.currentTarget || e.altKey || e.ctrlKey || e.metaKey) return;
596
597
  let t = {
@@ -601,20 +602,20 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
601
602
  };
602
603
  if (t[e.key]) {
603
604
  e.preventDefault();
604
- let [n, r] = t[e.key], i = (Y === "target" ? L : null) || I || F, a = i ? {
605
+ let [n, r] = t[e.key], i = (Y === "target" ? I : null) || F || P, a = i ? {
605
606
  row: Math.min(9, Math.max(0, i.row + n)),
606
607
  col: Math.min(9, Math.max(0, i.col + r))
607
608
  } : {
608
609
  row: 0,
609
610
  col: 0
610
611
  };
611
- Be(a), ze(null), Y === "target" && V && (Ve(a), m.current?.selectCell?.(a));
612
- } else (e.key === "Enter" || e.key === " ") && (e.preventDefault(), B ? _t(I || F) : gt(L || I));
612
+ Ve(a), Be(null), Y === "target" && B && (He(a), m.current?.selectCell?.(a));
613
+ } else (e.key === "Enter" || e.key === " ") && (e.preventDefault(), z ? _t(F || P) : gt(I || F));
613
614
  }, wt = (e) => {
614
- e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || /^(INPUT|TEXTAREA|SELECT)$/.test(e.target.tagName) || e.target.isContentEditable || (e.key === "r" || e.key === "R" ? (e.preventDefault(), B ? bt() : m.current?.resetCamera?.()) : e.key === "Escape" && z && (e.preventDefault(), e.stopPropagation(), qe(!1)));
615
- }, Tt = /* @__PURE__ */ x(Le, { game: e }), Et = e.status === "won" && n(a, e.winnerId), Dt = !o && !tt ? "Sin conexión · esperando reconexión" : e.pending ? "Sincronizando…" : s, Ot = lt.length;
615
+ e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || /^(INPUT|TEXTAREA|SELECT)$/.test(e.target.tagName) || e.target.isContentEditable || (e.key === "r" || e.key === "R" ? (e.preventDefault(), z ? bt() : m.current?.resetCamera?.()) : e.key === "Escape" && R && (e.preventDefault(), e.stopPropagation(), Je(!1)));
616
+ }, Tt = /* @__PURE__ */ x(Re, { game: e }), Et = e.status === "won" && f(r, e.winnerId), Dt = !i && !nt ? "Sin conexión · esperando reconexión" : e.pending ? "Sincronizando…" : o, Ot = lt.length;
616
617
  return /* @__PURE__ */ S("section", {
617
- className: `chat-game-card bs-card${rt ? " chat-game-card--my-turn" : ""}${c ? ` chat-game-card--${c}` : ""}${z ? " bs-card--expanded" : ""}`,
618
+ className: `chat-game-card bs-card${it ? " chat-game-card--my-turn" : ""}${s ? ` chat-game-card--${s}` : ""}${R ? " bs-card--expanded" : ""}`,
618
619
  "aria-label": "Partida de Batalla Naval",
619
620
  onKeyDown: wt,
620
621
  children: [
@@ -632,39 +633,39 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
632
633
  className: "bs-title-icon"
633
634
  })] })]
634
635
  }),
635
- c === "panel" && /* @__PURE__ */ x(i, { manager: w }),
636
- U && /* @__PURE__ */ x("button", {
636
+ s === "panel" && /* @__PURE__ */ x(n, { manager: w }),
637
+ H && /* @__PURE__ */ x("button", {
637
638
  className: "chat-game-close bs-expand",
638
639
  type: "button",
639
- "aria-pressed": z,
640
- "aria-label": z ? "Reducir tablero" : "Ampliar tablero",
641
- title: z ? "Reducir (Esc)" : "Ampliar",
642
- onClick: $(() => qe((e) => !e)),
643
- children: x(z ? ce : se, {
640
+ "aria-pressed": R,
641
+ "aria-label": R ? "Reducir tablero" : "Ampliar tablero",
642
+ title: R ? "Reducir (Esc)" : "Ampliar",
643
+ onClick: $(() => Je((e) => !e)),
644
+ children: x(R ? ce : se, {
644
645
  size: 15,
645
646
  "aria-hidden": "true"
646
647
  })
647
648
  }),
648
- l && /* @__PURE__ */ x("button", {
649
+ u && /* @__PURE__ */ x("button", {
649
650
  className: "chat-game-close",
650
651
  type: "button",
651
652
  "aria-label": "Minimizar tablero",
652
653
  title: "Minimizar tablero",
653
654
  onClick: () => {
654
- qe(!1), l();
655
+ Je(!1), u();
655
656
  },
656
657
  children: /* @__PURE__ */ x(ie, {
657
658
  size: 16,
658
659
  "aria-hidden": "true"
659
660
  })
660
661
  }),
661
- et && !tt && /* @__PURE__ */ x("button", {
662
+ tt && !nt && /* @__PURE__ */ x("button", {
662
663
  className: "chat-game-close",
663
664
  type: "button",
664
665
  "aria-label": "Finalizar partida para ambos jugadores",
665
666
  title: "Finalizar partida para ambos",
666
- onClick: () => void N("act", t, "game_end"),
667
- disabled: !o,
667
+ onClick: () => void M("act", t, "game_end"),
668
+ disabled: !i,
668
669
  children: /* @__PURE__ */ x(me, {
669
670
  size: 16,
670
671
  "aria-hidden": "true"
@@ -693,25 +694,25 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
693
694
  }),
694
695
  e.status === "invited" && /* @__PURE__ */ S("div", {
695
696
  className: "bs-invite",
696
- children: [/* @__PURE__ */ x("p", { children: "Coloca 5 barcos en un tablero de 10×10 y hunde la flota rival por turnos." }), $e && /* @__PURE__ */ S("div", {
697
+ children: [/* @__PURE__ */ x("p", { children: "Coloca 5 barcos en un tablero de 10×10 y hunde la flota rival por turnos." }), et && /* @__PURE__ */ S("div", {
697
698
  className: "chat-game-actions",
698
699
  children: [/* @__PURE__ */ x("button", {
699
700
  type: "button",
700
701
  className: "chat-game-action chat-game-action--primary",
701
- disabled: it,
702
- onClick: $(() => void N("act", t, "game_accept")),
702
+ disabled: at,
703
+ onClick: $(() => void M("act", t, "game_accept")),
703
704
  children: "Aceptar partida"
704
705
  }), /* @__PURE__ */ x("button", {
705
706
  type: "button",
706
707
  className: "chat-game-action",
707
- disabled: it,
708
- onClick: $(() => void N("act", t, "game_decline")),
708
+ disabled: at,
709
+ onClick: $(() => void M("act", t, "game_decline")),
709
710
  children: "Rechazar"
710
711
  })]
711
712
  })]
712
713
  }),
713
- U && /* @__PURE__ */ S(he, { children: [
714
- nt && /* @__PURE__ */ S("div", {
714
+ H && /* @__PURE__ */ S(he, { children: [
715
+ rt && /* @__PURE__ */ S("div", {
715
716
  className: "bs-hud",
716
717
  role: "toolbar",
717
718
  "aria-label": "Vista del tablero",
@@ -719,16 +720,16 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
719
720
  className: "bs-segment",
720
721
  children: [/* @__PURE__ */ S("button", {
721
722
  type: "button",
722
- "aria-pressed": Ce === "target",
723
- onClick: $(() => P("target")),
723
+ "aria-pressed": we === "target",
724
+ onClick: $(() => N("target")),
724
725
  children: [/* @__PURE__ */ x(ae, {
725
726
  size: 14,
726
727
  "aria-hidden": "true"
727
728
  }), "Objetivo"]
728
729
  }), /* @__PURE__ */ S("button", {
729
730
  type: "button",
730
- "aria-pressed": Ce === "own",
731
- onClick: $(() => P("own")),
731
+ "aria-pressed": we === "own",
732
+ onClick: $(() => N("own")),
732
733
  children: [/* @__PURE__ */ x(ne, {
733
734
  size: 14,
734
735
  "aria-hidden": "true"
@@ -742,7 +743,7 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
742
743
  /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "Hundidos" }), /* @__PURE__ */ S("dd", { children: [
743
744
  Ot,
744
745
  "/",
745
- p.length
746
+ c.length
746
747
  ] })] })
747
748
  ]
748
749
  })]
@@ -751,23 +752,23 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
751
752
  className: "bs-stage-wrap",
752
753
  children: [
753
754
  /* @__PURE__ */ x("div", {
754
- ref: f,
755
- className: `bs-stage${k === "fallback" ? " bs-stage--fallback" : ""}`,
755
+ ref: p,
756
+ className: `bs-stage${O === "fallback" ? " bs-stage--fallback" : ""}`,
756
757
  tabIndex: 0,
757
758
  role: "application",
758
- "aria-label": B ? "Tablero 3D de tu flota. Flechas para mover, Enter para colocar o quitar un barco, R para rotar." : "Tablero 3D de Batalla Naval. Flechas para mover la selección, Enter para disparar, R para centrar la cámara.",
759
- "aria-describedby": ye,
760
- "aria-busy": k === "loading",
759
+ "aria-label": z ? "Tablero 3D de tu flota. Flechas para mover, Enter para colocar o quitar un barco, R para rotar." : "Tablero 3D de Batalla Naval. Flechas para mover la selección, Enter para disparar, R para centrar la cámara.",
760
+ "aria-describedby": be,
761
+ "aria-busy": O === "loading",
761
762
  onKeyDown: Ct,
762
- children: k === "fallback" && /* @__PURE__ */ x(Re, {
763
+ children: O === "fallback" && /* @__PURE__ */ x(ze, {
763
764
  view: ht,
764
- selected: Y === "target" ? L : null,
765
- cursor: I,
765
+ selected: Y === "target" ? I : null,
766
+ cursor: F,
766
767
  onSelect: vt,
767
- onHover: ze
768
+ onHover: Be
768
769
  })
769
770
  }),
770
- k === "loading" && /* @__PURE__ */ S("div", {
771
+ O === "loading" && /* @__PURE__ */ S("div", {
771
772
  className: "bs-stage-state",
772
773
  role: "status",
773
774
  children: [/* @__PURE__ */ x(pe, {
@@ -775,7 +776,7 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
775
776
  "aria-hidden": "true"
776
777
  }), " Preparando el océano…"]
777
778
  }),
778
- k === "fallback" && /* @__PURE__ */ S("p", {
779
+ O === "fallback" && /* @__PURE__ */ S("p", {
779
780
  className: "bs-fallback-note",
780
781
  children: [/* @__PURE__ */ x(fe, {
781
782
  size: 12,
@@ -785,45 +786,45 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
785
786
  /* @__PURE__ */ x("div", {
786
787
  className: "bs-cell-chip",
787
788
  "aria-hidden": "true",
788
- children: j(B ? X : Y === "target" && L || F)
789
+ children: A(z ? X : Y === "target" && I || P)
789
790
  }),
790
791
  /* @__PURE__ */ x("div", {
791
792
  className: "bs-live",
792
793
  "aria-live": "polite",
793
794
  "aria-atomic": "true",
794
- children: Xe && /* @__PURE__ */ x("span", {
795
- className: `bs-toast bs-toast--${Xe.kind}`,
796
- children: Xe.text
797
- }, Xe.id)
795
+ children: Ze && /* @__PURE__ */ x("span", {
796
+ className: `bs-toast bs-toast--${Ze.kind}`,
797
+ children: Ze.text
798
+ }, Ze.id)
798
799
  })
799
800
  ]
800
801
  }),
801
802
  /* @__PURE__ */ x("p", {
802
- id: ye,
803
+ id: be,
803
804
  className: "bs-hint",
804
- children: B ? "Clic para colocar · clic en un barco para quitarlo · R para rotar" : "Arrastra para rotar · doble clic o Enter para disparar"
805
+ children: z ? "Clic para colocar · clic en un barco para quitarlo · R para rotar" : "Arrastra para rotar · doble clic o Enter para disparar"
805
806
  }),
806
- B && /* @__PURE__ */ S("div", {
807
+ z && /* @__PURE__ */ S("div", {
807
808
  className: "bs-placement",
808
809
  children: [
809
810
  /* @__PURE__ */ x("ul", {
810
811
  className: "bs-fleet",
811
812
  "aria-label": "Tu flota",
812
- children: p.map((e) => {
813
- let n = ot.has(e.id), r = J?.id === e.id;
813
+ children: c.map((e) => {
814
+ let n = q.has(e.id), r = J?.id === e.id;
814
815
  return /* @__PURE__ */ x("li", { children: /* @__PURE__ */ S("button", {
815
816
  type: "button",
816
817
  className: `bs-ship${n ? " is-placed" : ""}${r ? " is-active" : ""}`,
817
818
  "aria-pressed": r,
818
- disabled: !H,
819
+ disabled: !V,
819
820
  title: n ? "Quitar y volver a colocar" : "Seleccionar barco",
820
821
  onClick: $(() => {
821
- n && N("bsRemoveShip", t, e.id), We(e.id);
822
+ n && M("bsRemoveShip", t, e.id), Ge(e.id);
822
823
  }),
823
824
  children: [
824
825
  /* @__PURE__ */ x("span", {
825
826
  className: "bs-ship__name",
826
- children: je(Oe(e.id))
827
+ children: Me(ke(e.id))
827
828
  }),
828
829
  /* @__PURE__ */ x("span", {
829
830
  className: "bs-ship__pips",
@@ -844,20 +845,20 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
844
845
  /* @__PURE__ */ S("button", {
845
846
  type: "button",
846
847
  className: "chat-game-action bs-btn",
847
- disabled: !H,
848
+ disabled: !V,
848
849
  onClick: bt,
849
850
  title: "Rotar (R)",
850
851
  children: [/* @__PURE__ */ x(ue, {
851
852
  size: 15,
852
853
  "aria-hidden": "true"
853
- }), R === "horizontal" ? "Horizontal" : "Vertical"]
854
+ }), L === "horizontal" ? "Horizontal" : "Vertical"]
854
855
  }),
855
856
  /* @__PURE__ */ S("button", {
856
857
  type: "button",
857
858
  className: "chat-game-action bs-btn",
858
- disabled: !H,
859
+ disabled: !V,
859
860
  onClick: () => {
860
- E("ship_place"), N("bsRandomFleet", t);
861
+ T("ship_place"), M("bsRandomFleet", t);
861
862
  },
862
863
  children: [/* @__PURE__ */ x(de, {
863
864
  size: 15,
@@ -867,12 +868,12 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
867
868
  /* @__PURE__ */ S("button", {
868
869
  type: "button",
869
870
  className: "chat-game-action chat-game-action--primary bs-btn",
870
- disabled: !H || !st,
871
+ disabled: !V || !st,
871
872
  onClick: xt,
872
873
  children: [/* @__PURE__ */ x(re, {
873
874
  size: 15,
874
875
  "aria-hidden": "true"
875
- }), e.myReady ? "Flota lista" : `Listo (${ot.size}/${p.length})`]
876
+ }), e.myReady ? "Flota lista" : `Listo (${q.size}/${c.length})`]
876
877
  })
877
878
  ]
878
879
  }),
@@ -882,29 +883,29 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
882
883
  })
883
884
  ]
884
885
  }),
885
- nt && /* @__PURE__ */ S("div", {
886
+ rt && /* @__PURE__ */ S("div", {
886
887
  className: "chat-game-actions bs-actions",
887
888
  children: [
888
889
  /* @__PURE__ */ S("button", {
889
890
  type: "button",
890
891
  className: "chat-game-action chat-game-action--primary bs-btn bs-btn--fire",
891
- disabled: !V || !L || Y !== "target",
892
+ disabled: !B || !I || Y !== "target",
892
893
  onClick: () => gt(),
893
- title: L ? `Disparar en ${j(L)} (Enter)` : "Selecciona una casilla",
894
+ title: I ? `Disparar en ${A(I)} (Enter)` : "Selecciona una casilla",
894
895
  children: [
895
896
  /* @__PURE__ */ x(ae, {
896
897
  size: 15,
897
898
  "aria-hidden": "true"
898
899
  }),
899
900
  "Disparar",
900
- L ? ` · ${j(L)}` : ""
901
+ I ? ` · ${A(I)}` : ""
901
902
  ]
902
903
  }),
903
904
  /* @__PURE__ */ S("button", {
904
905
  type: "button",
905
906
  className: "chat-game-action bs-btn",
906
- "aria-pressed": Ge,
907
- disabled: Y !== "target" || !W,
907
+ "aria-pressed": Ke,
908
+ disabled: Y !== "target" || !U,
908
909
  onClick: St,
909
910
  title: "Radar de impactos",
910
911
  children: [/* @__PURE__ */ x(le, {
@@ -915,7 +916,7 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
915
916
  /* @__PURE__ */ S("button", {
916
917
  type: "button",
917
918
  className: "chat-game-action bs-btn",
918
- disabled: !W,
919
+ disabled: !U,
919
920
  onClick: $(() => m.current?.resetCamera?.()),
920
921
  title: "Centrar cámara (R)",
921
922
  children: [/* @__PURE__ */ x(oe, {
@@ -929,11 +930,11 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
929
930
  ]
930
931
  })
931
932
  ] }),
932
- e.status === "conflict" && et && /* @__PURE__ */ x(Ie, {
933
+ e.status === "conflict" && tt && /* @__PURE__ */ x(Le, {
933
934
  sync: e.sync,
934
- connected: o,
935
- onResync: () => void N("requestResync", t),
936
- onAdoptOffer: () => void N("adoptResyncOffer", t)
935
+ connected: i,
936
+ onResync: () => void M("requestResync", t),
937
+ onAdoptOffer: () => void M("adoptResyncOffer", t)
937
938
  }),
938
939
  e.error && /* @__PURE__ */ S("div", {
939
940
  className: "chat-game-error",
@@ -941,19 +942,19 @@ function ze({ game: e, gameKey: t, currentUserId: a, connected: o, status: s, va
941
942
  children: [/* @__PURE__ */ x("span", { children: e.error }), e.pendingEvent && /* @__PURE__ */ x("button", {
942
943
  type: "button",
943
944
  className: "chat-game-action",
944
- disabled: !o || e.pending,
945
- onClick: () => void N("retry", t),
945
+ disabled: !i || e.pending,
946
+ onClick: () => void M("retry", t),
946
947
  children: "Reintentar"
947
948
  })]
948
949
  }),
949
950
  /* @__PURE__ */ x("footer", {
950
951
  className: "chat-game-footer",
951
- children: tt ? "Puedes seguir conversando o invitar a otra partida." : "Hunde los 5 barcos rivales. El chat sigue disponible."
952
+ children: nt ? "Puedes seguir conversando o invitar a otra partida." : "Hunde los 5 barcos rivales. El chat sigue disponible."
952
953
  })
953
954
  ]
954
955
  });
955
956
  }
956
- var I = m(F);
957
- export { I as default };
957
+ var F = m(P);
958
+ export { F as default };
958
959
 
959
- //# sourceMappingURL=BattleshipGameCard-CAWHxqJE.js.map
960
+ //# sourceMappingURL=BattleshipGameCard-BFqA0cjT.js.map