speakid-build-a-sentence 1.0.1 → 1.0.2
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 +1 -1
- package/dist/Game.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.d.ts +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/speakid-build-a-sentence.es.js +446 -446
- package/dist/speakid-build-a-sentence.es.js.map +1 -1
- package/dist/speakid-build-a-sentence.umd.js +6 -6
- package/dist/speakid-build-a-sentence.umd.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import rn, { useState as g, useCallback as Ee, useRef as Ie, useEffect as ue, useMemo as on, Component as sn } from "react";
|
|
2
|
+
var ve = { exports: {} }, pe = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,27 +9,27 @@ var be = { exports: {} }, pe = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
26
|
-
type:
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
29
|
-
props:
|
|
12
|
+
var je;
|
|
13
|
+
function an() {
|
|
14
|
+
if (je) return pe;
|
|
15
|
+
je = 1;
|
|
16
|
+
var p = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
17
|
+
function S(T, 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: T,
|
|
27
|
+
key: P,
|
|
28
|
+
ref: W !== void 0 ? W : null,
|
|
29
|
+
props: w
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return pe.Fragment =
|
|
32
|
+
return pe.Fragment = l, pe.jsx = S, pe.jsxs = S, pe;
|
|
33
33
|
}
|
|
34
34
|
var fe = {};
|
|
35
35
|
/**
|
|
@@ -41,126 +41,126 @@ var fe = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
function
|
|
44
|
+
var Pe;
|
|
45
|
+
function dn() {
|
|
46
|
+
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function p(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof ===
|
|
50
|
+
return e.$$typeof === V ? null : e.displayName || e.name || null;
|
|
51
51
|
if (typeof e == "string") return e;
|
|
52
52
|
switch (e) {
|
|
53
|
-
case
|
|
53
|
+
case E:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case _:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case U:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case j:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case ae:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case $:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof e == "object")
|
|
67
67
|
switch (typeof e.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case ge:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case se:
|
|
73
73
|
return e.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case he:
|
|
75
75
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case j:
|
|
77
|
-
var i = e.render;
|
|
78
|
-
return e = e.displayName, e || (e = i.displayName || i.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
76
|
case me:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return p(e(a));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function l(e) {
|
|
91
91
|
return "" + e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function S(e) {
|
|
94
94
|
try {
|
|
95
|
-
|
|
96
|
-
var
|
|
95
|
+
l(e);
|
|
96
|
+
var a = !1;
|
|
97
97
|
} catch {
|
|
98
|
-
|
|
98
|
+
a = !0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
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
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
107
|
-
),
|
|
106
|
+
b
|
|
107
|
+
), l(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (e ===
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
110
|
+
function T(e) {
|
|
111
|
+
if (e === E) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var a = p(e);
|
|
116
|
+
return a ? "<" + a + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var e =
|
|
121
|
+
function W() {
|
|
122
|
+
var e = we.A;
|
|
123
123
|
return e === null ? null : e.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function w() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
128
|
+
function P(e) {
|
|
129
|
+
if (de.call(e, "key")) {
|
|
130
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (a && a.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
135
|
+
function R(e, a) {
|
|
136
|
+
function r() {
|
|
137
|
+
c || (c = !0, console.error(
|
|
138
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
|
-
|
|
139
|
+
a
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
r.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: r,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var e =
|
|
149
|
-
return
|
|
147
|
+
function f() {
|
|
148
|
+
var e = p(this.type);
|
|
149
|
+
return F[e] || (F[e] = !0, console.error(
|
|
150
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
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
153
|
+
function D(e, a, r, b, le, G) {
|
|
154
|
+
var x = r.ref;
|
|
155
155
|
return e = {
|
|
156
|
-
$$typeof:
|
|
156
|
+
$$typeof: oe,
|
|
157
157
|
type: e,
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
158
|
+
key: a,
|
|
159
|
+
props: r,
|
|
160
|
+
_owner: b
|
|
161
|
+
}, (x !== void 0 ? x : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
|
-
get:
|
|
163
|
+
get: f
|
|
164
164
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
165
|
configurable: !1,
|
|
166
166
|
enumerable: !1,
|
|
@@ -175,109 +175,109 @@ function an() {
|
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
178
|
+
value: le
|
|
179
179
|
}), Object.defineProperty(e, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: G
|
|
184
184
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function y(e, a, r, b, le, 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
|
+
I(x[b]);
|
|
193
|
+
Object.freeze && Object.freeze(x);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
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
197
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
198
|
+
else I(x);
|
|
199
|
+
if (de.call(a, "key")) {
|
|
200
|
+
x = p(e);
|
|
201
|
+
var O = Object.keys(a).filter(function(Se) {
|
|
202
|
+
return Se !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
b = 0 < O.length ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}", L[x + b] || (O = 0 < O.length ? "{" + O.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
),
|
|
211
|
+
b,
|
|
212
|
+
x,
|
|
213
|
+
O,
|
|
214
|
+
x
|
|
215
|
+
), L[x + b] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var ce in
|
|
220
|
-
ce !== "key" && (
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
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
224
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
-
),
|
|
225
|
+
), D(
|
|
226
226
|
e,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
x,
|
|
228
|
+
r,
|
|
229
|
+
W(),
|
|
230
|
+
le,
|
|
231
|
+
G
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
234
|
+
function I(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
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
237
|
+
function H(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === oe;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var B = rn, 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"), j = 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, de = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
B = {
|
|
244
244
|
react_stack_bottom_frame: function(e) {
|
|
245
245
|
return e();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
fe.Fragment =
|
|
253
|
-
var
|
|
254
|
-
return
|
|
248
|
+
var c, F = {}, X = B.react_stack_bottom_frame.bind(
|
|
249
|
+
B,
|
|
250
|
+
w
|
|
251
|
+
)(), xe = A(T(w)), L = {};
|
|
252
|
+
fe.Fragment = E, fe.jsx = function(e, a, r) {
|
|
253
|
+
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return y(
|
|
255
255
|
e,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
a,
|
|
257
|
+
r,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
b ? Error("react-stack-top-frame") : X,
|
|
260
|
+
b ? A(T(e)) : xe
|
|
261
261
|
);
|
|
262
|
-
}, fe.jsxs = function(e,
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, fe.jsxs = function(e, a, r) {
|
|
263
|
+
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return y(
|
|
265
265
|
e,
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
a,
|
|
267
|
+
r,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
b ? Error("react-stack-top-frame") : X,
|
|
270
|
+
b ? A(T(e)) : xe
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
273
|
})()), fe;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
function
|
|
277
|
-
return
|
|
275
|
+
var He;
|
|
276
|
+
function ln() {
|
|
277
|
+
return He || (He = 1, process.env.NODE_ENV === "production" ? ve.exports = an() : ve.exports = dn()), ve.exports;
|
|
278
278
|
}
|
|
279
|
-
var s =
|
|
280
|
-
const
|
|
279
|
+
var s = ln();
|
|
280
|
+
const cn = `
|
|
281
281
|
@keyframes magic-sentence-spin {
|
|
282
282
|
from { transform: rotate(0deg); }
|
|
283
283
|
to { transform: rotate(360deg); }
|
|
@@ -312,10 +312,10 @@ const ln = `
|
|
|
312
312
|
}
|
|
313
313
|
`;
|
|
314
314
|
if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
|
|
315
|
-
const
|
|
316
|
-
|
|
315
|
+
const p = document.createElement("style");
|
|
316
|
+
p.id = "magic-sentence-keyframes", p.innerHTML = cn, document.head.appendChild(p);
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const Ce = {
|
|
319
319
|
spin: {
|
|
320
320
|
animation: "magic-sentence-spin 1.4s linear infinite"
|
|
321
321
|
},
|
|
@@ -334,7 +334,7 @@ const He = {
|
|
|
334
334
|
glow: {
|
|
335
335
|
animation: "magic-sentence-glow 1s ease-in-out infinite"
|
|
336
336
|
}
|
|
337
|
-
},
|
|
337
|
+
}, h = {
|
|
338
338
|
gmCenterScreen: {
|
|
339
339
|
position: "relative",
|
|
340
340
|
zIndex: 1,
|
|
@@ -448,62 +448,62 @@ const He = {
|
|
|
448
448
|
},
|
|
449
449
|
gmHourglass: {
|
|
450
450
|
fontSize: "42px",
|
|
451
|
-
...
|
|
451
|
+
...Ce.spin
|
|
452
452
|
},
|
|
453
453
|
// ===== Анимационные стили =====
|
|
454
|
-
...
|
|
455
|
-
},
|
|
456
|
-
const [
|
|
457
|
-
const
|
|
458
|
-
|
|
454
|
+
...Ce
|
|
455
|
+
}, un = () => {
|
|
456
|
+
const [p, l] = g([]), S = Ee((w, P, R) => {
|
|
457
|
+
const f = [];
|
|
458
|
+
w.trim() || f.push({
|
|
459
459
|
type: "empty",
|
|
460
460
|
message: "Sentence cannot be empty"
|
|
461
|
-
}),
|
|
461
|
+
}), w.length > 41 && f.push({
|
|
462
462
|
type: "length",
|
|
463
|
-
message: `Sentence is too long (${
|
|
464
|
-
}),
|
|
463
|
+
message: `Sentence is too long (${w.length}/41 characters)`
|
|
464
|
+
}), w && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(w) && f.push({
|
|
465
465
|
type: "characters",
|
|
466
466
|
message: "Only Latin characters, numbers, spaces and punctuation are allowed"
|
|
467
467
|
});
|
|
468
|
-
const
|
|
469
|
-
return
|
|
468
|
+
const y = R.findIndex((I, H) => H !== P && I.toLowerCase().trim() === w.toLowerCase().trim());
|
|
469
|
+
return y !== -1 && f.push({
|
|
470
470
|
type: "duplicate",
|
|
471
|
-
message: `Duplicate sentence (same as sentence ${
|
|
472
|
-
}),
|
|
473
|
-
isValid:
|
|
474
|
-
errors:
|
|
471
|
+
message: `Duplicate sentence (same as sentence ${y + 1})`
|
|
472
|
+
}), l(f), {
|
|
473
|
+
isValid: f.length === 0,
|
|
474
|
+
errors: f
|
|
475
475
|
};
|
|
476
|
-
}, []),
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
const
|
|
480
|
-
|
|
481
|
-
...
|
|
482
|
-
message: `Sentence ${
|
|
476
|
+
}, []), T = Ee((w) => {
|
|
477
|
+
const P = [];
|
|
478
|
+
return w.forEach((R, f) => {
|
|
479
|
+
const D = S(R, f, w);
|
|
480
|
+
P.push(...D.errors.map((y) => ({
|
|
481
|
+
...y,
|
|
482
|
+
message: `Sentence ${f + 1}: ${y.message}`
|
|
483
483
|
})));
|
|
484
484
|
}), {
|
|
485
|
-
isValid:
|
|
486
|
-
errors:
|
|
485
|
+
isValid: P.length === 0,
|
|
486
|
+
errors: P
|
|
487
487
|
};
|
|
488
|
-
}, [
|
|
489
|
-
|
|
488
|
+
}, [S]), W = Ee(() => {
|
|
489
|
+
l([]);
|
|
490
490
|
}, []);
|
|
491
491
|
return {
|
|
492
|
-
errors:
|
|
493
|
-
validateSentence:
|
|
494
|
-
validateAllSentences:
|
|
495
|
-
clearErrors:
|
|
492
|
+
errors: p,
|
|
493
|
+
validateSentence: S,
|
|
494
|
+
validateAllSentences: T,
|
|
495
|
+
clearErrors: W
|
|
496
496
|
};
|
|
497
|
-
},
|
|
498
|
-
|
|
499
|
-
},
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
document.body.removeChild(
|
|
497
|
+
}, pn = (p, l, S) => l && S ? `${p} word "${l}" ${S}` : l ? `${p} word "${l}"` : p, fn = (p, l, S = ["Enter", " "]) => {
|
|
498
|
+
S.includes(p.key) && (p.preventDefault(), l());
|
|
499
|
+
}, Y = (p) => {
|
|
500
|
+
const l = document.createElement("div");
|
|
501
|
+
l.setAttribute("aria-live", "polite"), l.setAttribute("aria-atomic", "true"), l.style.position = "absolute", l.style.left = "-10000px", l.style.width = "1px", l.style.height = "1px", l.style.overflow = "hidden", document.body.appendChild(l), l.textContent = p, setTimeout(() => {
|
|
502
|
+
document.body.removeChild(l);
|
|
503
503
|
}, 1e3);
|
|
504
|
-
},
|
|
505
|
-
const
|
|
506
|
-
|
|
504
|
+
}, gn = () => {
|
|
505
|
+
const p = document.createElement("style");
|
|
506
|
+
p.textContent = `
|
|
507
507
|
#magic-sentence-root, #magic-sentence-root * {
|
|
508
508
|
box-sizing: border-box;
|
|
509
509
|
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
@@ -529,11 +529,11 @@ const He = {
|
|
|
529
529
|
height: 100% !important;
|
|
530
530
|
overflow: hidden !important;
|
|
531
531
|
}
|
|
532
|
-
`, document.head.appendChild(
|
|
533
|
-
},
|
|
534
|
-
function
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
532
|
+
`, document.head.appendChild(p);
|
|
533
|
+
}, hn = (p) => [...p].sort(() => Math.random() - 0.5);
|
|
534
|
+
function wn(p = {}) {
|
|
535
|
+
const { logoUrl: l, showLogo: S = !0, baseURL: T } = p, W = Ie(null), { validateAllSentences: w, errors: P } = un(), R = () => r || window.innerWidth < 768, f = () => r || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (n = "medium") => {
|
|
536
|
+
if (!f())
|
|
537
537
|
return {
|
|
538
538
|
padding: "12px 24px",
|
|
539
539
|
fontSize: "16px",
|
|
@@ -560,114 +560,114 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
ue(() => (
|
|
563
|
+
ue(() => (gn(), () => {
|
|
564
564
|
document.body.style.overflow = "";
|
|
565
565
|
}), []);
|
|
566
|
-
const [
|
|
566
|
+
const [y, I] = g("select"), [H, B] = g(null), [oe, ge] = g(null), [E, U] = g([]), [_, he] = g(0), [se, me] = g([]), [j, ae] = g([]), [z, J] = g(20), [$, V] = g(0), [we, de] = g(null), [M, A] = g(null), [c, F] = g(!1), [X, xe] = g(
|
|
567
567
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
568
|
-
),
|
|
568
|
+
), L = Ie(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [le, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q, Ae] = g(!1), [Z, De] = g(!1), [Q, _e] = g(!1), [K, Oe] = g(!1), [ee, ze] = g(!1), [ne, Me] = g(!1), [te, Le] = g(!1), [ie, Ne] = g(!1);
|
|
569
569
|
ue(() => {
|
|
570
570
|
const n = () => {
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
|
|
574
|
-
else if (
|
|
575
|
-
|
|
571
|
+
const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, d = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366, en = i === 1366 && t === 1024, nn = i >= 1200 && t >= 600 && !o;
|
|
572
|
+
if (Se(nn), Ae(v), De(k), _e(u), Oe(m), ze(re), Me(C), Le(Re), Ne(en), b(o), o)
|
|
573
|
+
O(null), G(1);
|
|
574
|
+
else if (d)
|
|
575
|
+
O(null), G(1);
|
|
576
576
|
else {
|
|
577
|
-
const
|
|
578
|
-
|
|
577
|
+
const tn = Math.min(1e3, Math.min(i, t) * 0.9);
|
|
578
|
+
O(tn), G(1);
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
581
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
582
582
|
}, []);
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
let
|
|
586
|
-
const
|
|
587
|
-
if (
|
|
588
|
-
const [
|
|
583
|
+
const ye = (n, i, t, o) => {
|
|
584
|
+
if (c) return;
|
|
585
|
+
let d = [...se], v = [...j];
|
|
586
|
+
const k = n === "bank" ? d : v, u = i === "bank" ? d : v, m = k.findIndex((Re) => Re.id === t);
|
|
587
|
+
if (m === -1) return;
|
|
588
|
+
const [re] = k.splice(m, 1);
|
|
589
589
|
let C = o;
|
|
590
|
-
n ===
|
|
591
|
-
},
|
|
592
|
-
if (n.preventDefault(),
|
|
593
|
-
|
|
590
|
+
n === i && C !== null && C !== void 0 && C > m && (C = C - 1), C == null || C < 0 || C > u.length ? u.push(re) : u.splice(C, 0, re), n === "bank" ? d = k : v = k, i === "bank" ? d = u : v = u, me(d), ae(v);
|
|
591
|
+
}, be = (n, i, t) => {
|
|
592
|
+
if (n.preventDefault(), c) {
|
|
593
|
+
a({ list: null, index: null, side: null });
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
596
596
|
const o = n.dataTransfer.getData("application/x-token") || (() => {
|
|
597
|
-
const
|
|
598
|
-
if (!
|
|
599
|
-
const
|
|
600
|
-
return
|
|
597
|
+
const d = n.dataTransfer.getData("text/plain");
|
|
598
|
+
if (!d) return "";
|
|
599
|
+
const v = se.some((m) => m.id === d), k = j.some((m) => m.id === d), u = v ? "bank" : k ? "selected" : null;
|
|
600
|
+
return u ? JSON.stringify({ from: u, id: d }) : "";
|
|
601
601
|
})();
|
|
602
602
|
if (o) {
|
|
603
603
|
try {
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
|
|
604
|
+
const d = JSON.parse(o);
|
|
605
|
+
if (!d || !d.id || !d.from) return;
|
|
606
|
+
ye(d.from, i, d.id, t);
|
|
607
607
|
} catch {
|
|
608
608
|
}
|
|
609
|
-
|
|
609
|
+
a({ list: null, index: null, side: null });
|
|
610
610
|
}
|
|
611
611
|
}, Be = (n) => {
|
|
612
|
-
|
|
613
|
-
},
|
|
614
|
-
|
|
615
|
-
},
|
|
616
|
-
if (
|
|
612
|
+
B(n), U(Array(n).fill("")), I("time");
|
|
613
|
+
}, $e = (n) => {
|
|
614
|
+
ge(n), I("type");
|
|
615
|
+
}, Fe = (n, i) => {
|
|
616
|
+
if (i.length > 41 || i && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(i))
|
|
617
617
|
return;
|
|
618
|
-
const o = [...
|
|
619
|
-
o[n] =
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
|
|
618
|
+
const o = [...E];
|
|
619
|
+
o[n] = i, U(o);
|
|
620
|
+
const d = w(o);
|
|
621
|
+
d.isValid || console.warn("Validation errors:", d.errors);
|
|
622
|
+
}, Ge = (n) => n.trim().replace(/\s+/g, " "), Te = (n) => n <= 3 ? 20 : n <= 5 ? 18 : n <= 7 ? 16 : n <= 9 ? 14 : 12, Ye = () => {
|
|
623
|
+
E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) => Ge(t))), V(0), he(0), de(null), I("getready"));
|
|
624
624
|
};
|
|
625
625
|
ue(() => {
|
|
626
|
-
if (
|
|
627
|
-
const n = setTimeout(() =>
|
|
626
|
+
if (y === "getready") {
|
|
627
|
+
const n = setTimeout(() => ke(0), 3e3);
|
|
628
628
|
return () => clearTimeout(n);
|
|
629
629
|
}
|
|
630
|
-
}, [
|
|
631
|
-
const
|
|
632
|
-
const
|
|
633
|
-
if (!
|
|
634
|
-
const o =
|
|
635
|
-
|
|
636
|
-
).map((
|
|
637
|
-
id: `${Date.now()}-${n}-${
|
|
638
|
-
text:
|
|
630
|
+
}, [y]);
|
|
631
|
+
const ke = (n) => {
|
|
632
|
+
const i = E[n];
|
|
633
|
+
if (!i) return;
|
|
634
|
+
const o = hn(
|
|
635
|
+
i.trim().split(/\s+/).filter(Boolean)
|
|
636
|
+
).map((d, v) => ({
|
|
637
|
+
id: `${Date.now()}-${n}-${v}-${Math.random().toString(36).slice(2)}`,
|
|
638
|
+
text: d
|
|
639
639
|
}));
|
|
640
|
-
|
|
640
|
+
me(o), ae([]), he(n), J(oe || 20), A(null), F(!1), I("play");
|
|
641
641
|
};
|
|
642
642
|
ue(() => {
|
|
643
|
-
if (
|
|
644
|
-
if (
|
|
645
|
-
|
|
643
|
+
if (y === "play" && !c)
|
|
644
|
+
if (L.current !== null && window.clearTimeout(L.current), z > 0)
|
|
645
|
+
L.current = window.setTimeout(() => J((n) => n - 1), 1e3);
|
|
646
646
|
else {
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
|
|
647
|
+
F(!0);
|
|
648
|
+
const i = E[_].trim().split(/\s+/), t = j.map((u) => u.text), o = i.filter((u) => !t.includes(u)).length, d = t.filter((u) => !i.includes(u)).length, v = i.filter((u, m) => u !== t[m]).length, k = o + d + v;
|
|
649
|
+
k === 0 ? (A("correct"), N("correct"), Y("Correct! Well done!")) : k === 1 ? (A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!"));
|
|
650
650
|
}
|
|
651
651
|
return () => {
|
|
652
|
-
|
|
652
|
+
L.current !== null && window.clearTimeout(L.current);
|
|
653
653
|
};
|
|
654
|
-
}, [
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
|
|
654
|
+
}, [y, z, c, E, _, j]);
|
|
655
|
+
const Ue = (n = !0) => {
|
|
656
|
+
if (c && n) {
|
|
657
|
+
_ + 1 < (H || 0) ? ke(_ + 1) : (I("results"), setTimeout(() => We(), 600));
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
|
-
if (n && !
|
|
661
|
-
const t =
|
|
662
|
-
|
|
660
|
+
if (n && !c) {
|
|
661
|
+
const t = E[_].trim().split(/\s+/), o = j.map((m) => m.text), d = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length, u = d + v + k;
|
|
662
|
+
u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (I("results"), setTimeout(() => We(), 600));
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
665
|
ue(() => {
|
|
666
|
-
|
|
667
|
-
}, [
|
|
668
|
-
const
|
|
669
|
-
const
|
|
670
|
-
switch (t.connect(o), o.connect(
|
|
666
|
+
y === "results" && $ > X && (xe($), localStorage.setItem("magicSentenceBest", String($)));
|
|
667
|
+
}, [y, $, X]);
|
|
668
|
+
const N = (n) => {
|
|
669
|
+
const i = new (window.AudioContext || window.webkitAudioContext)(), t = i.createOscillator(), o = i.createGain();
|
|
670
|
+
switch (t.connect(o), o.connect(i.destination), n) {
|
|
671
671
|
case "start":
|
|
672
672
|
t.frequency.value = 500;
|
|
673
673
|
break;
|
|
@@ -684,37 +684,37 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
684
684
|
t.frequency.value = 200;
|
|
685
685
|
break;
|
|
686
686
|
}
|
|
687
|
-
o.gain.setValueAtTime(0.1,
|
|
688
|
-
},
|
|
689
|
-
const
|
|
687
|
+
o.gain.setValueAtTime(0.1, i.currentTime), t.start(), t.stop(i.currentTime + 0.2);
|
|
688
|
+
}, We = () => {
|
|
689
|
+
const i = Date.now() + 2500, t = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], o = document.createElement("canvas"), d = o.getContext("2d");
|
|
690
690
|
o.width = window.innerWidth, o.height = window.innerHeight, o.style.position = "fixed", o.style.top = "0", o.style.left = "0", o.style.pointerEvents = "none", document.body.appendChild(o);
|
|
691
|
-
const
|
|
691
|
+
const v = Array.from({ length: 100 }).map(() => ({
|
|
692
692
|
x: Math.random() * o.width,
|
|
693
693
|
y: Math.random() * o.height - o.height,
|
|
694
694
|
size: 6 + Math.random() * 6,
|
|
695
695
|
color: t[Math.floor(Math.random() * t.length)],
|
|
696
696
|
speed: 2 + Math.random() * 4,
|
|
697
697
|
tilt: Math.random() * 2 * Math.PI
|
|
698
|
-
})),
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
}), Date.now() <
|
|
698
|
+
})), k = () => {
|
|
699
|
+
d.clearRect(0, 0, o.width, o.height), v.forEach((u) => {
|
|
700
|
+
d.fillStyle = u.color, d.beginPath(), d.ellipse(u.x, u.y, u.size, u.size / 2, u.tilt, 0, 2 * Math.PI), d.fill(), u.y += u.speed, u.x += Math.sin(u.tilt);
|
|
701
|
+
}), Date.now() < i ? requestAnimationFrame(k) : document.body.removeChild(o);
|
|
702
702
|
};
|
|
703
|
-
|
|
704
|
-
}, Je = () => /* @__PURE__ */ s.jsxs("div", { style:
|
|
705
|
-
/* @__PURE__ */ s.jsx("h1", { style:
|
|
706
|
-
/* @__PURE__ */ s.jsx("p", { style:
|
|
703
|
+
k();
|
|
704
|
+
}, Je = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
705
|
+
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
706
|
+
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select number of rounds" }),
|
|
707
707
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
708
708
|
display: "flex",
|
|
709
|
-
gap:
|
|
709
|
+
gap: f() ? "8px" : "16px",
|
|
710
710
|
justifyContent: "center"
|
|
711
711
|
}, children: [3, 4, 5].map((n) => /* @__PURE__ */ s.jsxs(
|
|
712
712
|
"button",
|
|
713
713
|
{
|
|
714
714
|
onClick: () => Be(n),
|
|
715
715
|
style: {
|
|
716
|
-
...
|
|
717
|
-
...
|
|
716
|
+
...h.gmButton,
|
|
717
|
+
...D("medium")
|
|
718
718
|
},
|
|
719
719
|
children: [
|
|
720
720
|
n,
|
|
@@ -723,20 +723,20 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
723
723
|
},
|
|
724
724
|
n
|
|
725
725
|
)) })
|
|
726
|
-
] }), Ve = () => /* @__PURE__ */ s.jsxs("div", { style:
|
|
727
|
-
/* @__PURE__ */ s.jsx("h1", { style:
|
|
728
|
-
/* @__PURE__ */ s.jsx("p", { style:
|
|
726
|
+
] }), Ve = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
727
|
+
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
728
|
+
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select time per round" }),
|
|
729
729
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
730
730
|
display: "flex",
|
|
731
|
-
gap:
|
|
731
|
+
gap: f() ? "8px" : "16px",
|
|
732
732
|
justifyContent: "center"
|
|
733
733
|
}, children: [15, 20, 30].map((n) => /* @__PURE__ */ s.jsxs(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
|
-
onClick: () =>
|
|
736
|
+
onClick: () => $e(n),
|
|
737
737
|
style: {
|
|
738
|
-
...
|
|
739
|
-
...
|
|
738
|
+
...h.gmButton,
|
|
739
|
+
...D("medium")
|
|
740
740
|
},
|
|
741
741
|
children: [
|
|
742
742
|
n,
|
|
@@ -745,15 +745,15 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
745
745
|
},
|
|
746
746
|
n
|
|
747
747
|
)) })
|
|
748
|
-
] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style:
|
|
749
|
-
/* @__PURE__ */ s.jsxs("h2", { style: { ...
|
|
748
|
+
] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
749
|
+
/* @__PURE__ */ s.jsxs("h2", { style: { ...h.gmBodyM, marginBottom: "0px" }, children: [
|
|
750
750
|
"Type down ",
|
|
751
|
-
|
|
751
|
+
H,
|
|
752
752
|
" sentence",
|
|
753
|
-
|
|
753
|
+
H && H > 1 ? "s" : "",
|
|
754
754
|
" for your student"
|
|
755
755
|
] }),
|
|
756
|
-
/* @__PURE__ */ s.jsx("p", { style: { ...
|
|
756
|
+
/* @__PURE__ */ s.jsx("p", { style: { ...h.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
|
|
757
757
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
758
758
|
display: "flex",
|
|
759
759
|
flexDirection: "column",
|
|
@@ -764,78 +764,78 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
764
764
|
// Минимальная ширина по содержимому
|
|
765
765
|
maxWidth: "600px"
|
|
766
766
|
// Ограничиваем максимальную ширину
|
|
767
|
-
}, children:
|
|
767
|
+
}, children: E.map((n, i) => /* @__PURE__ */ s.jsx(
|
|
768
768
|
"input",
|
|
769
769
|
{
|
|
770
770
|
value: n,
|
|
771
|
-
placeholder: `Sentence ${
|
|
772
|
-
onChange: (t) =>
|
|
771
|
+
placeholder: `Sentence ${i + 1}`,
|
|
772
|
+
onChange: (t) => Fe(i, t.target.value),
|
|
773
773
|
style: {
|
|
774
|
-
...
|
|
775
|
-
padding:
|
|
776
|
-
fontSize:
|
|
774
|
+
...h.gmInput,
|
|
775
|
+
padding: f() ? "8px 12px" : "12px 16px",
|
|
776
|
+
fontSize: f() ? "14px" : "16px",
|
|
777
777
|
width: "100%",
|
|
778
778
|
// Поля теперь будут шире благодаря увеличенной ширине контейнера
|
|
779
779
|
textAlign: "center"
|
|
780
780
|
// Центрируем placeholder текст
|
|
781
781
|
}
|
|
782
782
|
},
|
|
783
|
-
|
|
783
|
+
i
|
|
784
784
|
)) }),
|
|
785
785
|
/* @__PURE__ */ s.jsx(
|
|
786
786
|
"button",
|
|
787
787
|
{
|
|
788
|
-
onClick:
|
|
789
|
-
disabled:
|
|
788
|
+
onClick: Ye,
|
|
789
|
+
disabled: E.some((n) => n.trim().length === 0),
|
|
790
790
|
style: {
|
|
791
|
-
...
|
|
791
|
+
...h.gmButton,
|
|
792
792
|
marginTop: 30,
|
|
793
|
-
background:
|
|
794
|
-
cursor:
|
|
795
|
-
...
|
|
793
|
+
background: E.some((n) => n.trim().length === 0) ? "#ccc" : "#ec4c44",
|
|
794
|
+
cursor: E.some((n) => n.trim().length === 0) ? "not-allowed" : "pointer",
|
|
795
|
+
...D("large")
|
|
796
796
|
},
|
|
797
797
|
children: "PLAY"
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
|
-
] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style:
|
|
800
|
+
] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmReadyWrapper, children: [
|
|
801
801
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
802
|
-
...
|
|
803
|
-
fontSize:
|
|
802
|
+
...h.gmHeadline1,
|
|
803
|
+
fontSize: f() ? "36px" : "72px",
|
|
804
804
|
color: "#ec4c44",
|
|
805
805
|
marginBottom: "20px",
|
|
806
806
|
animation: "pulse 1s ease-in-out infinite"
|
|
807
807
|
}, children: "GET READY" }),
|
|
808
|
-
/* @__PURE__ */ s.jsx("div", { style:
|
|
809
|
-
] }),
|
|
808
|
+
/* @__PURE__ */ s.jsx("div", { style: h.gmHourglass, children: "⏳" })
|
|
809
|
+
] }), Ze = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmGameLayout, children: [
|
|
810
810
|
/* @__PURE__ */ s.jsxs("h2", { style: {
|
|
811
|
-
marginBottom:
|
|
812
|
-
fontSize:
|
|
811
|
+
marginBottom: f() ? "5px" : "10px",
|
|
812
|
+
fontSize: f() ? "16px" : "20px"
|
|
813
813
|
}, children: [
|
|
814
814
|
"Round ",
|
|
815
|
-
|
|
815
|
+
_ + 1,
|
|
816
816
|
"/",
|
|
817
|
-
|
|
817
|
+
H,
|
|
818
818
|
" — ",
|
|
819
|
-
|
|
819
|
+
c ? "TIME'S UP!" : `Time: ${z}s`
|
|
820
820
|
] }),
|
|
821
821
|
/* @__PURE__ */ s.jsx(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
824
|
style: {
|
|
825
825
|
width: "60%",
|
|
826
|
-
height:
|
|
826
|
+
height: f() ? "8px" : "14px",
|
|
827
827
|
borderRadius: 8,
|
|
828
828
|
background: "#eee",
|
|
829
829
|
overflow: "hidden",
|
|
830
|
-
marginBottom:
|
|
830
|
+
marginBottom: f() ? "10px" : "20px"
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ s.jsx(
|
|
833
833
|
"div",
|
|
834
834
|
{
|
|
835
835
|
style: {
|
|
836
836
|
height: "100%",
|
|
837
|
-
width: `${
|
|
838
|
-
background:
|
|
837
|
+
width: `${z / (oe || 20) * 100}%`,
|
|
838
|
+
background: z <= 5 ? "#ec4c44" : "#4caf50",
|
|
839
839
|
transition: "width 1s linear"
|
|
840
840
|
}
|
|
841
841
|
}
|
|
@@ -846,63 +846,63 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
846
846
|
"div",
|
|
847
847
|
{
|
|
848
848
|
onDragOver: (n) => n.preventDefault(),
|
|
849
|
-
onDrop: (n) =>
|
|
849
|
+
onDrop: (n) => be(n, "bank", null),
|
|
850
850
|
style: {
|
|
851
851
|
display: "flex",
|
|
852
|
-
flexWrap:
|
|
853
|
-
gap:
|
|
852
|
+
flexWrap: R() ? "wrap" : "nowrap",
|
|
853
|
+
gap: r || window.innerWidth < 768 ? "6px" : "10px",
|
|
854
854
|
justifyContent: "center",
|
|
855
|
-
marginBottom:
|
|
856
|
-
padding:
|
|
855
|
+
marginBottom: r || window.innerWidth < 768 ? "15px" : "30px",
|
|
856
|
+
padding: r || window.innerWidth < 768 ? "5px" : "10px",
|
|
857
857
|
width: "100%",
|
|
858
858
|
boxSizing: "border-box"
|
|
859
859
|
},
|
|
860
|
-
children:
|
|
860
|
+
children: se.map((n, i) => /* @__PURE__ */ s.jsx(
|
|
861
861
|
"div",
|
|
862
862
|
{
|
|
863
|
-
draggable: !
|
|
863
|
+
draggable: !c,
|
|
864
864
|
role: "button",
|
|
865
|
-
tabIndex:
|
|
866
|
-
"aria-label":
|
|
865
|
+
tabIndex: c ? -1 : 0,
|
|
866
|
+
"aria-label": c ? `Word: ${n.text} (time expired)` : pn("Drag word", n.text, "to build sentence"),
|
|
867
867
|
onDragStart: (t) => {
|
|
868
|
-
if (
|
|
868
|
+
if (c) {
|
|
869
869
|
t.preventDefault();
|
|
870
870
|
return;
|
|
871
871
|
}
|
|
872
872
|
t.dataTransfer.setData(
|
|
873
873
|
"application/x-token",
|
|
874
874
|
JSON.stringify({ from: "bank", id: n.id })
|
|
875
|
-
), t.dataTransfer.setData("text/plain", n.id),
|
|
875
|
+
), t.dataTransfer.setData("text/plain", n.id), Y(`Dragging word: ${n.text}`);
|
|
876
876
|
},
|
|
877
877
|
onKeyDown: (t) => {
|
|
878
|
-
|
|
878
|
+
c || fn(t, () => ye("bank", "selected", n.id, null));
|
|
879
879
|
},
|
|
880
880
|
onDragOver: (t) => t.preventDefault(),
|
|
881
881
|
onDrop: (t) => {
|
|
882
|
-
const o = t.currentTarget.getBoundingClientRect(),
|
|
883
|
-
|
|
882
|
+
const o = t.currentTarget.getBoundingClientRect(), d = o.left + o.width / 2, v = t.clientX > d ? i + 1 : i;
|
|
883
|
+
a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "bank", v);
|
|
884
884
|
},
|
|
885
885
|
onDragEnter: (t) => {
|
|
886
|
-
if (
|
|
887
|
-
const o = t.currentTarget.getBoundingClientRect(),
|
|
888
|
-
|
|
886
|
+
if (c) return;
|
|
887
|
+
const o = t.currentTarget.getBoundingClientRect(), d = o.left + o.width / 2;
|
|
888
|
+
a({ list: "bank", index: i, side: t.clientX > d ? "right" : "left" });
|
|
889
889
|
},
|
|
890
|
-
onDragLeave: () =>
|
|
890
|
+
onDragLeave: () => a({ list: null, index: null, side: null }),
|
|
891
891
|
onClick: () => {
|
|
892
|
-
|
|
892
|
+
c || ye("bank", "selected", n.id, null);
|
|
893
893
|
},
|
|
894
894
|
style: {
|
|
895
|
-
padding:
|
|
896
|
-
borderRadius:
|
|
895
|
+
padding: r || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
|
|
896
|
+
borderRadius: r || window.innerWidth < 768 ? "6px" : "10px",
|
|
897
897
|
border: "1px solid #ccc",
|
|
898
|
-
background:
|
|
899
|
-
cursor:
|
|
900
|
-
fontSize:
|
|
901
|
-
borderLeft:
|
|
902
|
-
borderRight:
|
|
898
|
+
background: c ? "#f0f0f0" : "#f9f9f9",
|
|
899
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
900
|
+
fontSize: r || window.innerWidth < 768 ? "12px" : "18px",
|
|
901
|
+
borderLeft: e.list === "bank" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
902
|
+
borderRight: e.list === "bank" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
903
903
|
flexShrink: 0,
|
|
904
904
|
flexBasis: "auto",
|
|
905
|
-
opacity:
|
|
905
|
+
opacity: c ? 0.6 : 1,
|
|
906
906
|
transition: "opacity 0.3s ease"
|
|
907
907
|
},
|
|
908
908
|
children: n.text
|
|
@@ -915,33 +915,33 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
915
915
|
"div",
|
|
916
916
|
{
|
|
917
917
|
onDragOver: (n) => n.preventDefault(),
|
|
918
|
-
onDrop: (n) =>
|
|
918
|
+
onDrop: (n) => be(n, "selected", null),
|
|
919
919
|
style: {
|
|
920
|
-
minHeight:
|
|
920
|
+
minHeight: r || window.innerWidth < 768 ? "50px" : "70px",
|
|
921
921
|
width: "auto",
|
|
922
922
|
// Автоматическая ширина в зависимости от содержимого
|
|
923
923
|
maxWidth: "none",
|
|
924
924
|
// Убираем ограничение максимальной ширины
|
|
925
925
|
minWidth: "245px",
|
|
926
926
|
// Минимальная ширина для растягивания
|
|
927
|
-
border:
|
|
928
|
-
borderRadius:
|
|
929
|
-
padding:
|
|
927
|
+
border: M === "correct" ? "2px dashed #4caf50" : M === "almost" ? "2px dashed #ff9800" : M === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
|
|
928
|
+
borderRadius: r || window.innerWidth < 768 ? "8px" : "12px",
|
|
929
|
+
padding: r || window.innerWidth < 768 ? "8px" : "12px",
|
|
930
930
|
display: "flex",
|
|
931
|
-
flexWrap:
|
|
931
|
+
flexWrap: R() ? "wrap" : "nowrap",
|
|
932
932
|
alignItems: "center",
|
|
933
933
|
justifyContent: "center",
|
|
934
934
|
fontSize: `${Te(j.length)}px`,
|
|
935
|
-
background:
|
|
936
|
-
overflowX:
|
|
937
|
-
whiteSpace:
|
|
935
|
+
background: M === "correct" ? "#e8f5e8" : M === "almost" ? "#fff3e0" : M === "wrong" ? "#ffebee" : "#fafafa",
|
|
936
|
+
overflowX: R() ? "hidden" : "auto",
|
|
937
|
+
whiteSpace: R() ? "normal" : "nowrap"
|
|
938
938
|
},
|
|
939
|
-
children: j.map((n,
|
|
939
|
+
children: j.map((n, i) => /* @__PURE__ */ s.jsx(
|
|
940
940
|
"span",
|
|
941
941
|
{
|
|
942
|
-
draggable: !
|
|
942
|
+
draggable: !c,
|
|
943
943
|
onDragStart: (t) => {
|
|
944
|
-
if (
|
|
944
|
+
if (c) {
|
|
945
945
|
t.preventDefault();
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
@@ -952,28 +952,28 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
952
952
|
},
|
|
953
953
|
onDragOver: (t) => t.preventDefault(),
|
|
954
954
|
onDrop: (t) => {
|
|
955
|
-
const o = t.currentTarget.getBoundingClientRect(),
|
|
956
|
-
|
|
955
|
+
const o = t.currentTarget.getBoundingClientRect(), d = o.left + o.width / 2, v = t.clientX > d ? i + 1 : i;
|
|
956
|
+
a({ list: null, index: null, side: null }), t.stopPropagation(), be(t, "selected", v);
|
|
957
957
|
},
|
|
958
958
|
onDragEnter: (t) => {
|
|
959
|
-
if (
|
|
960
|
-
const o = t.currentTarget.getBoundingClientRect(),
|
|
961
|
-
|
|
959
|
+
if (c) return;
|
|
960
|
+
const o = t.currentTarget.getBoundingClientRect(), d = o.left + o.width / 2;
|
|
961
|
+
a({ list: "selected", index: i, side: t.clientX > d ? "right" : "left" });
|
|
962
962
|
},
|
|
963
|
-
onDragLeave: () =>
|
|
963
|
+
onDragLeave: () => a({ list: null, index: null, side: null }),
|
|
964
964
|
onClick: () => {
|
|
965
|
-
|
|
965
|
+
c || ye("selected", "bank", n.id, null);
|
|
966
966
|
},
|
|
967
|
-
title:
|
|
967
|
+
title: c ? "Time expired" : "Click to remove back to bank",
|
|
968
968
|
style: {
|
|
969
|
-
padding:
|
|
970
|
-
margin:
|
|
971
|
-
borderRadius:
|
|
972
|
-
background:
|
|
973
|
-
border:
|
|
974
|
-
borderLeft:
|
|
975
|
-
borderRight:
|
|
976
|
-
cursor:
|
|
969
|
+
padding: f() ? "4px 6px" : "6px 10px",
|
|
970
|
+
margin: f() ? "2px" : "4px",
|
|
971
|
+
borderRadius: f() ? "4px" : "8px",
|
|
972
|
+
background: c ? "#f0f0f0" : "#ffe9e7",
|
|
973
|
+
border: c ? "1px solid #ccc" : "1px solid #ec4c44",
|
|
974
|
+
borderLeft: e.list === "selected" && e.index === i && e.side === "left" ? "3px solid #3b82f6" : void 0,
|
|
975
|
+
borderRight: e.list === "selected" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : void 0,
|
|
976
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
977
977
|
userSelect: "none",
|
|
978
978
|
fontSize: `${Te(j.length)}px`,
|
|
979
979
|
// Адаптивный размер шрифта для слов
|
|
@@ -981,7 +981,7 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
981
981
|
// Более плотный шрифт
|
|
982
982
|
whiteSpace: "nowrap",
|
|
983
983
|
// Запрещаем перенос слов
|
|
984
|
-
opacity:
|
|
984
|
+
opacity: c ? 0.6 : 1,
|
|
985
985
|
transition: "opacity 0.3s ease"
|
|
986
986
|
},
|
|
987
987
|
children: n.text
|
|
@@ -993,65 +993,65 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
993
993
|
/* @__PURE__ */ s.jsx(
|
|
994
994
|
"button",
|
|
995
995
|
{
|
|
996
|
-
onClick: () =>
|
|
997
|
-
disabled: !
|
|
996
|
+
onClick: () => Ue(!0),
|
|
997
|
+
disabled: !c && j.length === 0,
|
|
998
998
|
style: {
|
|
999
|
-
marginTop:
|
|
1000
|
-
fontSize:
|
|
1001
|
-
padding:
|
|
1002
|
-
borderRadius:
|
|
1003
|
-
background:
|
|
999
|
+
marginTop: f() ? "15px" : "30px",
|
|
1000
|
+
fontSize: f() ? "14px" : "20px",
|
|
1001
|
+
padding: f() ? "6px 12px" : "10px 24px",
|
|
1002
|
+
borderRadius: f() ? "8px" : "12px",
|
|
1003
|
+
background: c || j.length > 0 ? "#ec4c44" : "#ccc",
|
|
1004
1004
|
color: "white",
|
|
1005
1005
|
border: "none",
|
|
1006
|
-
cursor:
|
|
1006
|
+
cursor: c || j.length > 0 ? "pointer" : "not-allowed"
|
|
1007
1007
|
},
|
|
1008
1008
|
children: "NEXT"
|
|
1009
1009
|
}
|
|
1010
1010
|
)
|
|
1011
|
-
] }),
|
|
1011
|
+
] }), Qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
1012
1012
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
1013
|
-
...
|
|
1014
|
-
marginTop: (
|
|
1015
|
-
marginBottom:
|
|
1016
|
-
fontSize:
|
|
1013
|
+
...h.gmHeadline1,
|
|
1014
|
+
marginTop: (r && 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 || q || Z || Q || K || ee || ne || te || ie, "0px"),
|
|
1015
|
+
marginBottom: r && 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 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "10px",
|
|
1016
|
+
fontSize: r && 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
1017
|
}, children: "Game Over 🎯" }),
|
|
1018
1018
|
/* @__PURE__ */ s.jsxs("h2", { style: {
|
|
1019
|
-
...
|
|
1020
|
-
marginTop: (
|
|
1021
|
-
marginBottom:
|
|
1022
|
-
fontSize:
|
|
1019
|
+
...h.gmHeadline2,
|
|
1020
|
+
marginTop: (r && 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 || q || Z || Q || K || ee || ne || te || ie, "0px"),
|
|
1021
|
+
marginBottom: r && 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 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
|
|
1022
|
+
fontSize: r && 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
1023
|
}, children: [
|
|
1024
1024
|
"Your score: ",
|
|
1025
|
-
|
|
1025
|
+
$,
|
|
1026
1026
|
" out of ",
|
|
1027
|
-
|
|
1027
|
+
H
|
|
1028
1028
|
] }),
|
|
1029
1029
|
/* @__PURE__ */ s.jsxs("p", { style: {
|
|
1030
|
-
...
|
|
1030
|
+
...h.gmBodyM,
|
|
1031
1031
|
color: "#10b981",
|
|
1032
|
-
marginTop:
|
|
1033
|
-
marginBottom:
|
|
1034
|
-
fontSize:
|
|
1032
|
+
marginTop: r && 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 || q || Z || Q || K || ee || ne || te || ie ? "0px" : "12px",
|
|
1033
|
+
marginBottom: r && 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 || q || Z || Q || K || ee || ne || te || ie ? "2px" : "16px",
|
|
1034
|
+
fontSize: r && 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
1035
|
}, children: [
|
|
1036
1036
|
"Best score: ",
|
|
1037
|
-
|
|
1037
|
+
X
|
|
1038
1038
|
] }),
|
|
1039
1039
|
/* @__PURE__ */ s.jsxs("div", { style: {
|
|
1040
1040
|
display: "flex",
|
|
1041
|
-
gap:
|
|
1042
|
-
marginTop:
|
|
1041
|
+
gap: r && window.innerWidth > window.innerHeight || r && 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",
|
|
1042
|
+
marginTop: r && window.innerWidth > window.innerHeight || r && 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 || ce ? "12px" : "24px"
|
|
1043
1043
|
}, children: [
|
|
1044
1044
|
/* @__PURE__ */ s.jsx(
|
|
1045
1045
|
"button",
|
|
1046
1046
|
{
|
|
1047
1047
|
onClick: () => {
|
|
1048
|
-
|
|
1049
|
-
|
|
1048
|
+
We(), N("start"), setTimeout(() => {
|
|
1049
|
+
I("getready"), de(null), F(!1);
|
|
1050
1050
|
}, 800);
|
|
1051
1051
|
},
|
|
1052
1052
|
style: {
|
|
1053
|
-
...
|
|
1054
|
-
...
|
|
1053
|
+
...h.gmButton,
|
|
1054
|
+
...D("medium")
|
|
1055
1055
|
},
|
|
1056
1056
|
children: "🔁 Play again"
|
|
1057
1057
|
}
|
|
@@ -1060,38 +1060,38 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
1060
1060
|
"button",
|
|
1061
1061
|
{
|
|
1062
1062
|
onClick: () => {
|
|
1063
|
-
|
|
1063
|
+
N("click"), I("select"), B(null), ge(null), U([]), V(0), ae([]), F(!1);
|
|
1064
1064
|
},
|
|
1065
1065
|
style: {
|
|
1066
|
-
...
|
|
1067
|
-
...
|
|
1066
|
+
...h.gmButton,
|
|
1067
|
+
...D("medium")
|
|
1068
1068
|
},
|
|
1069
1069
|
children: "⬅️ Exit"
|
|
1070
1070
|
}
|
|
1071
1071
|
)
|
|
1072
1072
|
] })
|
|
1073
|
-
] }),
|
|
1073
|
+
] }), Ke = on(
|
|
1074
1074
|
() => {
|
|
1075
|
-
let n =
|
|
1076
|
-
return !n &&
|
|
1077
|
-
...
|
|
1078
|
-
display: !
|
|
1075
|
+
let n = l;
|
|
1076
|
+
return !n && T && (n = `${T.endsWith("/") ? T.slice(0, -1) : T}/logo.svg`), /* @__PURE__ */ s.jsx("div", { style: {
|
|
1077
|
+
...h.gmLogoFixed,
|
|
1078
|
+
display: !S || r && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "none" : "block"
|
|
1079
1079
|
}, children: n ? /* @__PURE__ */ s.jsx(
|
|
1080
1080
|
"img",
|
|
1081
1081
|
{
|
|
1082
1082
|
src: n,
|
|
1083
1083
|
alt: "SPEAKID Logo",
|
|
1084
|
-
style:
|
|
1084
|
+
style: h.gmLogoImg,
|
|
1085
1085
|
loading: "lazy"
|
|
1086
1086
|
}
|
|
1087
|
-
) : /* @__PURE__ */ s.jsx("div", { style:
|
|
1087
|
+
) : /* @__PURE__ */ s.jsx("div", { style: h.gmLogoImg, children: "SPEAKID" }) });
|
|
1088
1088
|
},
|
|
1089
|
-
[
|
|
1089
|
+
[r, S, l, T]
|
|
1090
1090
|
);
|
|
1091
1091
|
return /* @__PURE__ */ s.jsx(
|
|
1092
1092
|
"div",
|
|
1093
1093
|
{
|
|
1094
|
-
ref:
|
|
1094
|
+
ref: W,
|
|
1095
1095
|
style: {
|
|
1096
1096
|
width: "100%",
|
|
1097
1097
|
height: "100%",
|
|
@@ -1111,16 +1111,16 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
1111
1111
|
"div",
|
|
1112
1112
|
{
|
|
1113
1113
|
style: {
|
|
1114
|
-
width:
|
|
1115
|
-
height:
|
|
1114
|
+
width: r ? "100%" : x || 1e3,
|
|
1115
|
+
height: r ? "100%" : x || 1e3,
|
|
1116
1116
|
display: "flex",
|
|
1117
1117
|
justifyContent: "center",
|
|
1118
1118
|
alignItems: "center",
|
|
1119
1119
|
overflow: "hidden",
|
|
1120
|
-
borderRadius:
|
|
1120
|
+
borderRadius: r ? 0 : "20px",
|
|
1121
1121
|
background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
|
|
1122
|
-
boxShadow:
|
|
1123
|
-
margin:
|
|
1122
|
+
boxShadow: r ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
1123
|
+
margin: r ? "0 auto" : "unset",
|
|
1124
1124
|
position: "relative"
|
|
1125
1125
|
},
|
|
1126
1126
|
children: /* @__PURE__ */ s.jsx(
|
|
@@ -1135,13 +1135,13 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
1135
1135
|
alignItems: "center"
|
|
1136
1136
|
},
|
|
1137
1137
|
children: /* @__PURE__ */ s.jsxs("div", { id: "magic-sentence-root", children: [
|
|
1138
|
-
!
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1138
|
+
!r && Ke,
|
|
1139
|
+
y === "select" && Je(),
|
|
1140
|
+
y === "time" && Ve(),
|
|
1141
|
+
y === "type" && Xe(),
|
|
1142
|
+
y === "getready" && qe(),
|
|
1143
|
+
y === "play" && Ze(),
|
|
1144
|
+
y === "results" && Qe()
|
|
1145
1145
|
] })
|
|
1146
1146
|
}
|
|
1147
1147
|
)
|
|
@@ -1150,20 +1150,20 @@ function mn({ logoUrl: u, showLogo: d = !0, baseURL: m } = {}) {
|
|
|
1150
1150
|
}
|
|
1151
1151
|
);
|
|
1152
1152
|
}
|
|
1153
|
-
class
|
|
1154
|
-
constructor(
|
|
1155
|
-
super(
|
|
1153
|
+
class xn extends sn {
|
|
1154
|
+
constructor(l) {
|
|
1155
|
+
super(l), this.state = { hasError: !1 };
|
|
1156
1156
|
}
|
|
1157
|
-
static getDerivedStateFromError(
|
|
1157
|
+
static getDerivedStateFromError(l) {
|
|
1158
1158
|
return {
|
|
1159
1159
|
hasError: !0,
|
|
1160
|
-
error:
|
|
1160
|
+
error: l
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
|
-
componentDidCatch(
|
|
1164
|
-
console.error("Game Error:",
|
|
1165
|
-
error:
|
|
1166
|
-
errorInfo:
|
|
1163
|
+
componentDidCatch(l, S) {
|
|
1164
|
+
console.error("Game Error:", l, S), this.setState({
|
|
1165
|
+
error: l,
|
|
1166
|
+
errorInfo: S
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
1169
|
handleReset = () => {
|
|
@@ -1198,8 +1198,8 @@ class wn extends on {
|
|
|
1198
1198
|
cursor: "pointer",
|
|
1199
1199
|
transition: "background-color 0.2s"
|
|
1200
1200
|
},
|
|
1201
|
-
onMouseOver: (
|
|
1202
|
-
onMouseOut: (
|
|
1201
|
+
onMouseOver: (l) => l.currentTarget.style.backgroundColor = "#b91c1c",
|
|
1202
|
+
onMouseOut: (l) => l.currentTarget.style.backgroundColor = "#dc2626",
|
|
1203
1203
|
children: "🔄 Restart Game"
|
|
1204
1204
|
}
|
|
1205
1205
|
),
|
|
@@ -1221,12 +1221,12 @@ class wn extends on {
|
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
export {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1224
|
+
xn as ErrorBoundary,
|
|
1225
|
+
wn as Game,
|
|
1226
|
+
Y as announceToScreenReader,
|
|
1227
|
+
pn as createAriaLabel,
|
|
1228
|
+
wn as default,
|
|
1229
|
+
fn as handleKeyDown,
|
|
1230
|
+
un as useValidation
|
|
1231
1231
|
};
|
|
1232
1232
|
//# sourceMappingURL=speakid-build-a-sentence.es.js.map
|