speakid-build-a-sentence 1.0.30 → 1.0.32

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,6 +1,6 @@
1
- import { jsx as c, jsxs as b } from "react/jsx-runtime";
2
- import { useState as l, useCallback as ce, useRef as re, useEffect as j, useMemo as dt, Component as pt } from "react";
3
- const ut = `
1
+ import { jsx as p, jsxs as b } from "react/jsx-runtime";
2
+ import { useState as d, useCallback as de, useRef as re, useMemo as De, useEffect as X, Component as ft } from "react";
3
+ const mt = `
4
4
  @keyframes spin {
5
5
  from { transform: rotate(0deg); }
6
6
  to { transform: rotate(360deg); }
@@ -35,10 +35,10 @@ const ut = `
35
35
  }
36
36
  `;
37
37
  if (typeof document < "u" && !document.getElementById("game-keyframes")) {
38
- const f = document.createElement("style");
39
- f.id = "game-keyframes", f.innerHTML = ut, document.head.appendChild(f);
38
+ const u = document.createElement("style");
39
+ u.id = "game-keyframes", u.innerHTML = mt, document.head.appendChild(u);
40
40
  }
41
- const Ce = {
41
+ const Re = {
42
42
  spin: {
43
43
  animation: "spin 1.4s linear infinite"
44
44
  },
@@ -57,7 +57,7 @@ const Ce = {
57
57
  glow: {
58
58
  animation: "glow 1s ease-in-out infinite"
59
59
  }
60
- }, u = {
60
+ }, f = {
61
61
  gmCenterScreen: {
62
62
  position: "relative",
63
63
  zIndex: 1,
@@ -169,62 +169,62 @@ const Ce = {
169
169
  },
170
170
  gmHourglass: {
171
171
  fontSize: "42px",
172
- ...Ce.spin
172
+ ...Re.spin
173
173
  },
174
174
  // ===== Анимационные стили =====
175
- ...Ce
176
- }, ft = () => {
177
- const [f, s] = l([]), v = ce((k, L, h) => {
178
- const w = [];
179
- k.trim() || w.push({
175
+ ...Re
176
+ }, gt = () => {
177
+ const [u, i] = d([]), x = de((k, P, j) => {
178
+ const S = [];
179
+ k.trim() || S.push({
180
180
  type: "empty",
181
181
  message: "Sentence cannot be empty"
182
- }), k.length > 41 && w.push({
182
+ }), k.length > 41 && S.push({
183
183
  type: "length",
184
184
  message: `Sentence is too long (${k.length}/41 characters)`
185
- }), k && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(k) && w.push({
185
+ }), k && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(k) && S.push({
186
186
  type: "characters",
187
187
  message: "Only Latin characters, numbers, spaces and punctuation are allowed"
188
188
  });
189
- const O = h.findIndex((N, y) => y !== L && N.toLowerCase().trim() === k.toLowerCase().trim());
190
- return O !== -1 && w.push({
189
+ const D = j.findIndex((oe, pe) => pe !== P && oe.toLowerCase().trim() === k.toLowerCase().trim());
190
+ return D !== -1 && S.push({
191
191
  type: "duplicate",
192
- message: `Duplicate sentence (same as sentence ${O + 1})`
193
- }), s(w), {
194
- isValid: w.length === 0,
195
- errors: w
192
+ message: `Duplicate sentence (same as sentence ${D + 1})`
193
+ }), i(S), {
194
+ isValid: S.length === 0,
195
+ errors: S
196
196
  };
197
- }, []), H = ce((k) => {
198
- const L = [];
199
- return k.forEach((h, w) => {
200
- const K = v(h, w, k);
201
- L.push(...K.errors.map((O) => ({
202
- ...O,
203
- message: `Sentence ${w + 1}: ${O.message}`
197
+ }, []), $ = de((k) => {
198
+ const P = [];
199
+ return k.forEach((j, S) => {
200
+ const y = x(j, S, k);
201
+ P.push(...y.errors.map((D) => ({
202
+ ...D,
203
+ message: `Sentence ${S + 1}: ${D.message}`
204
204
  })));
205
205
  }), {
206
- isValid: L.length === 0,
207
- errors: L
206
+ isValid: P.length === 0,
207
+ errors: P
208
208
  };
209
- }, [v]), $ = ce(() => {
210
- s([]);
209
+ }, [x]), O = de(() => {
210
+ i([]);
211
211
  }, []);
212
212
  return {
213
- errors: f,
214
- validateSentence: v,
215
- validateAllSentences: H,
216
- clearErrors: $
213
+ errors: u,
214
+ validateSentence: x,
215
+ validateAllSentences: $,
216
+ clearErrors: O
217
217
  };
218
- }, mt = (f, s, v) => s && v ? `${f} word "${s}" ${v}` : s ? `${f} word "${s}"` : f, gt = (f, s, v = ["Enter", " "]) => {
219
- v.includes(f.key) && (f.preventDefault(), s());
220
- }, A = (f) => {
221
- const s = document.createElement("div");
222
- s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.style.position = "absolute", s.style.left = "-10000px", s.style.width = "1px", s.style.height = "1px", s.style.overflow = "hidden", document.body.appendChild(s), s.textContent = f, setTimeout(() => {
223
- document.body.removeChild(s);
218
+ }, ht = (u, i, x) => i && x ? `${u} word "${i}" ${x}` : i ? `${u} word "${i}"` : u, xt = (u, i, x = ["Enter", " "]) => {
219
+ x.includes(u.key) && (u.preventDefault(), i());
220
+ }, H = (u) => {
221
+ const i = document.createElement("div");
222
+ i.setAttribute("aria-live", "polite"), i.setAttribute("aria-atomic", "true"), i.style.position = "absolute", i.style.left = "-10000px", i.style.width = "1px", i.style.height = "1px", i.style.overflow = "hidden", document.body.appendChild(i), i.textContent = u, setTimeout(() => {
223
+ document.body.removeChild(i);
224
224
  }, 1e3);
225
- }, ht = () => {
226
- const f = document.createElement("style");
227
- f.id = "magic-sentence-reset", f.textContent = `
225
+ }, yt = () => {
226
+ const u = document.createElement("style");
227
+ u.id = "magic-sentence-reset", u.textContent = `
228
228
  #magic-sentence-root, #magic-sentence-root * {
229
229
  box-sizing: border-box;
230
230
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
@@ -251,18 +251,40 @@ const Ce = {
251
251
  overflow: hidden !important;
252
252
  }
253
253
  `;
254
- const s = document.getElementById("magic-sentence-reset");
255
- s && s.remove(), document.head.appendChild(f);
256
- }, xt = (f) => [...f].sort(() => Math.random() - 0.5);
257
- function kt(f = {}) {
258
- const { logoUrl: s, showLogo: v = !0, screenHeight: H, screenWidth: $, gameCubeSize: k } = f, L = re(null), h = () => $ ?? (typeof window < "u" ? window.innerWidth : 1920), w = () => H ?? (typeof window < "u" ? window.innerHeight : 1080), { validateAllSentences: K, errors: O } = ft(), N = () => {
259
- const e = h();
254
+ const i = document.getElementById("magic-sentence-reset");
255
+ i && i.remove(), document.head.appendChild(u);
256
+ };
257
+ class bt {
258
+ seed;
259
+ constructor(i) {
260
+ this.seed = i;
261
+ }
262
+ // Linear Congruential Generator (LCG)
263
+ next() {
264
+ return this.seed = (this.seed * 1664525 + 1013904223) % 2 ** 32, this.seed / 2 ** 32;
265
+ }
266
+ // Генерация случайного числа в диапазоне [min, max)
267
+ random(i = 0, x = 1) {
268
+ return i + this.next() * (x - i);
269
+ }
270
+ // Генерация случайного целого числа в диапазоне [min, max)
271
+ randomInt(i, x) {
272
+ return Math.floor(this.random(i, x));
273
+ }
274
+ }
275
+ const wt = (u) => u !== void 0 ? new bt(u) : null, St = (u, i) => {
276
+ const x = i || { next: () => Math.random() };
277
+ return [...u].sort(() => x.next() - 0.5);
278
+ };
279
+ function Dt(u = {}) {
280
+ const { logoUrl: i, showLogo: x = !0, screenHeight: $, screenWidth: O, gameCubeSize: k, seed: P } = u, j = re(null), S = De(() => wt(P), [P]), y = () => O ?? (typeof window < "u" ? window.innerWidth : 1920), D = () => $ ?? (typeof window < "u" ? window.innerHeight : 1080), { validateAllSentences: oe, errors: pe } = gt(), K = () => {
281
+ const e = y();
260
282
  return !!(m || e < 768 || e >= 768 && e < 1300);
261
- }, y = () => {
262
- const e = h(), n = w();
283
+ }, w = () => {
284
+ const e = y(), n = D();
263
285
  return m || e < 768 || e >= 320 && e <= 932 && n >= 390 && n <= 932;
264
286
  }, F = (e = "medium") => {
265
- if (!y())
287
+ if (!w())
266
288
  return {
267
289
  padding: "12px 24px",
268
290
  fontSize: "16px",
@@ -289,56 +311,56 @@ function kt(f = {}) {
289
311
  };
290
312
  }
291
313
  };
292
- j(() => (ht(), () => {
314
+ X(() => (yt(), () => {
293
315
  document.documentElement.style.overflow = "", document.body.style.overflow = "";
294
316
  const e = document.getElementById("magic-sentence-reset");
295
317
  e && e.remove();
296
318
  }), []);
297
- const [S, z] = l("select"), [E, de] = l(null), [pe, ue] = l(null), [T, Z] = l([]), [D, fe] = l(0), [oe, me] = l([]), [I, ie] = l([]), [M, ge] = l(20), [V, G] = l(0), [yt, he] = l(null), [X, P] = l(null), [a, _] = l(!1), [xe, se] = l(!1), [ae, Te] = l(
319
+ const [v, E] = d("select"), [B, ue] = d(null), [fe, me] = d(null), [R, Z] = d([]), [z, ge] = d(0), [ie, he] = d([]), [I, se] = d([]), [A, xe] = d(20), [V, N] = d(0), [vt, ye] = d(null), [G, W] = d(null), [l, _] = d(!1), [be, ae] = d(!1), [le, ze] = d(
298
320
  Number(localStorage.getItem("magicSentenceBest")) || 0
299
- ), q = re(null), De = re(null), ye = re(0), [x, B] = l({ list: null, id: null, side: null }), [m, Re] = l(!1), [ze, U] = l(1), [be, J] = l(null), [Ee, Pe] = l(!1), [Be, We] = l(!1), [Le, Me] = l(!1), [Ae, He] = l(!1), [$e, Oe] = l(!1), [Ne, Ge] = l(!1), [Xe, je] = l(!1), [Fe, Ve] = l(!1), [qe, Ue] = l(!1), [bt, Je] = l(!1), [wt, Ye] = l(!1);
300
- j(() => {
321
+ ), q = re(null), Ee = re(null), we = re(0), [h, L] = d({ list: null, id: null, side: null }), [m, Pe] = d(!1), [Be, U] = d(1), [Se, J] = d(null), [We, Le] = d(!1), [Me, Ae] = d(!1), [He, $e] = d(!1), [Oe, Ne] = d(!1), [Ge, Xe] = d(!1), [je, Fe] = d(!1), [Ve, qe] = d(!1), [Ue, Je] = d(!1), [Ye, Ke] = d(!1), [kt, Ze] = d(!1), [It, _e] = d(!1);
322
+ X(() => {
301
323
  const e = () => {
302
- const n = h(), t = w(), r = n < 768 || n === 926 && t === 428 || n === 932 && t === 430, o = t < 700, p = n / t > 1.8, g = n === 768 && t === 1024, i = n === 1024 && t === 768, d = n === 820 && t === 1180, R = n === 1180 && t === 820, C = n === 540 && t === 720, ne = n === 720 && t === 540, ve = n === 1024 && t === 1366, ke = n === 1366 && t === 1024, Ie = n >= 1200 && t >= 600 && !r;
303
- Pe(Ie), We(g), Me(i), He(d), Oe(R), Ge(C), je(ne), Ve(ve), Ue(ke), Ye(p);
304
- const ct = r && n > t || r || // ✅ ВСЕ мобильные устройства (включая portrait)
305
- t < 700 || p || // ✅ Широкие экраны
306
- n === 1366 && t === 766 || n === 1366 && t === 768 || n === 1280 && t === 720 || n === 1440 && t === 900 || g || i || d || R || C || ne || ve || ke || Ie;
307
- if (Je(ct), Re(r), k !== void 0)
324
+ const n = y(), t = D(), r = n < 768 || n === 926 && t === 428 || n === 932 && t === 430, o = t < 700, c = n / t > 1.8, g = n === 768 && t === 1024, a = n === 1024 && t === 768, s = n === 820 && t === 1180, T = n === 1180 && t === 820, C = n === 540 && t === 720, ne = n === 720 && t === 540, Ie = n === 1024 && t === 1366, Ce = n === 1366 && t === 1024, Te = n >= 1200 && t >= 600 && !r;
325
+ Le(Te), Ae(g), $e(a), Ne(s), Xe(T), Fe(C), qe(ne), Je(Ie), Ke(Ce), _e(c);
326
+ const ut = r && n > t || r || // ✅ ВСЕ мобильные устройства (включая portrait)
327
+ t < 700 || c || // ✅ Широкие экраны
328
+ n === 1366 && t === 766 || n === 1366 && t === 768 || n === 1280 && t === 720 || n === 1440 && t === 900 || g || a || s || T || C || ne || Ie || Ce || Te;
329
+ if (Ze(ut), Pe(r), k !== void 0)
308
330
  J(k), U(1);
309
331
  else if (r)
310
332
  J(null), U(1);
311
333
  else if (o)
312
334
  J(null), U(1);
313
- else if (p) {
314
- const le = Math.min(1e3, Math.min(n, t) * 0.9);
315
- J(le), U(0.85);
335
+ else if (c) {
336
+ const ce = Math.min(1e3, Math.min(n, t) * 0.9);
337
+ J(ce), U(0.85);
316
338
  } else {
317
- const le = Math.min(1e3, Math.min(n, t) * 0.9);
318
- J(le), U(1);
339
+ const ce = Math.min(1e3, Math.min(n, t) * 0.9);
340
+ J(ce), U(1);
319
341
  }
320
342
  };
321
- if (e(), $ === void 0 && H === void 0)
343
+ if (e(), O === void 0 && $ === void 0)
322
344
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
323
- }, [$, H, k]);
345
+ }, [O, $, k]);
324
346
  const Q = (e, n, t, r) => {
325
- if (a) return;
326
- let o = [...oe], p = [...I];
327
- const g = e === "bank" ? o : p, i = n === "bank" ? o : p, d = g.findIndex((ne) => ne.id === t);
328
- if (d === -1) return;
329
- const [R] = g.splice(d, 1);
347
+ if (l) return;
348
+ let o = [...ie], c = [...I];
349
+ const g = e === "bank" ? o : c, a = n === "bank" ? o : c, s = g.findIndex((ne) => ne.id === t);
350
+ if (s === -1) return;
351
+ const [T] = g.splice(s, 1);
330
352
  let C = r;
331
- e === n && C !== null && C !== void 0 && C > d && (C = C - 1), C == null || C < 0 || C > i.length ? i.push(R) : i.splice(C, 0, R), e === "bank" ? o = g : p = g, n === "bank" ? o = i : p = i, me(o), ie(p);
353
+ e === n && C !== null && C !== void 0 && C > s && (C = C - 1), C == null || C < 0 || C > a.length ? a.push(T) : a.splice(C, 0, T), e === "bank" ? o = g : c = g, n === "bank" ? o = a : c = a, he(o), se(c);
332
354
  }, Y = (e, n, t) => {
333
- if (e.preventDefault(), a) {
334
- B({ list: null, id: null, side: null });
355
+ if (e.preventDefault(), l) {
356
+ L({ list: null, id: null, side: null });
335
357
  return;
336
358
  }
337
359
  const r = e.dataTransfer.getData("application/x-token") || (() => {
338
360
  const o = e.dataTransfer.getData("text/plain");
339
361
  if (!o) return "";
340
- const p = oe.some((d) => d.id === o), g = I.some((d) => d.id === o), i = p ? "bank" : g ? "selected" : null;
341
- return i ? JSON.stringify({ from: i, id: o }) : "";
362
+ const c = ie.some((s) => s.id === o), g = I.some((s) => s.id === o), a = c ? "bank" : g ? "selected" : null;
363
+ return a ? JSON.stringify({ from: a, id: o }) : "";
342
364
  })();
343
365
  if (r) {
344
366
  try {
@@ -347,76 +369,80 @@ function kt(f = {}) {
347
369
  Q(o.from, n, o.id, t);
348
370
  } catch {
349
371
  }
350
- B({ list: null, id: null, side: null });
372
+ L({ list: null, id: null, side: null });
351
373
  }
352
- }, Ke = (e) => {
353
- de(e), De.current = e, Z(Array(e).fill("")), z("time");
354
- }, Ze = (e) => {
355
- ue(e), z("type");
356
- }, _e = (e, n) => {
374
+ }, Qe = (e) => {
375
+ ue(e), Ee.current = e, Z(Array(e).fill("")), E("time");
376
+ }, et = (e) => {
377
+ me(e), E("type");
378
+ }, tt = (e, n) => {
357
379
  if (n.length > 41 || n && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(n))
358
380
  return;
359
- const r = [...T];
381
+ const r = [...R];
360
382
  r[e] = n, Z(r);
361
- const o = K(r);
383
+ const o = oe(r);
362
384
  o.isValid || console.warn("Validation errors:", o.errors);
363
- }, Qe = (e) => e.trim().replace(/\s+/g, " "), we = (e) => {
364
- const n = h(), t = n >= 768 && n < 1300;
385
+ }, nt = (e) => e.trim().replace(/\s+/g, " "), ve = (e) => {
386
+ const n = y(), t = n >= 768 && n < 1300;
365
387
  return e <= 3 ? t ? 18 : 20 : e <= 5 ? t ? 16 : 18 : e <= 7 ? t ? 14 : 16 : e <= 9 ? t ? 12 : 14 : e <= 12 ? t ? 10 : 12 : t ? 9 : 10;
366
- }, et = () => {
367
- T.some((n) => n.trim().length === 0) || (Z((n) => n.map((t) => Qe(t))), G(0), fe(0), ye.current = 0, he(null), z("getready"));
388
+ }, rt = () => {
389
+ R.some((n) => n.trim().length === 0) || (Z((n) => n.map((t) => nt(t))), N(0), ge(0), we.current = 0, ye(null), E("getready"));
368
390
  };
369
- j(() => {
370
- if (S === "getready") {
391
+ X(() => {
392
+ if (v === "getready") {
371
393
  const e = setTimeout(() => ee(0), 3e3);
372
394
  return () => clearTimeout(e);
373
395
  }
374
- }, [S]);
396
+ }, [v]);
375
397
  const ee = (e) => {
376
- const n = T[e];
398
+ const n = R[e];
377
399
  if (!n) return;
378
- const r = xt(
379
- n.trim().split(/\s+/).filter(Boolean)
380
- ).map((o, p) => ({
381
- id: `${Date.now()}-${e}-${p}-${Math.random().toString(36).slice(2)}`,
382
- text: o
383
- }));
384
- me(r), ie([]), fe(e), ye.current = e, ge(pe || 20), P(null), _(!1), se(!1), z("play");
400
+ const r = St(
401
+ n.trim().split(/\s+/).filter(Boolean),
402
+ S
403
+ ).map((o, c) => {
404
+ const g = S ? S.random().toString(36).slice(2) : Math.random().toString(36).slice(2);
405
+ return {
406
+ id: `${Date.now()}-${e}-${c}-${g}`,
407
+ text: o
408
+ };
409
+ });
410
+ he(r), se([]), ge(e), we.current = e, xe(fe || 20), W(null), _(!1), ae(!1), E("play");
385
411
  };
386
- j(() => (S === "play" && !a && (q.current !== null && window.clearTimeout(q.current), M > 0 ? q.current = window.setTimeout(() => ge((e) => e - 1), 1e3) : _(!0)), () => {
412
+ X(() => (v === "play" && !l && (q.current !== null && window.clearTimeout(q.current), A > 0 ? q.current = window.setTimeout(() => xe((e) => e - 1), 1e3) : _(!0)), () => {
387
413
  q.current !== null && window.clearTimeout(q.current);
388
- }), [S, M, a]), j(() => {
389
- if (S === "play" && a && M === 0) {
390
- const e = T[D];
414
+ }), [v, A, l]), X(() => {
415
+ if (v === "play" && l && A === 0) {
416
+ const e = R[z];
391
417
  if (!e) {
392
- P(null);
418
+ W(null);
393
419
  return;
394
420
  }
395
- const n = e.trim().split(/\s+/), t = I.map((i) => i.text), r = n.filter((i) => !t.includes(i)).length, o = t.filter((i) => !n.includes(i)).length, p = n.filter((i, d) => t.includes(i) ? t[d] !== i : !1).length, g = r + o + p;
396
- g === 0 ? (P("correct"), xe || (se(!0), G((i) => i + 1)), W("correct"), A("Correct! Well done!")) : g === 1 ? (P("almost"), G((i) => i + 0.5), W("half"), A("Almost correct! Just one mistake.")) : (P("wrong"), W("wrong"), A("Not quite right. Keep trying!"));
421
+ const n = e.trim().split(/\s+/), t = I.map((a) => a.text), r = n.filter((a) => !t.includes(a)).length, o = t.filter((a) => !n.includes(a)).length, c = n.filter((a, s) => t.includes(a) ? t[s] !== a : !1).length, g = r + o + c;
422
+ g === 0 ? (W("correct"), be || (ae(!0), N((a) => a + 1)), M("correct"), H("Correct! Well done!")) : g === 1 ? (W("almost"), N((a) => a + 0.5), M("half"), H("Almost correct! Just one mistake.")) : (W("wrong"), M("wrong"), H("Not quite right. Keep trying!"));
397
423
  }
398
- }, [S, a, M, T, D, I, xe]);
399
- const tt = (e = !0) => {
424
+ }, [v, l, A, R, z, I, be]);
425
+ const ot = (e = !0) => {
400
426
  if (e) {
401
- if (a) {
402
- D + 1 < (E || 0) ? ee(D + 1) : (z("results"), setTimeout(() => te(), 600));
427
+ if (l) {
428
+ z + 1 < (B || 0) ? ee(z + 1) : (E("results"), setTimeout(() => te(), 600));
403
429
  return;
404
430
  }
405
- const n = T[D];
431
+ const n = R[z];
406
432
  if (!n) {
407
- D + 1 < (E || 0) ? ee(D + 1) : (z("results"), setTimeout(() => te(), 600));
433
+ z + 1 < (B || 0) ? ee(z + 1) : (E("results"), setTimeout(() => te(), 600));
408
434
  return;
409
435
  }
410
- const t = n.trim().split(/\s+/), r = I.map((d) => d.text), o = t.filter((d) => !r.includes(d)).length, p = r.filter((d) => !t.includes(d)).length, g = t.filter((d, R) => r.includes(d) ? r[R] !== d : !1).length, i = o + p + g;
411
- i === 0 ? (G((d) => d + 1), P("correct"), se(!0), W("correct"), A("Correct! Well done!")) : i === 1 ? (G((d) => d + 0.5), P("almost"), W("half"), A("Almost correct! Just one mistake.")) : (P("wrong"), W("wrong"), A("Not quite right. Keep trying!")), D + 1 < (E || 0) ? setTimeout(() => ee(D + 1), 800) : setTimeout(() => {
412
- z("results"), setTimeout(() => te(), 600);
436
+ const t = n.trim().split(/\s+/), r = I.map((s) => s.text), o = t.filter((s) => !r.includes(s)).length, c = r.filter((s) => !t.includes(s)).length, g = t.filter((s, T) => r.includes(s) ? r[T] !== s : !1).length, a = o + c + g;
437
+ a === 0 ? (N((s) => s + 1), W("correct"), ae(!0), M("correct"), H("Correct! Well done!")) : a === 1 ? (N((s) => s + 0.5), W("almost"), M("half"), H("Almost correct! Just one mistake.")) : (W("wrong"), M("wrong"), H("Not quite right. Keep trying!")), z + 1 < (B || 0) ? setTimeout(() => ee(z + 1), 800) : setTimeout(() => {
438
+ E("results"), setTimeout(() => te(), 600);
413
439
  }, 800);
414
440
  }
415
441
  };
416
- j(() => {
417
- S === "results" && V > ae && (Te(V), localStorage.setItem("magicSentenceBest", String(V)));
418
- }, [S, V, ae]);
419
- const W = (e) => {
442
+ X(() => {
443
+ v === "results" && V > le && (ze(V), localStorage.setItem("magicSentenceBest", String(V)));
444
+ }, [v, V, le]);
445
+ const M = (e) => {
420
446
  const n = new (window.AudioContext || window.webkitAudioContext)(), t = n.createOscillator(), r = n.createGain();
421
447
  switch (t.connect(r), r.connect(n.destination), e) {
422
448
  case "start":
@@ -438,33 +464,36 @@ function kt(f = {}) {
438
464
  r.gain.setValueAtTime(0.1, n.currentTime), t.start(), t.stop(n.currentTime + 0.2);
439
465
  }, te = () => {
440
466
  const n = Date.now() + 2500, t = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], r = document.createElement("canvas"), o = r.getContext("2d");
441
- r.width = h(), r.height = w(), r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.pointerEvents = "none", document.body.appendChild(r);
442
- const p = Array.from({ length: 100 }).map(() => ({
443
- x: Math.random() * r.width,
444
- y: Math.random() * r.height - r.height,
445
- size: 6 + Math.random() * 6,
446
- color: t[Math.floor(Math.random() * t.length)],
447
- speed: 2 + Math.random() * 4,
448
- tilt: Math.random() * 2 * Math.PI
449
- })), g = () => {
450
- o.clearRect(0, 0, r.width, r.height), p.forEach((i) => {
451
- o.fillStyle = i.color, o.beginPath(), o.ellipse(i.x, i.y, i.size, i.size / 2, i.tilt, 0, 2 * Math.PI), o.fill(), i.y += i.speed, i.x += Math.sin(i.tilt);
452
- }), Date.now() < n ? requestAnimationFrame(g) : document.body.removeChild(r);
467
+ r.width = y(), r.height = D(), r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.pointerEvents = "none", document.body.appendChild(r);
468
+ const c = S || {
469
+ random: () => Math.random(),
470
+ randomInt: (s, T) => Math.floor(Math.random() * (T - s) + s)
471
+ }, g = Array.from({ length: 100 }).map(() => ({
472
+ x: c.random(0, r.width),
473
+ y: c.random(0, r.height) - r.height,
474
+ size: 6 + c.random(0, 6),
475
+ color: t[c.randomInt(0, t.length)],
476
+ speed: 2 + c.random(0, 4),
477
+ tilt: c.random(0, 2 * Math.PI)
478
+ })), a = () => {
479
+ o.clearRect(0, 0, r.width, r.height), g.forEach((s) => {
480
+ o.fillStyle = s.color, o.beginPath(), o.ellipse(s.x, s.y, s.size, s.size / 2, s.tilt, 0, 2 * Math.PI), o.fill(), s.y += s.speed, s.x += Math.sin(s.tilt);
481
+ }), Date.now() < n ? requestAnimationFrame(a) : document.body.removeChild(r);
453
482
  };
454
- g();
455
- }, nt = () => /* @__PURE__ */ b("div", { style: u.gmCenterScreen, children: [
456
- /* @__PURE__ */ c("h1", { style: u.gmHeadline1, children: "MAGIC SENTENCE" }),
457
- /* @__PURE__ */ c("p", { style: u.gmBodyM, children: "Select number of rounds" }),
458
- /* @__PURE__ */ c("div", { style: {
483
+ a();
484
+ }, it = () => /* @__PURE__ */ b("div", { style: f.gmCenterScreen, children: [
485
+ /* @__PURE__ */ p("h1", { style: f.gmHeadline1, children: "MAGIC SENTENCE" }),
486
+ /* @__PURE__ */ p("p", { style: f.gmBodyM, children: "Select number of rounds" }),
487
+ /* @__PURE__ */ p("div", { style: {
459
488
  display: "flex",
460
- gap: y() ? "8px" : "16px",
489
+ gap: w() ? "8px" : "16px",
461
490
  justifyContent: "center"
462
491
  }, children: [3, 4, 5].map((e) => /* @__PURE__ */ b(
463
492
  "button",
464
493
  {
465
- onClick: () => Ke(e),
494
+ onClick: () => Qe(e),
466
495
  style: {
467
- ...u.gmButton,
496
+ ...f.gmButton,
468
497
  ...F("medium")
469
498
  },
470
499
  children: [
@@ -474,19 +503,19 @@ function kt(f = {}) {
474
503
  },
475
504
  e
476
505
  )) })
477
- ] }), rt = () => /* @__PURE__ */ b("div", { style: u.gmCenterScreen, children: [
478
- /* @__PURE__ */ c("h1", { style: u.gmHeadline1, children: "MAGIC SENTENCE" }),
479
- /* @__PURE__ */ c("p", { style: u.gmBodyM, children: "Select time per round" }),
480
- /* @__PURE__ */ c("div", { style: {
506
+ ] }), st = () => /* @__PURE__ */ b("div", { style: f.gmCenterScreen, children: [
507
+ /* @__PURE__ */ p("h1", { style: f.gmHeadline1, children: "MAGIC SENTENCE" }),
508
+ /* @__PURE__ */ p("p", { style: f.gmBodyM, children: "Select time per round" }),
509
+ /* @__PURE__ */ p("div", { style: {
481
510
  display: "flex",
482
- gap: y() ? "8px" : "16px",
511
+ gap: w() ? "8px" : "16px",
483
512
  justifyContent: "center"
484
513
  }, children: [15, 20, 30].map((e) => /* @__PURE__ */ b(
485
514
  "button",
486
515
  {
487
- onClick: () => Ze(e),
516
+ onClick: () => et(e),
488
517
  style: {
489
- ...u.gmButton,
518
+ ...f.gmButton,
490
519
  ...F("medium")
491
520
  },
492
521
  children: [
@@ -496,16 +525,16 @@ function kt(f = {}) {
496
525
  },
497
526
  e
498
527
  )) })
499
- ] }), ot = () => /* @__PURE__ */ b("div", { style: u.gmCenterScreen, children: [
500
- /* @__PURE__ */ b("h2", { style: { ...u.gmBodyM, marginBottom: "0px" }, children: [
528
+ ] }), at = () => /* @__PURE__ */ b("div", { style: f.gmCenterScreen, children: [
529
+ /* @__PURE__ */ b("h2", { style: { ...f.gmBodyM, marginBottom: "0px" }, children: [
501
530
  "Type down ",
502
- E,
531
+ B,
503
532
  " sentence",
504
- E && E > 1 ? "s" : "",
533
+ B && B > 1 ? "s" : "",
505
534
  " for your student"
506
535
  ] }),
507
- /* @__PURE__ */ c("p", { style: { ...u.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
508
- /* @__PURE__ */ c("div", { style: {
536
+ /* @__PURE__ */ p("p", { style: { ...f.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
537
+ /* @__PURE__ */ p("div", { style: {
509
538
  display: "flex",
510
539
  flexDirection: "column",
511
540
  gap: 12,
@@ -515,16 +544,16 @@ function kt(f = {}) {
515
544
  // Минимальная ширина по содержимому
516
545
  maxWidth: "600px"
517
546
  // Ограничиваем максимальную ширину
518
- }, children: T.map((e, n) => /* @__PURE__ */ c(
547
+ }, children: R.map((e, n) => /* @__PURE__ */ p(
519
548
  "input",
520
549
  {
521
550
  value: e,
522
551
  placeholder: `Sentence ${n + 1}`,
523
- onChange: (t) => _e(n, t.target.value),
552
+ onChange: (t) => tt(n, t.target.value),
524
553
  style: {
525
- ...u.gmInput,
526
- padding: y() ? "8px 12px" : "12px 16px",
527
- fontSize: y() ? "14px" : "16px",
554
+ ...f.gmInput,
555
+ padding: w() ? "8px 12px" : "12px 16px",
556
+ fontSize: w() ? "14px" : "16px",
528
557
  width: "100%",
529
558
  // Поля теперь будут шире благодаря увеличенной ширине контейнера
530
559
  textAlign: "center"
@@ -533,129 +562,129 @@ function kt(f = {}) {
533
562
  },
534
563
  n
535
564
  )) }),
536
- /* @__PURE__ */ c(
565
+ /* @__PURE__ */ p(
537
566
  "button",
538
567
  {
539
- onClick: et,
540
- disabled: T.some((e) => e.trim().length === 0),
568
+ onClick: rt,
569
+ disabled: R.some((e) => e.trim().length === 0),
541
570
  style: {
542
- ...u.gmButton,
571
+ ...f.gmButton,
543
572
  marginTop: 30,
544
- background: T.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
545
- cursor: T.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
573
+ background: R.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
574
+ cursor: R.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
546
575
  ...F("large")
547
576
  },
548
577
  children: "PLAY"
549
578
  }
550
579
  )
551
- ] }), it = () => /* @__PURE__ */ b("div", { style: u.gmReadyWrapper, children: [
552
- /* @__PURE__ */ c("h1", { style: {
553
- ...u.gmHeadline1,
580
+ ] }), lt = () => /* @__PURE__ */ b("div", { style: f.gmReadyWrapper, children: [
581
+ /* @__PURE__ */ p("h1", { style: {
582
+ ...f.gmHeadline1,
554
583
  color: "#ec4c44"
555
584
  }, children: "GET READY" }),
556
- /* @__PURE__ */ c("div", { style: u.gmHourglass, children: "⏳" })
557
- ] }), st = () => /* @__PURE__ */ b("div", { style: u.gmGameLayout, children: [
585
+ /* @__PURE__ */ p("div", { style: f.gmHourglass, children: "⏳" })
586
+ ] }), ct = () => /* @__PURE__ */ b("div", { style: f.gmGameLayout, children: [
558
587
  /* @__PURE__ */ b("h2", { style: {
559
- marginBottom: y() ? "5px" : "10px",
560
- fontSize: y() ? "16px" : "20px"
588
+ marginBottom: w() ? "5px" : "10px",
589
+ fontSize: w() ? "16px" : "20px"
561
590
  }, children: [
562
591
  "Round ",
563
- D + 1,
592
+ z + 1,
564
593
  "/",
565
- E,
594
+ B,
566
595
  " — ",
567
- a ? "TIME'S UP!" : `Time: ${M}s`
596
+ l ? "TIME'S UP!" : `Time: ${A}s`
568
597
  ] }),
569
- /* @__PURE__ */ c(
598
+ /* @__PURE__ */ p(
570
599
  "div",
571
600
  {
572
601
  style: {
573
602
  width: "60%",
574
- height: y() ? "8px" : "14px",
603
+ height: w() ? "8px" : "14px",
575
604
  borderRadius: 8,
576
605
  background: "#eee",
577
606
  overflow: "hidden",
578
- marginBottom: y() ? "10px" : "20px"
607
+ marginBottom: w() ? "10px" : "20px"
579
608
  },
580
- children: /* @__PURE__ */ c(
609
+ children: /* @__PURE__ */ p(
581
610
  "div",
582
611
  {
583
612
  style: {
584
613
  height: "100%",
585
- width: `${M / (pe || 20) * 100}%`,
586
- background: M <= 5 ? "#ec4c44" : "#4caf50",
614
+ width: `${A / (fe || 20) * 100}%`,
615
+ background: A <= 5 ? "#ec4c44" : "#4caf50",
587
616
  transition: "width 1s linear"
588
617
  }
589
618
  }
590
619
  )
591
620
  }
592
621
  ),
593
- /* @__PURE__ */ c(
622
+ /* @__PURE__ */ p(
594
623
  "div",
595
624
  {
596
625
  onDragOver: (e) => e.preventDefault(),
597
626
  onDrop: (e) => Y(e, "bank", null),
598
627
  style: {
599
628
  display: "flex",
600
- flexWrap: N() ? "wrap" : "nowrap",
601
- gap: m || h() < 768 ? "6px" : "10px",
629
+ flexWrap: K() ? "wrap" : "nowrap",
630
+ gap: m || y() < 768 ? "6px" : "10px",
602
631
  justifyContent: "center",
603
- marginBottom: m || h() < 768 ? "15px" : "30px",
604
- padding: m || h() < 768 ? "5px" : "10px",
632
+ marginBottom: m || y() < 768 ? "15px" : "30px",
633
+ padding: m || y() < 768 ? "5px" : "10px",
605
634
  width: "100%",
606
635
  boxSizing: "border-box"
607
636
  },
608
- children: oe.map((e, n) => /* @__PURE__ */ c(
637
+ children: ie.map((e, n) => /* @__PURE__ */ p(
609
638
  "div",
610
639
  {
611
- draggable: !a,
640
+ draggable: !l,
612
641
  role: "button",
613
- tabIndex: a ? -1 : 0,
614
- "aria-label": a ? `Word: ${e.text} (time expired)` : mt("Drag word", e.text, "to build sentence"),
642
+ tabIndex: l ? -1 : 0,
643
+ "aria-label": l ? `Word: ${e.text} (time expired)` : ht("Drag word", e.text, "to build sentence"),
615
644
  onDragStart: (t) => {
616
- if (a) {
645
+ if (l) {
617
646
  t.preventDefault();
618
647
  return;
619
648
  }
620
649
  t.dataTransfer.setData(
621
650
  "application/x-token",
622
651
  JSON.stringify({ from: "bank", id: e.id })
623
- ), t.dataTransfer.setData("text/plain", e.id), A(`Dragging word: ${e.text}`);
652
+ ), t.dataTransfer.setData("text/plain", e.id), H(`Dragging word: ${e.text}`);
624
653
  },
625
654
  onKeyDown: (t) => {
626
- a || gt(t, () => Q("bank", "selected", e.id, null));
655
+ l || xt(t, () => Q("bank", "selected", e.id, null));
627
656
  },
628
657
  onDragOver: (t) => t.preventDefault(),
629
658
  onDrop: (t) => {
630
- const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2, p = t.clientX > o ? n + 1 : n;
631
- B({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "bank", p);
659
+ const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2, c = t.clientX > o ? n + 1 : n;
660
+ L({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "bank", c);
632
661
  },
633
662
  onDragEnter: (t) => {
634
- if (a) return;
663
+ if (l) return;
635
664
  const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2;
636
- B({ list: "bank", id: e.id, side: t.clientX > o ? "right" : "left" });
665
+ L({ list: "bank", id: e.id, side: t.clientX > o ? "right" : "left" });
637
666
  },
638
- onDragLeave: () => B({ list: null, id: null, side: null }),
667
+ onDragLeave: () => L({ list: null, id: null, side: null }),
639
668
  onClick: () => {
640
- a || Q("bank", "selected", e.id, null);
669
+ l || Q("bank", "selected", e.id, null);
641
670
  },
642
671
  style: {
643
- padding: m || h() < 768 ? "6px 10px" : "10px 16px",
644
- borderRadius: m || h() < 768 ? "6px" : "10px",
672
+ padding: m || y() < 768 ? "6px 10px" : "10px 16px",
673
+ borderRadius: m || y() < 768 ? "6px" : "10px",
645
674
  border: "1px solid #ccc",
646
- background: a ? "#f0f0f0" : "#f9f9f9",
647
- cursor: a ? "not-allowed" : x.list === "bank" && x.id === e.id ? "grabbing" : "grab",
675
+ background: l ? "#f0f0f0" : "#f9f9f9",
676
+ cursor: l ? "not-allowed" : h.list === "bank" && h.id === e.id ? "grabbing" : "grab",
648
677
  fontSize: (() => {
649
- const t = h();
678
+ const t = y();
650
679
  return m || t < 768 ? "12px" : t >= 768 && t < 1300 ? "14px" : "18px";
651
680
  })(),
652
- ...x.list === "bank" && x.id === e.id && x.side === "left" ? { borderLeft: "3px solid #3b82f6" } : {},
653
- ...x.list === "bank" && x.id === e.id && x.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
681
+ ...h.list === "bank" && h.id === e.id && h.side === "left" ? { borderLeft: "3px solid #3b82f6" } : {},
682
+ ...h.list === "bank" && h.id === e.id && h.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
654
683
  flexShrink: 0,
655
684
  flexBasis: "auto",
656
- opacity: a ? 0.6 : 1,
685
+ opacity: l ? 0.6 : 1,
657
686
  transition: "opacity 0.3s ease, transform 0.2s ease",
658
- ...x.list === "bank" && x.id === e.id ? {
687
+ ...h.list === "bank" && h.id === e.id ? {
659
688
  transform: "scale(1.05)",
660
689
  boxShadow: "0 2px 8px rgba(59, 130, 246, 0.3)"
661
690
  } : {}
@@ -666,7 +695,7 @@ function kt(f = {}) {
666
695
  ))
667
696
  }
668
697
  ),
669
- /* @__PURE__ */ c(
698
+ /* @__PURE__ */ p(
670
699
  "div",
671
700
  {
672
701
  onDragOver: (e) => e.preventDefault(),
@@ -677,37 +706,37 @@ function kt(f = {}) {
677
706
  return;
678
707
  }
679
708
  let r = I.length, o = 1 / 0;
680
- t.forEach((p, g) => {
681
- const i = p.getBoundingClientRect(), d = i.left + i.width / 2, R = Math.abs(e.clientX - d);
682
- R < o && (o = R, r = e.clientX < d ? g : g + 1);
709
+ t.forEach((c, g) => {
710
+ const a = c.getBoundingClientRect(), s = a.left + a.width / 2, T = Math.abs(e.clientX - s);
711
+ T < o && (o = T, r = e.clientX < s ? g : g + 1);
683
712
  }), e.clientX > n.right - 30 && (r = I.length), e.clientX < n.left + 30 && (r = 0), Y(e, "selected", r);
684
713
  },
685
714
  style: {
686
- minHeight: m || h() < 768 ? "50px" : "70px",
715
+ minHeight: m || y() < 768 ? "50px" : "70px",
687
716
  width: "auto",
688
717
  // Автоматическая ширина в зависимости от содержимого
689
718
  maxWidth: "none",
690
719
  // Убираем ограничение максимальной ширины
691
720
  minWidth: "245px",
692
721
  // Минимальная ширина для растягивания
693
- border: X === "correct" ? "2px dashed #4caf50" : X === "almost" ? "2px dashed #ff9800" : X === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
694
- borderRadius: m || h() < 768 ? "8px" : "12px",
695
- padding: m || h() < 768 ? "8px" : "12px",
722
+ border: G === "correct" ? "2px dashed #4caf50" : G === "almost" ? "2px dashed #ff9800" : G === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
723
+ borderRadius: m || y() < 768 ? "8px" : "12px",
724
+ padding: m || y() < 768 ? "8px" : "12px",
696
725
  display: "flex",
697
- flexWrap: N() ? "wrap" : "nowrap",
726
+ flexWrap: K() ? "wrap" : "nowrap",
698
727
  alignItems: "center",
699
728
  justifyContent: "center",
700
- fontSize: `${we(I.length)}px`,
701
- background: X === "correct" ? "#e8f5e8" : X === "almost" ? "#fff3e0" : X === "wrong" ? "#ffebee" : "#fafafa",
702
- overflowX: N() ? "hidden" : "auto",
703
- whiteSpace: N() ? "normal" : "nowrap"
729
+ fontSize: `${ve(I.length)}px`,
730
+ background: G === "correct" ? "#e8f5e8" : G === "almost" ? "#fff3e0" : G === "wrong" ? "#ffebee" : "#fafafa",
731
+ overflowX: K() ? "hidden" : "auto",
732
+ whiteSpace: K() ? "normal" : "nowrap"
704
733
  },
705
- children: I.map((e, n) => /* @__PURE__ */ c(
734
+ children: I.map((e, n) => /* @__PURE__ */ p(
706
735
  "span",
707
736
  {
708
- draggable: !a,
737
+ draggable: !l,
709
738
  onDragStart: (t) => {
710
- if (a) {
739
+ if (l) {
711
740
  t.preventDefault();
712
741
  return;
713
742
  }
@@ -718,38 +747,38 @@ function kt(f = {}) {
718
747
  },
719
748
  onDragOver: (t) => t.preventDefault(),
720
749
  onDrop: (t) => {
721
- const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2, p = r.width * 0.25, g = t.clientX < o - p ? n : t.clientX > o + p || t.clientX > o ? n + 1 : n;
722
- B({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "selected", g);
750
+ const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2, c = r.width * 0.25, g = t.clientX < o - c ? n : t.clientX > o + c || t.clientX > o ? n + 1 : n;
751
+ L({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "selected", g);
723
752
  },
724
753
  onDragEnter: (t) => {
725
- if (a) return;
754
+ if (l) return;
726
755
  const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2;
727
- B({ list: "selected", id: e.id, side: t.clientX > o ? "right" : "left" });
756
+ L({ list: "selected", id: e.id, side: t.clientX > o ? "right" : "left" });
728
757
  },
729
- onDragLeave: () => B({ list: null, id: null, side: null }),
758
+ onDragLeave: () => L({ list: null, id: null, side: null }),
730
759
  onClick: () => {
731
- a || Q("selected", "bank", e.id, null);
760
+ l || Q("selected", "bank", e.id, null);
732
761
  },
733
- title: a ? "Time expired" : "Click to remove back to bank",
762
+ title: l ? "Time expired" : "Click to remove back to bank",
734
763
  style: {
735
- padding: y() ? "4px 6px" : "6px 10px",
736
- margin: y() ? "2px" : "4px",
737
- borderRadius: y() ? "4px" : "8px",
738
- background: a ? "#f0f0f0" : "#ffe9e7",
739
- border: a ? "1px solid #ccc" : "1px solid #ec4c44",
740
- ...x.list === "selected" && x.id === e.id && x.side === "left" ? { borderLeft: "3px solid #3b82f6" } : {},
741
- ...x.list === "selected" && x.id === e.id && x.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
742
- cursor: a ? "not-allowed" : x.list === "selected" && x.id === e.id ? "grabbing" : "grab",
764
+ padding: w() ? "4px 6px" : "6px 10px",
765
+ margin: w() ? "2px" : "4px",
766
+ borderRadius: w() ? "4px" : "8px",
767
+ background: l ? "#f0f0f0" : "#ffe9e7",
768
+ border: l ? "1px solid #ccc" : "1px solid #ec4c44",
769
+ ...h.list === "selected" && h.id === e.id && h.side === "left" ? { borderLeft: "3px solid #3b82f6" } : {},
770
+ ...h.list === "selected" && h.id === e.id && h.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
771
+ cursor: l ? "not-allowed" : h.list === "selected" && h.id === e.id ? "grabbing" : "grab",
743
772
  userSelect: "none",
744
- fontSize: `${we(I.length)}px`,
773
+ fontSize: `${ve(I.length)}px`,
745
774
  // Адаптивный размер шрифта для слов
746
775
  fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
747
776
  // Более плотный шрифт
748
777
  whiteSpace: "nowrap",
749
778
  // Запрещаем перенос слов
750
- opacity: a ? 0.6 : 1,
779
+ opacity: l ? 0.6 : 1,
751
780
  transition: "opacity 0.3s ease, transform 0.2s ease",
752
- ...x.list === "selected" && x.id === e.id ? {
781
+ ...h.list === "selected" && h.id === e.id ? {
753
782
  transform: "scale(1.05)",
754
783
  boxShadow: "0 2px 8px rgba(59, 130, 246, 0.3)"
755
784
  } : {}
@@ -760,35 +789,35 @@ function kt(f = {}) {
760
789
  ))
761
790
  }
762
791
  ),
763
- /* @__PURE__ */ c(
792
+ /* @__PURE__ */ p(
764
793
  "button",
765
794
  {
766
- onClick: () => tt(!0),
767
- disabled: !a && I.length === 0,
795
+ onClick: () => ot(!0),
796
+ disabled: !l && I.length === 0,
768
797
  style: {
769
- marginTop: y() ? "15px" : "30px",
770
- fontSize: y() ? "14px" : "20px",
771
- padding: y() ? "6px 12px" : "10px 24px",
772
- borderRadius: y() ? "8px" : "12px",
773
- background: a || I.length > 0 ? "#ec4c44" : "#ccc",
798
+ marginTop: w() ? "15px" : "30px",
799
+ fontSize: w() ? "14px" : "20px",
800
+ padding: w() ? "6px 12px" : "10px 24px",
801
+ borderRadius: w() ? "8px" : "12px",
802
+ background: l || I.length > 0 ? "#ec4c44" : "#ccc",
774
803
  color: "white",
775
804
  border: "none",
776
- cursor: a || I.length > 0 ? "pointer" : "not-allowed"
805
+ cursor: l || I.length > 0 ? "pointer" : "not-allowed"
777
806
  },
778
807
  children: "NEXT"
779
808
  }
780
809
  )
781
- ] }), at = () => {
782
- const e = h(), n = w(), t = m && e > n || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430 || Be || Le || Ae || $e || Ne || Xe || Fe || qe, r = m && e <= 375 && n <= 667 || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430, o = e === 1366 && n === 766 || e === 1366 && n === 768 || e === 1280 && n === 720 || e === 1440 && n === 900;
783
- return /* @__PURE__ */ b("div", { style: u.gmCenterScreen, children: [
784
- /* @__PURE__ */ c("h1", { style: {
785
- ...u.gmHeadline1,
810
+ ] }), dt = () => {
811
+ const e = y(), n = D(), t = m && e > n || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430 || Me || He || Oe || Ge || je || Ve || Ue || Ye, r = m && e <= 375 && n <= 667 || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430, o = e === 1366 && n === 766 || e === 1366 && n === 768 || e === 1280 && n === 720 || e === 1440 && n === 900;
812
+ return /* @__PURE__ */ b("div", { style: f.gmCenterScreen, children: [
813
+ /* @__PURE__ */ p("h1", { style: {
814
+ ...f.gmHeadline1,
786
815
  marginTop: "0px",
787
816
  marginBottom: t ? "2px" : "10px",
788
817
  fontSize: r ? "32px" : "clamp(28px, 4vw, 40px)"
789
818
  }, children: "Game Over 🎯" }),
790
819
  /* @__PURE__ */ b("h2", { style: {
791
- ...u.gmHeadline2,
820
+ ...f.gmHeadline2,
792
821
  marginTop: "0px",
793
822
  marginBottom: t ? "2px" : "16px",
794
823
  fontSize: r ? "18px" : "24px"
@@ -796,46 +825,46 @@ function kt(f = {}) {
796
825
  "Your score: ",
797
826
  V,
798
827
  " out of ",
799
- E
828
+ B
800
829
  ] }),
801
830
  /* @__PURE__ */ b("p", { style: {
802
- ...u.gmBodyM,
831
+ ...f.gmBodyM,
803
832
  color: "#10b981",
804
833
  marginTop: t ? "0px" : "12px",
805
834
  marginBottom: t ? "2px" : "16px",
806
835
  fontSize: r ? "14px" : "16px"
807
836
  }, children: [
808
837
  "Best score: ",
809
- ae
838
+ le
810
839
  ] }),
811
840
  /* @__PURE__ */ b("div", { style: {
812
841
  display: "flex",
813
842
  gap: t || m && e <= 375 && n <= 667 ? "6px" : "12px",
814
- marginTop: t || m && e <= 375 && n <= 667 ? "2px" : o || Ee ? "12px" : "24px"
843
+ marginTop: t || m && e <= 375 && n <= 667 ? "2px" : o || We ? "12px" : "24px"
815
844
  }, children: [
816
- /* @__PURE__ */ c(
845
+ /* @__PURE__ */ p(
817
846
  "button",
818
847
  {
819
848
  onClick: () => {
820
- te(), W("start"), setTimeout(() => {
821
- z("getready"), he(null), _(!1);
849
+ te(), M("start"), setTimeout(() => {
850
+ E("getready"), ye(null), _(!1);
822
851
  }, 800);
823
852
  },
824
853
  style: {
825
- ...u.gmButton,
854
+ ...f.gmButton,
826
855
  ...F("medium")
827
856
  },
828
857
  children: "🔁 Play again"
829
858
  }
830
859
  ),
831
- /* @__PURE__ */ c(
860
+ /* @__PURE__ */ p(
832
861
  "button",
833
862
  {
834
863
  onClick: () => {
835
- W("click"), z("select"), de(null), ue(null), Z([]), G(0), ie([]), _(!1);
864
+ M("click"), E("select"), ue(null), me(null), Z([]), N(0), se([]), _(!1);
836
865
  },
837
866
  style: {
838
- ...u.gmButton,
867
+ ...f.gmButton,
839
868
  ...F("medium")
840
869
  },
841
870
  children: "⬅️ Exit"
@@ -843,28 +872,28 @@ function kt(f = {}) {
843
872
  )
844
873
  ] })
845
874
  ] });
846
- }, Se = !m && v, lt = dt(
875
+ }, ke = !m && x, pt = De(
847
876
  () => {
848
- const e = h(), n = w(), t = e >= 1200 && e <= 1400;
849
- if (m && e > n || n < 700 && !t || !Se)
877
+ const e = y(), n = D(), t = e >= 1200 && e <= 1400;
878
+ if (m && e > n || n < 700 && !t || !ke)
850
879
  return null;
851
- const r = s || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/magic%20sentence/logo` : "/cloud/speakid/games/magic%20sentence/logo");
852
- return /* @__PURE__ */ c("div", { style: u.gmLogoFixed, children: /* @__PURE__ */ c(
880
+ const r = i || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/magic%20sentence/logo` : "/cloud/speakid/games/magic%20sentence/logo");
881
+ return /* @__PURE__ */ p("div", { style: f.gmLogoFixed, children: /* @__PURE__ */ p(
853
882
  "img",
854
883
  {
855
884
  src: `${r}.svg`,
856
885
  alt: "SPEAKID Logo",
857
- style: u.gmLogoImg,
886
+ style: f.gmLogoImg,
858
887
  loading: "lazy"
859
888
  }
860
889
  ) });
861
890
  },
862
- [m, Se, s, $, H]
891
+ [m, ke, i, O, $]
863
892
  );
864
- return /* @__PURE__ */ c(
893
+ return /* @__PURE__ */ p(
865
894
  "div",
866
895
  {
867
- ref: L,
896
+ ref: j,
868
897
  style: {
869
898
  width: "100%",
870
899
  height: "100%",
@@ -884,8 +913,8 @@ function kt(f = {}) {
884
913
  "div",
885
914
  {
886
915
  style: {
887
- width: m ? "100%" : be || 1e3,
888
- height: m ? "100%" : be || 1e3,
916
+ width: m ? "100%" : Se || 1e3,
917
+ height: m ? "100%" : Se || 1e3,
889
918
  display: "flex",
890
919
  justifyContent: "center",
891
920
  alignItems: "center",
@@ -896,12 +925,12 @@ function kt(f = {}) {
896
925
  margin: m ? "0 auto" : "unset",
897
926
  position: "relative",
898
927
  // needed so absolute logo is inside the square
899
- transform: `scale(${ze})`
928
+ transform: `scale(${Be})`
900
929
  // ✅ Применяем масштаб для широких экранов
901
930
  },
902
931
  children: [
903
- lt,
904
- /* @__PURE__ */ c(
932
+ pt,
933
+ /* @__PURE__ */ p(
905
934
  "div",
906
935
  {
907
936
  style: {
@@ -913,12 +942,12 @@ function kt(f = {}) {
913
942
  alignItems: "center"
914
943
  },
915
944
  children: /* @__PURE__ */ b("div", { id: "magic-sentence-root", children: [
916
- S === "select" ? nt() : null,
917
- S === "time" ? rt() : null,
918
- S === "type" ? ot() : null,
919
- S === "getready" ? it() : null,
920
- S === "play" ? st() : null,
921
- S === "results" ? at() : null
945
+ v === "select" ? it() : null,
946
+ v === "time" ? st() : null,
947
+ v === "type" ? at() : null,
948
+ v === "getready" ? lt() : null,
949
+ v === "play" ? ct() : null,
950
+ v === "results" ? dt() : null
922
951
  ] })
923
952
  }
924
953
  )
@@ -928,20 +957,20 @@ function kt(f = {}) {
928
957
  }
929
958
  );
930
959
  }
931
- class It extends pt {
932
- constructor(s) {
933
- super(s), this.state = { hasError: !1 };
960
+ class Rt extends ft {
961
+ constructor(i) {
962
+ super(i), this.state = { hasError: !1 };
934
963
  }
935
- static getDerivedStateFromError(s) {
964
+ static getDerivedStateFromError(i) {
936
965
  return {
937
966
  hasError: !0,
938
- error: s
967
+ error: i
939
968
  };
940
969
  }
941
- componentDidCatch(s, v) {
942
- console.error("Game Error:", s, v), this.setState({
943
- error: s,
944
- errorInfo: v
970
+ componentDidCatch(i, x) {
971
+ console.error("Game Error:", i, x), this.setState({
972
+ error: i,
973
+ errorInfo: x
945
974
  });
946
975
  }
947
976
  handleReset = () => {
@@ -960,9 +989,9 @@ class It extends pt {
960
989
  color: "#dc2626",
961
990
  fontFamily: "system-ui, sans-serif"
962
991
  }, children: [
963
- /* @__PURE__ */ c("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
964
- /* @__PURE__ */ c("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
965
- /* @__PURE__ */ c(
992
+ /* @__PURE__ */ p("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
993
+ /* @__PURE__ */ p("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
994
+ /* @__PURE__ */ p(
966
995
  "button",
967
996
  {
968
997
  onClick: this.handleReset,
@@ -976,13 +1005,13 @@ class It extends pt {
976
1005
  cursor: "pointer",
977
1006
  transition: "background-color 0.2s"
978
1007
  },
979
- onMouseOver: (s) => s.currentTarget.style.backgroundColor = "#b91c1c",
980
- onMouseOut: (s) => s.currentTarget.style.backgroundColor = "#dc2626",
1008
+ onMouseOver: (i) => i.currentTarget.style.backgroundColor = "#b91c1c",
1009
+ onMouseOut: (i) => i.currentTarget.style.backgroundColor = "#dc2626",
981
1010
  children: "🔄 Restart Game"
982
1011
  }
983
1012
  ),
984
1013
  typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ b("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
985
- /* @__PURE__ */ c("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
1014
+ /* @__PURE__ */ p("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
986
1015
  /* @__PURE__ */ b("pre", { style: {
987
1016
  backgroundColor: "#f3f4f6",
988
1017
  padding: "12px",
@@ -999,12 +1028,12 @@ class It extends pt {
999
1028
  }
1000
1029
  }
1001
1030
  export {
1002
- It as ErrorBoundary,
1003
- kt as Game,
1004
- A as announceToScreenReader,
1005
- mt as createAriaLabel,
1006
- kt as default,
1007
- gt as handleKeyDown,
1008
- ft as useValidation
1031
+ Rt as ErrorBoundary,
1032
+ Dt as Game,
1033
+ H as announceToScreenReader,
1034
+ ht as createAriaLabel,
1035
+ Dt as default,
1036
+ xt as handleKeyDown,
1037
+ gt as useValidation
1009
1038
  };
1010
1039
  //# sourceMappingURL=speakid-build-a-sentence.es.js.map