@minicode-dev/chat 0.1.14 → 0.1.16

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 (66) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/chunks/{BattleshipGameCard-B-B4r7lK.js → BattleshipGameCard-DwNzgH5G.js} +199 -199
  3. package/dist/chunks/{BattleshipGameCard-B-B4r7lK.js.map → BattleshipGameCard-DwNzgH5G.js.map} +1 -1
  4. package/dist/chunks/{BattleshipPrototype-CmQd5AUO.js → BattleshipPrototype-CSQxQJt5.js} +52 -52
  5. package/dist/chunks/{BattleshipPrototype-CmQd5AUO.js.map → BattleshipPrototype-CSQxQJt5.js.map} +1 -1
  6. package/dist/chunks/{ChatContext-DQtKsR6Z.js → ChatContext-D5rqvt5D.js} +2 -2
  7. package/dist/chunks/{ChatContext-DQtKsR6Z.js.map → ChatContext-D5rqvt5D.js.map} +1 -1
  8. package/dist/chunks/RacingLiveGameCard-_wvhDRlG.js +1873 -0
  9. package/dist/chunks/RacingLiveGameCard-_wvhDRlG.js.map +1 -0
  10. package/dist/chunks/{TanksGameCard-CvTaF7tu.js → TanksGameCard-B-gtDYYg.js} +144 -144
  11. package/dist/chunks/{TanksGameCard-CvTaF7tu.js.map → TanksGameCard-B-gtDYYg.js.map} +1 -1
  12. package/dist/chunks/TanksLiveGameCard-DXgd1J2Y.js +1274 -0
  13. package/dist/chunks/TanksLiveGameCard-DXgd1J2Y.js.map +1 -0
  14. package/dist/chunks/{avalancheScene3d-Z5QyZIid.js → avalancheScene3d-CNbQyGUd.js} +51 -50
  15. package/dist/chunks/{avalancheScene3d-Z5QyZIid.js.map → avalancheScene3d-CNbQyGUd.js.map} +1 -1
  16. package/dist/chunks/cars-D1PM7mVD.js +340 -0
  17. package/dist/chunks/cars-D1PM7mVD.js.map +1 -0
  18. package/dist/chunks/{connect4Sounds-DmD-E9kX.js → connect4Sounds-3a6h7gUC.js} +8 -8
  19. package/dist/chunks/{connect4Sounds-DmD-E9kX.js.map → connect4Sounds-3a6h7gUC.js.map} +1 -1
  20. package/dist/chunks/createLiveScene-jrzyQogh.js +756 -0
  21. package/dist/chunks/createLiveScene-jrzyQogh.js.map +1 -0
  22. package/dist/chunks/createRaceScene-C-aw0dlX.js +291 -0
  23. package/dist/chunks/createRaceScene-C-aw0dlX.js.map +1 -0
  24. package/dist/chunks/{createTankScene-yhX6la27.js → createTankScene-6asWHKFf.js} +123 -125
  25. package/dist/chunks/{createTankScene-yhX6la27.js.map → createTankScene-6asWHKFf.js.map} +1 -1
  26. package/dist/chunks/fx-BNJvJYOu.js +871 -0
  27. package/dist/chunks/fx-BNJvJYOu.js.map +1 -0
  28. package/dist/chunks/fx-DhXerGyt.js +248 -0
  29. package/dist/chunks/fx-DhXerGyt.js.map +1 -0
  30. package/dist/chunks/{games-BvYTWgaR.js → games-D_9SiSBT.js} +1261 -677
  31. package/dist/chunks/games-D_9SiSBT.js.map +1 -0
  32. package/dist/chunks/tank-DIn6Jyt8.js +605 -0
  33. package/dist/chunks/tank-DIn6Jyt8.js.map +1 -0
  34. package/dist/chunks/{tanks-live-BcKmrhnV.js → tanks-live-BRhYW4MG.js} +36 -36
  35. package/dist/chunks/{tanks-live-BcKmrhnV.js.map → tanks-live-BRhYW4MG.js.map} +1 -1
  36. package/dist/chunks/{tanksSounds-DwjfSp3W.js → tanksSounds-tYPzje61.js} +5 -5
  37. package/dist/chunks/{tanksSounds-DwjfSp3W.js.map → tanksSounds-tYPzje61.js.map} +1 -1
  38. package/dist/chunks/track-C1TWWT19.js +557 -0
  39. package/dist/chunks/track-C1TWWT19.js.map +1 -0
  40. package/dist/index.js +4244 -4028
  41. package/dist/index.js.map +1 -1
  42. package/dist/styles.css +1 -1
  43. package/index.d.ts +2 -0
  44. package/package.json +1 -1
  45. package/dist/chunks/RacingLiveGameCard-c1G7uoDI.js +0 -1654
  46. package/dist/chunks/RacingLiveGameCard-c1G7uoDI.js.map +0 -1
  47. package/dist/chunks/TanksLiveGameCard-COr9Oay5.js +0 -1011
  48. package/dist/chunks/TanksLiveGameCard-COr9Oay5.js.map +0 -1
  49. package/dist/chunks/createLiveScene-CWBunxPi.js +0 -367
  50. package/dist/chunks/createLiveScene-CWBunxPi.js.map +0 -1
  51. package/dist/chunks/createRaceScene-C7Rw89kj.js +0 -305
  52. package/dist/chunks/createRaceScene-C7Rw89kj.js.map +0 -1
  53. package/dist/chunks/decor-CyyCnmct.js +0 -418
  54. package/dist/chunks/decor-CyyCnmct.js.map +0 -1
  55. package/dist/chunks/fx-1ZwzmPWj.js +0 -458
  56. package/dist/chunks/fx-1ZwzmPWj.js.map +0 -1
  57. package/dist/chunks/fx-UZwhOmdl.js +0 -584
  58. package/dist/chunks/fx-UZwhOmdl.js.map +0 -1
  59. package/dist/chunks/games-BvYTWgaR.js.map +0 -1
  60. package/dist/chunks/rolldown-runtime-CGnMp29N.js +0 -10
  61. package/dist/chunks/tank-DjEQ4FXF.js +0 -553
  62. package/dist/chunks/tank-DjEQ4FXF.js.map +0 -1
  63. package/dist/chunks/track-BcnnpnAm.js +0 -259
  64. package/dist/chunks/track-BcnnpnAm.js.map +0 -1
  65. package/dist/chunks/util-DwI9bfS7.js +0 -57
  66. package/dist/chunks/util-DwI9bfS7.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { a as e, t } from "./games-BvYTWgaR.js";
1
+ import { a as e, t } from "./games-D_9SiSBT.js";
2
2
  import { l as n, n as r, s as i, t as a } from "./board-DXKuIZ1I.js";
3
3
  import { r as o } from "./connectionStore-DwgIUl30.js";
4
4
  import { c as s, i as c, l, t as u } from "./gameStatus-BChd29yI.js";
5
- import { a as d, o as f, t as p } from "./connect4Sounds-DmD-E9kX.js";
5
+ import { a as d, o as f, t as p } from "./connect4Sounds-3a6h7gUC.js";
6
6
  import "../index.js";
7
7
  import { t as ee } from "./webglSupport-2WjPEPZ_.js";
8
8
  import { memo as m, useCallback as h, useEffect as g, useId as te, useMemo as _, useRef as v, useState as y } from "react";
9
- 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";
10
- import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
9
+ import { Fragment as ne, jsx as b, jsxs as x } from "react/jsx-runtime";
10
+ import { Anchor as re, Check as ie, ChevronDown as ae, Crosshair as oe, LocateFixed as se, Maximize2 as ce, Minimize2 as le, Radar as ue, RotateCw as de, ShieldCheck as S, Shuffle as fe, TriangleAlert as pe, Waves as me, X as he } from "lucide-react";
11
11
  // src/games/battleship/sound/battleshipSounds.js
12
12
  var C = "ocean_ambient_loop", w = d({
13
13
  id: "battleship",
@@ -45,14 +45,14 @@ var C = "ocean_ambient_loop", w = d({
45
45
  defeat: .4,
46
46
  [C]: .22
47
47
  }
48
- }), T = () => typeof document < "u" && document.hidden;
49
- function E(e) {
50
- T() || w.play(e);
48
+ }), ge = () => typeof document < "u" && document.hidden;
49
+ function T(e) {
50
+ ge() || w.play(e);
51
51
  }
52
- function ge(e, t, n) {
52
+ function _e(e, t, n) {
53
53
  e.forEach(({ name: e, at: r }) => {
54
54
  let i = () => {
55
- T() || w.play(e, { key: t(e) });
55
+ ge() || w.play(e, { key: t(e) });
56
56
  };
57
57
  if (r <= 0) {
58
58
  i();
@@ -64,26 +64,26 @@ function ge(e, t, n) {
64
64
  n.add(a);
65
65
  });
66
66
  }
67
- var D = 0, O = () => {
68
- D > 0 && !T() ? w.startLoop(C) : w.stopLoop(C);
67
+ var E = 0, D = () => {
68
+ E > 0 && !ge() ? w.startLoop(C) : w.stopLoop(C);
69
69
  };
70
- function _e() {
71
- D += 1, D === 1 && document.addEventListener("visibilitychange", O), O();
70
+ function ve() {
71
+ E += 1, E === 1 && document.addEventListener("visibilitychange", D), D();
72
72
  let e = !1;
73
73
  return () => {
74
- e || (e = !0, --D, D === 0 && document.removeEventListener("visibilitychange", O), O());
74
+ e || (e = !0, --E, E === 0 && document.removeEventListener("visibilitychange", D), D());
75
75
  };
76
76
  }
77
77
  // src/games/battleship/sound/cues.js
78
- 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;
79
- function be(e, t, n) {
78
+ 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;
79
+ function xe(e, t, n) {
80
80
  if (n?.result !== "hit") return !1;
81
- let r = (e || []).find((e) => e.id === ve);
82
- if (!r?.cells?.some((e) => ye(e, n))) return !1;
83
- let i = k(r, t, n), a = k(r, t);
81
+ let r = (e || []).find((e) => e.id === ye);
82
+ if (!r?.cells?.some((e) => be(e, n))) return !1;
83
+ let i = O(r, t, n), a = O(r, t);
84
84
  return i < 2 && a >= 2;
85
85
  }
86
- function xe({ incoming: e }) {
86
+ function Se({ incoming: e }) {
87
87
  return e ? [{
88
88
  name: "projectile_flyby",
89
89
  at: 0
@@ -95,7 +95,7 @@ function xe({ incoming: e }) {
95
95
  at: 180
96
96
  }];
97
97
  }
98
- function Se({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
98
+ function Ce({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
99
99
  let a = e === "hit" ? t ? [{
100
100
  name: "ship_heavy_hit",
101
101
  at: 0
@@ -118,20 +118,20 @@ function Se({ result: e, sunk: t, defeated: n, won: r, cruiserAlarm: i }) {
118
118
  }), a;
119
119
  }
120
120
  // src/games/battleship/BattleshipGameCard.jsx
121
- var A = "ABCDEFGHIJ", Ce = {
121
+ var k = "ABCDEFGHIJ", we = {
122
122
  carrier: "portaaviones",
123
123
  battleship: "acorazado",
124
124
  cruiser: "crucero",
125
125
  submarine: "submarino",
126
126
  destroyer: "destructor"
127
- }, we = [
127
+ }, Te = [
128
128
  "placement",
129
129
  "active",
130
130
  "won",
131
131
  "conflict",
132
132
  "closed"
133
- ], 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(() => {});
134
- function Ne(e) {
133
+ ], 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 = (t, ...n) => Promise.resolve().then(() => e.getState()[t]?.(...n)).catch(() => {});
134
+ function Pe(e) {
135
135
  let t = r();
136
136
  for (let n of e || []) {
137
137
  let e = n.cells?.[0];
@@ -146,13 +146,13 @@ function Ne(e) {
146
146
  }
147
147
  return t;
148
148
  }
149
- function Pe(e, t, n) {
149
+ function Fe(e, t, n) {
150
150
  return Array.from({ length: t }, (t, r) => ({
151
151
  row: e.row + (n === "vertical" ? r : 0),
152
152
  col: e.col + (n === "horizontal" ? r : 0)
153
- })).filter(M);
153
+ })).filter(j);
154
154
  }
155
- function Fe(e) {
155
+ function Ie(e) {
156
156
  let t = 0, n = 0;
157
157
  for (let r of e || []) for (let e of r || []) e && (t += 1), e === "hit" && (n += 1);
158
158
  return {
@@ -160,24 +160,24 @@ function Fe(e) {
160
160
  hits: n
161
161
  };
162
162
  }
163
- function Ie({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
164
- return e?.status === "requesting" ? /* @__PURE__ */ x("div", {
163
+ function Le({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
164
+ return e?.status === "requesting" ? /* @__PURE__ */ b("div", {
165
165
  className: "chat-game-sync",
166
166
  role: "status",
167
167
  children: "Sincronizando partida…"
168
- }) : /* @__PURE__ */ S("div", {
168
+ }) : /* @__PURE__ */ x("div", {
169
169
  className: "chat-game-sync",
170
170
  role: "alert",
171
171
  children: [
172
- e?.message && /* @__PURE__ */ x("span", { children: e.message }),
173
- e?.status === "incompatible" && e.offer && /* @__PURE__ */ x("button", {
172
+ e?.message && /* @__PURE__ */ b("span", { children: e.message }),
173
+ e?.status === "incompatible" && e.offer && /* @__PURE__ */ b("button", {
174
174
  type: "button",
175
175
  className: "chat-game-action chat-game-action--primary",
176
176
  disabled: !t,
177
177
  onClick: r,
178
178
  children: "Usar estado del anfitrión"
179
179
  }),
180
- /* @__PURE__ */ x("button", {
180
+ /* @__PURE__ */ b("button", {
181
181
  type: "button",
182
182
  className: "chat-game-action",
183
183
  disabled: !t,
@@ -187,16 +187,16 @@ function Ie({ sync: e, connected: t, onResync: n, onAdoptOffer: r }) {
187
187
  ]
188
188
  });
189
189
  }
190
- function Le({ game: e }) {
190
+ function Re({ game: e }) {
191
191
  let t = c(e);
192
- return t ? /* @__PURE__ */ S("span", {
192
+ return t ? /* @__PURE__ */ x("span", {
193
193
  className: `bs-badge bs-badge--${e.verification}`,
194
194
  children: [
195
- e.verification === "ok" && /* @__PURE__ */ x(b, {
195
+ e.verification === "ok" && /* @__PURE__ */ b(S, {
196
196
  size: 12,
197
197
  "aria-hidden": "true"
198
198
  }),
199
- e.verification === "mismatch" && /* @__PURE__ */ x(fe, {
199
+ e.verification === "mismatch" && /* @__PURE__ */ b(pe, {
200
200
  size: 12,
201
201
  "aria-hidden": "true"
202
202
  }),
@@ -204,16 +204,16 @@ function Le({ game: e }) {
204
204
  ]
205
205
  }) : null;
206
206
  }
207
- function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
207
+ function ze({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
208
208
  let a = /* @__PURE__ */ new Map();
209
209
  e.ships.forEach((e) => e.cells.forEach((t) => a.set(`${t.row}-${t.col}`, e)));
210
210
  let o = new Set((e.preview?.cells || []).map((e) => `${e.row}-${e.col}`));
211
- return /* @__PURE__ */ x("div", {
211
+ return /* @__PURE__ */ b("div", {
212
212
  className: "bs-grid",
213
213
  role: "grid",
214
214
  "aria-label": e.mode === "target" ? "Tablero objetivo" : "Mi flota",
215
215
  onMouseLeave: () => i(null),
216
- children: Array.from({ length: 10 }, (s, c) => /* @__PURE__ */ x("div", {
216
+ children: Array.from({ length: 10 }, (s, c) => /* @__PURE__ */ b("div", {
217
217
  role: "row",
218
218
  className: "bs-grid__row",
219
219
  children: Array.from({ length: 10 }, (s, l) => {
@@ -223,22 +223,22 @@ function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
223
223
  d?.sunk && "is-sunk",
224
224
  f && `is-${f}`,
225
225
  o.has(u) && (e.preview.valid ? "is-preview" : "is-invalid"),
226
- De(t, {
226
+ Oe(t, {
227
227
  row: c,
228
228
  col: l
229
229
  }) && "is-selected",
230
- De(n, {
230
+ Oe(n, {
231
231
  row: c,
232
232
  col: l
233
233
  }) && "is-cursor"
234
234
  ].filter(Boolean).join(" ");
235
- return /* @__PURE__ */ x("button", {
235
+ return /* @__PURE__ */ b("button", {
236
236
  type: "button",
237
237
  role: "gridcell",
238
238
  tabIndex: -1,
239
239
  className: p,
240
240
  disabled: !e.interactive,
241
- "aria-label": `${A[c]}${l + 1}${f === "hit" ? ", impacto" : f === "miss" ? ", agua" : ""}${d ? ", barco" : ""}`,
241
+ "aria-label": `${k[c]}${l + 1}${f === "hit" ? ", impacto" : f === "miss" ? ", agua" : ""}${d ? ", barco" : ""}`,
242
242
  onMouseEnter: () => i({
243
243
  row: c,
244
244
  col: l
@@ -252,36 +252,36 @@ function Re({ view: e, selected: t, cursor: n, onSelect: r, onHover: i }) {
252
252
  }, c))
253
253
  });
254
254
  }
255
- function P({ game: e, currentUserId: t, status: n }) {
256
- let { total: r, hits: i } = Fe(e.targetShots), o = e.sunkEnemyShips?.length || 0, s = [
255
+ function N({ game: e, currentUserId: t, status: n }) {
256
+ let { total: r, hits: i } = Ie(e.targetShots), o = e.sunkEnemyShips?.length || 0, s = [
257
257
  "active",
258
258
  "won",
259
259
  "closed",
260
260
  "conflict"
261
261
  ].includes(e.status) && r > 0, c = e.status === "won" && l(t, e.winnerId);
262
- return /* @__PURE__ */ S("section", {
262
+ return /* @__PURE__ */ x("section", {
263
263
  className: "chat-game-card chat-game-card--history bs-card bs-card--history",
264
264
  "aria-label": "Partida de Batalla Naval",
265
265
  children: [
266
- /* @__PURE__ */ x("header", {
266
+ /* @__PURE__ */ b("header", {
267
267
  className: "chat-game-header",
268
- children: /* @__PURE__ */ S("div", {
268
+ children: /* @__PURE__ */ x("div", {
269
269
  className: "chat-game-heading",
270
- children: [/* @__PURE__ */ x("span", {
270
+ children: [/* @__PURE__ */ b("span", {
271
271
  className: "chat-game-eyebrow",
272
272
  children: "MINIJUEGOS · 2 JUGADORES"
273
- }), /* @__PURE__ */ S("h3", { children: ["Batalla Naval ", /* @__PURE__ */ x(ne, {
273
+ }), /* @__PURE__ */ x("h3", { children: ["Batalla Naval ", /* @__PURE__ */ b(re, {
274
274
  size: 13,
275
275
  "aria-hidden": "true",
276
276
  className: "bs-title-icon"
277
277
  })] })]
278
278
  })
279
279
  }),
280
- /* @__PURE__ */ x("p", {
280
+ /* @__PURE__ */ b("p", {
281
281
  className: `chat-game-status${c ? " bs-status--win" : ""}`,
282
282
  children: n
283
283
  }),
284
- s && /* @__PURE__ */ S("p", {
284
+ s && /* @__PURE__ */ x("p", {
285
285
  className: "bs-history-stats",
286
286
  children: [
287
287
  "Disparos ",
@@ -294,19 +294,19 @@ function P({ game: e, currentUserId: t, status: n }) {
294
294
  a.length
295
295
  ]
296
296
  }),
297
- /* @__PURE__ */ x(Le, { game: e })
297
+ /* @__PURE__ */ b(Re, { game: e })
298
298
  ]
299
299
  });
300
300
  }
301
- function ze({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: a }) {
301
+ function P({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i, onDismiss: a }) {
302
302
  let s = e((e) => e.games[t]), c = o() === "connected";
303
303
  if (!s) return null;
304
304
  let l = u(s, n);
305
- return r === "history" ? /* @__PURE__ */ x(P, {
305
+ return r === "history" ? /* @__PURE__ */ b(N, {
306
306
  game: s,
307
307
  currentUserId: n,
308
308
  status: l
309
- }) : /* @__PURE__ */ x(Be, {
309
+ }) : /* @__PURE__ */ b(Be, {
310
310
  game: s,
311
311
  gameKey: t,
312
312
  currentUserId: n,
@@ -318,17 +318,17 @@ function ze({ gameKey: t, currentUserId: n, variant: r = "panel", onMinimize: i,
318
318
  });
319
319
  }
320
320
  function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, variant: c, onMinimize: u, onDismiss: d }) {
321
- let p = v(null), m = v(null), b = v(!1), C = v(void 0), T = v({
321
+ let p = v(null), m = v(null), S = v(!1), C = v(void 0), ge = v({
322
322
  cell: null,
323
323
  time: 0
324
- }), D = v({}), O = v(/* @__PURE__ */ new Set()), ve = v(e.status), ye = te(), [k, A] = y("idle"), [Ce, P] = y("own"), [ze, 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 = l(r, e.hostId), et = l(r, e.guestId), tt = $e || et, nt = s(e), z = e.status === "placement", rt = e.status === "active" || e.status === "won", it = e.status === "active" && l(r, e.turnId), at = !i || !!e.pending || !!e.pendingEvent, B = it && !e.pendingShot && !at && !e.error && !Ye, V = z && !e.myReady && !at, H = we.includes(e.status) && (e.status !== "closed" || (e.myFleet?.length ?? 0) > 0), U = k === "ready", W = _(() => e.myFleet || [], [e.myFleet]), G = e.incomingShots || Ee, K = e.targetShots || Ee, ot = _(() => Ne(W), [W]), q = _(() => new Set(W.map((e) => e.id)), [W]), st = a.every((e) => q.has(e.id)), J = a.find((e) => e.id === We && !q.has(e.id)) || a.find((e) => !q.has(e.id)) || null, ct = _(() => W.map((e) => ({
324
+ }), 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 = l(r, e.hostId), et = l(r, e.guestId), tt = $e || et, nt = s(e), z = e.status === "placement", rt = e.status === "active" || e.status === "won", it = e.status === "active" && l(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 = a.every((e) => q.has(e.id)), J = a.find((e) => e.id === We && !q.has(e.id)) || a.find((e) => !q.has(e.id)) || null, ct = _(() => W.map((e) => ({
325
325
  ...e,
326
- sunk: !!e.cells?.length && e.cells.every((e) => ke(G, e) === "hit")
326
+ sunk: !!e.cells?.length && e.cells.every((e) => Ae(G, e) === "hit")
327
327
  })), [W, G]), lt = _(() => (e.sunkEnemyShips || []).filter((e) => e?.cells?.length).map((e) => ({
328
328
  ...e,
329
329
  size: e.size ?? e.cells.length,
330
330
  sunk: !0
331
- })), [e.sunkEnemyShips]), { total: ut, hits: dt } = _(() => Fe(K), [K]), ft = _(() => {
331
+ })), [e.sunkEnemyShips]), { total: ut, hits: dt } = _(() => Ie(K), [K]), ft = _(() => {
332
332
  let e = [];
333
333
  return K.forEach((t, n) => t?.forEach((t, r) => {
334
334
  t === "hit" && e.push({
@@ -336,7 +336,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
336
336
  col: r
337
337
  });
338
338
  })), e;
339
- }, [K]), Y = z ? "own" : Ce, X = ze || F, pt = _(() => {
339
+ }, [K]), Y = z ? "own" : we, X = P || F, pt = _(() => {
340
340
  if (!V || !J || !X) return null;
341
341
  let e = n(ot, {
342
342
  shipId: J.id,
@@ -345,7 +345,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
345
345
  orientation: L
346
346
  });
347
347
  return {
348
- cells: e.ok ? e.ship.cells : Pe(X, J.size, L),
348
+ cells: e.ok ? e.ship.cells : Fe(X, J.size, L),
349
349
  valid: e.ok
350
350
  };
351
351
  }, [
@@ -359,7 +359,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
359
359
  let e = t ? K.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : K;
360
360
  return {
361
361
  mode: "target",
362
- ships: t ? lt.map((e) => Ae([e], t) ? {
362
+ ships: t ? lt.map((e) => je([e], t) ? {
363
363
  ...e,
364
364
  sunk: !1
365
365
  } : e) : lt,
@@ -371,7 +371,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
371
371
  let n = t ? G.map((e, n) => e.map((e, r) => n === t.row && r === t.col ? null : e)) : G;
372
372
  return {
373
373
  mode: "own",
374
- ships: t ? ct.map((e) => Ae([e], t) ? {
374
+ ships: t ? ct.map((e) => je([e], t) ? {
375
375
  ...e,
376
376
  sunk: !1
377
377
  } : e) : ct,
@@ -393,7 +393,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
393
393
  kind: t,
394
394
  id: Date.now()
395
395
  }), []), gt = h((e = I) => {
396
- B && M(e) && (ke(K, e) ? Z(`Ya disparaste en ${j(e)}`) : (He(null), m.current?.selectCell?.(null), E("ui_click"), N("bsFire", t, {
396
+ B && j(e) && (Ae(K, e) ? Z(`Ya disparaste en ${A(e)}`) : (He(null), m.current?.selectCell?.(null), T("ui_click"), M("bsFire", t, {
397
397
  row: e.row,
398
398
  col: e.col
399
399
  })));
@@ -404,10 +404,10 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
404
404
  t,
405
405
  Z
406
406
  ]), _t = h((e) => {
407
- if (!V || !M(e)) return;
408
- let r = Ae(W, e);
407
+ if (!V || !j(e)) return;
408
+ let r = je(W, e);
409
409
  if (r) {
410
- Ge(r.id), r.orientation && Ue(r.orientation), E("ui_click"), N("bsRemoveShip", t, r.id);
410
+ Ge(r.id), r.orientation && Ue(r.orientation), T("ui_click"), M("bsRemoveShip", t, r.id);
411
411
  return;
412
412
  }
413
413
  if (!J) return;
@@ -417,7 +417,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
417
417
  col: e.col,
418
418
  orientation: L
419
419
  });
420
- i.ok ? (Ge(null), E("ship_place"), N("bsPlaceShip", t, {
420
+ i.ok ? (Ge(null), T("ship_place"), M("bsPlaceShip", t, {
421
421
  shipId: J.id,
422
422
  row: e.row,
423
423
  col: e.col,
@@ -432,17 +432,17 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
432
432
  t,
433
433
  Z
434
434
  ]), vt = h((e) => {
435
- if (!M(e)) return;
435
+ if (!j(e)) return;
436
436
  if (Ve(e), z) {
437
437
  _t(e);
438
438
  return;
439
439
  }
440
440
  if (Y !== "target" || !B) return;
441
- let t = Date.now(), n = T.current;
442
- T.current = {
441
+ let t = Date.now(), n = ge.current;
442
+ ge.current = {
443
443
  cell: e,
444
444
  time: t
445
- }, De(n.cell, e) && t - n.time < Te ? gt(e) : ke(K, e) ? Z(`Ya disparaste en ${j(e)}`) : (He(e), m.current?.selectCell?.(e));
445
+ }, 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));
446
446
  }, [
447
447
  z,
448
448
  _t,
@@ -452,36 +452,36 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
452
452
  K,
453
453
  Z
454
454
  ]);
455
- D.current = {
455
+ E.current = {
456
456
  selectCell: vt,
457
457
  setHovered: Be
458
458
  }, g(() => {
459
459
  let e = p.current;
460
460
  if (!H || !e) return;
461
461
  if (!ee()) {
462
- A("fallback");
462
+ k("fallback");
463
463
  return;
464
464
  }
465
465
  let t = !1, n = null;
466
- return A("loading"), import("./createBattleScene-L4ZRWDED.js").then(({ createBattleScene: r }) => {
466
+ return k("loading"), import("./createBattleScene-L4ZRWDED.js").then(({ createBattleScene: r }) => {
467
467
  t || (n = r(e, {
468
468
  quality: "auto",
469
- reducedMotion: Me(),
469
+ reducedMotion: Ne(),
470
470
  onCellHover: (e) => {
471
- t || D.current.setHovered(M(e) ? {
471
+ t || E.current.setHovered(j(e) ? {
472
472
  row: e.row,
473
473
  col: e.col
474
474
  } : null);
475
475
  },
476
476
  onCellSelect: (e) => {
477
- t || D.current.selectCell(M(e) ? {
477
+ t || E.current.selectCell(j(e) ? {
478
478
  row: e.row,
479
479
  col: e.col
480
480
  } : null);
481
481
  }
482
- }), m.current = n, A("ready"));
482
+ }), m.current = n, k("ready"));
483
483
  }).catch((e) => {
484
- t || (console.error("[battleship] No se pudo iniciar la escena", e), A("fallback"));
484
+ t || (console.error("[battleship] No se pudo iniciar la escena", e), k("fallback"));
485
485
  }), () => {
486
486
  t = !0, m.current = null;
487
487
  try {
@@ -492,22 +492,22 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
492
492
  };
493
493
  }, [H]), g(() => {
494
494
  w.preload();
495
- let e = O.current;
495
+ let e = D.current;
496
496
  return () => {
497
497
  e.forEach(clearTimeout), e.clear();
498
498
  };
499
499
  }, []);
500
500
  let yt = H && !nt;
501
- g(() => yt ? _e() : void 0, [yt]), g(() => {
502
- let t = ve.current;
503
- ve.current = e.status, t === "placement" && e.status === "active" && ge([{
501
+ g(() => yt ? ve() : void 0, [yt]), g(() => {
502
+ let t = ye.current;
503
+ ye.current = e.status, t === "placement" && e.status === "active" && _e([{
504
504
  name: "sonar_ping",
505
505
  at: 0
506
- }], () => `${e.gameId}:start`, O.current);
506
+ }], () => `${e.gameId}:start`, D.current);
507
507
  }, [e.status, e.gameId]);
508
508
  let Q = e.lastShot;
509
509
  g(() => {
510
- if (!U && k !== "fallback") return;
510
+ if (!U && O !== "fallback") return;
511
511
  let t = Q?.eventId ?? null;
512
512
  if (C.current === void 0) {
513
513
  C.current = t;
@@ -518,42 +518,42 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
518
518
  let n = !l(Q.by, r), i = {
519
519
  row: Q.row,
520
520
  col: Q.col
521
- }, a = j(i), o = typeof Q.sunk == "string" ? Q.sunk : Q.sunk ? Ae(n ? W : e.sunkEnemyShips || [], i)?.id : null, s = n ? Q.sunk ? `Te hundieron el ${Oe(o)}` : Q.result === "hit" ? `El rival impactó en ${a}` : `El rival falló: agua en ${a}` : Q.sunk ? `¡Hundiste el ${Oe(o)}!` : Q.result === "hit" ? `¡Impacto en ${a}!` : `Agua en ${a}`, c = Q.result === "hit" ? "hit" : "miss", u = n ? "own" : "target", d = n && be(W, e.incomingShots, Q), f = Se({
521
+ }, 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", u = n ? "own" : "target", d = n && xe(W, e.incomingShots, Q), f = Ce({
522
522
  result: Q.result,
523
523
  sunk: !!Q.sunk,
524
524
  defeated: !!Q.defeated,
525
525
  won: !n,
526
526
  cruiserAlarm: d
527
- }), p = (n) => n === "cruiser_damage_alarm" ? `${e.gameId}:cruiser` : n === "victory" || n === "defeat" ? `${e.gameId}:end` : t, ee = O.current;
528
- P(u);
527
+ }), p = (n) => n === "cruiser_damage_alarm" ? `${e.gameId}:cruiser` : n === "victory" || n === "defeat" ? `${e.gameId}:end` : t, ee = D.current;
528
+ N(u);
529
529
  let h = m.current;
530
530
  if (!h?.playShot) {
531
- ge(f, p, ee), Z(s, c);
531
+ _e(f, p, ee), Z(s, c);
532
532
  return;
533
533
  }
534
- ge(xe({ incoming: n }), p, ee), b.current = !0, Xe(!0);
534
+ _e(Se({ incoming: n }), p, ee), S.current = !0, Xe(!0);
535
535
  let g = !1;
536
536
  try {
537
537
  h.setView(mt(u, i));
538
538
  } catch {}
539
- let te = Me() ? 0 : 600;
539
+ let te = Ne() ? 0 : 600;
540
540
  return Promise.resolve(h.playShot({
541
541
  row: i.row,
542
542
  col: i.col,
543
543
  result: Q.result,
544
544
  sunk: !!Q.sunk,
545
545
  incoming: n
546
- })).catch(() => {}).then(() => (ge(f, p, ee), g || Z(s, c), new Promise((e) => setTimeout(e, te)))).then(() => {
547
- g || (b.current = !1, Xe(!1));
546
+ })).catch(() => {}).then(() => (_e(f, p, ee), g || Z(s, c), new Promise((e) => setTimeout(e, te)))).then(() => {
547
+ g || (S.current = !1, Xe(!1));
548
548
  }), () => {
549
- g = !0, b.current = !1, Xe(!1);
549
+ g = !0, S.current = !1, Xe(!1);
550
550
  };
551
551
  }, [
552
552
  U,
553
- k,
553
+ O,
554
554
  Q?.eventId
555
555
  ]), g(() => {
556
- Ye || e.status !== "active" || P(it ? "target" : "own");
556
+ Ye || e.status !== "active" || N(it ? "target" : "own");
557
557
  }, [
558
558
  it,
559
559
  e.status,
@@ -561,7 +561,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
561
561
  ]), g(() => {
562
562
  B || He(null);
563
563
  }, [B]), g(() => {
564
- if (U && !b.current) try {
564
+ if (U && !S.current) try {
565
565
  m.current?.setView(ht);
566
566
  } catch (e) {
567
567
  console.error("[battleship] setView", e);
@@ -587,13 +587,13 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
587
587
  ft
588
588
  ]);
589
589
  let bt = () => {
590
- E("ship_rotate"), Ue((e) => e === "horizontal" ? "vertical" : "horizontal");
590
+ T("ship_rotate"), Ue((e) => e === "horizontal" ? "vertical" : "horizontal");
591
591
  }, xt = () => {
592
- st && V && (E("ui_click"), N("bsReady", t));
592
+ st && V && (T("ui_click"), M("bsReady", t));
593
593
  }, $ = (e) => (...t) => {
594
- E("ui_click"), e(...t);
594
+ T("ui_click"), e(...t);
595
595
  }, St = () => {
596
- E(Ke ? "ui_click" : "sonar_ping"), qe((e) => !e);
596
+ T(Ke ? "ui_click" : "sonar_ping"), qe((e) => !e);
597
597
  }, Ct = (e) => {
598
598
  if (e.target !== e.currentTarget || e.altKey || e.ctrlKey || e.metaKey) return;
599
599
  let t = {
@@ -604,7 +604,7 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
604
604
  };
605
605
  if (t[e.key]) {
606
606
  e.preventDefault();
607
- let [n, r] = t[e.key], i = (Y === "target" ? I : null) || F || ze, a = i ? {
607
+ let [n, r] = t[e.key], i = (Y === "target" ? I : null) || F || P, a = i ? {
608
608
  row: Math.min(9, Math.max(0, i.row + n)),
609
609
  col: Math.min(9, Math.max(0, i.col + r))
610
610
  } : {
@@ -612,43 +612,43 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
612
612
  col: 0
613
613
  };
614
614
  Ve(a), Be(null), Y === "target" && B && (He(a), m.current?.selectCell?.(a));
615
- } else (e.key === "Enter" || e.key === " ") && (e.preventDefault(), z ? _t(F || ze) : gt(I || F));
615
+ } else (e.key === "Enter" || e.key === " ") && (e.preventDefault(), z ? _t(F || P) : gt(I || F));
616
616
  }, wt = (e) => {
617
617
  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)));
618
- }, Tt = /* @__PURE__ */ x(Le, { game: e }), Et = e.status === "won" && l(r, e.winnerId), Dt = !i && !nt ? "Sin conexión · esperando reconexión" : e.pending ? "Sincronizando…" : o, Ot = lt.length;
619
- return /* @__PURE__ */ S("section", {
618
+ }, Tt = /* @__PURE__ */ b(Re, { game: e }), Et = e.status === "won" && l(r, e.winnerId), Dt = !i && !nt ? "Sin conexión · esperando reconexión" : e.pending ? "Sincronizando…" : o, Ot = lt.length;
619
+ return /* @__PURE__ */ x("section", {
620
620
  className: `chat-game-card bs-card${it ? " chat-game-card--my-turn" : ""}${c ? ` chat-game-card--${c}` : ""}${R ? " bs-card--expanded" : ""}`,
621
621
  "aria-label": "Partida de Batalla Naval",
622
622
  onKeyDown: wt,
623
623
  children: [
624
- /* @__PURE__ */ S("header", {
624
+ /* @__PURE__ */ x("header", {
625
625
  className: "chat-game-header",
626
626
  children: [
627
- /* @__PURE__ */ S("div", {
627
+ /* @__PURE__ */ x("div", {
628
628
  className: "chat-game-heading",
629
- children: [/* @__PURE__ */ x("span", {
629
+ children: [/* @__PURE__ */ b("span", {
630
630
  className: "chat-game-eyebrow",
631
631
  children: "MINIJUEGOS · 2 JUGADORES"
632
- }), /* @__PURE__ */ S("h3", { children: ["Batalla Naval ", /* @__PURE__ */ x(ne, {
632
+ }), /* @__PURE__ */ x("h3", { children: ["Batalla Naval ", /* @__PURE__ */ b(re, {
633
633
  size: 13,
634
634
  "aria-hidden": "true",
635
635
  className: "bs-title-icon"
636
636
  })] })]
637
637
  }),
638
- c === "panel" && /* @__PURE__ */ x(f, { manager: w }),
639
- H && /* @__PURE__ */ x("button", {
638
+ c === "panel" && /* @__PURE__ */ b(f, { manager: w }),
639
+ H && /* @__PURE__ */ b("button", {
640
640
  className: "chat-game-close bs-expand",
641
641
  type: "button",
642
642
  "aria-pressed": R,
643
643
  "aria-label": R ? "Reducir tablero" : "Ampliar tablero",
644
644
  title: R ? "Reducir (Esc)" : "Ampliar",
645
645
  onClick: $(() => Je((e) => !e)),
646
- children: x(R ? ce : se, {
646
+ children: b(R ? le : ce, {
647
647
  size: 15,
648
648
  "aria-hidden": "true"
649
649
  })
650
650
  }),
651
- u && /* @__PURE__ */ x("button", {
651
+ u && /* @__PURE__ */ b("button", {
652
652
  className: "chat-game-close",
653
653
  type: "button",
654
654
  "aria-label": "Minimizar tablero",
@@ -656,93 +656,93 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
656
656
  onClick: () => {
657
657
  Je(!1), u();
658
658
  },
659
- children: /* @__PURE__ */ x(ie, {
659
+ children: /* @__PURE__ */ b(ae, {
660
660
  size: 16,
661
661
  "aria-hidden": "true"
662
662
  })
663
663
  }),
664
- tt && !nt && /* @__PURE__ */ x("button", {
664
+ tt && !nt && /* @__PURE__ */ b("button", {
665
665
  className: "chat-game-close",
666
666
  type: "button",
667
667
  "aria-label": "Finalizar partida para ambos jugadores",
668
668
  title: "Finalizar partida para ambos",
669
- onClick: () => void N("act", t, "game_end"),
669
+ onClick: () => void M("act", t, "game_end"),
670
670
  disabled: !i,
671
- children: /* @__PURE__ */ x(me, {
671
+ children: /* @__PURE__ */ b(he, {
672
672
  size: 16,
673
673
  "aria-hidden": "true"
674
674
  })
675
675
  }),
676
- d && /* @__PURE__ */ x("button", {
676
+ d && /* @__PURE__ */ b("button", {
677
677
  className: "chat-game-close",
678
678
  type: "button",
679
679
  "aria-label": "Cerrar tablero y volver al chat",
680
680
  title: "Cerrar tablero",
681
681
  onClick: d,
682
- children: /* @__PURE__ */ x(me, {
682
+ children: /* @__PURE__ */ b(he, {
683
683
  size: 16,
684
684
  "aria-hidden": "true"
685
685
  })
686
686
  })
687
687
  ]
688
688
  }),
689
- /* @__PURE__ */ S("div", {
689
+ /* @__PURE__ */ x("div", {
690
690
  className: "bs-statusline",
691
- children: [/* @__PURE__ */ x("p", {
691
+ children: [/* @__PURE__ */ b("p", {
692
692
  className: `chat-game-status${Et ? " bs-status--win" : ""}`,
693
693
  role: "status",
694
694
  children: Dt
695
695
  }), Tt]
696
696
  }),
697
- e.status === "invited" && /* @__PURE__ */ S("div", {
697
+ e.status === "invited" && /* @__PURE__ */ x("div", {
698
698
  className: "bs-invite",
699
- 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", {
699
+ children: [/* @__PURE__ */ b("p", { children: "Coloca 5 barcos en un tablero de 10×10 y hunde la flota rival por turnos." }), et && /* @__PURE__ */ x("div", {
700
700
  className: "chat-game-actions",
701
- children: [/* @__PURE__ */ x("button", {
701
+ children: [/* @__PURE__ */ b("button", {
702
702
  type: "button",
703
703
  className: "chat-game-action chat-game-action--primary",
704
704
  disabled: at,
705
- onClick: $(() => void N("act", t, "game_accept")),
705
+ onClick: $(() => void M("act", t, "game_accept")),
706
706
  children: "Aceptar partida"
707
- }), /* @__PURE__ */ x("button", {
707
+ }), /* @__PURE__ */ b("button", {
708
708
  type: "button",
709
709
  className: "chat-game-action",
710
710
  disabled: at,
711
- onClick: $(() => void N("act", t, "game_decline")),
711
+ onClick: $(() => void M("act", t, "game_decline")),
712
712
  children: "Rechazar"
713
713
  })]
714
714
  })]
715
715
  }),
716
- H && /* @__PURE__ */ S(he, { children: [
717
- rt && /* @__PURE__ */ S("div", {
716
+ H && /* @__PURE__ */ x(ne, { children: [
717
+ rt && /* @__PURE__ */ x("div", {
718
718
  className: "bs-hud",
719
719
  role: "toolbar",
720
720
  "aria-label": "Vista del tablero",
721
- children: [/* @__PURE__ */ S("div", {
721
+ children: [/* @__PURE__ */ x("div", {
722
722
  className: "bs-segment",
723
- children: [/* @__PURE__ */ S("button", {
723
+ children: [/* @__PURE__ */ x("button", {
724
724
  type: "button",
725
- "aria-pressed": Ce === "target",
726
- onClick: $(() => P("target")),
727
- children: [/* @__PURE__ */ x(ae, {
725
+ "aria-pressed": we === "target",
726
+ onClick: $(() => N("target")),
727
+ children: [/* @__PURE__ */ b(oe, {
728
728
  size: 14,
729
729
  "aria-hidden": "true"
730
730
  }), "Objetivo"]
731
- }), /* @__PURE__ */ S("button", {
731
+ }), /* @__PURE__ */ x("button", {
732
732
  type: "button",
733
- "aria-pressed": Ce === "own",
734
- onClick: $(() => P("own")),
735
- children: [/* @__PURE__ */ x(ne, {
733
+ "aria-pressed": we === "own",
734
+ onClick: $(() => N("own")),
735
+ children: [/* @__PURE__ */ b(re, {
736
736
  size: 14,
737
737
  "aria-hidden": "true"
738
738
  }), "Mi flota"]
739
739
  })]
740
- }), /* @__PURE__ */ S("dl", {
740
+ }), /* @__PURE__ */ x("dl", {
741
741
  className: "bs-stats",
742
742
  children: [
743
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "Disparos" }), /* @__PURE__ */ x("dd", { children: ut })] }),
744
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "Impactos" }), /* @__PURE__ */ x("dd", { children: dt })] }),
745
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "Hundidos" }), /* @__PURE__ */ S("dd", { children: [
743
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", { children: "Disparos" }), /* @__PURE__ */ b("dd", { children: ut })] }),
744
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", { children: "Impactos" }), /* @__PURE__ */ b("dd", { children: dt })] }),
745
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", { children: "Hundidos" }), /* @__PURE__ */ x("dd", { children: [
746
746
  Ot,
747
747
  "/",
748
748
  a.length
@@ -750,19 +750,19 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
750
750
  ]
751
751
  })]
752
752
  }),
753
- /* @__PURE__ */ S("div", {
753
+ /* @__PURE__ */ x("div", {
754
754
  className: "bs-stage-wrap",
755
755
  children: [
756
- /* @__PURE__ */ x("div", {
756
+ /* @__PURE__ */ b("div", {
757
757
  ref: p,
758
- className: `bs-stage${k === "fallback" ? " bs-stage--fallback" : ""}`,
758
+ className: `bs-stage${O === "fallback" ? " bs-stage--fallback" : ""}`,
759
759
  tabIndex: 0,
760
760
  role: "application",
761
761
  "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.",
762
- "aria-describedby": ye,
763
- "aria-busy": k === "loading",
762
+ "aria-describedby": be,
763
+ "aria-busy": O === "loading",
764
764
  onKeyDown: Ct,
765
- children: k === "fallback" && /* @__PURE__ */ x(Re, {
765
+ children: O === "fallback" && /* @__PURE__ */ b(ze, {
766
766
  view: ht,
767
767
  selected: Y === "target" ? I : null,
768
768
  cursor: F,
@@ -770,70 +770,70 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
770
770
  onHover: Be
771
771
  })
772
772
  }),
773
- k === "loading" && /* @__PURE__ */ S("div", {
773
+ O === "loading" && /* @__PURE__ */ x("div", {
774
774
  className: "bs-stage-state",
775
775
  role: "status",
776
- children: [/* @__PURE__ */ x(pe, {
776
+ children: [/* @__PURE__ */ b(me, {
777
777
  size: 16,
778
778
  "aria-hidden": "true"
779
779
  }), " Preparando el océano…"]
780
780
  }),
781
- k === "fallback" && /* @__PURE__ */ S("p", {
781
+ O === "fallback" && /* @__PURE__ */ x("p", {
782
782
  className: "bs-fallback-note",
783
- children: [/* @__PURE__ */ x(fe, {
783
+ children: [/* @__PURE__ */ b(pe, {
784
784
  size: 12,
785
785
  "aria-hidden": "true"
786
786
  }), " Vista 3D no disponible · modo 2D"]
787
787
  }),
788
- /* @__PURE__ */ x("div", {
788
+ /* @__PURE__ */ b("div", {
789
789
  className: "bs-cell-chip",
790
790
  "aria-hidden": "true",
791
- children: j(z ? X : Y === "target" && I || ze)
791
+ children: A(z ? X : Y === "target" && I || P)
792
792
  }),
793
- /* @__PURE__ */ x("div", {
793
+ /* @__PURE__ */ b("div", {
794
794
  className: "bs-live",
795
795
  "aria-live": "polite",
796
796
  "aria-atomic": "true",
797
- children: Ze && /* @__PURE__ */ x("span", {
797
+ children: Ze && /* @__PURE__ */ b("span", {
798
798
  className: `bs-toast bs-toast--${Ze.kind}`,
799
799
  children: Ze.text
800
800
  }, Ze.id)
801
801
  })
802
802
  ]
803
803
  }),
804
- /* @__PURE__ */ x("p", {
805
- id: ye,
804
+ /* @__PURE__ */ b("p", {
805
+ id: be,
806
806
  className: "bs-hint",
807
807
  children: z ? "Clic para colocar · clic en un barco para quitarlo · R para rotar" : "Arrastra para rotar · doble clic o Enter para disparar"
808
808
  }),
809
- z && /* @__PURE__ */ S("div", {
809
+ z && /* @__PURE__ */ x("div", {
810
810
  className: "bs-placement",
811
811
  children: [
812
- /* @__PURE__ */ x("ul", {
812
+ /* @__PURE__ */ b("ul", {
813
813
  className: "bs-fleet",
814
814
  "aria-label": "Tu flota",
815
815
  children: a.map((e) => {
816
816
  let n = q.has(e.id), r = J?.id === e.id;
817
- return /* @__PURE__ */ x("li", { children: /* @__PURE__ */ S("button", {
817
+ return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
818
818
  type: "button",
819
819
  className: `bs-ship${n ? " is-placed" : ""}${r ? " is-active" : ""}`,
820
820
  "aria-pressed": r,
821
821
  disabled: !V,
822
822
  title: n ? "Quitar y volver a colocar" : "Seleccionar barco",
823
823
  onClick: $(() => {
824
- n && N("bsRemoveShip", t, e.id), Ge(e.id);
824
+ n && M("bsRemoveShip", t, e.id), Ge(e.id);
825
825
  }),
826
826
  children: [
827
- /* @__PURE__ */ x("span", {
827
+ /* @__PURE__ */ b("span", {
828
828
  className: "bs-ship__name",
829
- children: je(Oe(e.id))
829
+ children: Me(ke(e.id))
830
830
  }),
831
- /* @__PURE__ */ x("span", {
831
+ /* @__PURE__ */ b("span", {
832
832
  className: "bs-ship__pips",
833
833
  "aria-label": `${e.size} casillas`,
834
- children: Array.from({ length: e.size }, (e, t) => /* @__PURE__ */ x("i", {}, t))
834
+ children: Array.from({ length: e.size }, (e, t) => /* @__PURE__ */ b("i", {}, t))
835
835
  }),
836
- n && /* @__PURE__ */ x(re, {
836
+ n && /* @__PURE__ */ b(ie, {
837
837
  size: 13,
838
838
  "aria-label": "colocado"
839
839
  })
@@ -841,90 +841,90 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
841
841
  }) }, e.id);
842
842
  })
843
843
  }),
844
- /* @__PURE__ */ S("div", {
844
+ /* @__PURE__ */ x("div", {
845
845
  className: "chat-game-actions bs-actions",
846
846
  children: [
847
- /* @__PURE__ */ S("button", {
847
+ /* @__PURE__ */ x("button", {
848
848
  type: "button",
849
849
  className: "chat-game-action bs-btn",
850
850
  disabled: !V,
851
851
  onClick: bt,
852
852
  title: "Rotar (R)",
853
- children: [/* @__PURE__ */ x(ue, {
853
+ children: [/* @__PURE__ */ b(de, {
854
854
  size: 15,
855
855
  "aria-hidden": "true"
856
856
  }), L === "horizontal" ? "Horizontal" : "Vertical"]
857
857
  }),
858
- /* @__PURE__ */ S("button", {
858
+ /* @__PURE__ */ x("button", {
859
859
  type: "button",
860
860
  className: "chat-game-action bs-btn",
861
861
  disabled: !V,
862
862
  onClick: () => {
863
- E("ship_place"), N("bsRandomFleet", t);
863
+ T("ship_place"), M("bsRandomFleet", t);
864
864
  },
865
- children: [/* @__PURE__ */ x(de, {
865
+ children: [/* @__PURE__ */ b(fe, {
866
866
  size: 15,
867
867
  "aria-hidden": "true"
868
868
  }), "Aleatorio"]
869
869
  }),
870
- /* @__PURE__ */ S("button", {
870
+ /* @__PURE__ */ x("button", {
871
871
  type: "button",
872
872
  className: "chat-game-action chat-game-action--primary bs-btn",
873
873
  disabled: !V || !st,
874
874
  onClick: xt,
875
- children: [/* @__PURE__ */ x(re, {
875
+ children: [/* @__PURE__ */ b(ie, {
876
876
  size: 15,
877
877
  "aria-hidden": "true"
878
878
  }), e.myReady ? "Flota lista" : `Listo (${q.size}/${a.length})`]
879
879
  })
880
880
  ]
881
881
  }),
882
- e.myReady && /* @__PURE__ */ x("p", {
882
+ e.myReady && /* @__PURE__ */ b("p", {
883
883
  className: "bs-waiting",
884
884
  children: e.opponentReady ? "Ambas flotas listas · iniciando…" : "Flota lista. Esperando a que el rival coloque su flota…"
885
885
  })
886
886
  ]
887
887
  }),
888
- rt && /* @__PURE__ */ S("div", {
888
+ rt && /* @__PURE__ */ x("div", {
889
889
  className: "chat-game-actions bs-actions",
890
890
  children: [
891
- /* @__PURE__ */ S("button", {
891
+ /* @__PURE__ */ x("button", {
892
892
  type: "button",
893
893
  className: "chat-game-action chat-game-action--primary bs-btn bs-btn--fire",
894
894
  disabled: !B || !I || Y !== "target",
895
895
  onClick: () => gt(),
896
- title: I ? `Disparar en ${j(I)} (Enter)` : "Selecciona una casilla",
896
+ title: I ? `Disparar en ${A(I)} (Enter)` : "Selecciona una casilla",
897
897
  children: [
898
- /* @__PURE__ */ x(ae, {
898
+ /* @__PURE__ */ b(oe, {
899
899
  size: 15,
900
900
  "aria-hidden": "true"
901
901
  }),
902
902
  "Disparar",
903
- I ? ` · ${j(I)}` : ""
903
+ I ? ` · ${A(I)}` : ""
904
904
  ]
905
905
  }),
906
- /* @__PURE__ */ S("button", {
906
+ /* @__PURE__ */ x("button", {
907
907
  type: "button",
908
908
  className: "chat-game-action bs-btn",
909
909
  "aria-pressed": Ke,
910
910
  disabled: Y !== "target" || !U,
911
911
  onClick: St,
912
912
  title: "Radar de impactos",
913
- children: [/* @__PURE__ */ x(le, {
913
+ children: [/* @__PURE__ */ b(ue, {
914
914
  size: 15,
915
915
  "aria-hidden": "true"
916
916
  }), "Radar"]
917
917
  }),
918
- /* @__PURE__ */ S("button", {
918
+ /* @__PURE__ */ x("button", {
919
919
  type: "button",
920
920
  className: "chat-game-action bs-btn",
921
921
  disabled: !U,
922
922
  onClick: $(() => m.current?.resetCamera?.()),
923
923
  title: "Centrar cámara (R)",
924
- children: [/* @__PURE__ */ x(oe, {
924
+ children: [/* @__PURE__ */ b(se, {
925
925
  size: 15,
926
926
  "aria-hidden": "true"
927
- }), /* @__PURE__ */ x("span", {
927
+ }), /* @__PURE__ */ b("span", {
928
928
  className: "bs-btn-label",
929
929
  children: "Centrar"
930
930
  })]
@@ -932,31 +932,31 @@ function Be({ game: e, gameKey: t, currentUserId: r, connected: i, status: o, va
932
932
  ]
933
933
  })
934
934
  ] }),
935
- e.status === "conflict" && tt && /* @__PURE__ */ x(Ie, {
935
+ e.status === "conflict" && tt && /* @__PURE__ */ b(Le, {
936
936
  sync: e.sync,
937
937
  connected: i,
938
- onResync: () => void N("requestResync", t),
939
- onAdoptOffer: () => void N("adoptResyncOffer", t)
938
+ onResync: () => void M("requestResync", t),
939
+ onAdoptOffer: () => void M("adoptResyncOffer", t)
940
940
  }),
941
- e.error && /* @__PURE__ */ S("div", {
941
+ e.error && /* @__PURE__ */ x("div", {
942
942
  className: "chat-game-error",
943
943
  role: "alert",
944
- children: [/* @__PURE__ */ x("span", { children: e.error }), e.pendingEvent && /* @__PURE__ */ x("button", {
944
+ children: [/* @__PURE__ */ b("span", { children: e.error }), e.pendingEvent && /* @__PURE__ */ b("button", {
945
945
  type: "button",
946
946
  className: "chat-game-action",
947
947
  disabled: !i || e.pending,
948
- onClick: () => void N("retry", t),
948
+ onClick: () => void M("retry", t),
949
949
  children: "Reintentar"
950
950
  })]
951
951
  }),
952
- /* @__PURE__ */ x("footer", {
952
+ /* @__PURE__ */ b("footer", {
953
953
  className: "chat-game-footer",
954
954
  children: nt ? "Puedes seguir conversando o invitar a otra partida." : "Hunde los 5 barcos rivales. El chat sigue disponible."
955
955
  })
956
956
  ]
957
957
  });
958
958
  }
959
- var F = m(ze);
959
+ var F = m(P);
960
960
  export { F as default };
961
961
 
962
- //# sourceMappingURL=BattleshipGameCard-B-B4r7lK.js.map
962
+ //# sourceMappingURL=BattleshipGameCard-DwNzgH5G.js.map