speakid-hangman 1.0.6 → 1.0.7

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as h, Fragment as G } from "react/jsx-runtime";
2
- import { useState as m, useMemo as Q, useCallback as ge, useEffect as pe } from "react";
2
+ import { useState as m, useMemo as Q, useCallback as ue, useEffect as he } from "react";
3
3
  const a = {
4
4
  gmCenterScreen: {
5
5
  position: "relative",
@@ -202,17 +202,17 @@ const a = {
202
202
  display: "block"
203
203
  }
204
204
  };
205
- function Fe({
206
- mistakes: r,
205
+ function He({
206
+ mistakes: i,
207
207
  maxMistakes: J,
208
208
  size: _ = 200
209
209
  }) {
210
- const l = _, c = _ * 1.25, w = Math.max(3, _ / 100), W = 10 * (l / 200), f = 240 * (c / 250), x = 150 * (l / 200), y = 80 * (l / 200), ee = 20 * (c / 250), N = 240 * (c / 250), k = 80 * (l / 200), P = 20 * (c / 250), v = 150 * (l / 200), C = 150 * (l / 200), $ = 20 * (c / 250), H = 50 * (c / 250), S = 150 * (l / 200), I = 70 * (c / 250), V = 20 * (l / 200), L = 150 * (l / 200), te = 90 * (c / 250), O = 150 * (c / 250), u = 150 * (l / 200), F = 110 * (c / 250), g = 130 * (l / 200), R = 130 * (c / 250), ne = 150 * (l / 200), j = 110 * (c / 250), he = 170 * (l / 200), T = 130 * (c / 250), oe = 150 * (l / 200), Z = 150 * (c / 250), d = 130 * (l / 200), re = 190 * (c / 250), E = 150 * (l / 200), ie = 150 * (c / 250), p = 170 * (l / 200), ae = 190 * (c / 250), b = r === 0 || r <= J * 0.5 ? "#1f2937" : r <= J * 0.75 ? "#f59e0b" : "#ec4c44";
210
+ const c = _, g = _ * 1.25, w = Math.max(3, _ / 100), C = 10 * (c / 200), x = 240 * (g / 250), y = 150 * (c / 200), b = 80 * (c / 200), ee = 20 * (g / 250), N = 240 * (g / 250), M = 80 * (c / 200), P = 20 * (g / 250), L = 150 * (c / 200), H = 150 * (c / 200), v = 20 * (g / 250), I = 50 * (g / 250), F = 150 * (c / 200), R = 70 * (g / 250), V = 20 * (c / 200), T = 150 * (c / 200), te = 90 * (g / 250), A = 150 * (g / 250), f = 150 * (c / 200), B = 110 * (g / 250), p = 130 * (c / 200), O = 130 * (g / 250), ne = 150 * (c / 200), E = 110 * (g / 250), me = 170 * (c / 200), z = 130 * (g / 250), oe = 150 * (c / 200), Z = 150 * (g / 250), d = 130 * (c / 200), re = 190 * (g / 250), j = 150 * (c / 200), ie = 150 * (g / 250), u = 170 * (c / 200), ae = 190 * (g / 250), k = i === 0 || i <= J * 0.5 ? "#1f2937" : i <= J * 0.75 ? "#f59e0b" : "#ec4c44";
211
211
  return /* @__PURE__ */ h(
212
212
  "svg",
213
213
  {
214
- width: l,
215
- height: c,
214
+ width: c,
215
+ height: g,
216
216
  viewBox: "0 0 200 250",
217
217
  style: {
218
218
  display: "block",
@@ -225,113 +225,113 @@ function Fe({
225
225
  // ✅ Включение аппаратного ускорения на iOS
226
226
  },
227
227
  children: [
228
- r > 0 && /* @__PURE__ */ o(
228
+ i > 0 && /* @__PURE__ */ o(
229
229
  "line",
230
230
  {
231
- x1: W,
232
- y1: f,
233
- x2: x,
234
- y2: f,
235
- stroke: b,
231
+ x1: C,
232
+ y1: x,
233
+ x2: y,
234
+ y2: x,
235
+ stroke: k,
236
236
  strokeWidth: w
237
237
  }
238
238
  ),
239
- r > 1 && /* @__PURE__ */ o(
239
+ i > 1 && /* @__PURE__ */ o(
240
240
  "line",
241
241
  {
242
- x1: y,
242
+ x1: b,
243
243
  y1: ee,
244
- x2: y,
244
+ x2: b,
245
245
  y2: N,
246
- stroke: b,
246
+ stroke: k,
247
247
  strokeWidth: w
248
248
  }
249
249
  ),
250
- r > 2 && /* @__PURE__ */ o(
250
+ i > 2 && /* @__PURE__ */ o(
251
251
  "line",
252
252
  {
253
- x1: k,
253
+ x1: M,
254
254
  y1: P,
255
- x2: v,
255
+ x2: L,
256
256
  y2: P,
257
- stroke: b,
257
+ stroke: k,
258
258
  strokeWidth: w
259
259
  }
260
260
  ),
261
- r > 3 && /* @__PURE__ */ o(
261
+ i > 3 && /* @__PURE__ */ o(
262
262
  "line",
263
263
  {
264
- x1: C,
265
- y1: $,
266
- x2: C,
267
- y2: H,
268
- stroke: b,
264
+ x1: H,
265
+ y1: v,
266
+ x2: H,
267
+ y2: I,
268
+ stroke: k,
269
269
  strokeWidth: w
270
270
  }
271
271
  ),
272
- r > 4 && /* @__PURE__ */ o(
272
+ i > 4 && /* @__PURE__ */ o(
273
273
  "circle",
274
274
  {
275
- cx: S,
276
- cy: I,
275
+ cx: F,
276
+ cy: R,
277
277
  r: V,
278
- stroke: b,
278
+ stroke: k,
279
279
  fill: "none",
280
280
  strokeWidth: w
281
281
  }
282
282
  ),
283
- r > 5 && /* @__PURE__ */ o(
283
+ i > 5 && /* @__PURE__ */ o(
284
284
  "line",
285
285
  {
286
- x1: L,
286
+ x1: T,
287
287
  y1: te,
288
- x2: L,
289
- y2: O,
290
- stroke: b,
288
+ x2: T,
289
+ y2: A,
290
+ stroke: k,
291
291
  strokeWidth: w
292
292
  }
293
293
  ),
294
- r > 6 && /* @__PURE__ */ o(
294
+ i > 6 && /* @__PURE__ */ o(
295
295
  "line",
296
296
  {
297
- x1: u,
298
- y1: F,
299
- x2: g,
300
- y2: R,
301
- stroke: b,
297
+ x1: f,
298
+ y1: B,
299
+ x2: p,
300
+ y2: O,
301
+ stroke: k,
302
302
  strokeWidth: w
303
303
  }
304
304
  ),
305
- r > 7 && /* @__PURE__ */ o(
305
+ i > 7 && /* @__PURE__ */ o(
306
306
  "line",
307
307
  {
308
308
  x1: ne,
309
- y1: j,
310
- x2: he,
311
- y2: T,
312
- stroke: b,
309
+ y1: E,
310
+ x2: me,
311
+ y2: z,
312
+ stroke: k,
313
313
  strokeWidth: w
314
314
  }
315
315
  ),
316
- r > 8 && /* @__PURE__ */ o(
316
+ i > 8 && /* @__PURE__ */ o(
317
317
  "line",
318
318
  {
319
319
  x1: oe,
320
320
  y1: Z,
321
321
  x2: d,
322
322
  y2: re,
323
- stroke: b,
323
+ stroke: k,
324
324
  strokeWidth: w
325
325
  }
326
326
  ),
327
- r > 9 && /* @__PURE__ */ o(
327
+ i > 9 && /* @__PURE__ */ o(
328
328
  "line",
329
329
  {
330
- x1: E,
330
+ x1: j,
331
331
  y1: ie,
332
- x2: p,
332
+ x2: u,
333
333
  y2: ae,
334
- stroke: b,
334
+ stroke: k,
335
335
  strokeWidth: w
336
336
  }
337
337
  )
@@ -339,15 +339,15 @@ function Fe({
339
339
  }
340
340
  );
341
341
  }
342
- function We({
343
- gameCubeSize: r = 400,
342
+ function Ye({
343
+ gameCubeSize: i = 400,
344
344
  screenHeight: J = 800,
345
345
  screenWidth: _ = 800,
346
- logoUrl: l,
347
- showLogo: c = !0,
346
+ logoUrl: c,
347
+ showLogo: g = !0,
348
348
  baseURL: w
349
349
  } = {}) {
350
- const W = {
350
+ const C = {
351
351
  Professions: ["teacher", "doctor", "nurse", "driver", "police", "firefighter", "cook", "waiter", "farmer", "builder", "singer", "actor", "dentist", "pilot", "vet", "artist", "cleaner", "student", "baker", "mechanic"],
352
352
  Family: ["mother", "father", "sister", "brother", "grandmother", "grandfather", "aunt", "uncle", "cousin", "baby", "parents", "children", "wife", "husband", "son", "daughter", "family", "twins", "relatives"],
353
353
  "Farm animals": ["cow", "pig", "horse", "sheep", "goat", "duck", "chicken", "rooster", "turkey", "goose", "rabbit", "mouse", "donkey", "bee", "hen", "lamb", "bull", "pony"],
@@ -365,132 +365,129 @@ function We({
365
365
  Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
366
366
  Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
367
367
  Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
368
- }, [f, x] = m("lobby"), [y, ee] = m(""), [N] = m("Normal"), [k, P] = m(0), [v, C] = m(1), [$, H] = m(""), [S, I] = m([]), [V, L] = m(0), [te, O] = m(0), [u, F] = m(null), [g, R] = m(null), [ne, j] = m(1), [he, T] = m([]), oe = N === "Easy" ? 8 : N === "Normal" ? 6 : 4, Z = w || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [d, re] = m(!1), [E, ie] = m(!1), [p, ae] = m(!1), s = Q(() => {
369
- const e = (g || r || 1e3) / 400, t = p ? 0.8 : 1;
368
+ }, [x, y] = m("lobby"), [b, ee] = m(""), [N] = m("Normal"), [M, P] = m(0), [L, H] = m(1), [v, I] = m(""), [F, R] = m([]), [V, T] = m(0), [te, A] = m(0), [f, B] = m(null), [p, O] = m(null), [ne, E] = m(1), [me, z] = m([]), oe = N === "Easy" ? 8 : N === "Normal" ? 6 : 4, Z = w || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [d, re] = m(!1), [j, ie] = m(!1), [u, ae] = m(!1), [$, k] = m(!1), s = Q(() => {
369
+ const e = (p || i || 1e3) / 400, t = u ? 0.8 : 1, r = $ ? 0.9 : 1, l = t * r;
370
370
  return {
371
- headline1: d ? Math.max(24, Math.min(30, 30 * e * t)) : Math.max(28, Math.min(32, 32 * e)),
371
+ headline1: d ? Math.max(24, Math.min(30, 30 * e * l)) : Math.max(28, Math.min(32, 32 * e * r)),
372
372
  // Desktop: 32px
373
- headline2: Math.max(20, Math.min(28, 24 * e * t)),
373
+ headline2: Math.max(20, Math.min(28, 24 * e * l)),
374
374
  // Desktop: 24px
375
- headline3: d ? Math.max(14, Math.min(18, 16 * e * t)) : Math.max(20, Math.min(26, 24 * e * t)),
375
+ headline3: d ? Math.max(14, Math.min(18, 16 * e * l)) : Math.max(20, Math.min(26, 24 * e * l)),
376
376
  // Desktop: 24px
377
- bodyL: Math.max(14, Math.min(20, 18 * e * t)),
377
+ bodyL: Math.max(14, Math.min(20, 18 * e * l)),
378
378
  // Desktop: 18px
379
- bodyM: d ? Math.max(12, Math.min(16, 14 * e * t)) : Math.max(14, Math.min(18, 16 * e * t)),
379
+ bodyM: d ? Math.max(12, Math.min(16, 14 * e * l)) : Math.max(14, Math.min(18, 16 * e * l)),
380
380
  // Desktop: 16px
381
- bodyS: d ? Math.max(10, Math.min(14, 12 * e * t)) : Math.max(12, Math.min(16, 14 * e * t)),
381
+ bodyS: d ? Math.max(10, Math.min(14, 12 * e * l)) : Math.max(12, Math.min(16, 14 * e * l)),
382
382
  // Desktop: 14px
383
- wordDisplay: Math.max(18, Math.min(32, 26 * e * t)),
383
+ wordDisplay: Math.max(18, Math.min(32, 26 * e * l)),
384
384
  // Адаптивный размер
385
- button: Math.max(12, Math.min(18, 16 * e * t))
385
+ button: Math.max(12, Math.min(18, 16 * e * l))
386
386
  // Desktop: 16px
387
387
  };
388
- }, [d, g, r, p]), b = Q(() => {
389
- const e = (g || r || 1e3) / 400, t = p ? 0.65 : 1;
390
- return E ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e)) * t;
391
- }, [E, g, r, p]), n = Q(() => {
392
- const e = (g || r || 1e3) / 400, t = p ? 0.65 : 1;
393
- return E ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e)) * t;
394
- }, [E, g, r, p]), M = Q(() => {
395
- const e = (g || r || 1e3) / 400;
396
- return Math.max(6, Math.min(10, 8 * e));
397
- }, [g, r]), fe = (e, t) => e.split("").every((i) => t.includes(i)), xe = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), ye = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)), U = (e, t = []) => {
388
+ }, [d, p, i, u, $]), fe = Q(() => {
389
+ const e = (p || i || 1e3) / 400, t = u ? 0.65 : 1, r = $ ? 0.85 : 1;
390
+ return j ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e)) * t * r;
391
+ }, [j, p, i, u, $]), n = Q(() => {
392
+ const e = (p || i || 1e3) / 400, t = u ? 0.65 : 1, r = $ ? 0.85 : 1;
393
+ return j ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e)) * t * r;
394
+ }, [j, p, i, u, $]), S = Q(() => {
395
+ const e = (p || i || 1e3) / 400, t = $ ? 0.9 : 1;
396
+ return Math.max(6, Math.min(10, 8 * e * t));
397
+ }, [p, i, $]), we = (e, t) => e.split("").every((r) => t.includes(r)), ke = (e, t) => e.split("").map((r) => t.includes(r) ? r : "_").join(" "), Me = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((r) => !e.includes(r)), U = (e, t = []) => {
398
398
  var q;
399
- if (!e || !W[e]) {
400
- const z = Object.keys(W)[0];
401
- return ((q = W[z]) == null ? void 0 : q[0]) || "";
399
+ if (!e || !C[e]) {
400
+ const W = Object.keys(C)[0];
401
+ return ((q = C[W]) == null ? void 0 : q[0]) || "";
402
402
  }
403
- const i = W[e];
404
- if (!i || i.length === 0)
403
+ const r = C[e];
404
+ if (!r || r.length === 0)
405
405
  return "";
406
- const B = i.filter((z) => !t.includes(z)), Y = B.length > 0 ? B : i;
406
+ const l = r.filter((W) => !t.includes(W)), Y = l.length > 0 ? l : r;
407
407
  if (Y.length === 0)
408
408
  return "";
409
409
  let D;
410
410
  if (typeof crypto < "u" && crypto.getRandomValues) {
411
- const z = new Uint32Array(1);
412
- crypto.getRandomValues(z);
413
- const A = z[0] / 4294967295;
414
- D = Math.floor(A * Y.length);
411
+ const W = new Uint32Array(1);
412
+ crypto.getRandomValues(W);
413
+ const ge = W[0] / 4294967295;
414
+ D = Math.floor(ge * Y.length);
415
415
  } else
416
416
  D = Math.floor(Math.random() * Y.length);
417
417
  return Y[D];
418
- }, be = () => {
419
- if (!y) return;
420
- T([]);
421
- const e = U(y, []);
418
+ }, $e = () => {
419
+ if (!b) return;
420
+ z([]);
421
+ const e = U(b, []);
422
422
  if (!e) {
423
- x("category");
423
+ y("category");
424
424
  return;
425
425
  }
426
- H(e), T([e]), I([]), L(0), C(1), O(0), F(null), x("game");
427
- }, se = ge((e) => {
428
- if (f !== "game" || u !== null) return;
426
+ I(e), z([e]), R([]), T(0), H(1), A(0), B(null), y("game");
427
+ }, se = ue((e) => {
428
+ if (x !== "game" || f !== null) return;
429
429
  const t = e.toLowerCase();
430
- /^[a-z]$/.test(t) && (I((i) => i.includes(t) ? i : [...i, t]), H((i) => (i && !i.includes(t) && L((B) => B + 1), i)));
431
- }, [f, u]), le = ge((e) => {
430
+ /^[a-z]$/.test(t) && (R((r) => r.includes(t) ? r : [...r, t]), I((r) => (r && !r.includes(t) && T((l) => l + 1), r)));
431
+ }, [x, f]), le = ue((e) => {
432
432
  se(e.key);
433
433
  }, [se]);
434
- pe(() => {
435
- if (f === "game")
434
+ he(() => {
435
+ if (x === "game")
436
436
  return window.addEventListener("keydown", le), () => window.removeEventListener("keydown", le);
437
- }, [f, le]);
438
- const we = $ ? xe($, S) : "", ue = $ ? fe($, S) : !1, me = V >= 10, ke = ye(S), de = ge(() => {
439
- if (!y || v >= k) {
440
- x("result");
437
+ }, [x, le]);
438
+ const Se = v ? ke(v, F) : "", xe = v ? we(v, F) : !1, ye = V >= 10, ve = Me(F), ce = ue(() => {
439
+ if (!b || L >= M) {
440
+ y("result");
441
441
  return;
442
442
  }
443
- C((e) => e + 1), T((e) => {
444
- const t = U(y, e);
445
- return t ? (H(t), [...e, t]) : e;
446
- }), I([]), L(0), F(null);
447
- }, [y, v, k]);
448
- pe(() => {
449
- if (ue && u === null) {
450
- F("win"), O((t) => t + 1);
443
+ H((e) => e + 1), z((e) => {
444
+ const t = U(b, e);
445
+ return t ? (I(t), [...e, t]) : e;
446
+ }), R([]), T(0), B(null);
447
+ }, [b, L, M]);
448
+ he(() => {
449
+ if (xe && f === null) {
450
+ B("win"), A((t) => t + 1);
451
451
  const e = setTimeout(() => {
452
- de();
452
+ ce();
453
453
  }, 2e3);
454
454
  return () => clearTimeout(e);
455
455
  }
456
- if (me && u === null) {
457
- F("lose");
456
+ if (ye && f === null) {
457
+ B("lose");
458
458
  const e = setTimeout(() => {
459
- de();
459
+ ce();
460
460
  }, 2e3);
461
461
  return () => clearTimeout(e);
462
462
  }
463
- }, [ue, me, u, de]);
464
- const Me = () => {
465
- if (!y || v >= k) {
466
- x("result");
463
+ }, [xe, ye, f, ce]);
464
+ const Le = () => {
465
+ if (!b || L >= M) {
466
+ y("result");
467
467
  return;
468
468
  }
469
- C((e) => e + 1), T((e) => {
470
- const t = U(y, e);
471
- return t ? (H(t), [...e, t]) : e;
472
- }), I([]), L(0), F(null);
469
+ H((e) => e + 1), z((e) => {
470
+ const t = U(b, e);
471
+ return t ? (I(t), [...e, t]) : e;
472
+ }), R([]), T(0), B(null);
473
473
  };
474
- pe(() => {
474
+ he(() => {
475
475
  const e = () => {
476
- const t = window.innerWidth, i = window.innerHeight, B = t < 768 || t === 926 && i === 428 || t === 932 && i === 430, Y = i < 700, D = t / i > 1.8, q = t === 1024 && i === 600, z = B && t > i;
477
- if (re(B), ie(q), ae(z), r && r >= 320) {
478
- const Le = Math.max(320, Math.min(1200, r));
479
- R(Le), j(1);
480
- } else if (B)
481
- R(null), j(1);
476
+ const t = window.innerWidth, r = window.innerHeight, l = t < 768 || t === 926 && r === 428 || t === 932 && r === 430, Y = r < 700, D = t / r > 1.8, q = t === 1024 && r === 600, W = l && t > r, ge = t >= 1200 && t <= 1400;
477
+ if (re(l), ie(q), ae(W), k(ge), l)
478
+ O(null), E(1);
482
479
  else if (Y)
483
- R(null), j(1);
484
- else if (D) {
485
- const A = Math.min(1e3, Math.min(t, i) * 0.9);
486
- R(A), j(0.85);
487
- } else {
488
- const A = Math.min(1e3, Math.min(t, i) * 0.9);
489
- R(A), j(1);
480
+ O(null), E(1);
481
+ else {
482
+ const ze = t - 80, We = r - 80, be = Math.min(ze, We);
483
+ let pe;
484
+ i && i >= 320 ? pe = Math.min(i, be) : pe = Math.min(1e3, be * 0.9);
485
+ const Ce = Math.max(400, Math.min(1200, pe));
486
+ O(Ce), E(D ? 0.85 : 1);
490
487
  }
491
488
  };
492
489
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
493
- }, [r]);
490
+ }, [i]);
494
491
  const K = `
495
492
  <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
496
493
  <!-- Каракули мелками и фломастерами -->
@@ -535,35 +532,36 @@ function We({
535
532
  <path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
536
533
  fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
537
534
  </svg>
538
- `, $e = !d && typeof window < "u" && window.innerWidth >= 768 && window.innerWidth < 1024, ce = !d && c && (f !== "game" || $e), ve = {
535
+ `, Fe = !d && typeof window < "u" && window.innerWidth >= 768 && window.innerWidth < 1024, de = !d && g && (x !== "game" || Fe), Te = {
539
536
  ...a.gmCenterScreen,
540
537
  width: "100%",
541
538
  height: "100%",
542
- padding: `${b}px`,
543
- paddingTop: ce ? "60px" : `${b}px`,
539
+ padding: `${fe}px`,
540
+ paddingTop: de ? "60px" : `${fe}px`,
544
541
  // ✅ Резервируем место под логотип (16px top + 28px высота + 16px отступ)
545
- overflow: "auto",
542
+ overflow: $ ? "hidden" : "auto",
543
+ // ✅ Для разрешений 1200-1400 убираем скролл
546
544
  position: "relative",
547
545
  boxSizing: "border-box",
548
546
  background: "transparent"
549
547
  }, X = Q(
550
548
  () => {
551
549
  const e = window.innerWidth, t = window.innerHeight;
552
- if (d && e > t || t < 700 || !ce)
550
+ if (d && e > t || t < 700 || !de)
553
551
  return null;
554
- const i = l || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
552
+ const r = c || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
555
553
  return /* @__PURE__ */ o("div", { style: a.gmLogoFixed, children: /* @__PURE__ */ h("picture", { children: [
556
554
  /* @__PURE__ */ o(
557
555
  "source",
558
556
  {
559
- srcSet: `${i}.svg`,
557
+ srcSet: `${r}.svg`,
560
558
  type: "image/svg+xml"
561
559
  }
562
560
  ),
563
561
  /* @__PURE__ */ o(
564
562
  "img",
565
563
  {
566
- src: `${i}.png`,
564
+ src: `${r}.png`,
567
565
  alt: "SPEAKID Logo",
568
566
  style: a.gmLogoImg,
569
567
  loading: "lazy"
@@ -571,8 +569,8 @@ function We({
571
569
  )
572
570
  ] }) });
573
571
  },
574
- [d, ce, l, f]
575
- ), Se = () => f === "lobby" ? /* @__PURE__ */ h(G, { children: [
572
+ [d, de, c, x]
573
+ ), Be = () => x === "lobby" ? /* @__PURE__ */ h(G, { children: [
576
574
  X,
577
575
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
578
576
  /* @__PURE__ */ o("h1", { style: {
@@ -585,14 +583,14 @@ function We({
585
583
  /* @__PURE__ */ h(
586
584
  "button",
587
585
  {
588
- onClick: () => x("category"),
586
+ onClick: () => y("category"),
589
587
  style: {
590
588
  fontFamily: '"Onest", system-ui, sans-serif',
591
589
  fontWeight: 500,
592
590
  // Medium для более заметности
593
591
  fontSize: `${s.button}px`,
594
592
  padding: `${n * 1.2}px ${n * 3}px`,
595
- borderRadius: `${M * 1.5}px`,
593
+ borderRadius: `${S * 1.5}px`,
596
594
  position: "relative",
597
595
  zIndex: 1,
598
596
  display: "flex",
@@ -659,7 +657,7 @@ function We({
659
657
  left: d ? "-10%" : "5%",
660
658
  top: "20%",
661
659
  width: "auto",
662
- height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
660
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || i || 1e3) * 0.33, 300)}px`,
663
661
  maxHeight: "33vh",
664
662
  objectFit: "contain",
665
663
  opacity: 0.6
@@ -676,7 +674,7 @@ function We({
676
674
  right: d ? "5%" : "10%",
677
675
  bottom: "10%",
678
676
  width: "auto",
679
- height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
677
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || i || 1e3) * 0.33, 300)}px`,
680
678
  maxHeight: "33vh",
681
679
  objectFit: "contain",
682
680
  opacity: 0.6
@@ -684,13 +682,13 @@ function We({
684
682
  }
685
683
  )
686
684
  ] })
687
- ] }) : f === "category" ? /* @__PURE__ */ h(G, { children: [
685
+ ] }) : x === "category" ? /* @__PURE__ */ h(G, { children: [
688
686
  X,
689
687
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
690
688
  /* @__PURE__ */ o(
691
689
  "button",
692
690
  {
693
- onClick: () => x("lobby"),
691
+ onClick: () => y("lobby"),
694
692
  onMouseEnter: (e) => {
695
693
  e.currentTarget.style.backgroundColor = "#e5e7eb";
696
694
  },
@@ -702,7 +700,7 @@ function We({
702
700
  ...a.gmButtonSecondary,
703
701
  fontSize: `${s.button}px`,
704
702
  padding: `${n}px ${n * 1.5}px`,
705
- borderRadius: `${M}px`,
703
+ borderRadius: `${S}px`,
706
704
  position: "absolute",
707
705
  top: "52px",
708
706
  // ✅ Под логотипом (16px top логотипа + 28px высота логотипа + 8px отступ)
@@ -713,11 +711,11 @@ function We({
713
711
  children: "←"
714
712
  }
715
713
  ),
716
- /* @__PURE__ */ o("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, marginTop: `${n * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(W).map((e) => /* @__PURE__ */ o(
714
+ /* @__PURE__ */ o("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, marginTop: `${n * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(C).map((e) => /* @__PURE__ */ o(
717
715
  "button",
718
716
  {
719
717
  onClick: () => {
720
- ee(e), x("rounds");
718
+ ee(e), y("rounds");
721
719
  },
722
720
  onMouseEnter: (t) => {
723
721
  t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
@@ -730,7 +728,7 @@ function We({
730
728
  fontWeight: 500,
731
729
  fontSize: `${s.button}px`,
732
730
  padding: `${n * 1.2}px ${n * 2}px`,
733
- borderRadius: `${M * 2}px`,
731
+ borderRadius: `${S * 2}px`,
734
732
  // Более округлые для облачков
735
733
  margin: `${n / 2}px`,
736
734
  background: "transparent",
@@ -744,13 +742,13 @@ function We({
744
742
  },
745
743
  e
746
744
  )) })
747
- ] }) : f === "rounds" ? /* @__PURE__ */ h(G, { children: [
745
+ ] }) : x === "rounds" ? /* @__PURE__ */ h(G, { children: [
748
746
  X,
749
747
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
750
748
  /* @__PURE__ */ o(
751
749
  "button",
752
750
  {
753
- onClick: () => x("category"),
751
+ onClick: () => y("category"),
754
752
  onMouseEnter: (e) => {
755
753
  e.currentTarget.style.backgroundColor = "#e5e7eb";
756
754
  },
@@ -762,7 +760,7 @@ function We({
762
760
  ...a.gmButtonSecondary,
763
761
  fontSize: `${s.button}px`,
764
762
  padding: `${n}px ${n * 1.5}px`,
765
- borderRadius: `${M}px`,
763
+ borderRadius: `${S}px`,
766
764
  position: "absolute",
767
765
  top: "52px",
768
766
  // ✅ Под логотипом (16px top логотипа + 28px высота логотипа + 8px отступ)
@@ -778,7 +776,7 @@ function We({
778
776
  "button",
779
777
  {
780
778
  onClick: () => {
781
- P(e), be();
779
+ P(e), $e();
782
780
  },
783
781
  onMouseEnter: (t) => {
784
782
  t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
@@ -791,7 +789,7 @@ function We({
791
789
  fontWeight: 500,
792
790
  fontSize: `${s.button}px`,
793
791
  padding: `${n * 1.2}px ${n * 2}px`,
794
- borderRadius: `${M * 2}px`,
792
+ borderRadius: `${S * 2}px`,
795
793
  // Более округлые для облачков
796
794
  margin: `${n / 2}px`,
797
795
  background: "transparent",
@@ -805,72 +803,72 @@ function We({
805
803
  },
806
804
  e
807
805
  )) })
808
- ] }) : f === "game" ? /* @__PURE__ */ h(G, { children: [
806
+ ] }) : x === "game" ? /* @__PURE__ */ h(G, { children: [
809
807
  X,
810
- !p && /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
808
+ !u && /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
811
809
  " ",
812
810
  /* @__PURE__ */ h("div", { style: {
813
811
  ...a.gmInfoBox,
814
- padding: `${p ? n * 0.6 : n * 0.8}px`,
812
+ padding: `${u ? n * 0.6 : n * 0.8}px`,
815
813
  // ✅ Уменьшаем padding в landscape
816
- marginBottom: `${p ? n * 0.3 : n * 0.5}px`,
814
+ marginBottom: `${u ? n * 0.3 : n * 0.5}px`,
817
815
  // ✅ Уменьшаем margin в landscape
818
- maxWidth: `${(g || r) * 0.9}px`
816
+ maxWidth: `${(p || i) * 0.9}px`
819
817
  }, children: [
820
818
  /* @__PURE__ */ h("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${n * 0.5}px` }, children: [
821
819
  "Category: ",
822
- y
820
+ b
823
821
  ] }),
824
822
  /* @__PURE__ */ h("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px" }, children: [
825
823
  "Round ",
826
- v,
824
+ L,
827
825
  " of ",
828
- k
826
+ M
829
827
  ] })
830
828
  ] }),
831
- $ && /* @__PURE__ */ h("p", { style: {
829
+ v && /* @__PURE__ */ h("p", { style: {
832
830
  ...a.gmBodyS,
833
831
  fontSize: `${s.bodyS}px`,
834
- marginTop: `${p ? n * 0.3 : n * 0.5}px`,
832
+ marginTop: `${u ? n * 0.3 : n * 0.5}px`,
835
833
  // ✅ Уменьшаем margin в landscape
836
- marginBottom: `${p ? n * 0.5 : n}px`
834
+ marginBottom: `${u ? n * 0.5 : n}px`
837
835
  // ✅ Уменьшаем margin в landscape
838
836
  }, children: [
839
837
  "I am thinking of a word that is ",
840
- /* @__PURE__ */ o("strong", { children: $.length }),
838
+ /* @__PURE__ */ o("strong", { children: v.length }),
841
839
  " letters long"
842
840
  ] }),
843
841
  /* @__PURE__ */ o("div", { style: {
844
- margin: `${p ? n * 0.5 : n}px 0`,
842
+ margin: `${u ? n * 0.5 : n}px 0`,
845
843
  // ✅ Уменьшаем margin в landscape
846
844
  display: "flex",
847
845
  justifyContent: "center",
848
846
  alignItems: "center"
849
847
  }, children: /* @__PURE__ */ o(
850
- Fe,
848
+ He,
851
849
  {
852
850
  mistakes: V,
853
851
  maxMistakes: oe,
854
- size: E ? Math.max(80, Math.min(110, (g || r) * 0.16)) : d ? p ? Math.max(70, Math.min(120, Math.min(window.innerWidth * 0.25, window.innerHeight * 0.15))) : Math.max(100, Math.min(150, Math.min(window.innerWidth * 0.3, window.innerHeight * 0.2))) : Math.max(100, Math.min(150, (g || r) * 0.2))
852
+ size: j ? Math.max(80, Math.min(110, (p || i) * 0.16)) : d ? u ? Math.max(70, Math.min(120, Math.min(window.innerWidth * 0.25, window.innerHeight * 0.15))) : Math.max(100, Math.min(150, Math.min(window.innerWidth * 0.3, window.innerHeight * 0.2))) : Math.max(100, Math.min(150, (p || i) * 0.2))
855
853
  }
856
854
  ) }),
857
855
  /* @__PURE__ */ o("div", { style: {
858
856
  ...a.gmWordDisplay,
859
857
  fontSize: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9))}px`,
860
- margin: `${p ? n * 0.5 : n}px 0`,
858
+ margin: `${u ? n * 0.5 : n}px 0`,
861
859
  // ✅ Уменьшаем margin в landscape
862
860
  letterSpacing: `${n * 0.8}px`,
863
861
  minHeight: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9)) * 1.2}px`
864
- }, children: we || "Loading..." }),
862
+ }, children: Se || "Loading..." }),
865
863
  /* @__PURE__ */ h("div", { style: {
866
864
  ...a.gmInfoBox,
867
- padding: `${p ? n * 0.6 : n}px`,
865
+ padding: `${u ? n * 0.6 : n}px`,
868
866
  // ✅ Уменьшаем padding в landscape
869
- marginTop: `${p ? n * 0.5 : n}px`,
867
+ marginTop: `${u ? n * 0.5 : n}px`,
870
868
  // ✅ Уменьшаем margin в landscape
871
- marginBottom: `${p ? n * 0.5 : n}px`,
869
+ marginBottom: `${u ? n * 0.5 : n}px`,
872
870
  // ✅ Уменьшаем margin в landscape
873
- maxWidth: `${(g || r) * 0.95}px`
871
+ maxWidth: `${(p || i) * 0.95}px`
874
872
  }, children: [
875
873
  /* @__PURE__ */ o("p", { style: {
876
874
  ...a.gmBodyS,
@@ -886,27 +884,27 @@ function We({
886
884
  justifyContent: "center",
887
885
  fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
888
886
  fontFamily: '"Onest", system-ui, sans-serif'
889
- }, children: ke.map((e) => /* @__PURE__ */ o(
887
+ }, children: ve.map((e) => /* @__PURE__ */ o(
890
888
  "button",
891
889
  {
892
890
  onClick: () => se(e),
893
- disabled: u !== null,
891
+ disabled: f !== null,
894
892
  onMouseEnter: (t) => {
895
- u === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
893
+ f === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
896
894
  },
897
895
  onMouseLeave: (t) => {
898
- u === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
896
+ f === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
899
897
  },
900
898
  style: {
901
899
  padding: `${n / 4}px ${n / 3}px`,
902
- borderRadius: `${M * 0.5}px`,
900
+ borderRadius: `${S * 0.5}px`,
903
901
  background: "#f9f9f9",
904
902
  color: "#1f2937",
905
903
  border: "1px solid #e5e7eb",
906
- minWidth: `${Math.max(n * 1.5, (g || r) * 0.04)}px`,
904
+ minWidth: `${Math.max(n * 1.5, (p || i) * 0.04)}px`,
907
905
  textAlign: "center",
908
906
  display: "inline-block",
909
- cursor: u === null ? "pointer" : "default",
907
+ cursor: f === null ? "pointer" : "default",
910
908
  fontFamily: '"Onest", system-ui, sans-serif',
911
909
  fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
912
910
  transition: "background-color 0.2s ease"
@@ -916,32 +914,32 @@ function We({
916
914
  e
917
915
  )) })
918
916
  ] }),
919
- S.length > 0 && /* @__PURE__ */ o("div", { style: {
917
+ F.length > 0 && /* @__PURE__ */ o("div", { style: {
920
918
  ...a.gmGuessedLetters,
921
919
  fontSize: `${Math.max(10, Math.min(12, s.bodyS * 0.85))}px`,
922
920
  marginTop: `${n * 0.5}px`,
923
921
  marginBottom: "2px"
924
922
  }, children: /* @__PURE__ */ h("span", { style: { color: "#6b7280" }, children: [
925
923
  "Guessed letters: ",
926
- /* @__PURE__ */ o("strong", { children: S.join(", ") })
924
+ /* @__PURE__ */ o("strong", { children: F.join(", ") })
927
925
  ] }) }),
928
- u === "win" && /* @__PURE__ */ o("div", { style: {
926
+ f === "win" && /* @__PURE__ */ o("div", { style: {
929
927
  ...a.gmStatusWin,
930
928
  fontSize: `${s.bodyL}px`,
931
929
  margin: "2px 0"
932
930
  }, children: "🎉 You won this round!" }),
933
- u === "lose" && /* @__PURE__ */ h("div", { style: {
931
+ f === "lose" && /* @__PURE__ */ h("div", { style: {
934
932
  ...a.gmStatusLose,
935
933
  fontSize: `${s.bodyL}px`,
936
934
  margin: "2px 0"
937
935
  }, children: [
938
936
  "The hangman is complete! The word was: ",
939
- /* @__PURE__ */ o("strong", { children: $ })
937
+ /* @__PURE__ */ o("strong", { children: v })
940
938
  ] }),
941
- u !== null && v < k && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
939
+ f !== null && L < M && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
942
940
  "button",
943
941
  {
944
- onClick: Me,
942
+ onClick: Le,
945
943
  onMouseEnter: (e) => {
946
944
  e.currentTarget.style.backgroundColor = "#d43a32";
947
945
  },
@@ -952,15 +950,15 @@ function We({
952
950
  ...a.gmButton,
953
951
  fontSize: `${Math.max(11, Math.min(14, s.button * 0.85))}px`,
954
952
  padding: `${n * 0.6}px ${n * 1.2}px`,
955
- borderRadius: `${M}px`
953
+ borderRadius: `${S}px`
956
954
  },
957
955
  children: "NEXT"
958
956
  }
959
957
  ) }),
960
- u !== null && v >= k && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
958
+ f !== null && L >= M && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
961
959
  "button",
962
960
  {
963
- onClick: () => x("result"),
961
+ onClick: () => y("result"),
964
962
  onMouseEnter: (e) => {
965
963
  e.currentTarget.style.backgroundColor = "#d43a32";
966
964
  },
@@ -971,18 +969,18 @@ function We({
971
969
  ...a.gmButton,
972
970
  fontSize: `${s.button}px`,
973
971
  padding: `${n}px ${n * 1.5}px`,
974
- borderRadius: `${M}px`
972
+ borderRadius: `${S}px`
975
973
  },
976
974
  children: "View results"
977
975
  }
978
976
  ) }),
979
- u === null && S.length === 0 && /* @__PURE__ */ o("p", { style: {
977
+ f === null && F.length === 0 && /* @__PURE__ */ o("p", { style: {
980
978
  ...a.gmBodyS,
981
979
  fontSize: `${s.bodyS}px`,
982
980
  marginTop: `${n}px`,
983
981
  marginBottom: `${n}px`
984
982
  }, children: "Type a letter on your keyboard" })
985
- ] }) : f === "result" ? /* @__PURE__ */ h(G, { children: [
983
+ ] }) : x === "result" ? /* @__PURE__ */ h(G, { children: [
986
984
  X,
987
985
  /* @__PURE__ */ o("h1", { style: {
988
986
  ...a.gmHeadline1,
@@ -997,7 +995,7 @@ function We({
997
995
  "You guessed ",
998
996
  /* @__PURE__ */ o("strong", { children: te }),
999
997
  " out of ",
1000
- /* @__PURE__ */ o("strong", { children: k }),
998
+ /* @__PURE__ */ o("strong", { children: M }),
1001
999
  " words correctly."
1002
1000
  ] }),
1003
1001
  /* @__PURE__ */ h("div", { style: {
@@ -1010,13 +1008,13 @@ function We({
1010
1008
  "button",
1011
1009
  {
1012
1010
  onClick: () => {
1013
- if (!y || k === 0) {
1014
- x("lobby");
1011
+ if (!b || M === 0) {
1012
+ y("lobby");
1015
1013
  return;
1016
1014
  }
1017
- T([]);
1018
- const e = U(y, []);
1019
- e && (H(e), T([e]), I([]), L(0), C(1), O(0), F(null), x("game"));
1015
+ z([]);
1016
+ const e = U(b, []);
1017
+ e && (I(e), z([e]), R([]), T(0), H(1), A(0), B(null), y("game"));
1020
1018
  },
1021
1019
  onMouseEnter: (e) => {
1022
1020
  e.currentTarget.style.backgroundColor = "#d43a32";
@@ -1028,7 +1026,7 @@ function We({
1028
1026
  ...a.gmButton,
1029
1027
  fontSize: `${s.button}px`,
1030
1028
  padding: `${n}px ${n * 1.5}px`,
1031
- borderRadius: `${M}px`,
1029
+ borderRadius: `${S}px`,
1032
1030
  minWidth: "200px"
1033
1031
  },
1034
1032
  children: "Play again"
@@ -1037,7 +1035,7 @@ function We({
1037
1035
  /* @__PURE__ */ o(
1038
1036
  "button",
1039
1037
  {
1040
- onClick: () => x("lobby"),
1038
+ onClick: () => y("lobby"),
1041
1039
  onMouseEnter: (e) => {
1042
1040
  e.currentTarget.style.backgroundColor = "#e5e7eb";
1043
1041
  },
@@ -1049,7 +1047,7 @@ function We({
1049
1047
  ...a.gmButtonSecondary,
1050
1048
  fontSize: `${s.button}px`,
1051
1049
  padding: `${n}px ${n * 1.5}px`,
1052
- borderRadius: `${M}px`,
1050
+ borderRadius: `${S}px`,
1053
1051
  minWidth: "200px"
1054
1052
  },
1055
1053
  children: "Exit"
@@ -1078,8 +1076,8 @@ function We({
1078
1076
  "div",
1079
1077
  {
1080
1078
  style: {
1081
- width: d ? "100%" : g || r || 1e3,
1082
- height: d ? "100%" : g || r || 1e3,
1079
+ width: d ? "100%" : p || i || 1e3,
1080
+ height: d ? "100%" : p || i || 1e3,
1083
1081
  display: "flex",
1084
1082
  justifyContent: "center",
1085
1083
  alignItems: "center",
@@ -1103,7 +1101,7 @@ function We({
1103
1101
  justifyContent: "center",
1104
1102
  alignItems: "center"
1105
1103
  },
1106
- children: /* @__PURE__ */ o("div", { style: ve, children: Se() })
1104
+ children: /* @__PURE__ */ o("div", { style: Te, children: Be() })
1107
1105
  }
1108
1106
  )
1109
1107
  }
@@ -1112,8 +1110,8 @@ function We({
1112
1110
  );
1113
1111
  }
1114
1112
  export {
1115
- We as Game,
1116
- We as HangmanLobbyGame,
1117
- We as default
1113
+ Ye as Game,
1114
+ Ye as HangmanLobbyGame,
1115
+ Ye as default
1118
1116
  };
1119
1117
  //# sourceMappingURL=speakid-hangman.es.js.map