speakid-build-a-sentence 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Game.d.ts.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/speakid-build-a-sentence.cjs.js +61 -0
- package/dist/speakid-build-a-sentence.cjs.js.map +1 -0
- package/dist/speakid-build-a-sentence.es.js +410 -677
- package/dist/speakid-build-a-sentence.es.js.map +1 -1
- package/package.json +3 -3
- package/dist/speakid-build-a-sentence.umd.js +0 -82
- package/dist/speakid-build-a-sentence.umd.js.map +0 -1
|
@@ -1,283 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var Pe;
|
|
13
|
-
function an() {
|
|
14
|
-
if (Pe) return pe;
|
|
15
|
-
Pe = 1;
|
|
16
|
-
var p = Symbol.for("react.transitional.element"), d = Symbol.for("react.fragment");
|
|
17
|
-
function S(j, W, w) {
|
|
18
|
-
var P = null;
|
|
19
|
-
if (w !== void 0 && (P = "" + w), W.key !== void 0 && (P = "" + W.key), "key" in W) {
|
|
20
|
-
w = {};
|
|
21
|
-
for (var R in W)
|
|
22
|
-
R !== "key" && (w[R] = W[R]);
|
|
23
|
-
} else w = W;
|
|
24
|
-
return W = w.ref, {
|
|
25
|
-
$$typeof: p,
|
|
26
|
-
type: j,
|
|
27
|
-
key: P,
|
|
28
|
-
ref: W !== void 0 ? W : null,
|
|
29
|
-
props: w
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return pe.Fragment = d, pe.jsx = S, pe.jsxs = S, pe;
|
|
33
|
-
}
|
|
34
|
-
var fe = {};
|
|
35
|
-
/**
|
|
36
|
-
* @license React
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var He;
|
|
45
|
-
function ln() {
|
|
46
|
-
return He || (He = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
-
function p(e) {
|
|
48
|
-
if (e == null) return null;
|
|
49
|
-
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof === V ? null : e.displayName || e.name || null;
|
|
51
|
-
if (typeof e == "string") return e;
|
|
52
|
-
switch (e) {
|
|
53
|
-
case E:
|
|
54
|
-
return "Fragment";
|
|
55
|
-
case _:
|
|
56
|
-
return "Profiler";
|
|
57
|
-
case U:
|
|
58
|
-
return "StrictMode";
|
|
59
|
-
case I:
|
|
60
|
-
return "Suspense";
|
|
61
|
-
case ae:
|
|
62
|
-
return "SuspenseList";
|
|
63
|
-
case $:
|
|
64
|
-
return "Activity";
|
|
65
|
-
}
|
|
66
|
-
if (typeof e == "object")
|
|
67
|
-
switch (typeof e.tag == "number" && console.error(
|
|
68
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
), e.$$typeof) {
|
|
70
|
-
case ge:
|
|
71
|
-
return "Portal";
|
|
72
|
-
case se:
|
|
73
|
-
return e.displayName || "Context";
|
|
74
|
-
case he:
|
|
75
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case me:
|
|
77
|
-
var a = e.render;
|
|
78
|
-
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case z:
|
|
80
|
-
return a = e.displayName || null, a !== null ? a : p(e.type) || "Memo";
|
|
81
|
-
case J:
|
|
82
|
-
a = e._payload, e = e._init;
|
|
83
|
-
try {
|
|
84
|
-
return p(e(a));
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
function d(e) {
|
|
91
|
-
return "" + e;
|
|
92
|
-
}
|
|
93
|
-
function S(e) {
|
|
94
|
-
try {
|
|
95
|
-
d(e);
|
|
96
|
-
var a = !1;
|
|
97
|
-
} catch {
|
|
98
|
-
a = !0;
|
|
99
|
-
}
|
|
100
|
-
if (a) {
|
|
101
|
-
a = console;
|
|
102
|
-
var r = a.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
-
return r.call(
|
|
104
|
-
a,
|
|
105
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
b
|
|
107
|
-
), d(e);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function j(e) {
|
|
111
|
-
if (e === E) return "<>";
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof === J)
|
|
113
|
-
return "<...>";
|
|
114
|
-
try {
|
|
115
|
-
var a = p(e);
|
|
116
|
-
return a ? "<" + a + ">" : "<...>";
|
|
117
|
-
} catch {
|
|
118
|
-
return "<...>";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function W() {
|
|
122
|
-
var e = we.A;
|
|
123
|
-
return e === null ? null : e.getOwner();
|
|
124
|
-
}
|
|
125
|
-
function w() {
|
|
126
|
-
return Error("react-stack-top-frame");
|
|
127
|
-
}
|
|
128
|
-
function P(e) {
|
|
129
|
-
if (le.call(e, "key")) {
|
|
130
|
-
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
-
if (a && a.isReactWarning) return !1;
|
|
132
|
-
}
|
|
133
|
-
return e.key !== void 0;
|
|
134
|
-
}
|
|
135
|
-
function R(e, a) {
|
|
136
|
-
function r() {
|
|
137
|
-
c || (c = !0, console.error(
|
|
138
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
a
|
|
140
|
-
));
|
|
141
|
-
}
|
|
142
|
-
r.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
-
get: r,
|
|
144
|
-
configurable: !0
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function f() {
|
|
148
|
-
var e = p(this.type);
|
|
149
|
-
return F[e] || (F[e] = !0, console.error(
|
|
150
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
-
}
|
|
153
|
-
function D(e, a, r, b, de, G) {
|
|
154
|
-
var x = r.ref;
|
|
155
|
-
return e = {
|
|
156
|
-
$$typeof: oe,
|
|
157
|
-
type: e,
|
|
158
|
-
key: a,
|
|
159
|
-
props: r,
|
|
160
|
-
_owner: b
|
|
161
|
-
}, (x !== void 0 ? x : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
-
enumerable: !1,
|
|
163
|
-
get: f
|
|
164
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
-
configurable: !1,
|
|
166
|
-
enumerable: !1,
|
|
167
|
-
writable: !0,
|
|
168
|
-
value: 0
|
|
169
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
-
configurable: !1,
|
|
171
|
-
enumerable: !1,
|
|
172
|
-
writable: !0,
|
|
173
|
-
value: null
|
|
174
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
-
configurable: !1,
|
|
176
|
-
enumerable: !1,
|
|
177
|
-
writable: !0,
|
|
178
|
-
value: de
|
|
179
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
-
configurable: !1,
|
|
181
|
-
enumerable: !1,
|
|
182
|
-
writable: !0,
|
|
183
|
-
value: G
|
|
184
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
-
}
|
|
186
|
-
function y(e, a, r, b, de, G) {
|
|
187
|
-
var x = a.children;
|
|
188
|
-
if (x !== void 0)
|
|
189
|
-
if (b)
|
|
190
|
-
if (M(x)) {
|
|
191
|
-
for (b = 0; b < x.length; b++)
|
|
192
|
-
T(x[b]);
|
|
193
|
-
Object.freeze && Object.freeze(x);
|
|
194
|
-
} else
|
|
195
|
-
console.error(
|
|
196
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
-
);
|
|
198
|
-
else T(x);
|
|
199
|
-
if (le.call(a, "key")) {
|
|
200
|
-
x = p(e);
|
|
201
|
-
var O = Object.keys(a).filter(function(Se) {
|
|
202
|
-
return Se !== "key";
|
|
203
|
-
});
|
|
204
|
-
b = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", L[x + b] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
-
let props = %s;
|
|
207
|
-
<%s {...props} />
|
|
208
|
-
React keys must be passed directly to JSX without using spread:
|
|
209
|
-
let props = %s;
|
|
210
|
-
<%s key={someKey} {...props} />`,
|
|
211
|
-
b,
|
|
212
|
-
x,
|
|
213
|
-
O,
|
|
214
|
-
x
|
|
215
|
-
), L[x + b] = !0);
|
|
216
|
-
}
|
|
217
|
-
if (x = null, r !== void 0 && (S(r), x = "" + r), P(a) && (S(a.key), x = "" + a.key), "key" in a) {
|
|
218
|
-
r = {};
|
|
219
|
-
for (var ce in a)
|
|
220
|
-
ce !== "key" && (r[ce] = a[ce]);
|
|
221
|
-
} else r = a;
|
|
222
|
-
return x && R(
|
|
223
|
-
r,
|
|
224
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
), D(
|
|
226
|
-
e,
|
|
227
|
-
x,
|
|
228
|
-
r,
|
|
229
|
-
W(),
|
|
230
|
-
de,
|
|
231
|
-
G
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
function T(e) {
|
|
235
|
-
H(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === J && (e._payload.status === "fulfilled" ? H(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
-
}
|
|
237
|
-
function H(e) {
|
|
238
|
-
return typeof e == "object" && e !== null && e.$$typeof === oe;
|
|
239
|
-
}
|
|
240
|
-
var B = on, oe = Symbol.for("react.transitional.element"), ge = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), he = Symbol.for("react.consumer"), se = Symbol.for("react.context"), me = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), we = B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
|
|
241
|
-
return null;
|
|
242
|
-
};
|
|
243
|
-
B = {
|
|
244
|
-
react_stack_bottom_frame: function(e) {
|
|
245
|
-
return e();
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var c, F = {}, X = B.react_stack_bottom_frame.bind(
|
|
249
|
-
B,
|
|
250
|
-
w
|
|
251
|
-
)(), xe = A(j(w)), L = {};
|
|
252
|
-
fe.Fragment = E, fe.jsx = function(e, a, r) {
|
|
253
|
-
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
254
|
-
return y(
|
|
255
|
-
e,
|
|
256
|
-
a,
|
|
257
|
-
r,
|
|
258
|
-
!1,
|
|
259
|
-
b ? Error("react-stack-top-frame") : X,
|
|
260
|
-
b ? A(j(e)) : xe
|
|
261
|
-
);
|
|
262
|
-
}, fe.jsxs = function(e, a, r) {
|
|
263
|
-
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
264
|
-
return y(
|
|
265
|
-
e,
|
|
266
|
-
a,
|
|
267
|
-
r,
|
|
268
|
-
!0,
|
|
269
|
-
b ? Error("react-stack-top-frame") : X,
|
|
270
|
-
b ? A(j(e)) : xe
|
|
271
|
-
);
|
|
272
|
-
};
|
|
273
|
-
})()), fe;
|
|
274
|
-
}
|
|
275
|
-
var Ce;
|
|
276
|
-
function dn() {
|
|
277
|
-
return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ve.exports = an() : ve.exports = ln()), ve.exports;
|
|
278
|
-
}
|
|
279
|
-
var s = dn();
|
|
280
|
-
const cn = `
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useCallback as pe, useRef as We, useEffect as V, Component as Ye } from "react";
|
|
3
|
+
const Ke = `
|
|
281
4
|
@keyframes magic-sentence-spin {
|
|
282
5
|
from { transform: rotate(0deg); }
|
|
283
6
|
to { transform: rotate(360deg); }
|
|
@@ -312,10 +35,10 @@ const cn = `
|
|
|
312
35
|
}
|
|
313
36
|
`;
|
|
314
37
|
if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
|
|
315
|
-
const
|
|
316
|
-
|
|
38
|
+
const h = document.createElement("style");
|
|
39
|
+
h.id = "magic-sentence-keyframes", h.innerHTML = Ke, document.head.appendChild(h);
|
|
317
40
|
}
|
|
318
|
-
const
|
|
41
|
+
const Se = {
|
|
319
42
|
spin: {
|
|
320
43
|
animation: "magic-sentence-spin 1.4s linear infinite"
|
|
321
44
|
},
|
|
@@ -334,7 +57,7 @@ const Ae = {
|
|
|
334
57
|
glow: {
|
|
335
58
|
animation: "magic-sentence-glow 1s ease-in-out infinite"
|
|
336
59
|
}
|
|
337
|
-
},
|
|
60
|
+
}, g = {
|
|
338
61
|
gmCenterScreen: {
|
|
339
62
|
position: "relative",
|
|
340
63
|
zIndex: 1,
|
|
@@ -448,62 +171,64 @@ const Ae = {
|
|
|
448
171
|
},
|
|
449
172
|
gmHourglass: {
|
|
450
173
|
fontSize: "42px",
|
|
451
|
-
...
|
|
174
|
+
...Se.spin
|
|
452
175
|
},
|
|
453
176
|
// ===== Анимационные стили =====
|
|
454
|
-
...
|
|
455
|
-
},
|
|
456
|
-
const [
|
|
457
|
-
const
|
|
458
|
-
|
|
177
|
+
...Se
|
|
178
|
+
}, _e = () => {
|
|
179
|
+
const [h, r] = p([]), y = pe((S, M, C) => {
|
|
180
|
+
const c = [];
|
|
181
|
+
S.trim() || c.push({
|
|
459
182
|
type: "empty",
|
|
460
183
|
message: "Sentence cannot be empty"
|
|
461
|
-
}),
|
|
184
|
+
}), S.length > 41 && c.push({
|
|
462
185
|
type: "length",
|
|
463
|
-
message: `Sentence is too long (${
|
|
464
|
-
}),
|
|
186
|
+
message: `Sentence is too long (${S.length}/41 characters)`
|
|
187
|
+
}), S && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(S) && c.push({
|
|
465
188
|
type: "characters",
|
|
466
189
|
message: "Only Latin characters, numbers, spaces and punctuation are allowed"
|
|
467
190
|
});
|
|
468
|
-
const
|
|
469
|
-
return
|
|
191
|
+
const f = C.findIndex((k, I) => I !== M && k.toLowerCase().trim() === S.toLowerCase().trim());
|
|
192
|
+
return f !== -1 && c.push({
|
|
470
193
|
type: "duplicate",
|
|
471
|
-
message: `Duplicate sentence (same as sentence ${
|
|
472
|
-
}),
|
|
473
|
-
isValid:
|
|
474
|
-
errors:
|
|
194
|
+
message: `Duplicate sentence (same as sentence ${f + 1})`
|
|
195
|
+
}), r(c), {
|
|
196
|
+
isValid: c.length === 0,
|
|
197
|
+
errors: c
|
|
475
198
|
};
|
|
476
|
-
}, []),
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
const D =
|
|
480
|
-
|
|
481
|
-
...
|
|
482
|
-
message: `Sentence ${
|
|
199
|
+
}, []), B = pe((S) => {
|
|
200
|
+
const M = [];
|
|
201
|
+
return S.forEach((C, c) => {
|
|
202
|
+
const D = y(C, c, S);
|
|
203
|
+
M.push(...D.errors.map((f) => ({
|
|
204
|
+
...f,
|
|
205
|
+
message: `Sentence ${c + 1}: ${f.message}`
|
|
483
206
|
})));
|
|
484
207
|
}), {
|
|
485
|
-
isValid:
|
|
486
|
-
errors:
|
|
208
|
+
isValid: M.length === 0,
|
|
209
|
+
errors: M
|
|
487
210
|
};
|
|
488
|
-
}, [
|
|
489
|
-
|
|
211
|
+
}, [y]), ne = pe(() => {
|
|
212
|
+
r([]);
|
|
490
213
|
}, []);
|
|
491
214
|
return {
|
|
492
|
-
errors:
|
|
493
|
-
validateSentence:
|
|
494
|
-
validateAllSentences:
|
|
495
|
-
clearErrors:
|
|
215
|
+
errors: h,
|
|
216
|
+
validateSentence: y,
|
|
217
|
+
validateAllSentences: B,
|
|
218
|
+
clearErrors: ne
|
|
496
219
|
};
|
|
497
|
-
},
|
|
498
|
-
|
|
499
|
-
},
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
document.body.removeChild(
|
|
220
|
+
}, en = (h, r, y) => r && y ? `${h} word "${r}" ${y}` : r ? `${h} word "${r}"` : h, nn = (h, r, y = ["Enter", " "]) => {
|
|
221
|
+
y.includes(h.key) && (h.preventDefault(), r());
|
|
222
|
+
}, E = (h) => {
|
|
223
|
+
const r = document.createElement("div");
|
|
224
|
+
r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.position = "absolute", r.style.left = "-10000px", r.style.width = "1px", r.style.height = "1px", r.style.overflow = "hidden", document.body.appendChild(r), r.textContent = h, setTimeout(() => {
|
|
225
|
+
document.body.removeChild(r);
|
|
503
226
|
}, 1e3);
|
|
504
|
-
},
|
|
505
|
-
const
|
|
506
|
-
|
|
227
|
+
}, tn = () => {
|
|
228
|
+
const h = document.createElement("style");
|
|
229
|
+
h.id = "magic-sentence-reset";
|
|
230
|
+
const r = document.getElementById("magic-sentence-reset");
|
|
231
|
+
r && r.remove(), h.textContent = `
|
|
507
232
|
#magic-sentence-root, #magic-sentence-root * {
|
|
508
233
|
box-sizing: border-box;
|
|
509
234
|
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
@@ -529,17 +254,17 @@ const Ae = {
|
|
|
529
254
|
height: 100% !important;
|
|
530
255
|
overflow: hidden !important;
|
|
531
256
|
}
|
|
532
|
-
`, document.head.appendChild(
|
|
533
|
-
},
|
|
534
|
-
function
|
|
535
|
-
const { logoUrl:
|
|
536
|
-
if (!
|
|
257
|
+
`, document.head.appendChild(h);
|
|
258
|
+
}, on = (h) => [...h].sort(() => Math.random() - 0.5);
|
|
259
|
+
function ln(h = {}) {
|
|
260
|
+
const { logoUrl: r, showLogo: y = !0, baseURL: B } = h, ne = We(null), { validateAllSentences: S, errors: M } = _e(), C = () => d || window.innerWidth < 768, c = () => d || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (e = "medium") => {
|
|
261
|
+
if (!c())
|
|
537
262
|
return {
|
|
538
263
|
padding: "12px 24px",
|
|
539
264
|
fontSize: "16px",
|
|
540
265
|
minWidth: "auto"
|
|
541
266
|
};
|
|
542
|
-
switch (
|
|
267
|
+
switch (e) {
|
|
543
268
|
case "small":
|
|
544
269
|
return {
|
|
545
270
|
padding: "4px 6px",
|
|
@@ -560,201 +285,203 @@ function wn(p = {}) {
|
|
|
560
285
|
};
|
|
561
286
|
}
|
|
562
287
|
};
|
|
563
|
-
|
|
564
|
-
document.body.style.overflow = "";
|
|
288
|
+
V(() => (tn(), () => {
|
|
289
|
+
document.documentElement.style.overflow = "", document.body.style.overflow = "";
|
|
290
|
+
const e = document.getElementById("magic-sentence-reset");
|
|
291
|
+
e && e.remove();
|
|
565
292
|
}), []);
|
|
566
|
-
const [
|
|
293
|
+
const [f, k] = p("select"), [I, ge] = p(null), [he, we] = p(null), [H, q] = p([]), [T, ue] = p(0), [te, me] = p([]), [v, ie] = p([]), [L, fe] = p(20), [J, Y] = p(0), [rn, xe] = p(null), [A, z] = p(null), [l, K] = p(!1), [oe, ve] = p(
|
|
567
294
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
568
|
-
),
|
|
569
|
-
|
|
570
|
-
const
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
|
|
574
|
-
else if (
|
|
575
|
-
|
|
295
|
+
), U = We(null), [b, P] = p({ list: null, index: null, side: null }), [d, ke] = p(!1), [sn, re] = p(1), [ye, se] = p(null), [He, Ie] = p(!1), [$, Ce] = p(!1), [G, De] = p(!1), [N, Te] = p(!1), [j, Pe] = p(!1), [O, Re] = p(!1), [F, ze] = p(!1), [Z, Ee] = p(!1), [Q, Be] = p(!1);
|
|
296
|
+
V(() => {
|
|
297
|
+
const e = () => {
|
|
298
|
+
const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700, u = t === 768 && n === 1024, x = t === 1024 && n === 768, s = t === 820 && n === 1180, w = t === 1180 && n === 820, X = t === 540 && n === 720, W = t === 720 && n === 540, ce = t === 1024 && n === 1366, Ue = t === 1366 && n === 1024, Ve = t >= 1200 && n >= 600 && !i;
|
|
299
|
+
if (Ie(Ve), Ce(u), De(x), Te(s), Pe(w), Re(X), ze(W), Ee(ce), Be(Ue), ke(i), i)
|
|
300
|
+
se(null), re(1);
|
|
301
|
+
else if (o)
|
|
302
|
+
se(null), re(1);
|
|
576
303
|
else {
|
|
577
|
-
const
|
|
578
|
-
|
|
304
|
+
const qe = Math.min(1e3, Math.min(t, n) * 0.9);
|
|
305
|
+
se(qe), re(1);
|
|
579
306
|
}
|
|
580
307
|
};
|
|
581
|
-
return
|
|
308
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
582
309
|
}, []);
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
let
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
588
|
-
const [
|
|
589
|
-
let
|
|
590
|
-
|
|
591
|
-
},
|
|
592
|
-
if (
|
|
593
|
-
|
|
310
|
+
const _ = (e, t, n, i) => {
|
|
311
|
+
if (l) return;
|
|
312
|
+
let o = [...te], u = [...v];
|
|
313
|
+
const x = e === "bank" ? o : u, s = t === "bank" ? o : u, w = x.findIndex((ce) => ce.id === n);
|
|
314
|
+
if (w === -1) return;
|
|
315
|
+
const [X] = x.splice(w, 1);
|
|
316
|
+
let W = i;
|
|
317
|
+
e === t && W !== null && W !== void 0 && W > w && (W = W - 1), W == null || W < 0 || W > s.length ? s.push(X) : s.splice(W, 0, X), e === "bank" ? o = x : u = x, t === "bank" ? o = s : u = s, me(o), ie(u);
|
|
318
|
+
}, ee = (e, t, n) => {
|
|
319
|
+
if (e.preventDefault(), l) {
|
|
320
|
+
P({ list: null, index: null, side: null });
|
|
594
321
|
return;
|
|
595
322
|
}
|
|
596
|
-
const
|
|
597
|
-
const
|
|
598
|
-
if (!
|
|
599
|
-
const
|
|
600
|
-
return
|
|
323
|
+
const i = e.dataTransfer.getData("application/x-token") || (() => {
|
|
324
|
+
const o = e.dataTransfer.getData("text/plain");
|
|
325
|
+
if (!o) return "";
|
|
326
|
+
const u = te.some((w) => w.id === o), x = v.some((w) => w.id === o), s = u ? "bank" : x ? "selected" : null;
|
|
327
|
+
return s ? JSON.stringify({ from: s, id: o }) : "";
|
|
601
328
|
})();
|
|
602
|
-
if (
|
|
329
|
+
if (i) {
|
|
603
330
|
try {
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
|
|
331
|
+
const o = JSON.parse(i);
|
|
332
|
+
if (!o || !o.id || !o.from) return;
|
|
333
|
+
_(o.from, t, o.id, n);
|
|
607
334
|
} catch {
|
|
608
335
|
}
|
|
609
|
-
|
|
336
|
+
P({ list: null, index: null, side: null });
|
|
610
337
|
}
|
|
611
|
-
},
|
|
612
|
-
|
|
613
|
-
},
|
|
614
|
-
|
|
615
|
-
},
|
|
616
|
-
if (
|
|
338
|
+
}, Me = (e) => {
|
|
339
|
+
ge(e), q(Array(e).fill("")), k("time");
|
|
340
|
+
}, Le = (e) => {
|
|
341
|
+
we(e), k("type");
|
|
342
|
+
}, Ae = (e, t) => {
|
|
343
|
+
if (t.length > 41 || t && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(t))
|
|
617
344
|
return;
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
|
|
345
|
+
const i = [...H];
|
|
346
|
+
i[e] = t, q(i);
|
|
347
|
+
const o = S(i);
|
|
348
|
+
o.isValid || console.warn("Validation errors:", o.errors);
|
|
349
|
+
}, $e = (e) => e.trim().replace(/\s+/g, " "), be = (e) => e <= 3 ? 20 : e <= 5 ? 18 : e <= 7 ? 16 : e <= 9 ? 14 : 12, Ge = () => {
|
|
350
|
+
H.some((t) => t.trim().length === 0) || (q((t) => t.map((n) => $e(n))), Y(0), ue(0), xe(null), k("getready"));
|
|
624
351
|
};
|
|
625
|
-
|
|
626
|
-
if (
|
|
627
|
-
const
|
|
628
|
-
return () => clearTimeout(
|
|
352
|
+
V(() => {
|
|
353
|
+
if (f === "getready") {
|
|
354
|
+
const e = setTimeout(() => ae(0), 3e3);
|
|
355
|
+
return () => clearTimeout(e);
|
|
629
356
|
}
|
|
630
|
-
}, [
|
|
631
|
-
const
|
|
632
|
-
const
|
|
633
|
-
if (!
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
).map((
|
|
637
|
-
id: `${Date.now()}-${
|
|
638
|
-
text:
|
|
357
|
+
}, [f]);
|
|
358
|
+
const ae = (e) => {
|
|
359
|
+
const t = H[e];
|
|
360
|
+
if (!t) return;
|
|
361
|
+
const i = on(
|
|
362
|
+
t.trim().split(/\s+/).filter(Boolean)
|
|
363
|
+
).map((o, u) => ({
|
|
364
|
+
id: `${Date.now()}-${e}-${u}-${Math.random().toString(36).slice(2)}`,
|
|
365
|
+
text: o
|
|
639
366
|
}));
|
|
640
|
-
me(
|
|
367
|
+
me(i), ie([]), ue(e), fe(he || 20), z(null), K(!1), k("play");
|
|
641
368
|
};
|
|
642
|
-
|
|
643
|
-
if (
|
|
644
|
-
if (
|
|
645
|
-
|
|
369
|
+
V(() => {
|
|
370
|
+
if (f === "play" && !l)
|
|
371
|
+
if (U.current !== null && window.clearTimeout(U.current), L > 0)
|
|
372
|
+
U.current = window.setTimeout(() => fe((e) => e - 1), 1e3);
|
|
646
373
|
else {
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
374
|
+
K(!0);
|
|
375
|
+
const t = H[T].trim().split(/\s+/), n = v.map((s) => s.text), i = t.filter((s) => !n.includes(s)).length, o = n.filter((s) => !t.includes(s)).length, u = t.filter((s, w) => s !== n[w]).length, x = i + o + u;
|
|
376
|
+
x === 0 ? (z("correct"), R("correct"), E("Correct! Well done!")) : x === 1 ? (z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!"));
|
|
650
377
|
}
|
|
651
378
|
return () => {
|
|
652
|
-
|
|
379
|
+
U.current !== null && window.clearTimeout(U.current);
|
|
653
380
|
};
|
|
654
|
-
}, [
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
|
|
381
|
+
}, [f, L, l, H, T, v]);
|
|
382
|
+
const Ne = (e = !0) => {
|
|
383
|
+
if (l && e) {
|
|
384
|
+
T + 1 < (I || 0) ? ae(T + 1) : (k("results"), setTimeout(() => de(), 600));
|
|
658
385
|
return;
|
|
659
386
|
}
|
|
660
|
-
if (
|
|
661
|
-
const
|
|
662
|
-
|
|
387
|
+
if (e && !l) {
|
|
388
|
+
const n = H[T].trim().split(/\s+/), i = v.map((w) => w.text), o = n.filter((w) => !i.includes(w)).length, u = i.filter((w) => !n.includes(w)).length, x = n.filter((w, X) => w !== i[X]).length, s = o + u + x;
|
|
389
|
+
s === 0 && L > 0 ? (Y((w) => w + 1), z("correct"), R("correct"), E("Correct! Well done!")) : s === 1 ? (Y((w) => w + 0.5), z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!")), T + 1 < (I || 0) ? setTimeout(() => ae(T + 1), 800) : (k("results"), setTimeout(() => de(), 600));
|
|
663
390
|
}
|
|
664
391
|
};
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}, [
|
|
668
|
-
const
|
|
669
|
-
const
|
|
670
|
-
switch (
|
|
392
|
+
V(() => {
|
|
393
|
+
f === "results" && J > oe && (ve(J), localStorage.setItem("magicSentenceBest", String(J)));
|
|
394
|
+
}, [f, J, oe]);
|
|
395
|
+
const R = (e) => {
|
|
396
|
+
const t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), i = t.createGain();
|
|
397
|
+
switch (n.connect(i), i.connect(t.destination), e) {
|
|
671
398
|
case "start":
|
|
672
|
-
|
|
399
|
+
n.frequency.value = 500;
|
|
673
400
|
break;
|
|
674
401
|
case "click":
|
|
675
|
-
|
|
402
|
+
n.frequency.value = 800;
|
|
676
403
|
break;
|
|
677
404
|
case "correct":
|
|
678
|
-
|
|
405
|
+
n.frequency.value = 1e3;
|
|
679
406
|
break;
|
|
680
407
|
case "half":
|
|
681
|
-
|
|
408
|
+
n.frequency.value = 700;
|
|
682
409
|
break;
|
|
683
410
|
case "wrong":
|
|
684
|
-
|
|
411
|
+
n.frequency.value = 200;
|
|
685
412
|
break;
|
|
686
413
|
}
|
|
687
|
-
|
|
688
|
-
},
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
x: Math.random() *
|
|
693
|
-
y: Math.random() *
|
|
414
|
+
i.gain.setValueAtTime(0.1, t.currentTime), n.start(), n.stop(t.currentTime + 0.2);
|
|
415
|
+
}, de = () => {
|
|
416
|
+
const t = Date.now() + 2500, n = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], i = document.createElement("canvas"), o = i.getContext("2d");
|
|
417
|
+
i.width = window.innerWidth, i.height = window.innerHeight, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.pointerEvents = "none", document.body.appendChild(i);
|
|
418
|
+
const u = Array.from({ length: 100 }).map(() => ({
|
|
419
|
+
x: Math.random() * i.width,
|
|
420
|
+
y: Math.random() * i.height - i.height,
|
|
694
421
|
size: 6 + Math.random() * 6,
|
|
695
|
-
color:
|
|
422
|
+
color: n[Math.floor(Math.random() * n.length)],
|
|
696
423
|
speed: 2 + Math.random() * 4,
|
|
697
424
|
tilt: Math.random() * 2 * Math.PI
|
|
698
|
-
})),
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}), Date.now() <
|
|
425
|
+
})), x = () => {
|
|
426
|
+
o.clearRect(0, 0, i.width, i.height), u.forEach((s) => {
|
|
427
|
+
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);
|
|
428
|
+
}), Date.now() < t ? requestAnimationFrame(x) : document.body.removeChild(i);
|
|
702
429
|
};
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
430
|
+
x();
|
|
431
|
+
}, je = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
|
|
432
|
+
/* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
433
|
+
/* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select number of rounds" }),
|
|
434
|
+
/* @__PURE__ */ a("div", { style: {
|
|
708
435
|
display: "flex",
|
|
709
|
-
gap:
|
|
436
|
+
gap: c() ? "8px" : "16px",
|
|
710
437
|
justifyContent: "center"
|
|
711
|
-
}, children: [3, 4, 5].map((
|
|
438
|
+
}, children: [3, 4, 5].map((e) => /* @__PURE__ */ m(
|
|
712
439
|
"button",
|
|
713
440
|
{
|
|
714
|
-
onClick: () =>
|
|
441
|
+
onClick: () => Me(e),
|
|
715
442
|
style: {
|
|
716
|
-
...
|
|
443
|
+
...g.gmButton,
|
|
717
444
|
...D("medium")
|
|
718
445
|
},
|
|
719
446
|
children: [
|
|
720
|
-
|
|
447
|
+
e,
|
|
721
448
|
" ROUNDS"
|
|
722
449
|
]
|
|
723
450
|
},
|
|
724
|
-
|
|
451
|
+
e
|
|
725
452
|
)) })
|
|
726
|
-
] }),
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
/* @__PURE__ */
|
|
453
|
+
] }), Oe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
|
|
454
|
+
/* @__PURE__ */ a("h1", { style: g.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
455
|
+
/* @__PURE__ */ a("p", { style: g.gmBodyM, children: "Select time per round" }),
|
|
456
|
+
/* @__PURE__ */ a("div", { style: {
|
|
730
457
|
display: "flex",
|
|
731
|
-
gap:
|
|
458
|
+
gap: c() ? "8px" : "16px",
|
|
732
459
|
justifyContent: "center"
|
|
733
|
-
}, children: [15, 20, 30].map((
|
|
460
|
+
}, children: [15, 20, 30].map((e) => /* @__PURE__ */ m(
|
|
734
461
|
"button",
|
|
735
462
|
{
|
|
736
|
-
onClick: () =>
|
|
463
|
+
onClick: () => Le(e),
|
|
737
464
|
style: {
|
|
738
|
-
...
|
|
465
|
+
...g.gmButton,
|
|
739
466
|
...D("medium")
|
|
740
467
|
},
|
|
741
468
|
children: [
|
|
742
|
-
|
|
469
|
+
e,
|
|
743
470
|
"s"
|
|
744
471
|
]
|
|
745
472
|
},
|
|
746
|
-
|
|
473
|
+
e
|
|
747
474
|
)) })
|
|
748
|
-
] }),
|
|
749
|
-
/* @__PURE__ */
|
|
475
|
+
] }), Fe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
|
|
476
|
+
/* @__PURE__ */ m("h2", { style: { ...g.gmBodyM, marginBottom: "0px" }, children: [
|
|
750
477
|
"Type down ",
|
|
751
|
-
|
|
478
|
+
I,
|
|
752
479
|
" sentence",
|
|
753
|
-
|
|
480
|
+
I && I > 1 ? "s" : "",
|
|
754
481
|
" for your student"
|
|
755
482
|
] }),
|
|
756
|
-
/* @__PURE__ */
|
|
757
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ a("p", { style: { ...g.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
|
|
484
|
+
/* @__PURE__ */ a("div", { style: {
|
|
758
485
|
display: "flex",
|
|
759
486
|
flexDirection: "column",
|
|
760
487
|
gap: 12,
|
|
@@ -764,317 +491,314 @@ function wn(p = {}) {
|
|
|
764
491
|
// Минимальная ширина по содержимому
|
|
765
492
|
maxWidth: "600px"
|
|
766
493
|
// Ограничиваем максимальную ширину
|
|
767
|
-
}, children:
|
|
494
|
+
}, children: H.map((e, t) => /* @__PURE__ */ a(
|
|
768
495
|
"input",
|
|
769
496
|
{
|
|
770
|
-
value:
|
|
771
|
-
placeholder: `Sentence ${
|
|
772
|
-
onChange: (
|
|
497
|
+
value: e,
|
|
498
|
+
placeholder: `Sentence ${t + 1}`,
|
|
499
|
+
onChange: (n) => Ae(t, n.target.value),
|
|
773
500
|
style: {
|
|
774
|
-
...
|
|
775
|
-
padding:
|
|
776
|
-
fontSize:
|
|
501
|
+
...g.gmInput,
|
|
502
|
+
padding: c() ? "8px 12px" : "12px 16px",
|
|
503
|
+
fontSize: c() ? "14px" : "16px",
|
|
777
504
|
width: "100%",
|
|
778
505
|
// Поля теперь будут шире благодаря увеличенной ширине контейнера
|
|
779
506
|
textAlign: "center"
|
|
780
507
|
// Центрируем placeholder текст
|
|
781
508
|
}
|
|
782
509
|
},
|
|
783
|
-
|
|
510
|
+
t
|
|
784
511
|
)) }),
|
|
785
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ a(
|
|
786
513
|
"button",
|
|
787
514
|
{
|
|
788
|
-
onClick:
|
|
789
|
-
disabled:
|
|
515
|
+
onClick: Ge,
|
|
516
|
+
disabled: H.some((e) => e.trim().length === 0),
|
|
790
517
|
style: {
|
|
791
|
-
...
|
|
518
|
+
...g.gmButton,
|
|
792
519
|
marginTop: 30,
|
|
793
|
-
background:
|
|
794
|
-
cursor:
|
|
520
|
+
background: H.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
|
|
521
|
+
cursor: H.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
|
|
795
522
|
...D("large")
|
|
796
523
|
},
|
|
797
524
|
children: "PLAY"
|
|
798
525
|
}
|
|
799
526
|
)
|
|
800
|
-
] }), Ze = () => /* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
...
|
|
803
|
-
|
|
804
|
-
color: "#ec4c44",
|
|
805
|
-
marginBottom: "20px",
|
|
806
|
-
animation: "pulse 1s ease-in-out infinite"
|
|
527
|
+
] }), Ze = () => /* @__PURE__ */ m("div", { style: g.gmReadyWrapper, children: [
|
|
528
|
+
/* @__PURE__ */ a("h1", { style: {
|
|
529
|
+
...g.gmHeadline1,
|
|
530
|
+
color: "#ec4c44"
|
|
807
531
|
}, children: "GET READY" }),
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
] }), Qe = () => /* @__PURE__ */
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
-
marginBottom:
|
|
812
|
-
fontSize:
|
|
532
|
+
/* @__PURE__ */ a("div", { style: g.gmHourglass, children: "⏳" })
|
|
533
|
+
] }), Qe = () => /* @__PURE__ */ m("div", { style: g.gmGameLayout, children: [
|
|
534
|
+
/* @__PURE__ */ m("h2", { style: {
|
|
535
|
+
marginBottom: c() ? "5px" : "10px",
|
|
536
|
+
fontSize: c() ? "16px" : "20px"
|
|
813
537
|
}, children: [
|
|
814
538
|
"Round ",
|
|
815
|
-
|
|
539
|
+
T + 1,
|
|
816
540
|
"/",
|
|
817
|
-
|
|
541
|
+
I,
|
|
818
542
|
" — ",
|
|
819
|
-
|
|
543
|
+
l ? "TIME'S UP!" : `Time: ${L}s`
|
|
820
544
|
] }),
|
|
821
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ a(
|
|
822
546
|
"div",
|
|
823
547
|
{
|
|
824
548
|
style: {
|
|
825
549
|
width: "60%",
|
|
826
|
-
height:
|
|
550
|
+
height: c() ? "8px" : "14px",
|
|
827
551
|
borderRadius: 8,
|
|
828
552
|
background: "#eee",
|
|
829
553
|
overflow: "hidden",
|
|
830
|
-
marginBottom:
|
|
554
|
+
marginBottom: c() ? "10px" : "20px"
|
|
831
555
|
},
|
|
832
|
-
children: /* @__PURE__ */
|
|
556
|
+
children: /* @__PURE__ */ a(
|
|
833
557
|
"div",
|
|
834
558
|
{
|
|
835
559
|
style: {
|
|
836
560
|
height: "100%",
|
|
837
|
-
width: `${
|
|
838
|
-
background:
|
|
561
|
+
width: `${L / (he || 20) * 100}%`,
|
|
562
|
+
background: L <= 5 ? "#ec4c44" : "#4caf50",
|
|
839
563
|
transition: "width 1s linear"
|
|
840
564
|
}
|
|
841
565
|
}
|
|
842
566
|
)
|
|
843
567
|
}
|
|
844
568
|
),
|
|
845
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ a(
|
|
846
570
|
"div",
|
|
847
571
|
{
|
|
848
|
-
onDragOver: (
|
|
849
|
-
onDrop: (
|
|
572
|
+
onDragOver: (e) => e.preventDefault(),
|
|
573
|
+
onDrop: (e) => ee(e, "bank", null),
|
|
850
574
|
style: {
|
|
851
575
|
display: "flex",
|
|
852
|
-
flexWrap:
|
|
853
|
-
gap:
|
|
576
|
+
flexWrap: C() ? "wrap" : "nowrap",
|
|
577
|
+
gap: d || window.innerWidth < 768 ? "6px" : "10px",
|
|
854
578
|
justifyContent: "center",
|
|
855
|
-
marginBottom:
|
|
856
|
-
padding:
|
|
579
|
+
marginBottom: d || window.innerWidth < 768 ? "15px" : "30px",
|
|
580
|
+
padding: d || window.innerWidth < 768 ? "5px" : "10px",
|
|
857
581
|
width: "100%",
|
|
858
582
|
boxSizing: "border-box"
|
|
859
583
|
},
|
|
860
|
-
children:
|
|
584
|
+
children: te.map((e, t) => /* @__PURE__ */ a(
|
|
861
585
|
"div",
|
|
862
586
|
{
|
|
863
|
-
draggable: !
|
|
587
|
+
draggable: !l,
|
|
864
588
|
role: "button",
|
|
865
|
-
tabIndex:
|
|
866
|
-
"aria-label":
|
|
867
|
-
onDragStart: (
|
|
868
|
-
if (
|
|
869
|
-
|
|
589
|
+
tabIndex: l ? -1 : 0,
|
|
590
|
+
"aria-label": l ? `Word: ${e.text} (time expired)` : en("Drag word", e.text, "to build sentence"),
|
|
591
|
+
onDragStart: (n) => {
|
|
592
|
+
if (l) {
|
|
593
|
+
n.preventDefault();
|
|
870
594
|
return;
|
|
871
595
|
}
|
|
872
|
-
|
|
596
|
+
n.dataTransfer.setData(
|
|
873
597
|
"application/x-token",
|
|
874
|
-
JSON.stringify({ from: "bank", id:
|
|
875
|
-
),
|
|
598
|
+
JSON.stringify({ from: "bank", id: e.id })
|
|
599
|
+
), n.dataTransfer.setData("text/plain", e.id), E(`Dragging word: ${e.text}`);
|
|
876
600
|
},
|
|
877
|
-
onKeyDown: (
|
|
878
|
-
|
|
601
|
+
onKeyDown: (n) => {
|
|
602
|
+
l || nn(n, () => _("bank", "selected", e.id, null));
|
|
879
603
|
},
|
|
880
|
-
onDragOver: (
|
|
881
|
-
onDrop: (
|
|
882
|
-
const
|
|
883
|
-
|
|
604
|
+
onDragOver: (n) => n.preventDefault(),
|
|
605
|
+
onDrop: (n) => {
|
|
606
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
|
|
607
|
+
P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "bank", u);
|
|
884
608
|
},
|
|
885
|
-
onDragEnter: (
|
|
886
|
-
if (
|
|
887
|
-
const
|
|
888
|
-
|
|
609
|
+
onDragEnter: (n) => {
|
|
610
|
+
if (l) return;
|
|
611
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
|
|
612
|
+
P({ list: "bank", index: t, side: n.clientX > o ? "right" : "left" });
|
|
889
613
|
},
|
|
890
|
-
onDragLeave: () =>
|
|
614
|
+
onDragLeave: () => P({ list: null, index: null, side: null }),
|
|
891
615
|
onClick: () => {
|
|
892
|
-
|
|
616
|
+
l || _("bank", "selected", e.id, null);
|
|
893
617
|
},
|
|
894
618
|
style: {
|
|
895
|
-
padding:
|
|
896
|
-
borderRadius:
|
|
619
|
+
padding: d || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
|
|
620
|
+
borderRadius: d || window.innerWidth < 768 ? "6px" : "10px",
|
|
897
621
|
border: "1px solid #ccc",
|
|
898
|
-
background:
|
|
899
|
-
cursor:
|
|
900
|
-
fontSize:
|
|
901
|
-
borderLeft:
|
|
902
|
-
borderRight:
|
|
622
|
+
background: l ? "#f0f0f0" : "#f9f9f9",
|
|
623
|
+
cursor: l ? "not-allowed" : "pointer",
|
|
624
|
+
fontSize: d || window.innerWidth < 768 ? "12px" : "18px",
|
|
625
|
+
borderLeft: b.list === "bank" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
626
|
+
borderRight: b.list === "bank" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
903
627
|
flexShrink: 0,
|
|
904
628
|
flexBasis: "auto",
|
|
905
|
-
opacity:
|
|
629
|
+
opacity: l ? 0.6 : 1,
|
|
906
630
|
transition: "opacity 0.3s ease"
|
|
907
631
|
},
|
|
908
|
-
children:
|
|
632
|
+
children: e.text
|
|
909
633
|
},
|
|
910
|
-
|
|
634
|
+
e.id
|
|
911
635
|
))
|
|
912
636
|
}
|
|
913
637
|
),
|
|
914
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ a(
|
|
915
639
|
"div",
|
|
916
640
|
{
|
|
917
|
-
onDragOver: (
|
|
918
|
-
onDrop: (
|
|
641
|
+
onDragOver: (e) => e.preventDefault(),
|
|
642
|
+
onDrop: (e) => ee(e, "selected", null),
|
|
919
643
|
style: {
|
|
920
|
-
minHeight:
|
|
644
|
+
minHeight: d || window.innerWidth < 768 ? "50px" : "70px",
|
|
921
645
|
width: "auto",
|
|
922
646
|
// Автоматическая ширина в зависимости от содержимого
|
|
923
647
|
maxWidth: "none",
|
|
924
648
|
// Убираем ограничение максимальной ширины
|
|
925
649
|
minWidth: "245px",
|
|
926
650
|
// Минимальная ширина для растягивания
|
|
927
|
-
border:
|
|
928
|
-
borderRadius:
|
|
929
|
-
padding:
|
|
651
|
+
border: A === "correct" ? "2px dashed #4caf50" : A === "almost" ? "2px dashed #ff9800" : A === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
|
|
652
|
+
borderRadius: d || window.innerWidth < 768 ? "8px" : "12px",
|
|
653
|
+
padding: d || window.innerWidth < 768 ? "8px" : "12px",
|
|
930
654
|
display: "flex",
|
|
931
|
-
flexWrap:
|
|
655
|
+
flexWrap: C() ? "wrap" : "nowrap",
|
|
932
656
|
alignItems: "center",
|
|
933
657
|
justifyContent: "center",
|
|
934
|
-
fontSize: `${
|
|
935
|
-
background:
|
|
936
|
-
overflowX:
|
|
937
|
-
whiteSpace:
|
|
658
|
+
fontSize: `${be(v.length)}px`,
|
|
659
|
+
background: A === "correct" ? "#e8f5e8" : A === "almost" ? "#fff3e0" : A === "wrong" ? "#ffebee" : "#fafafa",
|
|
660
|
+
overflowX: C() ? "hidden" : "auto",
|
|
661
|
+
whiteSpace: C() ? "normal" : "nowrap"
|
|
938
662
|
},
|
|
939
|
-
children:
|
|
663
|
+
children: v.map((e, t) => /* @__PURE__ */ a(
|
|
940
664
|
"span",
|
|
941
665
|
{
|
|
942
|
-
draggable: !
|
|
943
|
-
onDragStart: (
|
|
944
|
-
if (
|
|
945
|
-
|
|
666
|
+
draggable: !l,
|
|
667
|
+
onDragStart: (n) => {
|
|
668
|
+
if (l) {
|
|
669
|
+
n.preventDefault();
|
|
946
670
|
return;
|
|
947
671
|
}
|
|
948
|
-
|
|
672
|
+
n.dataTransfer.setData(
|
|
949
673
|
"application/x-token",
|
|
950
|
-
JSON.stringify({ from: "selected", id:
|
|
951
|
-
),
|
|
674
|
+
JSON.stringify({ from: "selected", id: e.id })
|
|
675
|
+
), n.dataTransfer.setData("text/plain", e.id);
|
|
952
676
|
},
|
|
953
|
-
onDragOver: (
|
|
954
|
-
onDrop: (
|
|
955
|
-
const
|
|
956
|
-
|
|
677
|
+
onDragOver: (n) => n.preventDefault(),
|
|
678
|
+
onDrop: (n) => {
|
|
679
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, u = n.clientX > o ? t + 1 : t;
|
|
680
|
+
P({ list: null, index: null, side: null }), n.stopPropagation(), ee(n, "selected", u);
|
|
957
681
|
},
|
|
958
|
-
onDragEnter: (
|
|
959
|
-
if (
|
|
960
|
-
const
|
|
961
|
-
|
|
682
|
+
onDragEnter: (n) => {
|
|
683
|
+
if (l) return;
|
|
684
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
|
|
685
|
+
P({ list: "selected", index: t, side: n.clientX > o ? "right" : "left" });
|
|
962
686
|
},
|
|
963
|
-
onDragLeave: () =>
|
|
687
|
+
onDragLeave: () => P({ list: null, index: null, side: null }),
|
|
964
688
|
onClick: () => {
|
|
965
|
-
|
|
689
|
+
l || _("selected", "bank", e.id, null);
|
|
966
690
|
},
|
|
967
|
-
title:
|
|
691
|
+
title: l ? "Time expired" : "Click to remove back to bank",
|
|
968
692
|
style: {
|
|
969
|
-
padding:
|
|
970
|
-
margin:
|
|
971
|
-
borderRadius:
|
|
972
|
-
background:
|
|
973
|
-
border:
|
|
974
|
-
borderLeft:
|
|
975
|
-
borderRight:
|
|
976
|
-
cursor:
|
|
693
|
+
padding: c() ? "4px 6px" : "6px 10px",
|
|
694
|
+
margin: c() ? "2px" : "4px",
|
|
695
|
+
borderRadius: c() ? "4px" : "8px",
|
|
696
|
+
background: l ? "#f0f0f0" : "#ffe9e7",
|
|
697
|
+
border: l ? "1px solid #ccc" : "1px solid #ec4c44",
|
|
698
|
+
borderLeft: b.list === "selected" && b.index === t && b.side === "left" ? "3px solid #3b82f6" : void 0,
|
|
699
|
+
borderRight: b.list === "selected" && b.index === t && b.side === "right" ? "3px solid #3b82f6" : void 0,
|
|
700
|
+
cursor: l ? "not-allowed" : "pointer",
|
|
977
701
|
userSelect: "none",
|
|
978
|
-
fontSize: `${
|
|
702
|
+
fontSize: `${be(v.length)}px`,
|
|
979
703
|
// Адаптивный размер шрифта для слов
|
|
980
704
|
fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
|
|
981
705
|
// Более плотный шрифт
|
|
982
706
|
whiteSpace: "nowrap",
|
|
983
707
|
// Запрещаем перенос слов
|
|
984
|
-
opacity:
|
|
708
|
+
opacity: l ? 0.6 : 1,
|
|
985
709
|
transition: "opacity 0.3s ease"
|
|
986
710
|
},
|
|
987
|
-
children:
|
|
711
|
+
children: e.text
|
|
988
712
|
},
|
|
989
|
-
|
|
713
|
+
e.id
|
|
990
714
|
))
|
|
991
715
|
}
|
|
992
716
|
),
|
|
993
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ a(
|
|
994
718
|
"button",
|
|
995
719
|
{
|
|
996
|
-
onClick: () =>
|
|
997
|
-
disabled: !
|
|
720
|
+
onClick: () => Ne(!0),
|
|
721
|
+
disabled: !l && v.length === 0,
|
|
998
722
|
style: {
|
|
999
|
-
marginTop:
|
|
1000
|
-
fontSize:
|
|
1001
|
-
padding:
|
|
1002
|
-
borderRadius:
|
|
1003
|
-
background:
|
|
723
|
+
marginTop: c() ? "15px" : "30px",
|
|
724
|
+
fontSize: c() ? "14px" : "20px",
|
|
725
|
+
padding: c() ? "6px 12px" : "10px 24px",
|
|
726
|
+
borderRadius: c() ? "8px" : "12px",
|
|
727
|
+
background: l || v.length > 0 ? "#ec4c44" : "#ccc",
|
|
1004
728
|
color: "white",
|
|
1005
729
|
border: "none",
|
|
1006
|
-
cursor:
|
|
730
|
+
cursor: l || v.length > 0 ? "pointer" : "not-allowed"
|
|
1007
731
|
},
|
|
1008
732
|
children: "NEXT"
|
|
1009
733
|
}
|
|
1010
734
|
)
|
|
1011
|
-
] }),
|
|
1012
|
-
/* @__PURE__ */
|
|
1013
|
-
...
|
|
1014
|
-
marginTop: (
|
|
1015
|
-
marginBottom:
|
|
1016
|
-
fontSize:
|
|
735
|
+
] }), Xe = () => /* @__PURE__ */ m("div", { style: g.gmCenterScreen, children: [
|
|
736
|
+
/* @__PURE__ */ a("h1", { style: {
|
|
737
|
+
...g.gmHeadline1,
|
|
738
|
+
marginTop: (d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
|
|
739
|
+
marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "10px",
|
|
740
|
+
fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
|
|
1017
741
|
}, children: "Game Over 🎯" }),
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
...
|
|
1020
|
-
marginTop: (
|
|
1021
|
-
marginBottom:
|
|
1022
|
-
fontSize:
|
|
742
|
+
/* @__PURE__ */ m("h2", { style: {
|
|
743
|
+
...g.gmHeadline2,
|
|
744
|
+
marginTop: (d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q, "0px"),
|
|
745
|
+
marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
|
|
746
|
+
fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
|
|
1023
747
|
}, children: [
|
|
1024
748
|
"Your score: ",
|
|
1025
|
-
|
|
749
|
+
J,
|
|
1026
750
|
" out of ",
|
|
1027
|
-
|
|
751
|
+
I
|
|
1028
752
|
] }),
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
...
|
|
753
|
+
/* @__PURE__ */ m("p", { style: {
|
|
754
|
+
...g.gmBodyM,
|
|
1031
755
|
color: "#10b981",
|
|
1032
|
-
marginTop:
|
|
1033
|
-
marginBottom:
|
|
1034
|
-
fontSize:
|
|
756
|
+
marginTop: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "0px" : "12px",
|
|
757
|
+
marginBottom: d && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || $ || G || N || j || O || F || Z || Q ? "2px" : "16px",
|
|
758
|
+
fontSize: d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
|
|
1035
759
|
}, children: [
|
|
1036
760
|
"Best score: ",
|
|
1037
|
-
|
|
761
|
+
oe
|
|
1038
762
|
] }),
|
|
1039
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ m("div", { style: {
|
|
1040
764
|
display: "flex",
|
|
1041
|
-
gap:
|
|
1042
|
-
marginTop:
|
|
765
|
+
gap: d && window.innerWidth > window.innerHeight || d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
|
|
766
|
+
marginTop: d && window.innerWidth > window.innerHeight || d && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || He ? "12px" : "24px"
|
|
1043
767
|
}, children: [
|
|
1044
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ a(
|
|
1045
769
|
"button",
|
|
1046
770
|
{
|
|
1047
771
|
onClick: () => {
|
|
1048
|
-
|
|
1049
|
-
|
|
772
|
+
de(), R("start"), setTimeout(() => {
|
|
773
|
+
k("getready"), xe(null), K(!1);
|
|
1050
774
|
}, 800);
|
|
1051
775
|
},
|
|
1052
776
|
style: {
|
|
1053
|
-
...
|
|
777
|
+
...g.gmButton,
|
|
1054
778
|
...D("medium")
|
|
1055
779
|
},
|
|
1056
780
|
children: "🔁 Play again"
|
|
1057
781
|
}
|
|
1058
782
|
),
|
|
1059
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ a(
|
|
1060
784
|
"button",
|
|
1061
785
|
{
|
|
1062
786
|
onClick: () => {
|
|
1063
|
-
|
|
787
|
+
R("click"), k("select"), ge(null), we(null), q([]), Y(0), ie([]), K(!1);
|
|
1064
788
|
},
|
|
1065
789
|
style: {
|
|
1066
|
-
...
|
|
790
|
+
...g.gmButton,
|
|
1067
791
|
...D("medium")
|
|
1068
792
|
},
|
|
1069
793
|
children: "⬅️ Exit"
|
|
1070
794
|
}
|
|
1071
795
|
)
|
|
1072
796
|
] })
|
|
1073
|
-
] }),
|
|
1074
|
-
return /* @__PURE__ */
|
|
797
|
+
] }), le = r || (B ? `${B.endsWith("/") ? B.slice(0, -1) : B}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), Je = !d && y && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
|
|
798
|
+
return /* @__PURE__ */ a(
|
|
1075
799
|
"div",
|
|
1076
800
|
{
|
|
1077
|
-
ref:
|
|
801
|
+
ref: ne,
|
|
1078
802
|
style: {
|
|
1079
803
|
width: "100%",
|
|
1080
804
|
height: "100%",
|
|
@@ -1090,81 +814,90 @@ function wn(p = {}) {
|
|
|
1090
814
|
right: 0,
|
|
1091
815
|
bottom: 0
|
|
1092
816
|
},
|
|
1093
|
-
children: /* @__PURE__ */
|
|
817
|
+
children: /* @__PURE__ */ m(
|
|
1094
818
|
"div",
|
|
1095
819
|
{
|
|
1096
820
|
style: {
|
|
1097
|
-
width:
|
|
1098
|
-
height:
|
|
821
|
+
width: d ? "100%" : ye || 1e3,
|
|
822
|
+
height: d ? "100%" : ye || 1e3,
|
|
1099
823
|
display: "flex",
|
|
1100
824
|
justifyContent: "center",
|
|
1101
825
|
alignItems: "center",
|
|
1102
826
|
overflow: "hidden",
|
|
1103
|
-
borderRadius:
|
|
827
|
+
borderRadius: d ? 0 : "20px",
|
|
1104
828
|
background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
|
|
1105
|
-
boxShadow:
|
|
1106
|
-
margin:
|
|
829
|
+
boxShadow: d ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
830
|
+
margin: d ? "0 auto" : "unset",
|
|
1107
831
|
position: "relative"
|
|
832
|
+
// needed so absolute logo is inside the square
|
|
1108
833
|
},
|
|
1109
|
-
children:
|
|
1110
|
-
"div",
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
834
|
+
children: [
|
|
835
|
+
!d && Je && /* @__PURE__ */ a("div", { style: { ...g.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: le ? /* @__PURE__ */ m("picture", { children: [
|
|
836
|
+
/* @__PURE__ */ a(
|
|
837
|
+
"source",
|
|
838
|
+
{
|
|
839
|
+
srcSet: le,
|
|
840
|
+
type: "image/svg+xml"
|
|
841
|
+
}
|
|
842
|
+
),
|
|
843
|
+
/* @__PURE__ */ a(
|
|
844
|
+
"img",
|
|
845
|
+
{
|
|
846
|
+
src: le.replace(".svg", ".png"),
|
|
847
|
+
alt: "SPEAKID Logo",
|
|
848
|
+
style: g.gmLogoImg,
|
|
849
|
+
loading: "lazy"
|
|
850
|
+
}
|
|
851
|
+
)
|
|
852
|
+
] }) : /* @__PURE__ */ a("div", { style: g.gmLogoImg, children: "SPEAKID" }) }),
|
|
853
|
+
/* @__PURE__ */ a(
|
|
854
|
+
"div",
|
|
855
|
+
{
|
|
856
|
+
style: {
|
|
857
|
+
transform: "none",
|
|
858
|
+
width: "100%",
|
|
859
|
+
height: "100%",
|
|
860
|
+
display: "flex",
|
|
861
|
+
justifyContent: "center",
|
|
862
|
+
alignItems: "center"
|
|
863
|
+
},
|
|
864
|
+
children: /* @__PURE__ */ m("div", { id: "magic-sentence-root", children: [
|
|
865
|
+
f === "select" ? je() : null,
|
|
866
|
+
f === "time" ? Oe() : null,
|
|
867
|
+
f === "type" ? Fe() : null,
|
|
868
|
+
f === "getready" ? Ze() : null,
|
|
869
|
+
f === "play" ? Qe() : null,
|
|
870
|
+
f === "results" ? Xe() : null
|
|
871
|
+
] })
|
|
872
|
+
}
|
|
873
|
+
)
|
|
874
|
+
]
|
|
1142
875
|
}
|
|
1143
876
|
)
|
|
1144
877
|
}
|
|
1145
878
|
);
|
|
1146
879
|
}
|
|
1147
|
-
class
|
|
1148
|
-
constructor(
|
|
1149
|
-
super(
|
|
880
|
+
class cn extends Ye {
|
|
881
|
+
constructor(r) {
|
|
882
|
+
super(r), this.state = { hasError: !1 };
|
|
1150
883
|
}
|
|
1151
|
-
static getDerivedStateFromError(
|
|
884
|
+
static getDerivedStateFromError(r) {
|
|
1152
885
|
return {
|
|
1153
886
|
hasError: !0,
|
|
1154
|
-
error:
|
|
887
|
+
error: r
|
|
1155
888
|
};
|
|
1156
889
|
}
|
|
1157
|
-
componentDidCatch(
|
|
1158
|
-
console.error("Game Error:",
|
|
1159
|
-
error:
|
|
1160
|
-
errorInfo:
|
|
890
|
+
componentDidCatch(r, y) {
|
|
891
|
+
console.error("Game Error:", r, y), this.setState({
|
|
892
|
+
error: r,
|
|
893
|
+
errorInfo: y
|
|
1161
894
|
});
|
|
1162
895
|
}
|
|
1163
896
|
handleReset = () => {
|
|
1164
897
|
this.setState({ hasError: !1, error: void 0, errorInfo: void 0 });
|
|
1165
898
|
};
|
|
1166
899
|
render() {
|
|
1167
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
900
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ m("div", { style: {
|
|
1168
901
|
display: "flex",
|
|
1169
902
|
flexDirection: "column",
|
|
1170
903
|
alignItems: "center",
|
|
@@ -1176,9 +909,9 @@ class xn extends sn {
|
|
|
1176
909
|
color: "#dc2626",
|
|
1177
910
|
fontFamily: "system-ui, sans-serif"
|
|
1178
911
|
}, children: [
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
/* @__PURE__ */
|
|
912
|
+
/* @__PURE__ */ a("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
|
|
913
|
+
/* @__PURE__ */ a("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
|
|
914
|
+
/* @__PURE__ */ a(
|
|
1182
915
|
"button",
|
|
1183
916
|
{
|
|
1184
917
|
onClick: this.handleReset,
|
|
@@ -1192,14 +925,14 @@ class xn extends sn {
|
|
|
1192
925
|
cursor: "pointer",
|
|
1193
926
|
transition: "background-color 0.2s"
|
|
1194
927
|
},
|
|
1195
|
-
onMouseOver: (
|
|
1196
|
-
onMouseOut: (
|
|
928
|
+
onMouseOver: (r) => r.currentTarget.style.backgroundColor = "#b91c1c",
|
|
929
|
+
onMouseOut: (r) => r.currentTarget.style.backgroundColor = "#dc2626",
|
|
1197
930
|
children: "🔄 Restart Game"
|
|
1198
931
|
}
|
|
1199
932
|
),
|
|
1200
|
-
typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1202
|
-
/* @__PURE__ */
|
|
933
|
+
typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ m("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
|
|
934
|
+
/* @__PURE__ */ a("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
|
|
935
|
+
/* @__PURE__ */ m("pre", { style: {
|
|
1203
936
|
backgroundColor: "#f3f4f6",
|
|
1204
937
|
padding: "12px",
|
|
1205
938
|
borderRadius: "4px",
|
|
@@ -1215,12 +948,12 @@ class xn extends sn {
|
|
|
1215
948
|
}
|
|
1216
949
|
}
|
|
1217
950
|
export {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
951
|
+
cn as ErrorBoundary,
|
|
952
|
+
ln as Game,
|
|
953
|
+
E as announceToScreenReader,
|
|
954
|
+
en as createAriaLabel,
|
|
955
|
+
ln as default,
|
|
956
|
+
nn as handleKeyDown,
|
|
957
|
+
_e as useValidation
|
|
1225
958
|
};
|
|
1226
959
|
//# sourceMappingURL=speakid-build-a-sentence.es.js.map
|