doubletwelve 0.2.0 → 0.3.1
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/ai/candidate-generator.d.ts +29 -0
- package/dist/ai/create-ai-player.d.ts +14 -0
- package/dist/ai/heuristics.d.ts +13 -0
- package/dist/ai/index.d.ts +12 -0
- package/dist/ai/policy.d.ts +65 -0
- package/dist/ai/search.d.ts +43 -0
- package/dist/ai/skill-profiles.d.ts +16 -0
- package/dist/ai/test-fixtures.d.ts +9 -0
- package/dist/ai/types.d.ts +84 -0
- package/dist/app/DefaultPip.d.ts +9 -0
- package/dist/app/DominoThemeContext.d.ts +8 -0
- package/dist/app/DoubleTwelve.d.ts +3 -0
- package/dist/app/Pip.d.ts +4 -11
- package/dist/app/dominoTheme.d.ts +39 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +982 -641
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,48 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as z, Fragment as we, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as Se, createContext as Ke, useEffect as ae, useMemo as He, useState as G, useRef as ve, useCallback as Ze } from "react";
|
|
3
|
+
const Je = {};
|
|
4
|
+
function ze(e, t) {
|
|
5
|
+
return t ? {
|
|
6
|
+
...e,
|
|
7
|
+
...t,
|
|
8
|
+
tileDataAttributes: {
|
|
9
|
+
...e.tileDataAttributes,
|
|
10
|
+
...t.tileDataAttributes
|
|
11
|
+
}
|
|
12
|
+
} : e;
|
|
13
|
+
}
|
|
14
|
+
function Qe(e) {
|
|
15
|
+
if (!e)
|
|
16
|
+
return {};
|
|
17
|
+
const t = {};
|
|
18
|
+
for (const [o, n] of Object.entries(e))
|
|
19
|
+
n === void 0 || n === !1 || (t[`data-${o}`] = n === !0 ? "true" : String(n));
|
|
20
|
+
return t;
|
|
16
21
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
gridSize: n,
|
|
21
|
-
color: o,
|
|
22
|
-
hollow: r,
|
|
23
|
-
top: i,
|
|
24
|
-
left: l
|
|
22
|
+
const le = Ke(Je), sn = ({
|
|
23
|
+
theme: e,
|
|
24
|
+
children: t
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
const o = Se(le), n = ze(o, e);
|
|
27
|
+
return /* @__PURE__ */ z(le.Provider, { value: n, children: t });
|
|
28
|
+
};
|
|
29
|
+
function Ie(e) {
|
|
30
|
+
const t = Se(le);
|
|
31
|
+
return ze(t, e);
|
|
32
|
+
}
|
|
33
|
+
const We = ({ ctx: e, theme: t }) => {
|
|
34
|
+
const { row: o, col: n, gridSize: r, color: i, hollow: l, positionStyle: s } = e, a = t?.pipStyle?.(e) ?? {};
|
|
35
|
+
return /* @__PURE__ */ z(
|
|
28
36
|
"div",
|
|
29
37
|
{
|
|
30
38
|
"data-testid": "pip",
|
|
31
|
-
"data-row":
|
|
32
|
-
"data-col":
|
|
33
|
-
"data-grid":
|
|
39
|
+
"data-row": o,
|
|
40
|
+
"data-col": n,
|
|
41
|
+
"data-grid": r,
|
|
42
|
+
"data-pip-value": e.value,
|
|
43
|
+
"data-hollow": l ? "true" : void 0,
|
|
34
44
|
style: {
|
|
35
45
|
position: "absolute",
|
|
36
|
-
backgroundColor: r ? "transparent" : o,
|
|
37
|
-
border: r ? "2px solid #888" : void 0,
|
|
38
46
|
borderRadius: "50%",
|
|
39
47
|
transform: "translate(-50%, -50%)",
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
backgroundColor: l ? "transparent" : i,
|
|
49
|
+
border: l ? `2px solid ${i}` : void 0,
|
|
50
|
+
boxShadow: l ? void 0 : "1px 2px 3px rgba(0,0,0,0.3)",
|
|
51
|
+
...s,
|
|
52
|
+
...a
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
55
|
);
|
|
45
|
-
},
|
|
56
|
+
}, et = {
|
|
57
|
+
"3x3": { rows: [20, 50, 80], cols: [20, 50, 80], size: "18%" },
|
|
58
|
+
"3x4": { rows: [24, 50, 76], cols: [22, 40, 60, 78], size: "12%" },
|
|
59
|
+
"4x3": { rows: [15, 38, 62, 85], cols: [20, 50, 80], size: "14%" }
|
|
60
|
+
};
|
|
61
|
+
function tt(e) {
|
|
62
|
+
const t = et[e.gridSize];
|
|
63
|
+
return {
|
|
64
|
+
top: e.top ?? `${t.rows[e.row]}%`,
|
|
65
|
+
left: e.left ?? `${t.cols[e.col]}%`,
|
|
66
|
+
width: t.size,
|
|
67
|
+
height: t.size
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const nt = {
|
|
46
71
|
0: [],
|
|
47
72
|
1: [{ row: 1, col: 1, gridSize: "3x3" }],
|
|
48
73
|
2: [
|
|
@@ -145,10 +170,10 @@ const Le = ({
|
|
|
145
170
|
{ row: 3, col: 2, gridSize: "4x3" }
|
|
146
171
|
]
|
|
147
172
|
};
|
|
148
|
-
function
|
|
149
|
-
return
|
|
173
|
+
function ot(e) {
|
|
174
|
+
return nt[e] ?? [];
|
|
150
175
|
}
|
|
151
|
-
const
|
|
176
|
+
const q = {
|
|
152
177
|
0: { color: "transparent" },
|
|
153
178
|
1: { color: "#1a1a1a" },
|
|
154
179
|
2: { color: "#8B1A1A" },
|
|
@@ -162,44 +187,45 @@ const j = {
|
|
|
162
187
|
10: { color: "#EA580C" },
|
|
163
188
|
11: { color: "#166534" },
|
|
164
189
|
12: { color: "#DC2626" }
|
|
165
|
-
},
|
|
166
|
-
function
|
|
167
|
-
return { ...
|
|
190
|
+
}, an = q;
|
|
191
|
+
function un(e) {
|
|
192
|
+
return { ...q, ...e };
|
|
168
193
|
}
|
|
169
|
-
function
|
|
194
|
+
function Pe(e, t) {
|
|
170
195
|
if (t !== void 0)
|
|
171
|
-
return t[e] ??
|
|
196
|
+
return t[e] ?? q[e] ?? { color: "#1a1a1a" };
|
|
172
197
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
198
|
+
function cn(e) {
|
|
199
|
+
return Pe(e, q);
|
|
175
200
|
}
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
},
|
|
201
|
+
const rt = (e, t, o) => {
|
|
202
|
+
const n = Pe(e, o);
|
|
203
|
+
return n ? { color: n.color, hollow: n.hollow } : { color: t };
|
|
204
|
+
}, it = ({
|
|
180
205
|
value: e,
|
|
181
206
|
pipColor: t,
|
|
182
|
-
pipColors:
|
|
207
|
+
pipColors: o
|
|
183
208
|
}) => {
|
|
184
|
-
const { color:
|
|
185
|
-
return /* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
row:
|
|
189
|
-
col:
|
|
190
|
-
gridSize:
|
|
191
|
-
color:
|
|
192
|
-
hollow:
|
|
193
|
-
top:
|
|
194
|
-
left:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
209
|
+
const n = Ie(), { color: r, hollow: i } = rt(e, t, o), l = ot(e);
|
|
210
|
+
return /* @__PURE__ */ z(we, { children: l.map((s, a) => {
|
|
211
|
+
const c = {
|
|
212
|
+
value: e,
|
|
213
|
+
row: s.row,
|
|
214
|
+
col: s.col,
|
|
215
|
+
gridSize: s.gridSize,
|
|
216
|
+
color: r,
|
|
217
|
+
hollow: i,
|
|
218
|
+
top: s.top,
|
|
219
|
+
left: s.left,
|
|
220
|
+
positionStyle: tt(s)
|
|
221
|
+
};
|
|
222
|
+
return n.renderPip ? /* @__PURE__ */ z("span", { children: n.renderPip(c) }, a) : /* @__PURE__ */ z(We, { ctx: c, theme: n }, a);
|
|
223
|
+
}) });
|
|
224
|
+
}, xe = ({
|
|
199
225
|
value: e,
|
|
200
226
|
pipColor: t,
|
|
201
|
-
pipColors:
|
|
202
|
-
}) => /* @__PURE__ */
|
|
227
|
+
pipColors: o
|
|
228
|
+
}) => /* @__PURE__ */ z(
|
|
203
229
|
"div",
|
|
204
230
|
{
|
|
205
231
|
style: {
|
|
@@ -209,26 +235,37 @@ const Be = (e, t, n) => {
|
|
|
209
235
|
padding: "0",
|
|
210
236
|
overflow: "hidden"
|
|
211
237
|
},
|
|
212
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ z(it, { value: e, pipColor: t, pipColors: o })
|
|
213
239
|
}
|
|
214
|
-
),
|
|
240
|
+
), Te = ({
|
|
215
241
|
value1: e = 0,
|
|
216
242
|
value2: t = 0,
|
|
217
|
-
width:
|
|
218
|
-
height:
|
|
243
|
+
width: o = 100,
|
|
244
|
+
height: n = 200,
|
|
219
245
|
backgroundColor: r = "white",
|
|
220
246
|
pipColor: i = "black",
|
|
221
247
|
pipColors: l,
|
|
222
248
|
borderColor: s = "black",
|
|
223
|
-
rotation: a = 0
|
|
249
|
+
rotation: a = 0,
|
|
250
|
+
theme: c
|
|
224
251
|
}) => {
|
|
225
|
-
const c = Math.min(Math.max(e, 0), 12),
|
|
226
|
-
|
|
252
|
+
const d = Ie(c), u = Math.min(Math.max(e, 0), 12), f = Math.min(Math.max(t, 0), 12), p = {
|
|
253
|
+
value1: u,
|
|
254
|
+
value2: f,
|
|
255
|
+
width: o,
|
|
256
|
+
height: n,
|
|
257
|
+
backgroundColor: r,
|
|
258
|
+
borderColor: s,
|
|
259
|
+
rotation: a
|
|
260
|
+
}, v = d.tileStyle?.(p) ?? {}, S = d.halfDividerStyle?.(p) ?? {};
|
|
261
|
+
return /* @__PURE__ */ $(
|
|
227
262
|
"div",
|
|
228
263
|
{
|
|
264
|
+
className: d.tileClassName,
|
|
265
|
+
...Qe(d.tileDataAttributes),
|
|
229
266
|
style: {
|
|
230
|
-
width: `${
|
|
231
|
-
height: `${
|
|
267
|
+
width: `${o}px`,
|
|
268
|
+
height: `${n}px`,
|
|
232
269
|
backgroundColor: r,
|
|
233
270
|
borderColor: s,
|
|
234
271
|
borderWidth: "1px",
|
|
@@ -239,10 +276,11 @@ const Be = (e, t, n) => {
|
|
|
239
276
|
boxShadow: "0 1px 2px rgba(0,0,0,0.2)",
|
|
240
277
|
display: "flex",
|
|
241
278
|
flexDirection: "column",
|
|
242
|
-
overflow: "hidden"
|
|
279
|
+
overflow: "hidden",
|
|
280
|
+
...v
|
|
243
281
|
},
|
|
244
282
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ z(
|
|
246
284
|
"div",
|
|
247
285
|
{
|
|
248
286
|
style: {
|
|
@@ -250,62 +288,63 @@ const Be = (e, t, n) => {
|
|
|
250
288
|
position: "relative",
|
|
251
289
|
borderBottomWidth: "1px",
|
|
252
290
|
borderBottomStyle: "solid",
|
|
253
|
-
borderBottomColor: s
|
|
291
|
+
borderBottomColor: s,
|
|
292
|
+
...S
|
|
254
293
|
},
|
|
255
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ z(xe, { value: u, pipColor: i, pipColors: l })
|
|
256
295
|
}
|
|
257
296
|
),
|
|
258
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ z(
|
|
259
298
|
"div",
|
|
260
299
|
{
|
|
261
300
|
style: {
|
|
262
301
|
flex: 1,
|
|
263
302
|
position: "relative"
|
|
264
303
|
},
|
|
265
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ z(xe, { value: f, pipColor: i, pipColors: l })
|
|
266
305
|
}
|
|
267
306
|
)
|
|
268
307
|
]
|
|
269
308
|
}
|
|
270
309
|
);
|
|
271
|
-
},
|
|
272
|
-
function
|
|
273
|
-
return e ? t / 2 :
|
|
310
|
+
}, C = 60, D = 120, lt = [-45, 45];
|
|
311
|
+
function W(e, t = C, o = D) {
|
|
312
|
+
return e ? t / 2 : o / 2;
|
|
274
313
|
}
|
|
275
|
-
function
|
|
276
|
-
return
|
|
314
|
+
function A(e, t, o = C, n = D) {
|
|
315
|
+
return W(e, o, n) + W(t, o, n);
|
|
277
316
|
}
|
|
278
|
-
function
|
|
317
|
+
function Y(e) {
|
|
279
318
|
const t = e * Math.PI / 180;
|
|
280
319
|
return {
|
|
281
320
|
dirX: Math.cos(t),
|
|
282
321
|
dirY: Math.sin(t)
|
|
283
322
|
};
|
|
284
323
|
}
|
|
285
|
-
function
|
|
286
|
-
const { dirX: t, dirY:
|
|
287
|
-
return { perpX: -
|
|
324
|
+
function L(e) {
|
|
325
|
+
const { dirX: t, dirY: o } = Y(e);
|
|
326
|
+
return { perpX: -o, perpY: t };
|
|
288
327
|
}
|
|
289
|
-
function
|
|
290
|
-
const t = e.map((
|
|
291
|
-
for (let
|
|
292
|
-
const
|
|
293
|
-
!(
|
|
328
|
+
function st(e) {
|
|
329
|
+
const t = e.map((o) => ({ ...o }));
|
|
330
|
+
for (let o = 1; o < t.length; o++) {
|
|
331
|
+
const n = t[o], r = t[o - 1].value2;
|
|
332
|
+
!(n.value1 === n.value2) && n.value1 !== r && n.value2 === r && (t[o] = { value1: n.value2, value2: n.value1 });
|
|
294
333
|
}
|
|
295
334
|
return t;
|
|
296
335
|
}
|
|
297
|
-
function
|
|
298
|
-
const { dirX: t, dirY:
|
|
299
|
-
return Math.abs(t) >= Math.abs(
|
|
336
|
+
function K(e) {
|
|
337
|
+
const { dirX: t, dirY: o } = Y(e);
|
|
338
|
+
return Math.abs(t) >= Math.abs(o) ? t >= 0 ? 1 : -1 : o >= 0 ? 1 : -1;
|
|
300
339
|
}
|
|
301
|
-
function
|
|
340
|
+
function Me(e, t) {
|
|
302
341
|
return e === 0 ? t : e === t ? -t : t;
|
|
303
342
|
}
|
|
304
|
-
function
|
|
343
|
+
function ke({
|
|
305
344
|
orientedDominoes: e,
|
|
306
345
|
startX: t,
|
|
307
|
-
startY:
|
|
308
|
-
angle:
|
|
346
|
+
startY: o,
|
|
347
|
+
angle: n,
|
|
309
348
|
layoutStyle: r,
|
|
310
349
|
dominoWidth: i,
|
|
311
350
|
dominoHeight: l,
|
|
@@ -313,96 +352,96 @@ function ye({
|
|
|
313
352
|
outwardSign: a,
|
|
314
353
|
hubIndex: c
|
|
315
354
|
}) {
|
|
316
|
-
const d = [], { dirX: u, dirY: f } =
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
const h = (
|
|
320
|
-
|
|
355
|
+
const d = [], { dirX: u, dirY: f } = Y(n), { perpX: p, perpY: v } = L(n), S = r === "offset" && c != null, m = [];
|
|
356
|
+
let P = t + u * s, b = o + f * s, M = 0, g = 0;
|
|
357
|
+
const I = i / 2, k = (x) => {
|
|
358
|
+
const h = (x - M) * I;
|
|
359
|
+
P += p * h, b += v * h, M = x;
|
|
321
360
|
};
|
|
322
|
-
for (let
|
|
323
|
-
const h = e[
|
|
324
|
-
r === "linear" ?
|
|
325
|
-
x:
|
|
326
|
-
y:
|
|
327
|
-
rotation: y ?
|
|
361
|
+
for (let x = 0; x < e.length; x++) {
|
|
362
|
+
const h = e[x], y = h.value1 === h.value2, T = x > 0 && e[x - 1].value1 === e[x - 1].value2;
|
|
363
|
+
r === "linear" ? x > 0 && (y ? (P += u * A(T, !0, i, l), b += f * A(T, !0, i, l)) : T ? (P += u * A(!0, !1, i, l), b += f * A(!0, !1, i, l)) : (P += u * l, b += f * l)) : y ? x > 0 && (P += u * A(T, !0, i, l), b += f * A(T, !0, i, l)) : (x === 0 ? g = a : T ? (P += u * A(!0, !1, i, l), b += f * A(!0, !1, i, l)) : (P += u * (l / 2), b += f * (l / 2), g = Me(g, a)), k(g)), m.push(M), d.push({
|
|
364
|
+
x: P,
|
|
365
|
+
y: b,
|
|
366
|
+
rotation: y ? n + 180 : n - 90,
|
|
328
367
|
isDouble: y,
|
|
329
368
|
value1: h.value1,
|
|
330
369
|
value2: h.value2
|
|
331
370
|
});
|
|
332
371
|
}
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
372
|
+
if (S && c != null) {
|
|
373
|
+
const x = -m[c] * I;
|
|
374
|
+
if (x !== 0)
|
|
336
375
|
for (let h = 0; h < d.length; h++)
|
|
337
376
|
d[h] = {
|
|
338
377
|
...d[h],
|
|
339
|
-
x: d[h].x + p *
|
|
340
|
-
y: d[h].y +
|
|
378
|
+
x: d[h].x + p * x,
|
|
379
|
+
y: d[h].y + v * x
|
|
341
380
|
};
|
|
342
381
|
}
|
|
343
382
|
return d;
|
|
344
383
|
}
|
|
345
|
-
function
|
|
384
|
+
function Ce(e, t) {
|
|
346
385
|
if (!e || e.length === 0) return [];
|
|
347
|
-
const
|
|
348
|
-
for (const
|
|
349
|
-
Number.isInteger(
|
|
350
|
-
return [...
|
|
386
|
+
const o = /* @__PURE__ */ new Map();
|
|
387
|
+
for (const n of e)
|
|
388
|
+
Number.isInteger(n.index) && (n.index <= 0 || n.index >= t || o.set(n.index, n.turn));
|
|
389
|
+
return [...o.entries()].map(([n, r]) => ({ index: n, turn: r })).sort((n, r) => n.index - r.index);
|
|
351
390
|
}
|
|
352
|
-
function
|
|
353
|
-
const r =
|
|
391
|
+
function at(e, t, o, n = 1 / 0) {
|
|
392
|
+
const r = Ce(t, Number.isFinite(n) ? n : o + 1);
|
|
354
393
|
let i = e;
|
|
355
394
|
for (const l of r)
|
|
356
|
-
if (l.index <=
|
|
395
|
+
if (l.index <= o) i += l.turn;
|
|
357
396
|
else break;
|
|
358
397
|
return i;
|
|
359
398
|
}
|
|
360
|
-
function
|
|
361
|
-
const { startX: r, startY: i, angle: l, layoutStyle: s, dominoWidth: a, dominoHeight: c, leadGap: d, outwardSign: u } = t, f = [0, ...
|
|
362
|
-
let
|
|
363
|
-
for (let
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
orientedDominoes:
|
|
368
|
-
startX:
|
|
369
|
-
startY:
|
|
370
|
-
angle:
|
|
399
|
+
function ut(e, t, o, n) {
|
|
400
|
+
const { startX: r, startY: i, angle: l, layoutStyle: s, dominoWidth: a, dominoHeight: c, leadGap: d, outwardSign: u } = t, f = [0, ...o.map((b) => b.index), e.length], p = [];
|
|
401
|
+
let v = l, S = r, m = i, P = d;
|
|
402
|
+
for (let b = 0; b < f.length - 1; b++) {
|
|
403
|
+
const M = e.slice(f[b], f[b + 1]);
|
|
404
|
+
if (M.length === 0) continue;
|
|
405
|
+
const g = b === 0 && n != null && n < f[1] ? n : void 0, I = ke({
|
|
406
|
+
orientedDominoes: M,
|
|
407
|
+
startX: S,
|
|
408
|
+
startY: m,
|
|
409
|
+
angle: v,
|
|
371
410
|
layoutStyle: s,
|
|
372
411
|
dominoWidth: a,
|
|
373
412
|
dominoHeight: c,
|
|
374
|
-
leadGap:
|
|
413
|
+
leadGap: P,
|
|
375
414
|
outwardSign: u,
|
|
376
|
-
hubIndex:
|
|
415
|
+
hubIndex: g
|
|
377
416
|
});
|
|
378
|
-
if (p.push(...
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
|
|
417
|
+
if (p.push(...I), b >= f.length - 2) break;
|
|
418
|
+
const x = I[I.length - 1], h = Y(v), y = W(x.isDouble, a, c);
|
|
419
|
+
v += o[b].turn;
|
|
420
|
+
const T = e[f[b + 1]], O = T.value1 === T.value2, _ = W(O, a, c), U = Y(v), j = L(v), E = a / 2, oe = x.x + h.dirX * (y - E) + U.dirX * (_ + E), H = x.y + h.dirY * (y - E) + U.dirY * (_ + E), R = s === "offset" && !O, Z = R ? j.perpX * E * u : 0, J = R ? j.perpY * E * u : 0;
|
|
421
|
+
S = oe - Z, m = H - J, P = 0;
|
|
383
422
|
}
|
|
384
423
|
return p;
|
|
385
424
|
}
|
|
386
|
-
function
|
|
425
|
+
function ct({
|
|
387
426
|
startX: e,
|
|
388
427
|
startY: t,
|
|
389
|
-
angle:
|
|
390
|
-
dominoes:
|
|
428
|
+
angle: o,
|
|
429
|
+
dominoes: n,
|
|
391
430
|
layoutStyle: r,
|
|
392
|
-
dominoWidth: i =
|
|
393
|
-
dominoHeight: l =
|
|
431
|
+
dominoWidth: i = C,
|
|
432
|
+
dominoHeight: l = D,
|
|
394
433
|
leadGap: s = l * 0.3,
|
|
395
434
|
outwardSign: a,
|
|
396
435
|
hubIndex: c,
|
|
397
436
|
bends: d
|
|
398
437
|
}) {
|
|
399
|
-
const u =
|
|
400
|
-
return p.length > 0 ?
|
|
438
|
+
const u = st([...n]), f = a ?? K(o), p = Ce(d, u.length);
|
|
439
|
+
return p.length > 0 ? ut(
|
|
401
440
|
u,
|
|
402
441
|
{
|
|
403
442
|
startX: e,
|
|
404
443
|
startY: t,
|
|
405
|
-
angle:
|
|
444
|
+
angle: o,
|
|
406
445
|
layoutStyle: r,
|
|
407
446
|
dominoWidth: i,
|
|
408
447
|
dominoHeight: l,
|
|
@@ -411,11 +450,11 @@ function Ke({
|
|
|
411
450
|
},
|
|
412
451
|
p,
|
|
413
452
|
c
|
|
414
|
-
) :
|
|
453
|
+
) : ke({
|
|
415
454
|
orientedDominoes: u,
|
|
416
455
|
startX: e,
|
|
417
456
|
startY: t,
|
|
418
|
-
angle:
|
|
457
|
+
angle: o,
|
|
419
458
|
layoutStyle: r,
|
|
420
459
|
dominoWidth: i,
|
|
421
460
|
dominoHeight: l,
|
|
@@ -424,8 +463,8 @@ function Ke({
|
|
|
424
463
|
hubIndex: c
|
|
425
464
|
});
|
|
426
465
|
}
|
|
427
|
-
function
|
|
428
|
-
const
|
|
466
|
+
function be(e, t = C, o = D) {
|
|
467
|
+
const n = e.rotation * Math.PI / 180, r = Math.cos(n), i = Math.sin(n), l = t / 2, s = o / 2;
|
|
429
468
|
return [
|
|
430
469
|
[-l, -s],
|
|
431
470
|
[l, -s],
|
|
@@ -436,56 +475,56 @@ function fe(e, t = T, n = I) {
|
|
|
436
475
|
y: e.y + a * i + c * r
|
|
437
476
|
}));
|
|
438
477
|
}
|
|
439
|
-
function
|
|
440
|
-
let
|
|
478
|
+
function dt(e, t, o) {
|
|
479
|
+
let n = 1 / 0, r = -1 / 0, i = 1 / 0, l = -1 / 0;
|
|
441
480
|
for (const s of e) {
|
|
442
|
-
const a = s.x *
|
|
443
|
-
|
|
481
|
+
const a = s.x * o.x + s.y * o.y;
|
|
482
|
+
n = Math.min(n, a), r = Math.max(r, a);
|
|
444
483
|
}
|
|
445
484
|
for (const s of t) {
|
|
446
|
-
const a = s.x *
|
|
485
|
+
const a = s.x * o.x + s.y * o.y;
|
|
447
486
|
i = Math.min(i, a), l = Math.max(l, a);
|
|
448
487
|
}
|
|
449
|
-
return Math.min(r, l) - Math.max(
|
|
488
|
+
return Math.min(r, l) - Math.max(n, i);
|
|
450
489
|
}
|
|
451
|
-
function
|
|
452
|
-
const i =
|
|
490
|
+
function ee(e, t, o = 1, n = C, r = D) {
|
|
491
|
+
const i = be(e, n, r), l = be(t, n, r);
|
|
453
492
|
for (const s of [i, l])
|
|
454
493
|
for (let a = 0; a < 4; a++) {
|
|
455
|
-
const c = s[a], d = s[(a + 1) % 4], u = d.x - c.x, f = d.y - c.y, p = Math.hypot(u, f) || 1,
|
|
456
|
-
if (
|
|
494
|
+
const c = s[a], d = s[(a + 1) % 4], u = d.x - c.x, f = d.y - c.y, p = Math.hypot(u, f) || 1, v = { x: -f / p, y: u / p };
|
|
495
|
+
if (dt(i, l, v) <= o)
|
|
457
496
|
return !1;
|
|
458
497
|
}
|
|
459
498
|
return !0;
|
|
460
499
|
}
|
|
461
|
-
function
|
|
500
|
+
function ft(e, t, o, n) {
|
|
462
501
|
return t.some(
|
|
463
|
-
(r) =>
|
|
502
|
+
(r) => ee(e, r, 1, o, n)
|
|
464
503
|
);
|
|
465
504
|
}
|
|
466
|
-
function
|
|
505
|
+
function De(e, t, o = 1, n = C, r = D) {
|
|
467
506
|
return e.some(
|
|
468
507
|
(i) => t.some(
|
|
469
|
-
(l) =>
|
|
508
|
+
(l) => ee(i, l, o, n, r)
|
|
470
509
|
)
|
|
471
510
|
);
|
|
472
511
|
}
|
|
473
|
-
function
|
|
512
|
+
function $e(e, t = 1, o = C, n = D) {
|
|
474
513
|
for (let r = 0; r < e.length; r++)
|
|
475
514
|
for (let i = r + 1; i < e.length; i++)
|
|
476
|
-
if (
|
|
515
|
+
if (ee(e[r], e[i], t, o, n))
|
|
477
516
|
return !0;
|
|
478
517
|
return !1;
|
|
479
518
|
}
|
|
480
|
-
const
|
|
481
|
-
function
|
|
519
|
+
const F = C / 4, ye = 24;
|
|
520
|
+
function ue({
|
|
482
521
|
startX: e,
|
|
483
522
|
startY: t,
|
|
484
|
-
angle:
|
|
485
|
-
branch:
|
|
523
|
+
angle: o,
|
|
524
|
+
branch: n,
|
|
486
525
|
layoutStyle: r,
|
|
487
|
-
dominoWidth: i =
|
|
488
|
-
dominoHeight: l =
|
|
526
|
+
dominoWidth: i = C,
|
|
527
|
+
dominoHeight: l = D,
|
|
489
528
|
leadGap: s,
|
|
490
529
|
depth: a = 0,
|
|
491
530
|
anchor: c,
|
|
@@ -494,105 +533,105 @@ function re({
|
|
|
494
533
|
pushAxis: f,
|
|
495
534
|
minPushSteps: p = 0
|
|
496
535
|
}) {
|
|
497
|
-
const
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
}).sort((
|
|
501
|
-
startX:
|
|
502
|
-
startY:
|
|
503
|
-
angle:
|
|
504
|
-
dominoes:
|
|
536
|
+
const v = d ?? K(o), S = n.feet ? Object.keys(n.feet).map(Number).filter((g) => {
|
|
537
|
+
const I = n.dominoes[g];
|
|
538
|
+
return I && I.value1 === I.value2;
|
|
539
|
+
}).sort((g, I) => g - I)[0] : void 0, m = (g, I) => ct({
|
|
540
|
+
startX: g,
|
|
541
|
+
startY: I,
|
|
542
|
+
angle: o,
|
|
543
|
+
dominoes: n.dominoes,
|
|
505
544
|
layoutStyle: r,
|
|
506
545
|
dominoWidth: i,
|
|
507
546
|
dominoHeight: l,
|
|
508
547
|
leadGap: s,
|
|
509
|
-
outwardSign:
|
|
510
|
-
hubIndex:
|
|
511
|
-
bends:
|
|
548
|
+
outwardSign: v,
|
|
549
|
+
hubIndex: S,
|
|
550
|
+
bends: n.bends
|
|
512
551
|
});
|
|
513
|
-
let
|
|
514
|
-
e + (f?.x ?? 0) *
|
|
515
|
-
t + (f?.y ?? 0) *
|
|
516
|
-
),
|
|
517
|
-
x: c.x + f.x *
|
|
518
|
-
y: c.y + f.y *
|
|
552
|
+
let P = m(
|
|
553
|
+
e + (f?.x ?? 0) * F * p,
|
|
554
|
+
t + (f?.y ?? 0) * F * p
|
|
555
|
+
), b = c && f ? {
|
|
556
|
+
x: c.x + f.x * F * p,
|
|
557
|
+
y: c.y + f.y * F * p
|
|
519
558
|
} : c;
|
|
520
559
|
if (f && u.length > 0)
|
|
521
|
-
for (let
|
|
522
|
-
const
|
|
523
|
-
if (!
|
|
524
|
-
(y) =>
|
|
525
|
-
) ||
|
|
526
|
-
|
|
527
|
-
x: c.x + f.x *
|
|
528
|
-
y: c.y + f.y *
|
|
560
|
+
for (let g = p; g <= ye; g++) {
|
|
561
|
+
const I = e + f.x * F * g, k = t + f.y * F * g, x = m(I, k);
|
|
562
|
+
if (!x.some(
|
|
563
|
+
(y) => ft(y, u, i, l)
|
|
564
|
+
) || g === ye) {
|
|
565
|
+
P = x, b = c && {
|
|
566
|
+
x: c.x + f.x * F * g,
|
|
567
|
+
y: c.y + f.y * F * g
|
|
529
568
|
};
|
|
530
569
|
break;
|
|
531
570
|
}
|
|
532
571
|
}
|
|
533
|
-
u.push(...
|
|
534
|
-
const
|
|
572
|
+
u.push(...P);
|
|
573
|
+
const M = [
|
|
535
574
|
{
|
|
536
|
-
angle:
|
|
575
|
+
angle: o,
|
|
537
576
|
depth: a,
|
|
538
577
|
layoutStyle: r,
|
|
539
|
-
outwardSign:
|
|
540
|
-
dominoes:
|
|
541
|
-
layout:
|
|
542
|
-
anchor:
|
|
578
|
+
outwardSign: v,
|
|
579
|
+
dominoes: n.dominoes,
|
|
580
|
+
layout: P,
|
|
581
|
+
anchor: b
|
|
543
582
|
}
|
|
544
583
|
];
|
|
545
|
-
if (
|
|
546
|
-
const
|
|
547
|
-
for (const
|
|
548
|
-
const
|
|
584
|
+
if (n.feet) {
|
|
585
|
+
const g = i / 2, I = l / 2;
|
|
586
|
+
for (const k of Object.keys(n.feet)) {
|
|
587
|
+
const x = Number(k), h = P[x], y = n.feet[x];
|
|
549
588
|
if (!h || !h.isDouble || !y)
|
|
550
589
|
continue;
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
), { dirX:
|
|
557
|
-
for (let
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
...
|
|
561
|
-
startX:
|
|
562
|
-
startY:
|
|
563
|
-
angle:
|
|
564
|
-
branch:
|
|
590
|
+
const T = at(
|
|
591
|
+
o,
|
|
592
|
+
n.bends,
|
|
593
|
+
x,
|
|
594
|
+
n.dominoes.length
|
|
595
|
+
), { dirX: O, dirY: _ } = Y(T), { perpX: U, perpY: j } = L(T);
|
|
596
|
+
for (let E = 0; E < y.length; E++) {
|
|
597
|
+
const oe = y[E], H = lt[E] ?? 0, R = Math.sign(H), Z = T + H, J = L(Z), re = -R, Ge = h.x + O * (i / 2) + U * (l / 2) * R, qe = h.y + _ * (i / 2) + j * (l / 2) * R, he = Ge - J.perpX * re * g, ge = qe - J.perpY * re * g;
|
|
598
|
+
M.push(
|
|
599
|
+
...ue({
|
|
600
|
+
startX: he,
|
|
601
|
+
startY: ge,
|
|
602
|
+
angle: Z,
|
|
603
|
+
branch: oe,
|
|
565
604
|
// Toes inherit the main style so they zigzag in offset mode.
|
|
566
605
|
layoutStyle: r,
|
|
567
606
|
dominoWidth: i,
|
|
568
607
|
dominoHeight: l,
|
|
569
|
-
leadGap:
|
|
570
|
-
outwardSign:
|
|
608
|
+
leadGap: I,
|
|
609
|
+
outwardSign: re,
|
|
571
610
|
depth: a + 1,
|
|
572
|
-
anchor: { x:
|
|
611
|
+
anchor: { x: he, y: ge },
|
|
573
612
|
placed: u,
|
|
574
613
|
// If the snug spot is still blocked (the offset center toe leans into
|
|
575
614
|
// one side), slide this toe along the double's open edge, away from
|
|
576
615
|
// center, until it clears. This keeps it butted against the double
|
|
577
616
|
// while stepping past the obstacle — independent per toe, so a foot
|
|
578
617
|
// ends up snug and only as asymmetric as the obstruction requires.
|
|
579
|
-
pushAxis: { x:
|
|
618
|
+
pushAxis: { x: U * R, y: j * R }
|
|
580
619
|
})
|
|
581
620
|
);
|
|
582
621
|
}
|
|
583
622
|
}
|
|
584
623
|
}
|
|
585
|
-
return
|
|
624
|
+
return M;
|
|
586
625
|
}
|
|
587
|
-
function
|
|
626
|
+
function Ee(e) {
|
|
588
627
|
return e.flatMap((t) => t.layout);
|
|
589
628
|
}
|
|
590
|
-
function
|
|
591
|
-
const r = Math.hypot(
|
|
629
|
+
function dn(e, t = 24, o = C, n = D) {
|
|
630
|
+
const r = Math.hypot(o, n) / 2;
|
|
592
631
|
if (e.length === 0)
|
|
593
632
|
return {
|
|
594
|
-
width: t * 2 +
|
|
595
|
-
height: t * 2 +
|
|
633
|
+
width: t * 2 + o,
|
|
634
|
+
height: t * 2 + n,
|
|
596
635
|
offsetX: t,
|
|
597
636
|
offsetY: t
|
|
598
637
|
};
|
|
@@ -606,84 +645,84 @@ function Ct(e, t = 24, n = T, o = I) {
|
|
|
606
645
|
offsetY: t - l
|
|
607
646
|
};
|
|
608
647
|
}
|
|
609
|
-
const
|
|
610
|
-
function
|
|
611
|
-
const { dirX:
|
|
612
|
-
return e *
|
|
648
|
+
const te = 1;
|
|
649
|
+
function Ae(e, t, o) {
|
|
650
|
+
const { dirX: n, dirY: r } = Y(o);
|
|
651
|
+
return e * n + t * r;
|
|
613
652
|
}
|
|
614
|
-
function
|
|
615
|
-
const { perpX:
|
|
616
|
-
return e *
|
|
653
|
+
function pt(e, t, o) {
|
|
654
|
+
const { perpX: n, perpY: r } = L(o);
|
|
655
|
+
return e * n + t * r;
|
|
617
656
|
}
|
|
618
|
-
function
|
|
657
|
+
function ce(e) {
|
|
619
658
|
const t = [];
|
|
620
|
-
for (let
|
|
621
|
-
e[
|
|
659
|
+
for (let o = 1; o < e.length; o++)
|
|
660
|
+
e[o].value1 !== e[o - 1].value2 && t.push({
|
|
622
661
|
code: "chain-break",
|
|
623
|
-
message: `Domino ${
|
|
624
|
-
index:
|
|
662
|
+
message: `Domino ${o} does not connect to domino ${o - 1}`,
|
|
663
|
+
index: o
|
|
625
664
|
});
|
|
626
|
-
for (let
|
|
627
|
-
const
|
|
628
|
-
|
|
665
|
+
for (let o = 1; o < e.length; o++) {
|
|
666
|
+
const n = e[o - 1].value1 === e[o - 1].value2, r = e[o].value1 === e[o].value2;
|
|
667
|
+
n && r && t.push({
|
|
629
668
|
code: "consecutive-doubles",
|
|
630
|
-
message: `Consecutive doubles at index ${
|
|
631
|
-
index:
|
|
669
|
+
message: `Consecutive doubles at index ${o - 1} and ${o}`,
|
|
670
|
+
index: o
|
|
632
671
|
});
|
|
633
672
|
}
|
|
634
673
|
return { valid: t.length === 0, issues: t };
|
|
635
674
|
}
|
|
636
|
-
function
|
|
637
|
-
const i =
|
|
675
|
+
function Oe(e, t, o, n = C, r = D) {
|
|
676
|
+
const i = n / 2, l = e.map((u) => u.isDouble), s = [];
|
|
638
677
|
let a = 0, c = 0, d = 0;
|
|
639
678
|
for (let u = 0; u < e.length; u++) {
|
|
640
679
|
const f = l[u], p = u > 0 && l[u - 1];
|
|
641
|
-
t === "linear" ? (u > 0 && (a +=
|
|
680
|
+
t === "linear" ? (u > 0 && (a += A(p, f, n, r)), c = 0) : f ? u > 0 && (a += A(p, !0, n, r)) : u === 0 ? (d = o, c = d * i) : p ? a += A(!0, !1, n, r) : (a += r / 2, d = Me(d, o), c = d * i), s.push({ along: a, perp: c });
|
|
642
681
|
}
|
|
643
682
|
return s;
|
|
644
683
|
}
|
|
645
|
-
function
|
|
646
|
-
const i = [], l = r ??
|
|
684
|
+
function ht(e, t, o, n = te, r) {
|
|
685
|
+
const i = [], l = r ?? K(t), s = Oe(e, o, l);
|
|
647
686
|
for (let a = 1; a < e.length; a++) {
|
|
648
|
-
const c = e[a - 1], d = e[a], u = d.x - c.x, f = d.y - c.y, p =
|
|
649
|
-
Math.abs(p -
|
|
687
|
+
const c = e[a - 1], d = e[a], u = d.x - c.x, f = d.y - c.y, p = Ae(u, f, t), v = pt(u, f, t), S = s[a].along - s[a - 1].along, m = s[a].perp - s[a - 1].perp;
|
|
688
|
+
Math.abs(p - S) > n && i.push({
|
|
650
689
|
code: "spacing-along-train",
|
|
651
|
-
message: `Along-train spacing between domino ${a - 1} and ${a} is ${p.toFixed(2)}px (expected ${
|
|
690
|
+
message: `Along-train spacing between domino ${a - 1} and ${a} is ${p.toFixed(2)}px (expected ${S}px)`,
|
|
652
691
|
index: a
|
|
653
|
-
}), Math.abs(
|
|
692
|
+
}), Math.abs(v - m) > n && i.push({
|
|
654
693
|
code: "spacing-perpendicular",
|
|
655
|
-
message: `Perpendicular spacing between domino ${a - 1} and ${a} is ${
|
|
694
|
+
message: `Perpendicular spacing between domino ${a - 1} and ${a} is ${v.toFixed(2)}px (expected ${m}px)`,
|
|
656
695
|
index: a
|
|
657
696
|
});
|
|
658
697
|
}
|
|
659
698
|
return { valid: i.length === 0, issues: i };
|
|
660
699
|
}
|
|
661
|
-
function
|
|
662
|
-
const i = [], l = r ??
|
|
700
|
+
function gt(e, t, o, n = te, r) {
|
|
701
|
+
const i = [], l = r ?? K(t), s = Oe(e, o, l);
|
|
663
702
|
for (let a = 1; a < e.length; a++) {
|
|
664
|
-
const c = e[a - 1], d = e[a], u = d.x - c.x, f = d.y - c.y, p = Math.hypot(u, f),
|
|
665
|
-
p +
|
|
703
|
+
const c = e[a - 1], d = e[a], u = d.x - c.x, f = d.y - c.y, p = Math.hypot(u, f), v = s[a].along - s[a - 1].along, S = s[a].perp - s[a - 1].perp, m = Math.hypot(v, S) * 0.9;
|
|
704
|
+
p + n < m && i.push({
|
|
666
705
|
code: "overlap",
|
|
667
|
-
message: `Domino ${a - 1} and ${a} centers are ${p.toFixed(2)}px apart (minimum ${
|
|
706
|
+
message: `Domino ${a - 1} and ${a} centers are ${p.toFixed(2)}px apart (minimum ${m.toFixed(2)}px)`,
|
|
668
707
|
index: a
|
|
669
708
|
});
|
|
670
709
|
}
|
|
671
710
|
return { valid: i.length === 0, issues: i };
|
|
672
711
|
}
|
|
673
|
-
function
|
|
712
|
+
function fn(e, t, o, n, r = te, i) {
|
|
674
713
|
const l = [
|
|
675
|
-
...
|
|
676
|
-
...
|
|
714
|
+
...ce(t).issues,
|
|
715
|
+
...ht(
|
|
677
716
|
e,
|
|
678
|
-
n,
|
|
679
717
|
o,
|
|
718
|
+
n,
|
|
680
719
|
r,
|
|
681
720
|
i
|
|
682
721
|
).issues,
|
|
683
|
-
...
|
|
722
|
+
...gt(
|
|
684
723
|
e,
|
|
685
|
-
n,
|
|
686
724
|
o,
|
|
725
|
+
n,
|
|
687
726
|
r,
|
|
688
727
|
i
|
|
689
728
|
).issues
|
|
@@ -693,16 +732,16 @@ function Tt(e, t, n, o, r = Q, i) {
|
|
|
693
732
|
message: `Layout length ${e.length} does not match domino count ${t.length}`
|
|
694
733
|
}), { valid: l.length === 0, issues: l };
|
|
695
734
|
}
|
|
696
|
-
function
|
|
697
|
-
const t = [],
|
|
735
|
+
function vt(e) {
|
|
736
|
+
const t = [], o = (n, r) => {
|
|
698
737
|
if (t.push(
|
|
699
|
-
...
|
|
738
|
+
...ce(n.dominoes).issues.map((i) => ({
|
|
700
739
|
...i,
|
|
701
740
|
message: `[${r}] ${i.message}`
|
|
702
741
|
}))
|
|
703
|
-
), !!
|
|
704
|
-
for (const i of Object.keys(
|
|
705
|
-
const l = Number(i), s =
|
|
742
|
+
), !!n.feet)
|
|
743
|
+
for (const i of Object.keys(n.feet)) {
|
|
744
|
+
const l = Number(i), s = n.dominoes[l], a = n.feet[l] ?? [];
|
|
706
745
|
if (!s) {
|
|
707
746
|
t.push({
|
|
708
747
|
code: "foot-host-missing",
|
|
@@ -721,57 +760,57 @@ function et(e) {
|
|
|
721
760
|
u && u.value1 !== s.value1 && t.push({
|
|
722
761
|
code: "foot-connection",
|
|
723
762
|
message: `[${r}] Toe ${d} on double ${l} starts with ${u.value1} but the double is ${s.value1}`
|
|
724
|
-
}),
|
|
763
|
+
}), o(c, `${r}.${l}.${d}`);
|
|
725
764
|
});
|
|
726
765
|
}
|
|
727
766
|
};
|
|
728
|
-
return
|
|
767
|
+
return o(e, "main"), { valid: t.length === 0, issues: t };
|
|
729
768
|
}
|
|
730
|
-
function
|
|
731
|
-
const
|
|
769
|
+
function pn(e, t = te) {
|
|
770
|
+
const o = [];
|
|
732
771
|
e.forEach((r, i) => {
|
|
733
|
-
if (
|
|
734
|
-
...
|
|
772
|
+
if (o.push(
|
|
773
|
+
...ce(r.dominoes).issues.map((l) => ({
|
|
735
774
|
...l,
|
|
736
775
|
message: `[segment ${i} @${r.angle}°] ${l.message}`
|
|
737
776
|
}))
|
|
738
|
-
), r.layout.length !== r.dominoes.length &&
|
|
777
|
+
), r.layout.length !== r.dominoes.length && o.push({
|
|
739
778
|
code: "layout-length",
|
|
740
779
|
message: `[segment ${i}] Layout length ${r.layout.length} does not match domino count ${r.dominoes.length}`
|
|
741
780
|
}), r.anchor && r.layout.length > 0) {
|
|
742
|
-
const l = r.layout[0], s =
|
|
781
|
+
const l = r.layout[0], s = Ae(
|
|
743
782
|
l.x - r.anchor.x,
|
|
744
783
|
l.y - r.anchor.y,
|
|
745
784
|
r.angle
|
|
746
|
-
), a =
|
|
747
|
-
Math.abs(s - a) > t &&
|
|
785
|
+
), a = D / 2;
|
|
786
|
+
Math.abs(s - a) > t && o.push({
|
|
748
787
|
code: "foot-anchor",
|
|
749
788
|
message: `[segment ${i}] First toe tile sits ${s.toFixed(2)}px from the double along the toe (expected ${a}px)`,
|
|
750
789
|
index: 0
|
|
751
790
|
});
|
|
752
791
|
}
|
|
753
792
|
});
|
|
754
|
-
const
|
|
755
|
-
for (let r = 0; r <
|
|
756
|
-
for (let i = r + 1; i <
|
|
757
|
-
|
|
793
|
+
const n = e.flatMap((r) => r.layout);
|
|
794
|
+
for (let r = 0; r < n.length; r++)
|
|
795
|
+
for (let i = r + 1; i < n.length; i++)
|
|
796
|
+
ee(n[r], n[i]) && o.push({
|
|
758
797
|
code: "tile-overlap",
|
|
759
798
|
message: `Tiles ${r} and ${i} overlap`,
|
|
760
799
|
index: i
|
|
761
800
|
});
|
|
762
|
-
return { valid:
|
|
801
|
+
return { valid: o.length === 0, issues: o };
|
|
763
802
|
}
|
|
764
|
-
const
|
|
803
|
+
const xt = (() => {
|
|
765
804
|
try {
|
|
766
805
|
return !1;
|
|
767
806
|
} catch {
|
|
768
807
|
return !1;
|
|
769
808
|
}
|
|
770
|
-
})(),
|
|
809
|
+
})(), bt = ({
|
|
771
810
|
startX: e,
|
|
772
811
|
startY: t,
|
|
773
|
-
angle:
|
|
774
|
-
trainData:
|
|
812
|
+
angle: o,
|
|
813
|
+
trainData: n,
|
|
775
814
|
layoutStyle: r,
|
|
776
815
|
tableWidth: i,
|
|
777
816
|
tableHeight: l,
|
|
@@ -779,56 +818,56 @@ const tt = (() => {
|
|
|
779
818
|
centerY: a,
|
|
780
819
|
pipColors: c
|
|
781
820
|
}) => {
|
|
782
|
-
|
|
783
|
-
if (!
|
|
784
|
-
const u =
|
|
785
|
-
dominoes:
|
|
786
|
-
feet:
|
|
821
|
+
ae(() => {
|
|
822
|
+
if (!xt) return;
|
|
823
|
+
const u = vt({
|
|
824
|
+
dominoes: n.dominoes,
|
|
825
|
+
feet: n.feet
|
|
787
826
|
});
|
|
788
827
|
u.valid || console.warn(
|
|
789
|
-
`DominoTrain: player ${
|
|
828
|
+
`DominoTrain: player ${n.playerId} train does not follow the rules:`,
|
|
790
829
|
u.issues.map((f) => f.message)
|
|
791
830
|
);
|
|
792
|
-
}, [
|
|
793
|
-
const d =
|
|
794
|
-
() =>
|
|
795
|
-
|
|
831
|
+
}, [n.dominoes, n.feet, n.playerId]);
|
|
832
|
+
const d = He(
|
|
833
|
+
() => Ee(
|
|
834
|
+
ue({
|
|
796
835
|
startX: e,
|
|
797
836
|
startY: t,
|
|
798
|
-
angle:
|
|
799
|
-
branch: { dominoes:
|
|
837
|
+
angle: o,
|
|
838
|
+
branch: { dominoes: n.dominoes, feet: n.feet },
|
|
800
839
|
layoutStyle: r
|
|
801
840
|
})
|
|
802
841
|
),
|
|
803
842
|
[
|
|
804
843
|
e,
|
|
805
844
|
t,
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
845
|
+
o,
|
|
846
|
+
n.dominoes,
|
|
847
|
+
n.feet,
|
|
809
848
|
r,
|
|
810
849
|
i,
|
|
811
850
|
l
|
|
812
851
|
]
|
|
813
852
|
);
|
|
814
|
-
return /* @__PURE__ */
|
|
815
|
-
const p =
|
|
816
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ z(we, { children: d.map((u, f) => {
|
|
854
|
+
const p = n.isPublic;
|
|
855
|
+
return /* @__PURE__ */ z(
|
|
817
856
|
"div",
|
|
818
857
|
{
|
|
819
858
|
style: {
|
|
820
859
|
position: "absolute",
|
|
821
|
-
left: `${u.x -
|
|
822
|
-
top: `${u.y -
|
|
860
|
+
left: `${u.x - C / 2}px`,
|
|
861
|
+
top: `${u.y - D / 2}px`,
|
|
823
862
|
zIndex: 5
|
|
824
863
|
},
|
|
825
|
-
children: /* @__PURE__ */
|
|
826
|
-
|
|
864
|
+
children: /* @__PURE__ */ z(
|
|
865
|
+
Te,
|
|
827
866
|
{
|
|
828
867
|
value1: u.value1,
|
|
829
868
|
value2: u.value2,
|
|
830
|
-
width:
|
|
831
|
-
height:
|
|
869
|
+
width: C,
|
|
870
|
+
height: D,
|
|
832
871
|
backgroundColor: "white",
|
|
833
872
|
pipColor: "black",
|
|
834
873
|
pipColors: c,
|
|
@@ -837,19 +876,19 @@ const tt = (() => {
|
|
|
837
876
|
}
|
|
838
877
|
)
|
|
839
878
|
},
|
|
840
|
-
`main-train-${
|
|
879
|
+
`main-train-${n.playerId}-${f}`
|
|
841
880
|
);
|
|
842
881
|
}) });
|
|
843
882
|
};
|
|
844
|
-
function
|
|
845
|
-
const r =
|
|
883
|
+
function yt(e, t, o, n) {
|
|
884
|
+
const r = o * (n === "offset" ? 2.5 : 1.3);
|
|
846
885
|
return Math.max(t + 20, Math.ceil(r * e / (2 * Math.PI)));
|
|
847
886
|
}
|
|
848
|
-
const
|
|
887
|
+
const mt = ({
|
|
849
888
|
playerCount: e,
|
|
850
889
|
centerX: t,
|
|
851
|
-
centerY:
|
|
852
|
-
radius:
|
|
890
|
+
centerY: o,
|
|
891
|
+
radius: n,
|
|
853
892
|
engineValue: r,
|
|
854
893
|
trains: i,
|
|
855
894
|
layoutStyle: l,
|
|
@@ -857,9 +896,9 @@ const rt = ({
|
|
|
857
896
|
tableHeight: a,
|
|
858
897
|
pipColors: c
|
|
859
898
|
}) => {
|
|
860
|
-
const d = Math.max(8, e), u = 120, f = 60, p = 120,
|
|
861
|
-
return /* @__PURE__ */
|
|
862
|
-
/* @__PURE__ */
|
|
899
|
+
const d = Math.max(8, e), u = 120, f = 60, p = 120, v = yt(d, n, f, l);
|
|
900
|
+
return /* @__PURE__ */ $("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
|
|
901
|
+
/* @__PURE__ */ z(
|
|
863
902
|
"div",
|
|
864
903
|
{
|
|
865
904
|
style: {
|
|
@@ -867,7 +906,7 @@ const rt = ({
|
|
|
867
906
|
width: `${u}px`,
|
|
868
907
|
height: `${u}px`,
|
|
869
908
|
left: `${t - u / 2}px`,
|
|
870
|
-
top: `${
|
|
909
|
+
top: `${o - u / 2}px`,
|
|
871
910
|
backgroundColor: "#d1d5db",
|
|
872
911
|
borderWidth: "3px",
|
|
873
912
|
borderStyle: "solid",
|
|
@@ -879,8 +918,8 @@ const rt = ({
|
|
|
879
918
|
justifyContent: "center",
|
|
880
919
|
alignItems: "center"
|
|
881
920
|
},
|
|
882
|
-
children: /* @__PURE__ */
|
|
883
|
-
|
|
921
|
+
children: /* @__PURE__ */ z("div", { style: { transform: "rotate(0deg)" }, children: /* @__PURE__ */ z(
|
|
922
|
+
Te,
|
|
884
923
|
{
|
|
885
924
|
value1: r,
|
|
886
925
|
value2: r,
|
|
@@ -894,79 +933,79 @@ const rt = ({
|
|
|
894
933
|
) })
|
|
895
934
|
}
|
|
896
935
|
),
|
|
897
|
-
Array.from({ length: d }).map((
|
|
898
|
-
const
|
|
936
|
+
Array.from({ length: d }).map((S, m) => {
|
|
937
|
+
const P = m * 360 / d, b = P * Math.PI / 180, M = t + v * Math.cos(b), g = o + v * Math.sin(b), I = i.find((k) => k.playerId === m) || {
|
|
899
938
|
dominoes: [],
|
|
900
|
-
playerId:
|
|
939
|
+
playerId: m,
|
|
901
940
|
isPublic: !1
|
|
902
941
|
};
|
|
903
|
-
return /* @__PURE__ */
|
|
904
|
-
|
|
942
|
+
return /* @__PURE__ */ z(
|
|
943
|
+
bt,
|
|
905
944
|
{
|
|
906
|
-
startX:
|
|
907
|
-
startY:
|
|
908
|
-
angle:
|
|
909
|
-
trainData:
|
|
945
|
+
startX: M,
|
|
946
|
+
startY: g,
|
|
947
|
+
angle: P,
|
|
948
|
+
trainData: I,
|
|
910
949
|
layoutStyle: l,
|
|
911
950
|
tableWidth: s,
|
|
912
951
|
tableHeight: a,
|
|
913
952
|
centerX: t,
|
|
914
|
-
centerY:
|
|
953
|
+
centerY: o,
|
|
915
954
|
pipColors: c
|
|
916
955
|
},
|
|
917
|
-
|
|
956
|
+
m
|
|
918
957
|
);
|
|
919
958
|
})
|
|
920
959
|
] });
|
|
921
960
|
};
|
|
922
|
-
function
|
|
961
|
+
function V(e, t) {
|
|
923
962
|
return e <= t ? `${e}:${t}` : `${t}:${e}`;
|
|
924
963
|
}
|
|
925
|
-
function
|
|
926
|
-
return
|
|
964
|
+
function B(e) {
|
|
965
|
+
return V(e.value1, e.value2);
|
|
927
966
|
}
|
|
928
|
-
function
|
|
967
|
+
function Re(e) {
|
|
929
968
|
return e.value1 === e.value2;
|
|
930
969
|
}
|
|
931
|
-
function
|
|
970
|
+
function Fe(e, t) {
|
|
932
971
|
return e.value1 === t || e.value2 === t;
|
|
933
972
|
}
|
|
934
|
-
function
|
|
973
|
+
function hn(e, t) {
|
|
935
974
|
return e.value1 === t ? e.value2 : e.value2 === t ? e.value1 : null;
|
|
936
975
|
}
|
|
937
|
-
function
|
|
976
|
+
function de(e, t) {
|
|
938
977
|
return e.value1 === t ? { value1: e.value1, value2: e.value2 } : e.value2 === t ? { value1: e.value2, value2: e.value1 } : null;
|
|
939
978
|
}
|
|
940
|
-
function
|
|
979
|
+
function wt(e) {
|
|
941
980
|
const t = [];
|
|
942
|
-
for (let
|
|
943
|
-
for (let
|
|
944
|
-
t.push({ value1:
|
|
981
|
+
for (let o = 0; o <= e; o++)
|
|
982
|
+
for (let n = o; n <= e; n++)
|
|
983
|
+
t.push({ value1: o, value2: n });
|
|
945
984
|
return t;
|
|
946
985
|
}
|
|
947
|
-
function
|
|
986
|
+
function gn(e) {
|
|
948
987
|
const t = e + 1;
|
|
949
988
|
return t * (t + 1) / 2;
|
|
950
989
|
}
|
|
951
|
-
function
|
|
952
|
-
const
|
|
990
|
+
function St(e, t = 12, o = {}) {
|
|
991
|
+
const n = /* @__PURE__ */ new Set([V(t, t)]), r = [];
|
|
953
992
|
for (let i = 0; i < e; i++) {
|
|
954
993
|
const l = 4 + Math.floor(Math.random() * 7), s = [];
|
|
955
994
|
let a = t, c = !1;
|
|
956
995
|
for (let u = 0; u < l; u++) {
|
|
957
|
-
const f =
|
|
996
|
+
const f = Tt(
|
|
958
997
|
a,
|
|
959
998
|
c,
|
|
960
999
|
u === 0,
|
|
961
1000
|
t,
|
|
962
|
-
|
|
1001
|
+
n
|
|
963
1002
|
);
|
|
964
1003
|
if (f === null)
|
|
965
1004
|
break;
|
|
966
1005
|
const p = f === a;
|
|
967
|
-
|
|
1006
|
+
n.add(V(a, f)), s.push({ value1: a, value2: f }), c = p, a = f;
|
|
968
1007
|
}
|
|
969
|
-
const d =
|
|
1008
|
+
const d = o.chickenFeet ? zt(s, n) : void 0;
|
|
970
1009
|
r.push({
|
|
971
1010
|
playerId: i,
|
|
972
1011
|
dominoes: s,
|
|
@@ -976,89 +1015,89 @@ function it(e, t = 12, n = {}) {
|
|
|
976
1015
|
}
|
|
977
1016
|
return r;
|
|
978
1017
|
}
|
|
979
|
-
function
|
|
980
|
-
const
|
|
981
|
-
for (let
|
|
982
|
-
if (e[
|
|
1018
|
+
function zt(e, t) {
|
|
1019
|
+
const o = {};
|
|
1020
|
+
for (let n = 0; n < e.length; n++) {
|
|
1021
|
+
if (e[n].value1 !== e[n].value2)
|
|
983
1022
|
continue;
|
|
984
|
-
const r = e[
|
|
1023
|
+
const r = e[n].value1, i = [];
|
|
985
1024
|
for (let l = 0; l < 2; l++) {
|
|
986
|
-
const s =
|
|
1025
|
+
const s = It(r, t);
|
|
987
1026
|
s && i.push(s);
|
|
988
1027
|
}
|
|
989
|
-
i.length && (n
|
|
1028
|
+
i.length && (o[n] = i);
|
|
990
1029
|
}
|
|
991
|
-
return Object.keys(
|
|
1030
|
+
return Object.keys(o).length ? o : void 0;
|
|
992
1031
|
}
|
|
993
|
-
function
|
|
994
|
-
const
|
|
1032
|
+
function It(e, t) {
|
|
1033
|
+
const o = 1 + Math.floor(Math.random() * 2), n = [];
|
|
995
1034
|
let r = e;
|
|
996
|
-
for (let i = 0; i <
|
|
997
|
-
const l =
|
|
1035
|
+
for (let i = 0; i < o; i++) {
|
|
1036
|
+
const l = Pt(r, t);
|
|
998
1037
|
if (l === null)
|
|
999
1038
|
break;
|
|
1000
|
-
t.add(
|
|
1039
|
+
t.add(V(r, l)), n.push({ value1: r, value2: l }), r = l;
|
|
1001
1040
|
}
|
|
1002
|
-
return
|
|
1041
|
+
return n.length ? { dominoes: n } : null;
|
|
1003
1042
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const
|
|
1006
|
-
for (let
|
|
1007
|
-
|
|
1008
|
-
return
|
|
1043
|
+
function Pt(e, t) {
|
|
1044
|
+
const o = [];
|
|
1045
|
+
for (let n = 0; n < 13; n++)
|
|
1046
|
+
n !== e && (t.has(V(e, n)) || o.push(n));
|
|
1047
|
+
return o.length === 0 ? null : o[Math.floor(Math.random() * o.length)];
|
|
1009
1048
|
}
|
|
1010
|
-
function
|
|
1049
|
+
function Tt(e, t, o, n, r) {
|
|
1011
1050
|
const i = Array.from({ length: 13 }, (l, s) => s).filter(
|
|
1012
|
-
(l) =>
|
|
1051
|
+
(l) => Mt(
|
|
1013
1052
|
e,
|
|
1014
1053
|
l,
|
|
1015
1054
|
t,
|
|
1016
|
-
n,
|
|
1017
1055
|
o,
|
|
1056
|
+
n,
|
|
1018
1057
|
r
|
|
1019
1058
|
)
|
|
1020
1059
|
);
|
|
1021
1060
|
return i.length === 0 ? null : i[Math.floor(Math.random() * i.length)];
|
|
1022
1061
|
}
|
|
1023
|
-
function
|
|
1062
|
+
function Mt(e, t, o, n, r, i) {
|
|
1024
1063
|
const l = t === e;
|
|
1025
|
-
return !(
|
|
1064
|
+
return !(n && l && e === r || l && o || i.has(V(e, t)));
|
|
1026
1065
|
}
|
|
1027
|
-
const
|
|
1066
|
+
const kt = {
|
|
1028
1067
|
playerCount: 8,
|
|
1029
1068
|
trains: [],
|
|
1030
1069
|
engineValue: 12
|
|
1031
|
-
},
|
|
1032
|
-
initialState: e =
|
|
1070
|
+
}, vn = ({
|
|
1071
|
+
initialState: e = kt,
|
|
1033
1072
|
width: t = 1200,
|
|
1034
|
-
height:
|
|
1035
|
-
pipColors:
|
|
1073
|
+
height: o = 800,
|
|
1074
|
+
pipColors: n,
|
|
1036
1075
|
onPipColorsChange: r
|
|
1037
1076
|
}) => {
|
|
1038
|
-
const [i, l] =
|
|
1039
|
-
const
|
|
1077
|
+
const [i, l] = G(e), [s, a] = G("offset"), [c, d] = G(!1), [u, f] = G(void 0), p = n ?? u, v = r ?? f, S = p !== void 0, m = t / 2, P = o / 2, b = (g = c) => {
|
|
1078
|
+
const I = St(
|
|
1040
1079
|
i.playerCount,
|
|
1041
1080
|
i.engineValue,
|
|
1042
|
-
{ chickenFeet:
|
|
1081
|
+
{ chickenFeet: g }
|
|
1043
1082
|
);
|
|
1044
|
-
l((
|
|
1045
|
-
...
|
|
1046
|
-
trains:
|
|
1083
|
+
l((k) => ({
|
|
1084
|
+
...k,
|
|
1085
|
+
trains: I
|
|
1047
1086
|
}));
|
|
1048
1087
|
};
|
|
1049
|
-
|
|
1050
|
-
|
|
1088
|
+
ae(() => {
|
|
1089
|
+
b();
|
|
1051
1090
|
}, []);
|
|
1052
|
-
const
|
|
1053
|
-
const
|
|
1054
|
-
d(
|
|
1091
|
+
const M = () => {
|
|
1092
|
+
const g = !c;
|
|
1093
|
+
d(g), b(g);
|
|
1055
1094
|
};
|
|
1056
|
-
return /* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ $(
|
|
1057
1096
|
"div",
|
|
1058
1097
|
{
|
|
1059
1098
|
style: {
|
|
1060
1099
|
width: `${t}px`,
|
|
1061
|
-
height: `${
|
|
1100
|
+
height: `${o}px`,
|
|
1062
1101
|
position: "relative",
|
|
1063
1102
|
backgroundColor: "#1f8a55",
|
|
1064
1103
|
// Classic green felt background
|
|
@@ -1067,15 +1106,15 @@ const dt = {
|
|
|
1067
1106
|
overflow: "hidden"
|
|
1068
1107
|
},
|
|
1069
1108
|
children: [
|
|
1070
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ $(
|
|
1071
1110
|
"div",
|
|
1072
1111
|
{
|
|
1073
1112
|
style: { position: "absolute", top: "10px", left: "10px", zIndex: 100 },
|
|
1074
1113
|
children: [
|
|
1075
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ z(
|
|
1076
1115
|
"button",
|
|
1077
1116
|
{
|
|
1078
|
-
onClick: () =>
|
|
1117
|
+
onClick: () => b(),
|
|
1079
1118
|
style: {
|
|
1080
1119
|
padding: "8px 12px",
|
|
1081
1120
|
backgroundColor: "#fff",
|
|
@@ -1087,7 +1126,7 @@ const dt = {
|
|
|
1087
1126
|
children: "New trains"
|
|
1088
1127
|
}
|
|
1089
1128
|
),
|
|
1090
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ $(
|
|
1091
1130
|
"button",
|
|
1092
1131
|
{
|
|
1093
1132
|
onClick: () => a(s === "offset" ? "linear" : "offset"),
|
|
@@ -1105,10 +1144,10 @@ const dt = {
|
|
|
1105
1144
|
]
|
|
1106
1145
|
}
|
|
1107
1146
|
),
|
|
1108
|
-
/* @__PURE__ */
|
|
1147
|
+
/* @__PURE__ */ $(
|
|
1109
1148
|
"button",
|
|
1110
1149
|
{
|
|
1111
|
-
onClick:
|
|
1150
|
+
onClick: M,
|
|
1112
1151
|
style: {
|
|
1113
1152
|
padding: "8px 12px",
|
|
1114
1153
|
backgroundColor: c ? "#fef3c7" : "#fff",
|
|
@@ -1123,27 +1162,27 @@ const dt = {
|
|
|
1123
1162
|
]
|
|
1124
1163
|
}
|
|
1125
1164
|
),
|
|
1126
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ $(
|
|
1127
1166
|
"button",
|
|
1128
1167
|
{
|
|
1129
|
-
onClick: () =>
|
|
1168
|
+
onClick: () => v(S ? void 0 : q),
|
|
1130
1169
|
style: {
|
|
1131
1170
|
padding: "8px 12px",
|
|
1132
|
-
backgroundColor:
|
|
1133
|
-
border: `1px solid ${
|
|
1171
|
+
backgroundColor: S ? "#fef3c7" : "#fff",
|
|
1172
|
+
border: `1px solid ${S ? "#f59e0b" : "#ccc"}`,
|
|
1134
1173
|
borderRadius: "4px",
|
|
1135
1174
|
cursor: "pointer"
|
|
1136
1175
|
},
|
|
1137
1176
|
children: [
|
|
1138
1177
|
"Pip Colors: ",
|
|
1139
|
-
|
|
1178
|
+
S ? "On" : "Off"
|
|
1140
1179
|
]
|
|
1141
1180
|
}
|
|
1142
1181
|
)
|
|
1143
1182
|
]
|
|
1144
1183
|
}
|
|
1145
1184
|
),
|
|
1146
|
-
/* @__PURE__ */
|
|
1185
|
+
/* @__PURE__ */ $(
|
|
1147
1186
|
"div",
|
|
1148
1187
|
{
|
|
1149
1188
|
style: {
|
|
@@ -1157,55 +1196,55 @@ const dt = {
|
|
|
1157
1196
|
fontSize: "14px"
|
|
1158
1197
|
},
|
|
1159
1198
|
children: [
|
|
1160
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ $("div", { children: [
|
|
1161
1200
|
"Engine: Double-",
|
|
1162
1201
|
i.engineValue
|
|
1163
1202
|
] }),
|
|
1164
|
-
/* @__PURE__ */
|
|
1203
|
+
/* @__PURE__ */ $("div", { children: [
|
|
1165
1204
|
"Players: ",
|
|
1166
1205
|
i.playerCount
|
|
1167
1206
|
] })
|
|
1168
1207
|
]
|
|
1169
1208
|
}
|
|
1170
1209
|
),
|
|
1171
|
-
/* @__PURE__ */
|
|
1172
|
-
|
|
1210
|
+
/* @__PURE__ */ z(
|
|
1211
|
+
mt,
|
|
1173
1212
|
{
|
|
1174
1213
|
playerCount: i.playerCount,
|
|
1175
|
-
centerX:
|
|
1176
|
-
centerY:
|
|
1214
|
+
centerX: m,
|
|
1215
|
+
centerY: P,
|
|
1177
1216
|
radius: 80,
|
|
1178
1217
|
engineValue: i.engineValue,
|
|
1179
1218
|
trains: i.trains,
|
|
1180
1219
|
layoutStyle: s,
|
|
1181
1220
|
tableWidth: t,
|
|
1182
|
-
tableHeight:
|
|
1221
|
+
tableHeight: o,
|
|
1183
1222
|
pipColors: p
|
|
1184
1223
|
}
|
|
1185
1224
|
)
|
|
1186
1225
|
]
|
|
1187
1226
|
}
|
|
1188
1227
|
);
|
|
1189
|
-
},
|
|
1190
|
-
function
|
|
1228
|
+
}, fe = 90;
|
|
1229
|
+
function se(e, t = fe) {
|
|
1191
1230
|
return e === "right" ? t : -t;
|
|
1192
1231
|
}
|
|
1193
|
-
function
|
|
1232
|
+
function Ne(e) {
|
|
1194
1233
|
return e === "right" ? "left" : "right";
|
|
1195
1234
|
}
|
|
1196
|
-
function
|
|
1197
|
-
return (t ??
|
|
1235
|
+
function xn(e, t) {
|
|
1236
|
+
return (t ?? K(e)) >= 0 ? "left" : "right";
|
|
1198
1237
|
}
|
|
1199
|
-
function
|
|
1200
|
-
const { perpX:
|
|
1238
|
+
function bn(e, t, o) {
|
|
1239
|
+
const { perpX: n, perpY: r } = L(t), i = (a, c) => {
|
|
1201
1240
|
let d = 1 / 0;
|
|
1202
|
-
return a > 0 ? d = Math.min(d, (
|
|
1203
|
-
}, l = i(
|
|
1241
|
+
return a > 0 ? d = Math.min(d, (o.width - e.x) / a) : a < 0 && (d = Math.min(d, (0 - e.x) / a)), c > 0 ? d = Math.min(d, (o.height - e.y) / c) : c < 0 && (d = Math.min(d, (0 - e.y) / c)), Number.isFinite(d) ? Math.max(0, d) : 1 / 0;
|
|
1242
|
+
}, l = i(n, r), s = i(-n, -r);
|
|
1204
1243
|
return l >= s ? "right" : "left";
|
|
1205
1244
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return
|
|
1208
|
-
|
|
1245
|
+
function Ye(e, t) {
|
|
1246
|
+
return Ee(
|
|
1247
|
+
ue({
|
|
1209
1248
|
startX: t.startX,
|
|
1210
1249
|
startY: t.startY,
|
|
1211
1250
|
angle: t.angle,
|
|
@@ -1214,80 +1253,80 @@ function De(e, t) {
|
|
|
1214
1253
|
})
|
|
1215
1254
|
);
|
|
1216
1255
|
}
|
|
1217
|
-
function
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1256
|
+
function Q(e, t, o) {
|
|
1257
|
+
const n = (e ?? []).filter((r) => r.index !== t);
|
|
1258
|
+
return o === null ? n : [...n, { index: t, turn: o }].sort((r, i) => r.index - i.index);
|
|
1220
1259
|
}
|
|
1221
|
-
function
|
|
1260
|
+
function yn({
|
|
1222
1261
|
branch: e,
|
|
1223
1262
|
index: t,
|
|
1224
|
-
build:
|
|
1225
|
-
obstacles:
|
|
1263
|
+
build: o,
|
|
1264
|
+
obstacles: n,
|
|
1226
1265
|
preferredSide: r,
|
|
1227
|
-
degrees: i =
|
|
1266
|
+
degrees: i = fe
|
|
1228
1267
|
}) {
|
|
1229
|
-
const l = [r,
|
|
1268
|
+
const l = [r, Ne(r)];
|
|
1230
1269
|
for (const s of l) {
|
|
1231
|
-
const a =
|
|
1270
|
+
const a = se(s, i), c = {
|
|
1232
1271
|
...e,
|
|
1233
|
-
bends:
|
|
1234
|
-
}, d =
|
|
1235
|
-
if (
|
|
1272
|
+
bends: Q(e.bends, t, a)
|
|
1273
|
+
}, d = Ye(c, o);
|
|
1274
|
+
if (!$e(d) && !De(d, n))
|
|
1236
1275
|
return { turn: a };
|
|
1237
1276
|
}
|
|
1238
1277
|
return { turn: null, reason: "blocked" };
|
|
1239
1278
|
}
|
|
1240
|
-
function
|
|
1241
|
-
const l = (e.bends ?? []).find((u) => u.index === t), s =
|
|
1279
|
+
function mn(e, t, o, n, r, i = fe) {
|
|
1280
|
+
const l = (e.bends ?? []).find((u) => u.index === t), s = se(r, i), a = se(Ne(r), i), c = (u) => {
|
|
1242
1281
|
const f = {
|
|
1243
1282
|
...e,
|
|
1244
|
-
bends:
|
|
1245
|
-
}, p =
|
|
1246
|
-
return
|
|
1283
|
+
bends: Q(e.bends, t, u)
|
|
1284
|
+
}, p = Ye(f, o);
|
|
1285
|
+
return !$e(p) && !De(p, n);
|
|
1247
1286
|
};
|
|
1248
1287
|
let d;
|
|
1249
1288
|
l ? l.turn === s ? d = [a, null] : l.turn === a ? d = [null] : d = [s, a, null] : d = [s, a];
|
|
1250
1289
|
for (const u of d) {
|
|
1251
1290
|
if (u === null)
|
|
1252
|
-
return { bends:
|
|
1291
|
+
return { bends: Q(e.bends, t, null), changed: !0, blocked: !1 };
|
|
1253
1292
|
if (c(u))
|
|
1254
|
-
return { bends:
|
|
1293
|
+
return { bends: Q(e.bends, t, u), changed: !0, blocked: !1 };
|
|
1255
1294
|
}
|
|
1256
1295
|
return { bends: e.bends ?? [], changed: !1, blocked: !0 };
|
|
1257
1296
|
}
|
|
1258
|
-
function
|
|
1259
|
-
return Math.min(
|
|
1297
|
+
function pe(e, t, o) {
|
|
1298
|
+
return Math.min(o, Math.max(t, e));
|
|
1260
1299
|
}
|
|
1261
|
-
function
|
|
1262
|
-
const i =
|
|
1300
|
+
function me(e, t, o, n, r) {
|
|
1301
|
+
const i = pe(e.scale * t, n, r), l = i / e.scale;
|
|
1263
1302
|
return {
|
|
1264
1303
|
scale: i,
|
|
1265
|
-
x:
|
|
1266
|
-
y:
|
|
1304
|
+
x: o.x - (o.x - e.x) * l,
|
|
1305
|
+
y: o.y - (o.y - e.y) * l
|
|
1267
1306
|
};
|
|
1268
1307
|
}
|
|
1269
|
-
function
|
|
1308
|
+
function Ct(e, t, o, n, r) {
|
|
1270
1309
|
const i = Math.max(1, e.width), l = Math.max(1, e.height), s = Math.min(
|
|
1271
|
-
(t.width -
|
|
1272
|
-
(t.height -
|
|
1273
|
-
), a =
|
|
1310
|
+
(t.width - o * 2) / i,
|
|
1311
|
+
(t.height - o * 2) / l
|
|
1312
|
+
), a = pe(s, n, r);
|
|
1274
1313
|
return {
|
|
1275
1314
|
scale: a,
|
|
1276
1315
|
x: (t.width - i * a) / 2,
|
|
1277
1316
|
y: (t.height - l * a) / 2
|
|
1278
1317
|
};
|
|
1279
1318
|
}
|
|
1280
|
-
function
|
|
1319
|
+
function wn(e, t) {
|
|
1281
1320
|
return {
|
|
1282
1321
|
x: (t.x - e.x) / e.scale,
|
|
1283
1322
|
y: (t.y - e.y) / e.scale
|
|
1284
1323
|
};
|
|
1285
1324
|
}
|
|
1286
|
-
const
|
|
1325
|
+
const Dt = 3, Sn = ({
|
|
1287
1326
|
width: e,
|
|
1288
1327
|
height: t,
|
|
1289
|
-
contentWidth:
|
|
1290
|
-
contentHeight:
|
|
1328
|
+
contentWidth: o,
|
|
1329
|
+
contentHeight: n,
|
|
1291
1330
|
children: r,
|
|
1292
1331
|
minScale: i = 0.2,
|
|
1293
1332
|
maxScale: l = 4,
|
|
@@ -1297,44 +1336,44 @@ const pt = 3, _t = ({
|
|
|
1297
1336
|
showControls: d = !0,
|
|
1298
1337
|
testId: u = "viewport"
|
|
1299
1338
|
}) => {
|
|
1300
|
-
const f =
|
|
1301
|
-
() =>
|
|
1302
|
-
{ width:
|
|
1339
|
+
const f = ve(null), p = Ze(
|
|
1340
|
+
() => Ct(
|
|
1341
|
+
{ width: o, height: n },
|
|
1303
1342
|
{ width: e, height: t },
|
|
1304
1343
|
a,
|
|
1305
1344
|
i,
|
|
1306
1345
|
l
|
|
1307
1346
|
),
|
|
1308
|
-
[
|
|
1309
|
-
), [
|
|
1310
|
-
|
|
1311
|
-
|
|
1347
|
+
[o, n, e, t, a, i, l]
|
|
1348
|
+
), [v, S] = G(p);
|
|
1349
|
+
ae(() => {
|
|
1350
|
+
S(p());
|
|
1312
1351
|
}, [p]);
|
|
1313
|
-
const
|
|
1314
|
-
const
|
|
1315
|
-
return { x: h - (
|
|
1316
|
-
},
|
|
1317
|
-
|
|
1352
|
+
const m = ve(null), P = (h, y) => {
|
|
1353
|
+
const T = f.current?.getBoundingClientRect();
|
|
1354
|
+
return { x: h - (T?.left ?? 0), y: y - (T?.top ?? 0) };
|
|
1355
|
+
}, b = (h) => {
|
|
1356
|
+
m.current = {
|
|
1318
1357
|
pointerX: h.clientX,
|
|
1319
1358
|
pointerY: h.clientY,
|
|
1320
|
-
startX:
|
|
1321
|
-
startY:
|
|
1359
|
+
startX: v.x,
|
|
1360
|
+
startY: v.y,
|
|
1322
1361
|
moved: !1
|
|
1323
1362
|
};
|
|
1324
|
-
},
|
|
1325
|
-
const y =
|
|
1363
|
+
}, M = (h) => {
|
|
1364
|
+
const y = m.current;
|
|
1326
1365
|
if (!y) return;
|
|
1327
|
-
const
|
|
1328
|
-
!y.moved && Math.hypot(
|
|
1329
|
-
},
|
|
1330
|
-
|
|
1331
|
-
},
|
|
1366
|
+
const T = h.clientX - y.pointerX, O = h.clientY - y.pointerY;
|
|
1367
|
+
!y.moved && Math.hypot(T, O) < Dt || (y.moved = !0, f.current?.setPointerCapture?.(h.pointerId), S((_) => ({ ..._, x: y.startX + T, y: y.startY + O })));
|
|
1368
|
+
}, g = (h) => {
|
|
1369
|
+
m.current?.moved && h.preventDefault(), m.current = null;
|
|
1370
|
+
}, I = (h) => {
|
|
1332
1371
|
h.preventDefault();
|
|
1333
|
-
const y =
|
|
1334
|
-
|
|
1335
|
-
},
|
|
1336
|
-
(y) =>
|
|
1337
|
-
),
|
|
1372
|
+
const y = P(h.clientX, h.clientY), T = h.deltaY < 0 ? s : 1 / s;
|
|
1373
|
+
S((O) => me(O, T, y, i, l));
|
|
1374
|
+
}, k = (h) => S(
|
|
1375
|
+
(y) => me(y, h, { x: e / 2, y: t / 2 }, i, l)
|
|
1376
|
+
), x = {
|
|
1338
1377
|
width: 32,
|
|
1339
1378
|
height: 32,
|
|
1340
1379
|
fontSize: 18,
|
|
@@ -1346,16 +1385,16 @@ const pt = 3, _t = ({
|
|
|
1346
1385
|
borderRadius: 6,
|
|
1347
1386
|
userSelect: "none"
|
|
1348
1387
|
};
|
|
1349
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ $(
|
|
1350
1389
|
"div",
|
|
1351
1390
|
{
|
|
1352
1391
|
ref: f,
|
|
1353
1392
|
"data-testid": u,
|
|
1354
|
-
onPointerDown:
|
|
1355
|
-
onPointerMove:
|
|
1356
|
-
onPointerUp:
|
|
1357
|
-
onPointerLeave:
|
|
1358
|
-
onWheel:
|
|
1393
|
+
onPointerDown: b,
|
|
1394
|
+
onPointerMove: M,
|
|
1395
|
+
onPointerUp: g,
|
|
1396
|
+
onPointerLeave: g,
|
|
1397
|
+
onWheel: I,
|
|
1359
1398
|
style: {
|
|
1360
1399
|
position: "relative",
|
|
1361
1400
|
width: e,
|
|
@@ -1367,7 +1406,7 @@ const pt = 3, _t = ({
|
|
|
1367
1406
|
touchAction: "none"
|
|
1368
1407
|
},
|
|
1369
1408
|
children: [
|
|
1370
|
-
/* @__PURE__ */
|
|
1409
|
+
/* @__PURE__ */ z(
|
|
1371
1410
|
"div",
|
|
1372
1411
|
{
|
|
1373
1412
|
"data-testid": `${u}-content`,
|
|
@@ -1376,12 +1415,12 @@ const pt = 3, _t = ({
|
|
|
1376
1415
|
left: 0,
|
|
1377
1416
|
top: 0,
|
|
1378
1417
|
transformOrigin: "0 0",
|
|
1379
|
-
transform: `translate(${
|
|
1418
|
+
transform: `translate(${v.x}px, ${v.y}px) scale(${v.scale})`
|
|
1380
1419
|
},
|
|
1381
1420
|
children: r
|
|
1382
1421
|
}
|
|
1383
1422
|
),
|
|
1384
|
-
d && /* @__PURE__ */
|
|
1423
|
+
d && /* @__PURE__ */ $(
|
|
1385
1424
|
"div",
|
|
1386
1425
|
{
|
|
1387
1426
|
"data-testid": `${u}-controls`,
|
|
@@ -1394,24 +1433,24 @@ const pt = 3, _t = ({
|
|
|
1394
1433
|
gap: 6
|
|
1395
1434
|
},
|
|
1396
1435
|
children: [
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ z("div", { style: x, role: "button", "aria-label": "Zoom in", onClick: () => k(s), children: "+" }),
|
|
1437
|
+
/* @__PURE__ */ z("div", { style: x, role: "button", "aria-label": "Zoom out", onClick: () => k(1 / s), children: "−" }),
|
|
1438
|
+
/* @__PURE__ */ z(
|
|
1400
1439
|
"div",
|
|
1401
1440
|
{
|
|
1402
|
-
style: { ...
|
|
1441
|
+
style: { ...x, fontSize: 12, lineHeight: "30px" },
|
|
1403
1442
|
role: "button",
|
|
1404
1443
|
"aria-label": "Reset view",
|
|
1405
|
-
onClick: () =>
|
|
1444
|
+
onClick: () => S(p()),
|
|
1406
1445
|
children: "⤢"
|
|
1407
1446
|
}
|
|
1408
1447
|
),
|
|
1409
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ z(
|
|
1410
1449
|
"div",
|
|
1411
1450
|
{
|
|
1412
1451
|
"data-testid": `${u}-zoom-readout`,
|
|
1413
|
-
style: { ...
|
|
1414
|
-
children: Math.round(
|
|
1452
|
+
style: { ...x, fontSize: 11, cursor: "default" },
|
|
1453
|
+
children: Math.round(pe(v.scale, i, l) * 100)
|
|
1415
1454
|
}
|
|
1416
1455
|
)
|
|
1417
1456
|
]
|
|
@@ -1420,7 +1459,7 @@ const pt = 3, _t = ({
|
|
|
1420
1459
|
]
|
|
1421
1460
|
}
|
|
1422
1461
|
);
|
|
1423
|
-
},
|
|
1462
|
+
}, zn = [
|
|
1424
1463
|
{
|
|
1425
1464
|
id: "regular-after-double",
|
|
1426
1465
|
name: "Regular after double",
|
|
@@ -1507,7 +1546,7 @@ const pt = 3, _t = ({
|
|
|
1507
1546
|
],
|
|
1508
1547
|
layoutStyles: ["linear", "offset"]
|
|
1509
1548
|
}
|
|
1510
|
-
],
|
|
1549
|
+
], In = [
|
|
1511
1550
|
{
|
|
1512
1551
|
id: "single-foot",
|
|
1513
1552
|
name: "Single foot",
|
|
@@ -1615,7 +1654,7 @@ const pt = 3, _t = ({
|
|
|
1615
1654
|
},
|
|
1616
1655
|
layoutStyles: ["linear", "offset"]
|
|
1617
1656
|
}
|
|
1618
|
-
],
|
|
1657
|
+
], ie = {
|
|
1619
1658
|
maxPips: 12,
|
|
1620
1659
|
engineValue: 12,
|
|
1621
1660
|
allowConsecutiveDoubles: !1,
|
|
@@ -1627,7 +1666,7 @@ const pt = 3, _t = ({
|
|
|
1627
1666
|
sideToeAngles: [-45, 45]
|
|
1628
1667
|
}
|
|
1629
1668
|
};
|
|
1630
|
-
function
|
|
1669
|
+
function $t(e) {
|
|
1631
1670
|
switch (e.doubleObligation) {
|
|
1632
1671
|
case "chicken-foot":
|
|
1633
1672
|
return Math.max(1, e.chickenFoot.toeCount);
|
|
@@ -1637,45 +1676,45 @@ function ht(e) {
|
|
|
1637
1676
|
return 0;
|
|
1638
1677
|
}
|
|
1639
1678
|
}
|
|
1640
|
-
function
|
|
1679
|
+
function Et(e) {
|
|
1641
1680
|
return e.doubleObligation === "chicken-foot" ? Math.max(0, e.chickenFoot.toeCount - 1) : 0;
|
|
1642
1681
|
}
|
|
1643
|
-
function
|
|
1644
|
-
const t = e.maxPips ??
|
|
1682
|
+
function Pn(e = {}) {
|
|
1683
|
+
const t = e.maxPips ?? ie.maxPips;
|
|
1645
1684
|
return {
|
|
1646
|
-
...
|
|
1685
|
+
...ie,
|
|
1647
1686
|
...e,
|
|
1648
1687
|
maxPips: t,
|
|
1649
1688
|
engineValue: e.engineValue ?? t,
|
|
1650
1689
|
chickenFoot: {
|
|
1651
|
-
...
|
|
1690
|
+
...ie.chickenFoot,
|
|
1652
1691
|
...e.chickenFoot ?? {}
|
|
1653
1692
|
}
|
|
1654
1693
|
};
|
|
1655
1694
|
}
|
|
1656
|
-
function
|
|
1657
|
-
let
|
|
1658
|
-
for (const
|
|
1659
|
-
if (
|
|
1660
|
-
return
|
|
1695
|
+
function At(e, t) {
|
|
1696
|
+
let o = e;
|
|
1697
|
+
for (const n of t)
|
|
1698
|
+
if (o = o?.feet?.[n.doubleIndex]?.[n.toeIndex], !o) return;
|
|
1699
|
+
return o;
|
|
1661
1700
|
}
|
|
1662
|
-
function
|
|
1663
|
-
if (
|
|
1664
|
-
for (const
|
|
1665
|
-
const r = Number(
|
|
1701
|
+
function ne(e, t, o) {
|
|
1702
|
+
if (o(e, t), !!e.feet)
|
|
1703
|
+
for (const n of Object.keys(e.feet)) {
|
|
1704
|
+
const r = Number(n);
|
|
1666
1705
|
e.feet[r].forEach((i, l) => {
|
|
1667
|
-
|
|
1706
|
+
ne(i, [...t, { doubleIndex: r, toeIndex: l }], o);
|
|
1668
1707
|
});
|
|
1669
1708
|
}
|
|
1670
1709
|
}
|
|
1671
|
-
function
|
|
1710
|
+
function Ot(e) {
|
|
1672
1711
|
const t = [];
|
|
1673
|
-
return
|
|
1674
|
-
|
|
1712
|
+
return ne(e, [], (o, n) => {
|
|
1713
|
+
o.dominoes.forEach((r, i) => {
|
|
1675
1714
|
if (r.value1 !== r.value2) return;
|
|
1676
|
-
const l = i <
|
|
1715
|
+
const l = i < o.dominoes.length - 1, s = o.feet?.[i]?.length ?? 0;
|
|
1677
1716
|
t.push({
|
|
1678
|
-
path:
|
|
1717
|
+
path: n,
|
|
1679
1718
|
doubleIndex: i,
|
|
1680
1719
|
value: r.value1,
|
|
1681
1720
|
hasCenter: l,
|
|
@@ -1685,18 +1724,18 @@ function vt(e) {
|
|
|
1685
1724
|
});
|
|
1686
1725
|
}), t;
|
|
1687
1726
|
}
|
|
1688
|
-
function
|
|
1689
|
-
const
|
|
1690
|
-
return
|
|
1727
|
+
function Rt(e, t) {
|
|
1728
|
+
const o = $t(t);
|
|
1729
|
+
return o <= 0 ? [] : Ot(e).filter((n) => n.answers < o);
|
|
1691
1730
|
}
|
|
1692
|
-
function
|
|
1731
|
+
function Xe(e) {
|
|
1693
1732
|
const t = /* @__PURE__ */ new Set();
|
|
1694
|
-
return
|
|
1695
|
-
for (const
|
|
1696
|
-
t.add(
|
|
1733
|
+
return ne(e, [], (o) => {
|
|
1734
|
+
for (const n of o.dominoes)
|
|
1735
|
+
t.add(B(n));
|
|
1697
1736
|
}), t;
|
|
1698
1737
|
}
|
|
1699
|
-
function
|
|
1738
|
+
function Ft(e, t, o) {
|
|
1700
1739
|
if (e.dominoes.length === 0)
|
|
1701
1740
|
return [
|
|
1702
1741
|
{
|
|
@@ -1708,11 +1747,11 @@ function wt(e, t, n) {
|
|
|
1708
1747
|
obligation: !1
|
|
1709
1748
|
}
|
|
1710
1749
|
];
|
|
1711
|
-
const
|
|
1712
|
-
if (
|
|
1713
|
-
const i =
|
|
1714
|
-
for (const s of
|
|
1715
|
-
const a =
|
|
1750
|
+
const n = Rt(e, o);
|
|
1751
|
+
if (o.doubleObligation !== "none" && n.length > 0) {
|
|
1752
|
+
const i = Et(o), l = [];
|
|
1753
|
+
for (const s of n) {
|
|
1754
|
+
const a = At(e, s.path);
|
|
1716
1755
|
a && (!s.hasCenter && s.doubleIndex === a.dominoes.length - 1 && l.push({
|
|
1717
1756
|
path: s.path,
|
|
1718
1757
|
attach: "run-tail",
|
|
@@ -1732,126 +1771,428 @@ function wt(e, t, n) {
|
|
|
1732
1771
|
return l;
|
|
1733
1772
|
}
|
|
1734
1773
|
const r = [];
|
|
1735
|
-
return
|
|
1774
|
+
return ne(e, [], (i, l) => {
|
|
1736
1775
|
const s = i.dominoes[i.dominoes.length - 1];
|
|
1737
1776
|
s && r.push({
|
|
1738
1777
|
path: l,
|
|
1739
1778
|
attach: "run-tail",
|
|
1740
1779
|
value: s.value2,
|
|
1741
|
-
attachToDouble:
|
|
1780
|
+
attachToDouble: Re(s),
|
|
1742
1781
|
obligation: !1
|
|
1743
1782
|
});
|
|
1744
1783
|
}), r;
|
|
1745
1784
|
}
|
|
1746
|
-
function
|
|
1747
|
-
const r = [], i =
|
|
1748
|
-
return
|
|
1785
|
+
function _e(e, t, o, n) {
|
|
1786
|
+
const r = [], i = de(e, t.value);
|
|
1787
|
+
return n.requireSequential && !i && r.push("value-mismatch"), n.requireUniqueTiles && o.has(B(e)) && r.push("duplicate-tile"), !n.allowConsecutiveDoubles && t.attachToDouble && Re(e) && r.push("consecutive-doubles"), { legal: r.length === 0, violations: r };
|
|
1749
1788
|
}
|
|
1750
|
-
function
|
|
1751
|
-
const i =
|
|
1789
|
+
function Nt(e, t, o, n, r) {
|
|
1790
|
+
const i = Ft(e, t, r), l = [];
|
|
1752
1791
|
for (const s of i)
|
|
1753
|
-
for (const a of
|
|
1754
|
-
|
|
1792
|
+
for (const a of o)
|
|
1793
|
+
_e(a, s, n, r).legal && l.push({ end: s, tile: a });
|
|
1755
1794
|
return l;
|
|
1756
1795
|
}
|
|
1757
|
-
function
|
|
1796
|
+
function Le(e, t, o) {
|
|
1758
1797
|
if (t.length === 0)
|
|
1759
|
-
return
|
|
1760
|
-
const [
|
|
1761
|
-
(s, a) => a ===
|
|
1798
|
+
return o(e);
|
|
1799
|
+
const [n, ...r] = t, l = (e.feet?.[n.doubleIndex] ?? []).map(
|
|
1800
|
+
(s, a) => a === n.toeIndex ? Le(s, r, o) : s
|
|
1762
1801
|
);
|
|
1763
1802
|
return {
|
|
1764
1803
|
...e,
|
|
1765
|
-
feet: { ...e.feet, [
|
|
1804
|
+
feet: { ...e.feet, [n.doubleIndex]: l }
|
|
1766
1805
|
};
|
|
1767
1806
|
}
|
|
1768
|
-
function
|
|
1769
|
-
const
|
|
1770
|
-
return
|
|
1807
|
+
function Yt(e, t, o) {
|
|
1808
|
+
const n = de(t.tile, t.end.value) ?? { ...t.tile };
|
|
1809
|
+
return Le(e, t.end.path, (r) => {
|
|
1771
1810
|
if (t.end.attach === "run-tail")
|
|
1772
|
-
return { ...r, dominoes: [...r.dominoes,
|
|
1811
|
+
return { ...r, dominoes: [...r.dominoes, n] };
|
|
1773
1812
|
const i = t.end.doubleIndex ?? 0, l = t.end.toeSlot ?? r.feet?.[i]?.length ?? 0, s = r.feet?.[i] ? [...r.feet[i]] : [];
|
|
1774
|
-
return s[l] = { dominoes: [
|
|
1813
|
+
return s[l] = { dominoes: [n] }, {
|
|
1775
1814
|
...r,
|
|
1776
1815
|
feet: { ...r.feet, [i]: s }
|
|
1777
1816
|
};
|
|
1778
1817
|
});
|
|
1779
1818
|
}
|
|
1780
|
-
function
|
|
1781
|
-
const
|
|
1819
|
+
function Tn(e, t, o) {
|
|
1820
|
+
const n = _e(
|
|
1782
1821
|
t.tile,
|
|
1783
1822
|
t.end,
|
|
1784
|
-
|
|
1785
|
-
|
|
1823
|
+
Xe(e),
|
|
1824
|
+
o
|
|
1786
1825
|
);
|
|
1787
|
-
return
|
|
1826
|
+
return n.legal ? { ok: !0, board: Yt(e, t), violations: [] } : { ok: !1, board: e, violations: n.violations };
|
|
1827
|
+
}
|
|
1828
|
+
function X(e) {
|
|
1829
|
+
return e.kind === "play";
|
|
1830
|
+
}
|
|
1831
|
+
function Xt(e) {
|
|
1832
|
+
const t = [];
|
|
1833
|
+
return e.trains.forEach((o, n) => {
|
|
1834
|
+
(o.playerId === e.selfPlayerId || o.isPublic) && t.push(n);
|
|
1835
|
+
}), t;
|
|
1836
|
+
}
|
|
1837
|
+
function Ve(e) {
|
|
1838
|
+
const t = /* @__PURE__ */ new Set();
|
|
1839
|
+
for (const o of e)
|
|
1840
|
+
for (const n of Xe(o))
|
|
1841
|
+
t.add(n);
|
|
1842
|
+
return t;
|
|
1843
|
+
}
|
|
1844
|
+
function _t(e) {
|
|
1845
|
+
const t = Ve(e.trains), o = [];
|
|
1846
|
+
for (const n of Xt(e)) {
|
|
1847
|
+
const r = e.trains[n], i = Nt(
|
|
1848
|
+
r,
|
|
1849
|
+
e.engineValue,
|
|
1850
|
+
e.hand,
|
|
1851
|
+
t,
|
|
1852
|
+
e.rules
|
|
1853
|
+
);
|
|
1854
|
+
for (const l of i)
|
|
1855
|
+
o.push({ kind: "play", trainIndex: n, move: l });
|
|
1856
|
+
}
|
|
1857
|
+
return o;
|
|
1858
|
+
}
|
|
1859
|
+
function Lt(e = {}) {
|
|
1860
|
+
return (t) => {
|
|
1861
|
+
const o = _t(t), n = [...o];
|
|
1862
|
+
return (t.drawPileSize ?? Number.POSITIVE_INFINITY) > 0 && !t.turnDrawUsed && (o.length === 0 || e.allowOptionalDraw) && n.push({ kind: "draw" }), n.length === 0 && n.push({ kind: "pass" }), n;
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
const Vt = Lt(), N = {
|
|
1866
|
+
preferPlay: "prefer-play",
|
|
1867
|
+
dumpPips: "dump-pips",
|
|
1868
|
+
doublesEarly: "play-doubles-early",
|
|
1869
|
+
ownTrain: "own-train",
|
|
1870
|
+
obligationRelief: "obligation-relief",
|
|
1871
|
+
handFlexibility: "hand-flexibility",
|
|
1872
|
+
defensivePublic: "defensive-public"
|
|
1873
|
+
};
|
|
1874
|
+
function Be(e) {
|
|
1875
|
+
const t = de(e.move.tile, e.move.end.value);
|
|
1876
|
+
return t ? t.value2 : e.move.tile.value2;
|
|
1877
|
+
}
|
|
1878
|
+
const Bt = {
|
|
1879
|
+
id: N.preferPlay,
|
|
1880
|
+
score(e) {
|
|
1881
|
+
return e.kind === "play" ? 100 : e.kind === "draw" ? 0 : -50;
|
|
1882
|
+
}
|
|
1883
|
+
}, Ut = {
|
|
1884
|
+
id: N.dumpPips,
|
|
1885
|
+
score(e) {
|
|
1886
|
+
if (!X(e)) return 0;
|
|
1887
|
+
const t = e.move.tile;
|
|
1888
|
+
return t.value1 + t.value2;
|
|
1889
|
+
}
|
|
1890
|
+
}, jt = {
|
|
1891
|
+
id: N.doublesEarly,
|
|
1892
|
+
score(e, t) {
|
|
1893
|
+
if (!X(e)) return 0;
|
|
1894
|
+
const o = e.move.tile;
|
|
1895
|
+
return o.value1 !== o.value2 ? 0 : Math.min(t.obs.hand.length, 12);
|
|
1896
|
+
}
|
|
1897
|
+
}, Gt = {
|
|
1898
|
+
id: N.ownTrain,
|
|
1899
|
+
score(e, t) {
|
|
1900
|
+
if (!X(e)) return 0;
|
|
1901
|
+
const o = t.obs.trains[e.trainIndex];
|
|
1902
|
+
return o && o.playerId === t.obs.selfPlayerId ? 8 : 0;
|
|
1903
|
+
}
|
|
1904
|
+
}, qt = {
|
|
1905
|
+
id: N.obligationRelief,
|
|
1906
|
+
score(e) {
|
|
1907
|
+
return X(e) && e.move.end.obligation ? 10 : 0;
|
|
1908
|
+
}
|
|
1909
|
+
}, Kt = {
|
|
1910
|
+
id: N.handFlexibility,
|
|
1911
|
+
score(e, t) {
|
|
1912
|
+
if (!X(e)) return 0;
|
|
1913
|
+
const o = Be(e), n = B(e.move.tile);
|
|
1914
|
+
let r = !1, i = 0;
|
|
1915
|
+
for (const l of t.obs.hand) {
|
|
1916
|
+
if (!r && B(l) === n) {
|
|
1917
|
+
r = !0;
|
|
1918
|
+
continue;
|
|
1919
|
+
}
|
|
1920
|
+
Fe(l, o) && i++;
|
|
1921
|
+
}
|
|
1922
|
+
return i * 3;
|
|
1923
|
+
}
|
|
1924
|
+
}, Ht = {
|
|
1925
|
+
id: N.defensivePublic,
|
|
1926
|
+
score(e, t) {
|
|
1927
|
+
if (!X(e)) return 0;
|
|
1928
|
+
const o = t.obs.trains[e.trainIndex];
|
|
1929
|
+
if (!o || o.playerId === t.obs.selfPlayerId) return 0;
|
|
1930
|
+
const n = Be(e);
|
|
1931
|
+
let r = 0;
|
|
1932
|
+
for (const i of t.unseen)
|
|
1933
|
+
Fe(i, n) && r++;
|
|
1934
|
+
return -r;
|
|
1935
|
+
}
|
|
1936
|
+
}, Zt = [
|
|
1937
|
+
Bt,
|
|
1938
|
+
Ut,
|
|
1939
|
+
jt,
|
|
1940
|
+
Gt,
|
|
1941
|
+
qt,
|
|
1942
|
+
Kt,
|
|
1943
|
+
Ht
|
|
1944
|
+
], w = N, Jt = {
|
|
1945
|
+
beginner: {
|
|
1946
|
+
id: "beginner",
|
|
1947
|
+
temperature: 2.5,
|
|
1948
|
+
blunderRate: 0.25,
|
|
1949
|
+
lookaheadDepth: 0,
|
|
1950
|
+
enabled: /* @__PURE__ */ new Set([w.preferPlay, w.dumpPips]),
|
|
1951
|
+
weights: {
|
|
1952
|
+
[w.preferPlay]: 1,
|
|
1953
|
+
[w.dumpPips]: 0.2
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
1956
|
+
intermediate: {
|
|
1957
|
+
id: "intermediate",
|
|
1958
|
+
temperature: 0.6,
|
|
1959
|
+
blunderRate: 0.05,
|
|
1960
|
+
lookaheadDepth: 0,
|
|
1961
|
+
enabled: /* @__PURE__ */ new Set([w.preferPlay, w.dumpPips, w.doublesEarly, w.ownTrain]),
|
|
1962
|
+
weights: {
|
|
1963
|
+
[w.preferPlay]: 1,
|
|
1964
|
+
[w.dumpPips]: 1,
|
|
1965
|
+
[w.doublesEarly]: 1,
|
|
1966
|
+
[w.ownTrain]: 1
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
advanced: {
|
|
1970
|
+
id: "advanced",
|
|
1971
|
+
temperature: 0.15,
|
|
1972
|
+
blunderRate: 0,
|
|
1973
|
+
lookaheadDepth: 0,
|
|
1974
|
+
enabled: /* @__PURE__ */ new Set([
|
|
1975
|
+
w.preferPlay,
|
|
1976
|
+
w.dumpPips,
|
|
1977
|
+
w.doublesEarly,
|
|
1978
|
+
w.ownTrain,
|
|
1979
|
+
w.obligationRelief,
|
|
1980
|
+
w.handFlexibility,
|
|
1981
|
+
w.defensivePublic
|
|
1982
|
+
]),
|
|
1983
|
+
weights: {
|
|
1984
|
+
[w.preferPlay]: 1,
|
|
1985
|
+
[w.dumpPips]: 1.2,
|
|
1986
|
+
[w.doublesEarly]: 1.5,
|
|
1987
|
+
[w.ownTrain]: 1,
|
|
1988
|
+
[w.obligationRelief]: 1.5,
|
|
1989
|
+
[w.handFlexibility]: 1,
|
|
1990
|
+
[w.defensivePublic]: 1.5
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
};
|
|
1994
|
+
function Mn(e) {
|
|
1995
|
+
return Jt[e];
|
|
1996
|
+
}
|
|
1997
|
+
function Qt(e, t, o, n) {
|
|
1998
|
+
let r = 0;
|
|
1999
|
+
for (const i of n.enabled) {
|
|
2000
|
+
const l = o.get(i);
|
|
2001
|
+
if (!l) continue;
|
|
2002
|
+
const s = n.weights[i] ?? 1;
|
|
2003
|
+
r += s * l.score(e, t);
|
|
2004
|
+
}
|
|
2005
|
+
return r;
|
|
2006
|
+
}
|
|
2007
|
+
function Wt(e, t) {
|
|
2008
|
+
let o = Number.NEGATIVE_INFINITY, n = [];
|
|
2009
|
+
return e.forEach((r, i) => {
|
|
2010
|
+
r > o ? (o = r, n = [i]) : r === o && n.push(i);
|
|
2011
|
+
}), n[Math.floor(t() * n.length)];
|
|
2012
|
+
}
|
|
2013
|
+
function en(e, t, o) {
|
|
2014
|
+
const n = Math.max(...e), r = e.map((s) => Math.exp((s - n) / t)), i = r.reduce((s, a) => s + a, 0);
|
|
2015
|
+
let l = o() * i;
|
|
2016
|
+
for (let s = 0; s < r.length; s++)
|
|
2017
|
+
if (l -= r[s], l <= 0) return s;
|
|
2018
|
+
return r.length - 1;
|
|
2019
|
+
}
|
|
2020
|
+
function tn(e, t, o) {
|
|
2021
|
+
return e.length <= 1 ? 0 : t.temperature <= 0 ? Wt(e, o) : en(e, t.temperature, o);
|
|
2022
|
+
}
|
|
2023
|
+
function nn(e) {
|
|
2024
|
+
const { skill: t, generateCandidates: o, buildContext: n, fallback: r } = e, i = e.rng ?? Math.random, l = new Map(e.heuristics.map((s) => [s.id, s]));
|
|
2025
|
+
return {
|
|
2026
|
+
decide(s) {
|
|
2027
|
+
const a = o(s);
|
|
2028
|
+
if (a.length === 0) return r(s);
|
|
2029
|
+
if (a.length === 1) return a[0];
|
|
2030
|
+
if (t.blunderRate > 0 && i() < t.blunderRate)
|
|
2031
|
+
return a[Math.floor(i() * a.length)];
|
|
2032
|
+
const c = n(s, a), d = a.map(
|
|
2033
|
+
(u) => Qt(u, c, l, t)
|
|
2034
|
+
);
|
|
2035
|
+
return a[tn(d, t, i)];
|
|
2036
|
+
}
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
function on(e, t, o) {
|
|
2040
|
+
const n = Ve(e.trains), r = new Set(n);
|
|
2041
|
+
for (const l of e.hand)
|
|
2042
|
+
r.add(B(l));
|
|
2043
|
+
const i = wt(e.rules.maxPips).filter(
|
|
2044
|
+
(l) => !r.has(B(l))
|
|
2045
|
+
);
|
|
2046
|
+
return {
|
|
2047
|
+
obs: e,
|
|
2048
|
+
playedKeys: n,
|
|
2049
|
+
candidates: t,
|
|
2050
|
+
playCandidates: t.filter(X),
|
|
2051
|
+
unseen: i,
|
|
2052
|
+
rng: o
|
|
2053
|
+
};
|
|
2054
|
+
}
|
|
2055
|
+
function kn(e) {
|
|
2056
|
+
const t = e.heuristics ?? Zt, o = e.generateCandidates ?? Vt, n = e.rng ?? Math.random;
|
|
2057
|
+
return nn({
|
|
2058
|
+
skill: e.skill,
|
|
2059
|
+
heuristics: t,
|
|
2060
|
+
generateCandidates: o,
|
|
2061
|
+
buildContext: (r, i) => on(r, i, n),
|
|
2062
|
+
fallback: () => ({ kind: "pass" }),
|
|
2063
|
+
rng: n
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
function Ue(e, t, o) {
|
|
2067
|
+
let n = t.legalActions(e);
|
|
2068
|
+
return t.orderActions && (n = t.orderActions(e, n)), Number.isFinite(o) && n.length > o && (n = n.slice(0, o)), n;
|
|
2069
|
+
}
|
|
2070
|
+
function je(e, t, o, n, r) {
|
|
2071
|
+
if (o <= 0 || t.isTerminal(e))
|
|
2072
|
+
return t.evaluate(e, n);
|
|
2073
|
+
const i = Ue(e, t, r);
|
|
2074
|
+
if (i.length === 0)
|
|
2075
|
+
return t.evaluate(e, n);
|
|
2076
|
+
const l = t.currentPlayer(e) === n;
|
|
2077
|
+
let s = l ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;
|
|
2078
|
+
for (const a of i) {
|
|
2079
|
+
const c = je(
|
|
2080
|
+
t.applyAction(e, a),
|
|
2081
|
+
t,
|
|
2082
|
+
o - 1,
|
|
2083
|
+
n,
|
|
2084
|
+
r
|
|
2085
|
+
);
|
|
2086
|
+
s = l ? Math.max(s, c) : Math.min(s, c);
|
|
2087
|
+
}
|
|
2088
|
+
return s;
|
|
2089
|
+
}
|
|
2090
|
+
function Cn(e, t, o) {
|
|
2091
|
+
const n = o.rng ?? Math.random, r = Math.max(1, o.determinizations ?? 1), i = o.maxBranch ?? Number.POSITIVE_INFINITY, l = Math.max(1, o.depth);
|
|
2092
|
+
return Ue(e, t, i).map((a) => {
|
|
2093
|
+
let c = 0;
|
|
2094
|
+
for (let d = 0; d < r; d++) {
|
|
2095
|
+
const u = t.determinize ? t.determinize(e, o.perspective, n) : e;
|
|
2096
|
+
c += je(
|
|
2097
|
+
t.applyAction(u, a),
|
|
2098
|
+
t,
|
|
2099
|
+
l - 1,
|
|
2100
|
+
o.perspective,
|
|
2101
|
+
i
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
return { action: a, value: c / r };
|
|
2105
|
+
});
|
|
1788
2106
|
}
|
|
1789
2107
|
export {
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
K as
|
|
1855
|
-
|
|
2108
|
+
In as CHICKEN_FOOT_FIXTURES,
|
|
2109
|
+
lt as CHICKEN_FOOT_TOE_ANGLES,
|
|
2110
|
+
Je as DEFAULT_DOMINO_THEME,
|
|
2111
|
+
Zt as DEFAULT_HEURISTICS,
|
|
2112
|
+
q as DEFAULT_PIP_COLORS,
|
|
2113
|
+
ie as DEFAULT_RULES,
|
|
2114
|
+
We as DefaultPip,
|
|
2115
|
+
mt as DominoHub,
|
|
2116
|
+
sn as DominoThemeProvider,
|
|
2117
|
+
bt as DominoTrain,
|
|
2118
|
+
Te as DoubleTwelve,
|
|
2119
|
+
N as HEURISTIC_IDS,
|
|
2120
|
+
vn as MexicanTrainGame,
|
|
2121
|
+
an as PIP_COLORS,
|
|
2122
|
+
nt as PIP_LAYOUTS,
|
|
2123
|
+
Jt as SKILL_PRESETS,
|
|
2124
|
+
zn as TRAIN_FIXTURES,
|
|
2125
|
+
fe as TURN_DEGREES,
|
|
2126
|
+
Sn as Viewport,
|
|
2127
|
+
Yt as applyMove,
|
|
2128
|
+
Wt as argmaxIndex,
|
|
2129
|
+
Ye as buildBranchTiles,
|
|
2130
|
+
tn as chooseActionIndex,
|
|
2131
|
+
pe as clampScale,
|
|
2132
|
+
Ve as collectAllPlayedKeys,
|
|
2133
|
+
Xe as collectPlayedKeys,
|
|
2134
|
+
ct as computeTrainLayout,
|
|
2135
|
+
ue as computeTrainTree,
|
|
2136
|
+
kn as createAiPlayer,
|
|
2137
|
+
Lt as createCandidateGenerator,
|
|
2138
|
+
nn as createPolicyPlayer,
|
|
2139
|
+
mn as cycleBendAt,
|
|
2140
|
+
Vt as defaultCandidateGenerator,
|
|
2141
|
+
B as dominoKey,
|
|
2142
|
+
gn as dominoSetSize,
|
|
2143
|
+
_e as evaluatePlacement,
|
|
2144
|
+
Ct as fitToBounds,
|
|
2145
|
+
Ee as flattenSegments,
|
|
2146
|
+
wt as generateDominoSet,
|
|
2147
|
+
_t as generatePlayActions,
|
|
2148
|
+
St as generateSampleTrains,
|
|
2149
|
+
Xt as getAccessibleTrainIndices,
|
|
2150
|
+
At as getBranchAt,
|
|
2151
|
+
Nt as getLegalMoves,
|
|
2152
|
+
Ft as getOpenEnds,
|
|
2153
|
+
ot as getPipLayout,
|
|
2154
|
+
cn as getPipStyle,
|
|
2155
|
+
Mn as getSkillProfile,
|
|
2156
|
+
dn as getTrainLayoutBounds,
|
|
2157
|
+
Rt as getUnsatisfiedDoubles,
|
|
2158
|
+
at as headingAtIndex,
|
|
2159
|
+
yt as hubTrainStartDistance,
|
|
2160
|
+
Re as isDouble,
|
|
2161
|
+
X as isPlayAction,
|
|
2162
|
+
$e as layoutSelfIntersects,
|
|
2163
|
+
De as layoutsCollide,
|
|
2164
|
+
bn as linearDefaultSide,
|
|
2165
|
+
ze as mergeDominoTheme,
|
|
2166
|
+
un as mergePipColors,
|
|
2167
|
+
Ce as normalizeBends,
|
|
2168
|
+
xn as offsetDefaultSide,
|
|
2169
|
+
Ne as oppositeSide,
|
|
2170
|
+
de as orientForConnection,
|
|
2171
|
+
hn as otherEnd,
|
|
2172
|
+
K as outwardPerpSign,
|
|
2173
|
+
Tn as playMove,
|
|
2174
|
+
$t as requiredDoubleAnswers,
|
|
2175
|
+
yn as resolveBend,
|
|
2176
|
+
tt as resolvePipPosition,
|
|
2177
|
+
Pe as resolvePipStyle,
|
|
2178
|
+
Pn as resolveRules,
|
|
2179
|
+
Qt as scoreWithHeuristics,
|
|
2180
|
+
wn as screenToContent,
|
|
2181
|
+
Cn as searchActionValues,
|
|
2182
|
+
se as sideToTurn,
|
|
2183
|
+
Et as sideToeSlots,
|
|
2184
|
+
en as softmaxIndex,
|
|
2185
|
+
A as stepAlongTrain,
|
|
2186
|
+
Qe as themeDataAttributes,
|
|
2187
|
+
be as tileCorners,
|
|
2188
|
+
Fe as tileHasValue,
|
|
2189
|
+
V as tileKey,
|
|
2190
|
+
ee as tilesOverlap,
|
|
2191
|
+
Ie as useDominoTheme,
|
|
2192
|
+
vt as validateChickenFootChain,
|
|
2193
|
+
fn as validateTrainLayout,
|
|
2194
|
+
pn as validateTrainTree,
|
|
2195
|
+
Q as withBendAt,
|
|
2196
|
+
me as zoomAt
|
|
1856
2197
|
};
|
|
1857
2198
|
//# sourceMappingURL=index.js.map
|