@pieai/swimmer-ui-kit 3.0.0-rc.1 → 3.0.0-rc.3
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/CHANGELOG.md +18 -3
- package/README.md +3 -3
- package/dist/{GameStageTile-BcFCu22b.js → GameStageTile-DwU_Vvi8.js} +408 -365
- package/dist/index.d.ts +13 -2
- package/dist/index.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { _ as e, b as t, d as n, f as r, g as i, h as a, l as o, p as s, t as c, u as l, v as u, y as d } from "./LiquidGroup-BXw1tv9H.js";
|
|
3
|
-
import { g as f, h as p,
|
|
4
|
-
import { A as
|
|
5
|
-
import { cloneElement as ze, createElement as Be, forwardRef as
|
|
6
|
-
import { Fragment as
|
|
3
|
+
import { g as f, h as p, r as m, t as h } from "./reducedMotion-B8kv-v64.js";
|
|
4
|
+
import { A as g, B as _, C as v, D as y, E as b, F as x, G as S, H as C, I as w, J as ee, K as te, L as ne, M as re, N as ie, O as ae, P as oe, R as se, S as ce, T as le, U as ue, V as de, W as fe, _ as pe, a as me, b as he, c as ge, d as _e, f as ve, g as ye, h as be, i as xe, j as Se, k as Ce, l as we, m as Te, n as Ee, o as De, p as Oe, q as ke, r as Ae, s as je, t as Me, u as Ne, v as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./paths-B7D0h7Mh.js";
|
|
5
|
+
import { cloneElement as ze, createElement as Be, forwardRef as T, isValidElement as Ve, useCallback as He, useEffect as E, useId as D, useLayoutEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
6
|
+
import { Fragment as Ue, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
7
7
|
//#region src/tokens/index.ts
|
|
8
|
-
var
|
|
8
|
+
var We = {
|
|
9
9
|
...e,
|
|
10
10
|
...t,
|
|
11
11
|
...u,
|
|
@@ -19,13 +19,13 @@ var Ge = {
|
|
|
19
19
|
...n,
|
|
20
20
|
...o,
|
|
21
21
|
...r
|
|
22
|
-
},
|
|
22
|
+
}, Ge = {
|
|
23
23
|
toneAttr: "data-game-ui-tone",
|
|
24
24
|
toneGlass: "glass",
|
|
25
25
|
densityAttr: "data-game-ui-density",
|
|
26
26
|
densityCompact: "compact",
|
|
27
27
|
scopeClass: "game-ui-overlay-scope"
|
|
28
|
-
},
|
|
28
|
+
}, Ke = d, qe = [
|
|
29
29
|
"--game-ui-bg",
|
|
30
30
|
"--game-ui-surface",
|
|
31
31
|
"--game-ui-surface-raised",
|
|
@@ -49,7 +49,7 @@ var Ge = {
|
|
|
49
49
|
"--game-ui-wood",
|
|
50
50
|
"--game-ui-ink-title",
|
|
51
51
|
"--game-ui-ink-heading"
|
|
52
|
-
],
|
|
52
|
+
], P = {
|
|
53
53
|
set: {
|
|
54
54
|
kind: "body",
|
|
55
55
|
summary: "A liquid body firms up and stops being liquid.",
|
|
@@ -238,15 +238,15 @@ var Ge = {
|
|
|
238
238
|
transition: "wobbly"
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
},
|
|
242
|
-
function
|
|
241
|
+
}, Je = Object.keys(P);
|
|
242
|
+
function F(e, t) {
|
|
243
243
|
return {
|
|
244
|
-
...
|
|
244
|
+
...P[e].group,
|
|
245
245
|
...t
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
let n =
|
|
248
|
+
function Ye(e, t) {
|
|
249
|
+
let n = P[e].item;
|
|
250
250
|
return {
|
|
251
251
|
...n,
|
|
252
252
|
...t,
|
|
@@ -258,16 +258,16 @@ function Ze(e, t) {
|
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region src/liquid/LiquidSurface/LiquidSurface.tsx
|
|
261
|
-
var
|
|
261
|
+
var Xe = {
|
|
262
262
|
set: {
|
|
263
263
|
scale: .99,
|
|
264
264
|
scaleY: .99,
|
|
265
265
|
y: 0
|
|
266
266
|
},
|
|
267
267
|
press: {
|
|
268
|
-
scale: 1.
|
|
269
|
-
scaleY: .
|
|
270
|
-
y:
|
|
268
|
+
scale: 1.06,
|
|
269
|
+
scaleY: .87,
|
|
270
|
+
y: 3
|
|
271
271
|
},
|
|
272
272
|
swell: {
|
|
273
273
|
scale: 1.07,
|
|
@@ -320,58 +320,82 @@ var Qe = {
|
|
|
320
320
|
scaleY: 1,
|
|
321
321
|
y: 0
|
|
322
322
|
}
|
|
323
|
-
},
|
|
323
|
+
}, Ze = { settle: {
|
|
324
324
|
scale: .94,
|
|
325
325
|
scaleY: 1.08,
|
|
326
326
|
y: -8
|
|
327
|
-
} },
|
|
328
|
-
|
|
329
|
-
|
|
327
|
+
} }, Qe = {
|
|
328
|
+
scale: 1.04,
|
|
329
|
+
scaleY: 1.04,
|
|
330
|
+
y: 0
|
|
331
|
+
}, $e = 600, et = {
|
|
332
|
+
duration: $e,
|
|
333
|
+
ease: "ease-in-out"
|
|
334
|
+
};
|
|
335
|
+
function tt(e, t, n) {
|
|
336
|
+
let [r, i] = j(!1), [a, o] = j(t), [s, c] = j(!1);
|
|
337
|
+
return a !== t && (o(t), a && c(!0)), E(() => {
|
|
338
|
+
if (!e) return;
|
|
339
|
+
let t = window.setInterval(() => i((e) => !e), $e);
|
|
340
|
+
return () => window.clearInterval(t);
|
|
341
|
+
}, [e]), E(() => {
|
|
342
|
+
if (!s) return;
|
|
343
|
+
let e = window.setTimeout(() => c(!1), n);
|
|
344
|
+
return () => window.clearTimeout(e);
|
|
345
|
+
}, [s, n]), {
|
|
346
|
+
swollen: e && r,
|
|
347
|
+
rebounding: s
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
var nt = /* @__PURE__ */ new Set();
|
|
351
|
+
function rt(e) {
|
|
352
|
+
nt.has(e) || (nt.add(e), console.warn(`LiquidSurface cannot express the '${e}' form: it describes a relationship between sibling items, not one body. Arrange the items in a <LiquidGroup> with explicit group props instead; LiquidSurface will render a body that never moves.`));
|
|
330
353
|
}
|
|
331
|
-
function
|
|
332
|
-
let
|
|
333
|
-
|
|
334
|
-
let
|
|
354
|
+
function it({ children: e, form: t = "press", active: n = !1, breathing: r = !1, fill: i = "var(--game-ui-liquid-surface-fill, var(--game-ui-surface-raised))", stroke: a, shadow: o, gloss: s, outline: l, radius: u = 999, className: d, style: f }) {
|
|
355
|
+
let p = h(), g = n && !p, _ = k(() => F(t, g ? P[t].groupEngaged : void 0), [t, g]), v = k(() => Ye(t), [t]);
|
|
356
|
+
P[t].kind === "group" && rt(t);
|
|
357
|
+
let y = r && !g && !p, b = tt(y, g, m(v.transition).duration), x = g ? Xe[t] : b.swollen ? Qe : Ze[t] ?? {
|
|
335
358
|
scale: 1,
|
|
336
359
|
scaleY: 1,
|
|
337
360
|
y: 0
|
|
338
|
-
}, v =
|
|
339
|
-
amplitude:
|
|
340
|
-
lobes:
|
|
361
|
+
}, S = y && !b.rebounding ? et : v.transition, C = o ?? _.shadow, w = l ? {
|
|
362
|
+
amplitude: l.amplitude,
|
|
363
|
+
lobes: l.lobes ?? _.lobes
|
|
341
364
|
} : {
|
|
342
|
-
amplitude:
|
|
343
|
-
lobes:
|
|
365
|
+
amplitude: _.blob,
|
|
366
|
+
lobes: _.lobes
|
|
344
367
|
};
|
|
345
|
-
return /* @__PURE__ */
|
|
346
|
-
className: ["game-ui-liquid-surface",
|
|
368
|
+
return /* @__PURE__ */ N("span", {
|
|
369
|
+
className: ["game-ui-liquid-surface", d].filter(Boolean).join(" "),
|
|
347
370
|
"data-liquid-form": t,
|
|
348
|
-
"data-liquid-active":
|
|
349
|
-
|
|
350
|
-
|
|
371
|
+
"data-liquid-active": g ? "true" : "false",
|
|
372
|
+
"data-liquid-breathing": y ? "true" : void 0,
|
|
373
|
+
style: f,
|
|
374
|
+
children: [/* @__PURE__ */ M(c, {
|
|
351
375
|
"aria-hidden": "true",
|
|
352
|
-
blur:
|
|
376
|
+
blur: _.blur,
|
|
353
377
|
className: "game-ui-liquid-surface__body",
|
|
354
|
-
contrast:
|
|
355
|
-
gloss:
|
|
356
|
-
fill:
|
|
357
|
-
filterPadding: Math.max(
|
|
358
|
-
motion:
|
|
359
|
-
...
|
|
360
|
-
...
|
|
361
|
-
children: /* @__PURE__ */
|
|
362
|
-
...
|
|
378
|
+
contrast: _.contrast,
|
|
379
|
+
gloss: s ?? _.gloss,
|
|
380
|
+
fill: i,
|
|
381
|
+
filterPadding: Math.max(_.filterPadding, Math.ceil(w.amplitude) + 8),
|
|
382
|
+
motion: p ? "reduced" : "auto",
|
|
383
|
+
...C === void 0 ? {} : { shadow: C },
|
|
384
|
+
...a === void 0 ? {} : { stroke: a },
|
|
385
|
+
children: /* @__PURE__ */ M(c.Item, {
|
|
386
|
+
...w.amplitude > 0 ? { blob: w } : {},
|
|
363
387
|
className: "game-ui-liquid-surface__shape",
|
|
364
|
-
...
|
|
365
|
-
...
|
|
366
|
-
radius:
|
|
367
|
-
scale:
|
|
368
|
-
scaleY:
|
|
369
|
-
...
|
|
370
|
-
...
|
|
371
|
-
y:
|
|
372
|
-
children: /* @__PURE__ */
|
|
388
|
+
...v.effect === void 0 ? {} : { effect: v.effect },
|
|
389
|
+
...v.morph === void 0 ? {} : { morph: v.morph },
|
|
390
|
+
radius: u,
|
|
391
|
+
scale: x.scale,
|
|
392
|
+
scaleY: x.scaleY,
|
|
393
|
+
...S === void 0 ? {} : { transition: S },
|
|
394
|
+
...x.x === void 0 ? {} : { x: x.x },
|
|
395
|
+
y: x.y,
|
|
396
|
+
children: /* @__PURE__ */ M("span", { className: "game-ui-liquid-surface__fill" })
|
|
373
397
|
})
|
|
374
|
-
}), /* @__PURE__ */
|
|
398
|
+
}), /* @__PURE__ */ M("span", {
|
|
375
399
|
className: "game-ui-liquid-surface__content",
|
|
376
400
|
children: e
|
|
377
401
|
})]
|
|
@@ -379,19 +403,19 @@ function N({ children: e, form: t = "press", active: n = !1, fill: r = "var(--ga
|
|
|
379
403
|
}
|
|
380
404
|
//#endregion
|
|
381
405
|
//#region src/feedback/sound/interactionSound.ts
|
|
382
|
-
var
|
|
383
|
-
function
|
|
406
|
+
var I = null, at = !1;
|
|
407
|
+
function L(e) {
|
|
384
408
|
return typeof e != "number" || !Number.isFinite(e) ? 1 : Math.min(1, Math.max(0, e));
|
|
385
409
|
}
|
|
386
|
-
function
|
|
387
|
-
|
|
388
|
-
document.visibilityState === "hidden" &&
|
|
389
|
-
}),
|
|
410
|
+
function ot() {
|
|
411
|
+
at || typeof document > "u" || (document.addEventListener("visibilitychange", () => {
|
|
412
|
+
document.visibilityState === "hidden" && I?.state === "running" && I.suspend();
|
|
413
|
+
}), at = !0);
|
|
390
414
|
}
|
|
391
|
-
function
|
|
392
|
-
return typeof window > "u" || window.AudioContext === void 0 ? null : (
|
|
415
|
+
function st() {
|
|
416
|
+
return typeof window > "u" || window.AudioContext === void 0 ? null : (ot(), I ??= new window.AudioContext(), I);
|
|
393
417
|
}
|
|
394
|
-
function
|
|
418
|
+
function ct(e) {
|
|
395
419
|
let t = /* @__PURE__ */ new WeakMap();
|
|
396
420
|
return {
|
|
397
421
|
createGain: () => {
|
|
@@ -428,21 +452,21 @@ function rt(e) {
|
|
|
428
452
|
suspend: () => e.suspend()
|
|
429
453
|
};
|
|
430
454
|
}
|
|
431
|
-
function
|
|
455
|
+
function lt(e, t = {}) {
|
|
432
456
|
if (t.enabled === !1) return !1;
|
|
433
|
-
let n = .06 *
|
|
457
|
+
let n = .06 * L(t.masterVolume) * L(t.sfxVolume);
|
|
434
458
|
if (n <= 0) return !1;
|
|
435
459
|
e.state === "suspended" && e.resume();
|
|
436
460
|
let r = e.currentTime, i = e.createOscillator(), a = e.createGain();
|
|
437
461
|
return i.type = "triangle", i.frequency.setValueAtTime(420, r), i.frequency.exponentialRampToValueAtTime(620, r + .045), a.gain.setValueAtTime(1e-4, r), a.gain.exponentialRampToValueAtTime(n, r + .008), a.gain.exponentialRampToValueAtTime(1e-4, r + .055), i.connect(a), a.connect(e.destination), i.start(r), i.stop(r + .055), !0;
|
|
438
462
|
}
|
|
439
|
-
function
|
|
440
|
-
let t =
|
|
441
|
-
return t ?
|
|
463
|
+
function ut(e = {}) {
|
|
464
|
+
let t = st();
|
|
465
|
+
return t ? lt(ct(t), e) : !1;
|
|
442
466
|
}
|
|
443
|
-
function
|
|
467
|
+
function dt(e, t, n = {}) {
|
|
444
468
|
if (n.enabled === !1) return !1;
|
|
445
|
-
let r = .05 *
|
|
469
|
+
let r = .05 * L(n.masterVolume) * L(n.sfxVolume);
|
|
446
470
|
if (r <= 0) return !1;
|
|
447
471
|
e.state === "suspended" && e.resume();
|
|
448
472
|
let i = e.currentTime, a = (t, n, r, i, a, o) => {
|
|
@@ -451,67 +475,82 @@ function ot(e, t, n = {}) {
|
|
|
451
475
|
};
|
|
452
476
|
return a("triangle", 900, 260, i, .09, r), (t === "legendary" ? [880, 1320] : t === "rare" ? [990] : []).forEach((e, t) => a("sine", e, e, i + .08 + t * .09, .35, r * .8)), !0;
|
|
453
477
|
}
|
|
454
|
-
function
|
|
455
|
-
let n =
|
|
456
|
-
return n ?
|
|
478
|
+
function ft(e, t = {}) {
|
|
479
|
+
let n = st();
|
|
480
|
+
return n ? dt(ct(n), e, t) : !1;
|
|
457
481
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
},
|
|
464
|
-
if (n)
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
},
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
482
|
+
function pt(e, t) {
|
|
483
|
+
let n = !1, r = null, i = null, a = !1, o = 0, s, c = !1, l = () => {}, u = () => e.matches(":disabled,[aria-disabled=\"true\"]") || !!e.querySelector(":scope > input:disabled"), d = () => {
|
|
484
|
+
o++, r = null, i = null, c = !1, clearTimeout(s), s = void 0, l(), l = () => {}, n && (n = !1, t(!1));
|
|
485
|
+
}, f = (e) => {
|
|
486
|
+
c || (r = null, i = null, l(), l = () => {}, e.defaultPrevented || s === void 0 ? d() : c = !0);
|
|
487
|
+
}, p = () => {
|
|
488
|
+
if (n) {
|
|
489
|
+
c = !1, m();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
n = !0, t(!0), s = setTimeout(() => {
|
|
493
|
+
s = void 0, c && d();
|
|
494
|
+
}, 140), m();
|
|
495
|
+
}, m = () => {
|
|
496
|
+
l();
|
|
497
|
+
let t = (e) => {
|
|
498
|
+
(r === null || e.pointerId === r) && f(e);
|
|
499
|
+
}, n = (e) => {
|
|
500
|
+
(r === null || e.pointerId === r) && d();
|
|
501
|
+
}, a = (e) => {
|
|
502
|
+
e.key === i ? f(e) : e.key === "Escape" && d();
|
|
503
|
+
}, o = () => {
|
|
504
|
+
document.hidden && d();
|
|
505
|
+
}, s = new MutationObserver(() => {
|
|
506
|
+
u() && d();
|
|
474
507
|
});
|
|
475
|
-
for (let t = e; t; t = t.parentElement) (t === e || t.tagName === "FIELDSET") &&
|
|
508
|
+
for (let t = e; t; t = t.parentElement) (t === e || t.tagName === "FIELDSET") && s.observe(t, {
|
|
476
509
|
attributes: !0,
|
|
477
510
|
attributeFilter: ["disabled", "aria-disabled"]
|
|
478
511
|
});
|
|
479
|
-
window.addEventListener("pointerup",
|
|
480
|
-
|
|
512
|
+
window.addEventListener("pointerup", t), window.addEventListener("pointercancel", n), window.addEventListener("keyup", a), window.addEventListener("blur", d), document.addEventListener("visibilitychange", o), l = () => {
|
|
513
|
+
s.disconnect(), window.removeEventListener("pointerup", t), window.removeEventListener("pointercancel", n), window.removeEventListener("keyup", a), window.removeEventListener("blur", d), document.removeEventListener("visibilitychange", o);
|
|
481
514
|
};
|
|
482
|
-
},
|
|
483
|
-
if (t.button !== 0 ||
|
|
515
|
+
}, h = (t) => {
|
|
516
|
+
if (t.button !== 0 || u()) return;
|
|
484
517
|
let n = ++o;
|
|
485
518
|
r = t.pointerId, queueMicrotask(() => {
|
|
486
|
-
!a && n === o && !t.defaultPrevented && !
|
|
519
|
+
!a && n === o && !t.defaultPrevented && !u() && e.isConnected ? p() : n === o && (r = null);
|
|
487
520
|
});
|
|
488
|
-
},
|
|
489
|
-
(r === null || e.pointerId === r) &&
|
|
490
|
-
},
|
|
521
|
+
}, g = (e) => {
|
|
522
|
+
(r === null || e.pointerId === r) && f(e);
|
|
523
|
+
}, _ = (e) => {
|
|
524
|
+
(r === null || e.pointerId === r) && d();
|
|
525
|
+
}, v = () => {
|
|
526
|
+
c || d();
|
|
527
|
+
}, y = (t) => {
|
|
491
528
|
if (t.key === "Escape") {
|
|
492
|
-
|
|
529
|
+
d();
|
|
493
530
|
return;
|
|
494
531
|
}
|
|
495
|
-
if (t.repeat || t.key !== " " && t.key !== "Enter" ||
|
|
532
|
+
if (t.repeat || t.key !== " " && t.key !== "Enter" || u() || e.tagName === "LABEL" && t.key === "Enter" || e.tagName === "A" && t.key === " ") return;
|
|
496
533
|
let n = ++o;
|
|
497
534
|
queueMicrotask(() => {
|
|
498
|
-
!a && n === o && !t.defaultPrevented && !
|
|
535
|
+
!a && n === o && !t.defaultPrevented && !u() && e.isConnected && (i = t.key, p());
|
|
499
536
|
});
|
|
500
|
-
},
|
|
501
|
-
|
|
537
|
+
}, b = (e) => {
|
|
538
|
+
e.key === i ? f(e) : d();
|
|
539
|
+
}, x = (t) => {
|
|
540
|
+
c || (r === null || t.relatedTarget instanceof Node && !e.contains(t.relatedTarget)) && d();
|
|
502
541
|
};
|
|
503
|
-
return e.addEventListener("pointerdown",
|
|
504
|
-
a = !0,
|
|
542
|
+
return e.addEventListener("pointerdown", h), e.addEventListener("pointerup", g), e.addEventListener("pointercancel", _), e.addEventListener("pointerleave", v), e.addEventListener("lostpointercapture", v), e.addEventListener("keydown", y), e.addEventListener("keyup", b), e.addEventListener("blur", x, !0), () => {
|
|
543
|
+
a = !0, d(), e.removeEventListener("pointerdown", h), e.removeEventListener("pointerleave", v), e.removeEventListener("pointerup", g), e.removeEventListener("pointercancel", _), e.removeEventListener("lostpointercapture", v), e.removeEventListener("keydown", y), e.removeEventListener("keyup", b), e.removeEventListener("blur", x, !0);
|
|
505
544
|
};
|
|
506
545
|
}
|
|
507
546
|
//#endregion
|
|
508
547
|
//#region src/liquid/LiquidPressSurface/LiquidPressSurface.tsx
|
|
509
|
-
function
|
|
510
|
-
let [
|
|
511
|
-
return
|
|
512
|
-
if (
|
|
513
|
-
let e = !0, n =
|
|
514
|
-
e &&
|
|
548
|
+
function mt({ children: e, control: t, controlIdentity: n, enabled: r, static: i = !1, fullWidth: a = !1, pending: o = !1 }) {
|
|
549
|
+
let [s, c] = j(!1);
|
|
550
|
+
return O(() => {
|
|
551
|
+
if (c(!1), !r || i || !t.current) return;
|
|
552
|
+
let e = !0, n = pt(t.current, (t) => {
|
|
553
|
+
e && c(t);
|
|
515
554
|
});
|
|
516
555
|
return () => {
|
|
517
556
|
e = !1, n();
|
|
@@ -521,12 +560,13 @@ function lt({ children: e, control: t, controlIdentity: n, enabled: r, static: i
|
|
|
521
560
|
n,
|
|
522
561
|
r,
|
|
523
562
|
i
|
|
524
|
-
]), /* @__PURE__ */
|
|
563
|
+
]), /* @__PURE__ */ N("span", {
|
|
525
564
|
className: "game-ui-button-frame",
|
|
526
565
|
"data-liquid": r ? "true" : void 0,
|
|
527
566
|
"data-full-width": a ? "true" : void 0,
|
|
528
|
-
children: [r ? /* @__PURE__ */
|
|
529
|
-
active:
|
|
567
|
+
children: [r ? /* @__PURE__ */ M(it, {
|
|
568
|
+
active: s && !i,
|
|
569
|
+
breathing: o && !i,
|
|
530
570
|
form: "press",
|
|
531
571
|
fill: f,
|
|
532
572
|
className: "game-ui-cta-decoration",
|
|
@@ -536,14 +576,14 @@ function lt({ children: e, control: t, controlIdentity: n, enabled: r, static: i
|
|
|
536
576
|
}
|
|
537
577
|
//#endregion
|
|
538
578
|
//#region src/controls/DropletSurface/geometry.ts
|
|
539
|
-
var
|
|
540
|
-
function
|
|
579
|
+
var R = (e, t) => Number.isFinite(e) ? e : t, z = (e) => Math.round(e * 1e3) / 1e3, B = 1.4;
|
|
580
|
+
function V(e) {
|
|
541
581
|
let t = 2166136261;
|
|
542
582
|
for (let n of e) t = Math.imul(t ^ n.charCodeAt(0), 16777619);
|
|
543
583
|
return (t >>> 0) / 4294967296 * Math.PI * 2;
|
|
544
584
|
}
|
|
545
|
-
function
|
|
546
|
-
let r = Math.max(1,
|
|
585
|
+
function H(e, t, n) {
|
|
586
|
+
let r = Math.max(1, R(e, 1)), i = Math.max(1, R(t, 1)), a = Math.max(.5, Math.min(R(n, i / 2), r / 2, i / 2)), o = Math.max(0, r - 2 * a), s = Math.max(0, i - 2 * a), c = Math.PI * a / 2, l = [
|
|
547
587
|
o,
|
|
548
588
|
c,
|
|
549
589
|
s,
|
|
@@ -580,101 +620,101 @@ function V(e, t, n) {
|
|
|
580
620
|
points: f
|
|
581
621
|
};
|
|
582
622
|
}
|
|
583
|
-
function
|
|
584
|
-
let a = Math.max(0, Math.min(
|
|
623
|
+
function U(e, t, n = 0, r = 0, i = 0) {
|
|
624
|
+
let a = Math.max(0, Math.min(B, R(t, 0), Math.min(e.width, e.height) * .1)), o = R(n, 0), s = R(r, 0), c = R(i, 0), l = e.points.map((t) => {
|
|
585
625
|
let n = Math.PI * 2 * t.u, r = a * (.67 * Math.sin(n * e.frequency + s + o) + .33 * Math.sin(n * (e.frequency + 1) - s * .7 - o * .55));
|
|
586
626
|
return {
|
|
587
627
|
x: t.x + t.nx * r + c,
|
|
588
628
|
y: t.y + t.ny * r + c
|
|
589
629
|
};
|
|
590
|
-
}), u = (e) => l[(e + l.length) % l.length], d = u(0), f = `M${
|
|
630
|
+
}), u = (e) => l[(e + l.length) % l.length], d = u(0), f = `M${z(d.x)} ${z(d.y)}`;
|
|
591
631
|
for (let e = 0; e < l.length; e++) {
|
|
592
632
|
let t = u(e - 1), n = u(e), r = u(e + 1), i = u(e + 2);
|
|
593
|
-
f += `C${
|
|
633
|
+
f += `C${z(n.x + (r.x - t.x) / 6)} ${z(n.y + (r.y - t.y) / 6)} ${z(r.x - (i.x - n.x) / 6)} ${z(r.y - (i.y - n.y) / 6)} ${z(r.x)} ${z(r.y)}`;
|
|
594
634
|
}
|
|
595
635
|
return `${f}Z`;
|
|
596
636
|
}
|
|
597
637
|
//#endregion
|
|
598
638
|
//#region src/controls/DropletSurface/spring.ts
|
|
599
|
-
var
|
|
639
|
+
var ht = [
|
|
600
640
|
"x",
|
|
601
641
|
"y",
|
|
602
642
|
"amplitude",
|
|
603
643
|
"phase"
|
|
604
|
-
],
|
|
644
|
+
], gt = () => ({
|
|
605
645
|
x: 0,
|
|
606
646
|
y: 0,
|
|
607
647
|
amplitude: 0,
|
|
608
648
|
phase: 0
|
|
609
|
-
}),
|
|
649
|
+
}), W = (e) => ({
|
|
610
650
|
x: 1,
|
|
611
651
|
y: 1,
|
|
612
652
|
amplitude: e,
|
|
613
653
|
phase: 0
|
|
614
|
-
}),
|
|
615
|
-
x: 1.
|
|
616
|
-
y: .
|
|
654
|
+
}), _t = (e) => ({
|
|
655
|
+
x: 1.09,
|
|
656
|
+
y: .8,
|
|
617
657
|
amplitude: e * 1.75 + .65,
|
|
618
658
|
phase: .8
|
|
619
659
|
});
|
|
620
|
-
function
|
|
660
|
+
function vt(e) {
|
|
621
661
|
return {
|
|
622
|
-
value:
|
|
623
|
-
velocity:
|
|
624
|
-
target:
|
|
662
|
+
value: W(e),
|
|
663
|
+
velocity: gt(),
|
|
664
|
+
target: W(e)
|
|
625
665
|
};
|
|
626
666
|
}
|
|
627
|
-
function
|
|
628
|
-
e.value = { ...t }, e.target = { ...t }, e.velocity =
|
|
667
|
+
function G(e, t) {
|
|
668
|
+
e.value = { ...t }, e.target = { ...t }, e.velocity = gt();
|
|
629
669
|
}
|
|
630
|
-
function
|
|
670
|
+
function yt(e, t) {
|
|
631
671
|
let n = Math.min(.064, Math.max(0, Number.isFinite(t) ? t : 0));
|
|
632
672
|
for (; n > 0;) {
|
|
633
673
|
let t = Math.min(1 / 120, n);
|
|
634
|
-
for (let n of
|
|
674
|
+
for (let n of ht) e.velocity[n] += (320 * (e.target[n] - e.value[n]) - 14 * e.velocity[n]) * t, e.value[n] += e.velocity[n] * t;
|
|
635
675
|
n -= t;
|
|
636
676
|
}
|
|
637
|
-
let r =
|
|
638
|
-
return r ||
|
|
677
|
+
let r = ht.some((t) => Math.abs(e.value[t] - e.target[t]) > 8e-4 || Math.abs(e.velocity[t]) > .008);
|
|
678
|
+
return r || G(e, e.target), r;
|
|
639
679
|
}
|
|
640
680
|
//#endregion
|
|
641
681
|
//#region src/controls/DropletSurface/controller.ts
|
|
642
|
-
var
|
|
682
|
+
var K = (e, t) => {
|
|
643
683
|
let n = Number.parseFloat(e);
|
|
644
684
|
return Number.isFinite(n) ? n : t;
|
|
645
685
|
};
|
|
646
|
-
function
|
|
647
|
-
let o = e.querySelector("path"), s = e.querySelector("g"), c =
|
|
686
|
+
function bt(e, t, n, r, i = t, a = B) {
|
|
687
|
+
let o = e.querySelector("path"), s = e.querySelector("g"), c = vt(1.4), l, u = 1.4, d = 10, f = 0, p, m = !1, h = !1, g = "", _ = () => {
|
|
648
688
|
if (h || !l) return;
|
|
649
689
|
let { x: e, y: t, phase: r, amplitude: i } = c.value;
|
|
650
|
-
o.setAttribute("d",
|
|
690
|
+
o.setAttribute("d", U(l, i, r, n, d));
|
|
651
691
|
let a = d + l.width / 2, u = d + l.height / 2;
|
|
652
692
|
s.setAttribute("transform", `translate(${a} ${u}) scale(${e.toFixed(5)} ${t.toFixed(5)}) translate(${-a} ${-u})`);
|
|
653
693
|
}, v = () => {
|
|
654
694
|
p !== void 0 && cancelAnimationFrame(p), p = void 0;
|
|
655
695
|
}, y = () => {
|
|
656
696
|
let n = getComputedStyle(t), i = (e) => {
|
|
657
|
-
let r = e === "width" ? ["Left", "Right"] : ["Top", "Bottom"], i = n.boxSizing === "border-box" ? 0 : r.reduce((e, t) => e +
|
|
658
|
-
return
|
|
697
|
+
let r = e === "width" ? ["Left", "Right"] : ["Top", "Bottom"], i = n.boxSizing === "border-box" ? 0 : r.reduce((e, t) => e + K(n.getPropertyValue(`padding-${t.toLowerCase()}`), 0) + K(n.getPropertyValue(`border-${t.toLowerCase()}-width`), 0), 0);
|
|
698
|
+
return K(n[e], e === "width" ? t.offsetWidth : t.offsetHeight) + i;
|
|
659
699
|
}, o = i("width"), s = i("height");
|
|
660
700
|
if (o <= 0 || s <= 0) return;
|
|
661
|
-
let f =
|
|
701
|
+
let f = K(n.getPropertyValue("--game-ui-droplet-radius"), Math.min(o, s) / 2), p = Math.max(0, Math.min(B, Number.isFinite(a) ? Math.max(0, a) : B, K(n.getPropertyValue("--game-ui-droplet-wobble"), B))), h = `${o}|${s}|${f}|${p}`;
|
|
662
702
|
if (h === g) return;
|
|
663
|
-
g = h, u = p, l =
|
|
664
|
-
let v = m && r ?
|
|
665
|
-
|
|
703
|
+
g = h, u = p, l = H(o, s, f), d = Math.ceil(o * .025 + p * 3 + 6), e.setAttribute("width", String(o + 2 * d)), e.setAttribute("height", String(s + 2 * d)), e.setAttribute("viewBox", `0 0 ${o + 2 * d} ${s + 2 * d}`), e.style.left = `${-d}px`, e.style.top = `${-d}px`, e.style.width = `${o + d * 2}px`, e.style.height = `${s + d * 2}px`;
|
|
704
|
+
let v = m && r ? _t(u) : W(u);
|
|
705
|
+
G(c, v), e.dataset.ready = "true", _();
|
|
666
706
|
}, b = (e) => {
|
|
667
707
|
if (p = void 0, h || !t.isConnected) return;
|
|
668
708
|
if (document.hidden) {
|
|
669
|
-
|
|
709
|
+
G(c, W(u)), m = !1, _();
|
|
670
710
|
return;
|
|
671
711
|
}
|
|
672
|
-
let n =
|
|
712
|
+
let n = yt(c, f ? (e - f) / 1e3 : 1 / 60);
|
|
673
713
|
f = e, _(), n && (p = requestAnimationFrame(b));
|
|
674
714
|
}, x = (t) => {
|
|
675
715
|
if (!h) {
|
|
676
|
-
if (y(), m = t && r, e.dataset.pressed = String(m), c.target = m ?
|
|
677
|
-
v(),
|
|
716
|
+
if (y(), m = t && r, e.dataset.pressed = String(m), c.target = m ? _t(u) : W(u), !r || document.hidden || i.matches(":disabled,[aria-disabled=\"true\"]")) {
|
|
717
|
+
v(), G(c, W(u)), _();
|
|
678
718
|
return;
|
|
679
719
|
}
|
|
680
720
|
p === void 0 && (f = 0, p = requestAnimationFrame(b));
|
|
@@ -683,20 +723,20 @@ function pt(e, t, n, r, i = t, a = z) {
|
|
|
683
723
|
y();
|
|
684
724
|
let S = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(y);
|
|
685
725
|
S?.observe(t);
|
|
686
|
-
let C = r ?
|
|
726
|
+
let C = r ? pt(i, x) : () => {};
|
|
687
727
|
return () => {
|
|
688
728
|
h = !0, v(), C(), S?.disconnect(), delete e.dataset.ready, delete e.dataset.pressed;
|
|
689
729
|
};
|
|
690
730
|
}
|
|
691
731
|
//#endregion
|
|
692
732
|
//#region src/controls/DropletSurface/DropletSurface.tsx
|
|
693
|
-
function
|
|
694
|
-
let r =
|
|
695
|
-
return
|
|
733
|
+
function q({ static: e = !1, pressTarget: t, maxWobble: n = 1.4 }) {
|
|
734
|
+
let r = D(), i = A(null), a = h();
|
|
735
|
+
return O(() => {
|
|
696
736
|
let o = i.current, s = o?.parentElement;
|
|
697
737
|
if (!o || !(s instanceof HTMLElement)) return;
|
|
698
738
|
let c = !1, l, u = () => {
|
|
699
|
-
c || (l =
|
|
739
|
+
c || (l = bt(o, s, V(r), !a && !e, t?.current ?? s, n));
|
|
700
740
|
};
|
|
701
741
|
return t ? queueMicrotask(u) : u(), () => {
|
|
702
742
|
c = !0, l?.();
|
|
@@ -707,16 +747,16 @@ function J({ static: e = !1, pressTarget: t, maxWobble: n = 1.4 }) {
|
|
|
707
747
|
e,
|
|
708
748
|
t,
|
|
709
749
|
n
|
|
710
|
-
]), /* @__PURE__ */
|
|
750
|
+
]), /* @__PURE__ */ M("svg", {
|
|
711
751
|
ref: i,
|
|
712
752
|
className: "game-ui-droplet",
|
|
713
753
|
"aria-hidden": "true",
|
|
714
754
|
focusable: "false",
|
|
715
|
-
children: /* @__PURE__ */
|
|
755
|
+
children: /* @__PURE__ */ M("g", { children: /* @__PURE__ */ M("path", { vectorEffect: "non-scaling-stroke" }) })
|
|
716
756
|
});
|
|
717
757
|
}
|
|
718
|
-
function
|
|
719
|
-
return /* @__PURE__ */
|
|
758
|
+
function J() {
|
|
759
|
+
return /* @__PURE__ */ M("span", {
|
|
720
760
|
className: "game-ui-selection-mark",
|
|
721
761
|
"aria-hidden": "true",
|
|
722
762
|
children: "✓"
|
|
@@ -724,7 +764,7 @@ function Y() {
|
|
|
724
764
|
}
|
|
725
765
|
//#endregion
|
|
726
766
|
//#region src/tokens/hue.ts
|
|
727
|
-
function
|
|
767
|
+
function Y(e = "sky", t = !1) {
|
|
728
768
|
return t ? {
|
|
729
769
|
"--hue": "var(--game-ui-danger)",
|
|
730
770
|
"--game-ui-hue-ink": "var(--game-ui-control-danger-ink)"
|
|
@@ -732,7 +772,7 @@ function X(e = "sky", t = !1) {
|
|
|
732
772
|
}
|
|
733
773
|
//#endregion
|
|
734
774
|
//#region src/controls/NativeAction/NativeAction.tsx
|
|
735
|
-
function
|
|
775
|
+
function xt(e, t) {
|
|
736
776
|
return He((n) => {
|
|
737
777
|
t && (t.current = n);
|
|
738
778
|
let r = typeof e == "function" ? e(n) : void 0;
|
|
@@ -741,8 +781,8 @@ function mt(e, t) {
|
|
|
741
781
|
};
|
|
742
782
|
}, [e, t]);
|
|
743
783
|
}
|
|
744
|
-
var
|
|
745
|
-
let n =
|
|
784
|
+
var St = T(function(e, t) {
|
|
785
|
+
let n = xt(t);
|
|
746
786
|
if (e.href !== void 0) {
|
|
747
787
|
let { href: t, linkComponent: r, disabled: i = !1, target: a, rel: o, tabIndex: s, onClick: c, onKeyDown: l, onActivate: u, ...d } = e, f = {
|
|
748
788
|
...d,
|
|
@@ -766,18 +806,18 @@ var ht = w(function(e, t) {
|
|
|
766
806
|
l?.(e);
|
|
767
807
|
}
|
|
768
808
|
};
|
|
769
|
-
return r && !i ? /* @__PURE__ */
|
|
809
|
+
return r && !i ? /* @__PURE__ */ M(r, {
|
|
770
810
|
...f,
|
|
771
811
|
href: t,
|
|
772
812
|
ref: n
|
|
773
|
-
}) : /* @__PURE__ */
|
|
813
|
+
}) : /* @__PURE__ */ M("a", {
|
|
774
814
|
...f,
|
|
775
815
|
href: i ? void 0 : t,
|
|
776
816
|
ref: n
|
|
777
817
|
});
|
|
778
818
|
}
|
|
779
819
|
let { href: r, linkComponent: i, onActivate: a, onClick: o, type: s = "button", ...c } = e;
|
|
780
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ M("button", {
|
|
781
821
|
...c,
|
|
782
822
|
type: s,
|
|
783
823
|
ref: n,
|
|
@@ -785,56 +825,59 @@ var ht = w(function(e, t) {
|
|
|
785
825
|
c.disabled || (a?.(), o?.(e));
|
|
786
826
|
}
|
|
787
827
|
});
|
|
788
|
-
}),
|
|
789
|
-
let
|
|
828
|
+
}), X = T(function({ children: e, className: t, fullWidth: n = !1, hue: r, pending: i = !1, sound: a = !1, static: o = !1, variant: s = "secondary", size: c = "md", style: l, ...u }, d) {
|
|
829
|
+
let f = A(null), p = xt(d, f), m = u["data-game-ui-control"] === "liquid-presence", h = s === "primary" && !u.disabled && !m, g = [
|
|
790
830
|
"game-ui-button",
|
|
791
|
-
`game-ui-button--${
|
|
831
|
+
`game-ui-button--${s}`,
|
|
792
832
|
n && "game-ui-button--full-width",
|
|
793
|
-
|
|
833
|
+
o && "game-ui-button--static",
|
|
794
834
|
t
|
|
795
835
|
].filter(Boolean).join(" ");
|
|
796
|
-
return /* @__PURE__ */
|
|
797
|
-
control:
|
|
798
|
-
controlIdentity:
|
|
799
|
-
enabled:
|
|
800
|
-
static:
|
|
836
|
+
return /* @__PURE__ */ M(mt, {
|
|
837
|
+
control: f,
|
|
838
|
+
controlIdentity: u.href === void 0 ? "button" : u.linkComponent ?? "a",
|
|
839
|
+
enabled: h,
|
|
840
|
+
static: o,
|
|
801
841
|
fullWidth: n,
|
|
802
|
-
|
|
803
|
-
|
|
842
|
+
pending: i,
|
|
843
|
+
children: /* @__PURE__ */ Be(St, {
|
|
844
|
+
...u,
|
|
804
845
|
key: "control",
|
|
805
|
-
ref:
|
|
806
|
-
className:
|
|
846
|
+
ref: p,
|
|
847
|
+
className: g,
|
|
848
|
+
"aria-busy": i ? !0 : u["aria-busy"],
|
|
807
849
|
onActivate: () => {
|
|
808
|
-
|
|
850
|
+
a && ut(a);
|
|
809
851
|
},
|
|
810
|
-
"data-game-ui-size":
|
|
852
|
+
"data-game-ui-size": c,
|
|
853
|
+
"data-game-ui-pending": i ? "true" : void 0,
|
|
811
854
|
"data-game-ui-paint": "",
|
|
812
|
-
"data-game-ui-cta":
|
|
813
|
-
"data-game-ui-meaning":
|
|
814
|
-
"data-game-ui-danger":
|
|
855
|
+
"data-game-ui-cta": h ? "true" : void 0,
|
|
856
|
+
"data-game-ui-meaning": s === "danger" || s === "success" ? "true" : void 0,
|
|
857
|
+
"data-game-ui-danger": s === "danger" ? "true" : void 0,
|
|
815
858
|
style: {
|
|
816
|
-
...
|
|
817
|
-
...
|
|
859
|
+
...Y(r ?? (s === "success" ? "leaf" : "sky")),
|
|
860
|
+
...l
|
|
818
861
|
}
|
|
819
|
-
}, !
|
|
862
|
+
}, !h && !m ? /* @__PURE__ */ M(q, { static: o }) : null, e, u["aria-pressed"] === void 0 ? null : /* @__PURE__ */ M(J, {}))
|
|
820
863
|
});
|
|
821
864
|
});
|
|
822
865
|
//#endregion
|
|
823
866
|
//#region src/controls/GameCheckbox/GameCheckbox.tsx
|
|
824
|
-
function
|
|
825
|
-
return /* @__PURE__ */
|
|
867
|
+
function Ct({ className: e, label: t, hue: n, ...r }) {
|
|
868
|
+
return /* @__PURE__ */ N("label", {
|
|
826
869
|
className: ["game-ui-checkbox", e].filter(Boolean).join(" "),
|
|
827
870
|
"data-game-ui-paint": "",
|
|
828
|
-
style:
|
|
871
|
+
style: Y(n),
|
|
829
872
|
children: [
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ M(q, {}),
|
|
874
|
+
/* @__PURE__ */ M("input", {
|
|
832
875
|
className: "game-ui-checkbox-input",
|
|
833
876
|
type: "checkbox",
|
|
834
877
|
...r
|
|
835
878
|
}),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ M(J, {}),
|
|
880
|
+
/* @__PURE__ */ M("span", {
|
|
838
881
|
className: "game-ui-checkbox-label",
|
|
839
882
|
children: t
|
|
840
883
|
})
|
|
@@ -843,25 +886,25 @@ function gt({ className: e, label: t, hue: n, ...r }) {
|
|
|
843
886
|
}
|
|
844
887
|
//#endregion
|
|
845
888
|
//#region src/controls/GameField/GameField.tsx
|
|
846
|
-
function
|
|
847
|
-
return /* @__PURE__ */
|
|
889
|
+
function wt({ children: e, className: t, error: n, hint: r, label: i, required: a }) {
|
|
890
|
+
return /* @__PURE__ */ N("label", {
|
|
848
891
|
className: ["game-ui-field", t].filter(Boolean).join(" "),
|
|
849
892
|
"data-invalid": n ? "true" : void 0,
|
|
850
893
|
children: [
|
|
851
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ N("span", {
|
|
852
895
|
className: "game-ui-field-label",
|
|
853
|
-
children: [i, a ? /* @__PURE__ */
|
|
896
|
+
children: [i, a ? /* @__PURE__ */ N("span", {
|
|
854
897
|
"aria-hidden": "true",
|
|
855
898
|
className: "game-ui-field-required",
|
|
856
899
|
children: [" ", "*"]
|
|
857
900
|
}) : null]
|
|
858
901
|
}),
|
|
859
902
|
e,
|
|
860
|
-
r && !n ? /* @__PURE__ */
|
|
903
|
+
r && !n ? /* @__PURE__ */ M("span", {
|
|
861
904
|
className: "game-ui-field-hint",
|
|
862
905
|
children: r
|
|
863
906
|
}) : null,
|
|
864
|
-
n ? /* @__PURE__ */
|
|
907
|
+
n ? /* @__PURE__ */ M("span", {
|
|
865
908
|
className: "game-ui-field-error",
|
|
866
909
|
role: "alert",
|
|
867
910
|
children: n
|
|
@@ -871,8 +914,8 @@ function _t({ children: e, className: t, error: n, hint: r, label: i, required:
|
|
|
871
914
|
}
|
|
872
915
|
//#endregion
|
|
873
916
|
//#region src/controls/GameIconButton/GameIconButton.tsx
|
|
874
|
-
var
|
|
875
|
-
return /* @__PURE__ */
|
|
917
|
+
var Tt = T(function({ children: e, className: t, label: n, hue: r, size: i = "md", style: a, ...o }, s) {
|
|
918
|
+
return /* @__PURE__ */ N(St, {
|
|
876
919
|
...o,
|
|
877
920
|
ref: s,
|
|
878
921
|
"aria-label": n,
|
|
@@ -880,30 +923,30 @@ var vt = w(function({ children: e, className: t, label: n, hue: r, size: i = "md
|
|
|
880
923
|
"data-game-ui-paint": "",
|
|
881
924
|
"data-game-ui-size": i,
|
|
882
925
|
style: {
|
|
883
|
-
...
|
|
926
|
+
...Y(r),
|
|
884
927
|
...a
|
|
885
928
|
},
|
|
886
929
|
children: [
|
|
887
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ M(q, {}),
|
|
888
931
|
e,
|
|
889
|
-
o["aria-pressed"] === void 0 ? null : /* @__PURE__ */
|
|
932
|
+
o["aria-pressed"] === void 0 ? null : /* @__PURE__ */ M(J, {})
|
|
890
933
|
]
|
|
891
934
|
});
|
|
892
|
-
}),
|
|
893
|
-
return /* @__PURE__ */
|
|
935
|
+
}), Et = T(function({ className: e, invalid: t, hue: n, type: r = "text", ...i }, a) {
|
|
936
|
+
return /* @__PURE__ */ M("input", {
|
|
894
937
|
className: ["game-ui-input", e].filter(Boolean).join(" "),
|
|
895
938
|
"data-invalid": t ? "true" : void 0,
|
|
896
939
|
ref: a,
|
|
897
940
|
type: r,
|
|
898
941
|
...i,
|
|
899
942
|
style: {
|
|
900
|
-
...
|
|
943
|
+
...Y(n),
|
|
901
944
|
...i.style
|
|
902
945
|
},
|
|
903
946
|
"aria-invalid": i["aria-invalid"] ?? (t || void 0),
|
|
904
947
|
"data-game-ui-paint": ""
|
|
905
948
|
});
|
|
906
|
-
}),
|
|
949
|
+
}), Dt = {
|
|
907
950
|
ai: Me,
|
|
908
951
|
alert: Ee,
|
|
909
952
|
card: me,
|
|
@@ -919,25 +962,25 @@ var vt = w(function({ children: e, className: t, label: n, hue: r, size: i = "md
|
|
|
919
962
|
gift: Le,
|
|
920
963
|
globe: he,
|
|
921
964
|
history: Ie,
|
|
922
|
-
redo:
|
|
965
|
+
redo: w,
|
|
923
966
|
undo: te,
|
|
924
967
|
home: ce,
|
|
925
|
-
hourglass:
|
|
968
|
+
hourglass: v,
|
|
926
969
|
laurel: Fe,
|
|
927
970
|
lock: le,
|
|
928
|
-
lucky:
|
|
929
|
-
mail:
|
|
971
|
+
lucky: b,
|
|
972
|
+
mail: y,
|
|
930
973
|
medal: ae,
|
|
931
974
|
mission: Se,
|
|
932
975
|
mobile: re,
|
|
933
|
-
portal:
|
|
976
|
+
portal: x,
|
|
934
977
|
scroll: ne,
|
|
935
978
|
settings: Re,
|
|
936
|
-
shirt:
|
|
979
|
+
shirt: _,
|
|
937
980
|
shop: de,
|
|
938
|
-
smile:
|
|
981
|
+
smile: C,
|
|
939
982
|
timer: fe,
|
|
940
|
-
trophy:
|
|
983
|
+
trophy: S,
|
|
941
984
|
vote: ee,
|
|
942
985
|
"arrow-left": Ae,
|
|
943
986
|
"arrow-right": xe,
|
|
@@ -946,22 +989,22 @@ var vt = w(function({ children: e, className: t, label: n, hue: r, size: i = "md
|
|
|
946
989
|
download: be,
|
|
947
990
|
external: pe,
|
|
948
991
|
menu: Ce,
|
|
949
|
-
minus:
|
|
992
|
+
minus: g,
|
|
950
993
|
moon: ie,
|
|
951
994
|
plus: oe,
|
|
952
995
|
search: se,
|
|
953
996
|
sun: ue,
|
|
954
997
|
user: ke
|
|
955
|
-
},
|
|
998
|
+
}, Ot = Object.keys(Dt);
|
|
956
999
|
//#endregion
|
|
957
1000
|
//#region src/icons/GameIcon/GameIcon.tsx
|
|
958
|
-
function
|
|
959
|
-
let a = typeof e == "string" ?
|
|
1001
|
+
function Z({ icon: e, size: t = "md", label: n, className: r, ...i }) {
|
|
1002
|
+
let a = typeof e == "string" ? Dt[e] : e, o = {
|
|
960
1003
|
sm: 16,
|
|
961
1004
|
md: 20,
|
|
962
1005
|
lg: 24
|
|
963
1006
|
}[t];
|
|
964
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ M("svg", {
|
|
965
1008
|
...i,
|
|
966
1009
|
className: ["game-ui-icon", r].filter(Boolean).join(" "),
|
|
967
1010
|
viewBox: "0 0 24 24",
|
|
@@ -978,18 +1021,18 @@ function Q({ icon: e, size: t = "md", label: n, className: r, ...i }) {
|
|
|
978
1021
|
"aria-hidden": !n || void 0,
|
|
979
1022
|
"data-icon": a.name,
|
|
980
1023
|
"data-icon-size": t,
|
|
981
|
-
children: a.paths.map((e, t) => /* @__PURE__ */
|
|
1024
|
+
children: a.paths.map((e, t) => /* @__PURE__ */ M("path", { d: e }, t))
|
|
982
1025
|
});
|
|
983
1026
|
}
|
|
984
1027
|
//#endregion
|
|
985
1028
|
//#region src/controls/GameLanguageMenu/GameLanguageMenu.tsx
|
|
986
|
-
function
|
|
987
|
-
let [s, c] =
|
|
1029
|
+
function kt({ className: e, currentLabel: t, label: n, options: r, value: i, defaultValue: a, onSelect: o }) {
|
|
1030
|
+
let [s, c] = j(!1), [l, u] = j(a ?? r[0]?.id ?? ""), d = D(), f = ["game-ui-language-menu", e].filter(Boolean).join(" "), p = i ?? l, m = r.find((e) => e.id === p), h = t ?? m?.label ?? r[0]?.label ?? "", g = (e) => {
|
|
988
1031
|
i === void 0 && u(e), o?.(e), c(!1);
|
|
989
1032
|
};
|
|
990
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ N("div", {
|
|
991
1034
|
className: f,
|
|
992
|
-
children: [/* @__PURE__ */
|
|
1035
|
+
children: [/* @__PURE__ */ N("button", {
|
|
993
1036
|
"aria-controls": d,
|
|
994
1037
|
"aria-expanded": s,
|
|
995
1038
|
className: "game-ui-language-trigger",
|
|
@@ -997,19 +1040,19 @@ function St({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
997
1040
|
type: "button",
|
|
998
1041
|
"data-game-ui-paint": "",
|
|
999
1042
|
children: [
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ M(q, {}),
|
|
1044
|
+
/* @__PURE__ */ M(Z, {
|
|
1002
1045
|
icon: "globe",
|
|
1003
1046
|
size: "sm"
|
|
1004
1047
|
}),
|
|
1005
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ M("span", { children: h })
|
|
1006
1049
|
]
|
|
1007
|
-
}), s ? /* @__PURE__ */
|
|
1050
|
+
}), s ? /* @__PURE__ */ M("div", {
|
|
1008
1051
|
"aria-label": n,
|
|
1009
1052
|
className: "game-ui-language-popover",
|
|
1010
1053
|
id: d,
|
|
1011
1054
|
role: "menu",
|
|
1012
|
-
children: r.map((e) => /* @__PURE__ */
|
|
1055
|
+
children: r.map((e) => /* @__PURE__ */ N("button", {
|
|
1013
1056
|
"aria-checked": e.id === p,
|
|
1014
1057
|
"data-selected": e.id === p,
|
|
1015
1058
|
onClick: () => g(e.id),
|
|
@@ -1017,9 +1060,9 @@ function St({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
1017
1060
|
type: "button",
|
|
1018
1061
|
"data-game-ui-paint": "",
|
|
1019
1062
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ M(q, {}),
|
|
1064
|
+
/* @__PURE__ */ N("span", { children: [/* @__PURE__ */ M("strong", { children: e.label }), /* @__PURE__ */ M("small", { children: e.meta })] }),
|
|
1065
|
+
/* @__PURE__ */ M(J, {})
|
|
1023
1066
|
]
|
|
1024
1067
|
}, e.id))
|
|
1025
1068
|
}) : null]
|
|
@@ -1027,33 +1070,33 @@ function St({ className: e, currentLabel: t, label: n, options: r, value: i, def
|
|
|
1027
1070
|
}
|
|
1028
1071
|
//#endregion
|
|
1029
1072
|
//#region src/controls/GameSegmentedControl/GameSegmentedControl.tsx
|
|
1030
|
-
function
|
|
1031
|
-
return /* @__PURE__ */
|
|
1073
|
+
function At({ activeId: e, label: t, onSelect: n, options: r, disabled: i, hue: a }) {
|
|
1074
|
+
return /* @__PURE__ */ M("div", {
|
|
1032
1075
|
"aria-label": t,
|
|
1033
1076
|
className: "game-ui-segmented",
|
|
1034
1077
|
role: "group",
|
|
1035
|
-
children: r.map((t) => /* @__PURE__ */
|
|
1078
|
+
children: r.map((t) => /* @__PURE__ */ N("button", {
|
|
1036
1079
|
type: "button",
|
|
1037
1080
|
className: "game-ui-segmented-option",
|
|
1038
1081
|
"aria-pressed": t.id === e,
|
|
1039
1082
|
disabled: i,
|
|
1040
1083
|
onClick: n ? () => n(t.id) : void 0,
|
|
1041
1084
|
"data-game-ui-paint": "",
|
|
1042
|
-
style:
|
|
1085
|
+
style: Y(t.hue ?? a),
|
|
1043
1086
|
children: [
|
|
1044
|
-
/* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
1046
|
-
/* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ M(q, {}),
|
|
1088
|
+
/* @__PURE__ */ M("span", { children: t.label }),
|
|
1089
|
+
/* @__PURE__ */ M(J, {})
|
|
1047
1090
|
]
|
|
1048
1091
|
}, t.id))
|
|
1049
1092
|
});
|
|
1050
1093
|
}
|
|
1051
1094
|
//#endregion
|
|
1052
1095
|
//#region src/controls/GameSlider/GameSlider.tsx
|
|
1053
|
-
function
|
|
1054
|
-
return /* @__PURE__ */
|
|
1096
|
+
function jt({ label: e, max: t, min: n, step: r, disabled: i, name: a, id: o, onChange: s, value: c }) {
|
|
1097
|
+
return /* @__PURE__ */ N("label", {
|
|
1055
1098
|
className: "game-ui-slider",
|
|
1056
|
-
children: [/* @__PURE__ */
|
|
1099
|
+
children: [/* @__PURE__ */ M("span", { children: e }), /* @__PURE__ */ M("input", {
|
|
1057
1100
|
"aria-label": e,
|
|
1058
1101
|
max: t,
|
|
1059
1102
|
min: n,
|
|
@@ -1071,9 +1114,9 @@ function wt({ label: e, max: t, min: n, step: r, disabled: i, name: a, id: o, on
|
|
|
1071
1114
|
}
|
|
1072
1115
|
//#endregion
|
|
1073
1116
|
//#region src/controls/GameTabs/GameTabs.tsx
|
|
1074
|
-
function
|
|
1075
|
-
let c =
|
|
1076
|
-
return /* @__PURE__ */
|
|
1117
|
+
function Mt({ activeId: e, id: t, onSelect: n, tabs: r, hue: i, orientation: a = "horizontal", "aria-label": o, "aria-labelledby": s }) {
|
|
1118
|
+
let c = D(), l = t ?? c;
|
|
1119
|
+
return /* @__PURE__ */ M("div", {
|
|
1077
1120
|
className: "game-ui-tabs",
|
|
1078
1121
|
onKeyDown: (t) => {
|
|
1079
1122
|
if (!n || r.length === 0) return;
|
|
@@ -1106,11 +1149,11 @@ function Tt({ activeId: e, id: t, onSelect: n, tabs: r, hue: i, orientation: a =
|
|
|
1106
1149
|
"aria-orientation": a === "vertical" ? "vertical" : void 0,
|
|
1107
1150
|
"aria-label": o,
|
|
1108
1151
|
"aria-labelledby": s,
|
|
1109
|
-
children: r.map((t) => /* @__PURE__ */
|
|
1152
|
+
children: r.map((t) => /* @__PURE__ */ N("button", {
|
|
1110
1153
|
"aria-controls": t.panelId,
|
|
1111
1154
|
"aria-selected": t.id === e,
|
|
1112
1155
|
className: "game-ui-tab",
|
|
1113
|
-
style:
|
|
1156
|
+
style: Y(t.hue ?? i),
|
|
1114
1157
|
id: `${l}-${t.id}`,
|
|
1115
1158
|
onClick: n ? () => n(t.id) : void 0,
|
|
1116
1159
|
role: "tab",
|
|
@@ -1118,17 +1161,17 @@ function Tt({ activeId: e, id: t, onSelect: n, tabs: r, hue: i, orientation: a =
|
|
|
1118
1161
|
type: "button",
|
|
1119
1162
|
"data-game-ui-paint": "",
|
|
1120
1163
|
children: [
|
|
1121
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ M(q, {}),
|
|
1122
1165
|
t.label,
|
|
1123
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ M(J, {})
|
|
1124
1167
|
]
|
|
1125
1168
|
}, t.id))
|
|
1126
1169
|
});
|
|
1127
1170
|
}
|
|
1128
1171
|
//#endregion
|
|
1129
1172
|
//#region src/controls/GameTextArea/GameTextArea.tsx
|
|
1130
|
-
var
|
|
1131
|
-
return /* @__PURE__ */
|
|
1173
|
+
var Nt = T(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a) {
|
|
1174
|
+
return /* @__PURE__ */ M("textarea", {
|
|
1132
1175
|
className: [
|
|
1133
1176
|
"game-ui-input",
|
|
1134
1177
|
"game-ui-textarea",
|
|
@@ -1139,7 +1182,7 @@ var Et = w(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a)
|
|
|
1139
1182
|
rows: r,
|
|
1140
1183
|
...i,
|
|
1141
1184
|
style: {
|
|
1142
|
-
...
|
|
1185
|
+
...Y(n),
|
|
1143
1186
|
...i.style
|
|
1144
1187
|
},
|
|
1145
1188
|
"aria-invalid": i["aria-invalid"] ?? (t || void 0),
|
|
@@ -1148,8 +1191,8 @@ var Et = w(function({ className: e, invalid: t, hue: n, rows: r = 3, ...i }, a)
|
|
|
1148
1191
|
});
|
|
1149
1192
|
//#endregion
|
|
1150
1193
|
//#region src/controls/GameToggle/GameToggle.tsx
|
|
1151
|
-
function
|
|
1152
|
-
return /* @__PURE__ */
|
|
1194
|
+
function Pt({ checked: e, disabled: t, label: n, onClick: r, hue: i }) {
|
|
1195
|
+
return /* @__PURE__ */ N("button", {
|
|
1153
1196
|
type: "button",
|
|
1154
1197
|
className: "game-ui-toggle",
|
|
1155
1198
|
role: "switch",
|
|
@@ -1157,30 +1200,30 @@ function Dt({ checked: e, disabled: t, label: n, onClick: r, hue: i }) {
|
|
|
1157
1200
|
disabled: t,
|
|
1158
1201
|
onClick: r,
|
|
1159
1202
|
"data-game-ui-paint": "",
|
|
1160
|
-
style:
|
|
1203
|
+
style: Y(i),
|
|
1161
1204
|
children: [
|
|
1162
|
-
/* @__PURE__ */
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ M(q, {}),
|
|
1206
|
+
/* @__PURE__ */ M("span", { children: n }),
|
|
1207
|
+
/* @__PURE__ */ M(J, {}),
|
|
1208
|
+
/* @__PURE__ */ M("span", {
|
|
1166
1209
|
className: "game-ui-toggle-track",
|
|
1167
1210
|
"aria-hidden": "true",
|
|
1168
|
-
children: /* @__PURE__ */
|
|
1211
|
+
children: /* @__PURE__ */ M("span", { className: "game-ui-toggle-thumb" })
|
|
1169
1212
|
})
|
|
1170
1213
|
]
|
|
1171
1214
|
});
|
|
1172
1215
|
}
|
|
1173
1216
|
//#endregion
|
|
1174
1217
|
//#region src/feedback/GameBadge/GameBadge.tsx
|
|
1175
|
-
function
|
|
1176
|
-
return /* @__PURE__ */
|
|
1218
|
+
function Q({ children: e, className: t, tone: n = "neutral" }) {
|
|
1219
|
+
return /* @__PURE__ */ N("span", {
|
|
1177
1220
|
className: ["game-ui-badge", t].filter(Boolean).join(" "),
|
|
1178
1221
|
"data-badge-tone": n,
|
|
1179
1222
|
"data-game-ui-paint": "",
|
|
1180
1223
|
"data-game-ui-meaning": n !== "neutral" && n !== "danger" ? "true" : void 0,
|
|
1181
1224
|
"data-game-ui-danger": n === "danger" ? "true" : void 0,
|
|
1182
|
-
style:
|
|
1183
|
-
children: [/* @__PURE__ */
|
|
1225
|
+
style: Y(n === "success" ? "leaf" : n === "warning" ? "sun" : "sky"),
|
|
1226
|
+
children: [/* @__PURE__ */ M(q, {
|
|
1184
1227
|
static: !0,
|
|
1185
1228
|
maxWobble: 1
|
|
1186
1229
|
}), e]
|
|
@@ -1188,23 +1231,23 @@ function $({ children: e, className: t, tone: n = "neutral" }) {
|
|
|
1188
1231
|
}
|
|
1189
1232
|
//#endregion
|
|
1190
1233
|
//#region src/feedback/GameEmptyState/GameEmptyState.tsx
|
|
1191
|
-
function
|
|
1192
|
-
return /* @__PURE__ */
|
|
1234
|
+
function Ft({ action: e, className: t, description: n, icon: r, title: i }) {
|
|
1235
|
+
return /* @__PURE__ */ N("div", {
|
|
1193
1236
|
className: ["game-ui-empty-state", t].filter(Boolean).join(" "),
|
|
1194
1237
|
children: [
|
|
1195
|
-
r ? /* @__PURE__ */
|
|
1238
|
+
r ? /* @__PURE__ */ M(Z, {
|
|
1196
1239
|
icon: r,
|
|
1197
1240
|
size: "lg"
|
|
1198
1241
|
}) : null,
|
|
1199
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ M("strong", {
|
|
1200
1243
|
className: "game-ui-empty-state-title",
|
|
1201
1244
|
children: i
|
|
1202
1245
|
}),
|
|
1203
|
-
n ? /* @__PURE__ */
|
|
1246
|
+
n ? /* @__PURE__ */ M("p", {
|
|
1204
1247
|
className: "game-ui-empty-state-body",
|
|
1205
1248
|
children: n
|
|
1206
1249
|
}) : null,
|
|
1207
|
-
e ? /* @__PURE__ */
|
|
1250
|
+
e ? /* @__PURE__ */ M("div", {
|
|
1208
1251
|
className: "game-ui-empty-state-action",
|
|
1209
1252
|
children: e
|
|
1210
1253
|
}) : null
|
|
@@ -1213,20 +1256,20 @@ function Ot({ action: e, className: t, description: n, icon: r, title: i }) {
|
|
|
1213
1256
|
}
|
|
1214
1257
|
//#endregion
|
|
1215
1258
|
//#region src/feedback/GameLoadingState/GameLoadingState.tsx
|
|
1216
|
-
function
|
|
1217
|
-
return /* @__PURE__ */
|
|
1259
|
+
function It({ label: e, tone: t = "loading" }) {
|
|
1260
|
+
return /* @__PURE__ */ N("div", {
|
|
1218
1261
|
className: "game-ui-loading-state",
|
|
1219
1262
|
"data-loading-tone": t,
|
|
1220
1263
|
role: t === "error" ? "alert" : "status",
|
|
1221
|
-
children: [/* @__PURE__ */
|
|
1264
|
+
children: [/* @__PURE__ */ M(Z, {
|
|
1222
1265
|
icon: t === "error" ? "alert" : "timer",
|
|
1223
1266
|
size: "lg"
|
|
1224
|
-
}), /* @__PURE__ */
|
|
1267
|
+
}), /* @__PURE__ */ M("span", { children: e })]
|
|
1225
1268
|
});
|
|
1226
1269
|
}
|
|
1227
1270
|
//#endregion
|
|
1228
1271
|
//#region src/feedback/GameProgress/geometry.ts
|
|
1229
|
-
function
|
|
1272
|
+
function $(e, t, n = 0, r = 4) {
|
|
1230
1273
|
let i = Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : 0, a = Number.isFinite(e) ? Math.max(1, e) : 1, o = r, s = o + 10;
|
|
1231
1274
|
if (i === 0) return "M0 0Z";
|
|
1232
1275
|
if (i === 1) return `M0 0H${a + 2 * o}V${s + o}H0Z`;
|
|
@@ -1235,10 +1278,10 @@ function At(e, t, n = 0, r = 4) {
|
|
|
1235
1278
|
}
|
|
1236
1279
|
//#endregion
|
|
1237
1280
|
//#region src/feedback/GameProgress/controller.ts
|
|
1238
|
-
function
|
|
1281
|
+
function Lt(e, t, n, r) {
|
|
1239
1282
|
let i = e.parentElement, a = e.querySelector("[data-progress-track]"), o = e.querySelector("[data-progress-clip]"), s = e.querySelector("[data-progress-front]"), c = 0, l = n, u = n, d = n, f, p = 0, m = !1, h = (e, t) => {
|
|
1240
1283
|
e.getAttribute("d") !== t && e.setAttribute("d", t);
|
|
1241
|
-
}, g = (e = 0) => h(s,
|
|
1284
|
+
}, g = (e = 0) => h(s, $(c || 100, l, e)), _ = () => {
|
|
1242
1285
|
f !== void 0 && cancelAnimationFrame(f), f = void 0;
|
|
1243
1286
|
}, v = () => {
|
|
1244
1287
|
_(), l = u, g(), e.dataset.progressMotion = "static";
|
|
@@ -1246,7 +1289,7 @@ function jt(e, t, n, r) {
|
|
|
1246
1289
|
let n = Number.parseFloat(getComputedStyle(i).width) || i.clientWidth;
|
|
1247
1290
|
if (!n || n === c) return;
|
|
1248
1291
|
c = n, e.setAttribute("viewBox", `0 0 ${c + 8} 18`);
|
|
1249
|
-
let r = H(
|
|
1292
|
+
let r = U(H(c, 10, 5), 1, 0, t, 4);
|
|
1250
1293
|
h(a, r), h(o, r), e.dataset.progressReady = "true", g(), f === void 0 && (e.dataset.progressMotion = "static");
|
|
1251
1294
|
}, b = (t) => {
|
|
1252
1295
|
if (f = void 0, m) return;
|
|
@@ -1279,19 +1322,19 @@ function jt(e, t, n, r) {
|
|
|
1279
1322
|
}
|
|
1280
1323
|
//#endregion
|
|
1281
1324
|
//#region src/feedback/GameProgress/GameProgress.tsx
|
|
1282
|
-
function
|
|
1283
|
-
let o = !Number.isFinite(t) || t <= 0 ? 100 : t, s = Math.max(0, Math.min(o, Number.isFinite(e) ? e : 0)), c = s / o, l = c * 100, u = `progress-${
|
|
1284
|
-
g.current = c,
|
|
1325
|
+
function Rt({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i, className: a }) {
|
|
1326
|
+
let o = !Number.isFinite(t) || t <= 0 ? 100 : t, s = Math.max(0, Math.min(o, Number.isFinite(e) ? e : 0)), c = s / o, l = c * 100, u = `progress-${D().replace(/[^a-zA-Z0-9_-]/g, "")}`, d = h(), f = A(null), p = A(null), m = A(c).current, g = A(c);
|
|
1327
|
+
g.current = c, O(() => {
|
|
1285
1328
|
if (!f.current) return;
|
|
1286
|
-
let e =
|
|
1329
|
+
let e = Lt(f.current, V(u), g.current, !d);
|
|
1287
1330
|
return p.current = e, () => {
|
|
1288
1331
|
e.dispose(), p.current = null;
|
|
1289
1332
|
};
|
|
1290
|
-
}, [u, d]),
|
|
1291
|
-
let _ = H(
|
|
1292
|
-
return /* @__PURE__ */
|
|
1333
|
+
}, [u, d]), O(() => p.current?.update(c), [c, d]);
|
|
1334
|
+
let _ = U(H(100, 10, 5), 1, 0, V(u), 4);
|
|
1335
|
+
return /* @__PURE__ */ N("div", {
|
|
1293
1336
|
className: ["game-ui-progress", a].filter(Boolean).join(" "),
|
|
1294
|
-
children: [/* @__PURE__ */
|
|
1337
|
+
children: [/* @__PURE__ */ M("div", {
|
|
1295
1338
|
role: "progressbar",
|
|
1296
1339
|
"aria-label": n,
|
|
1297
1340
|
"aria-valuemin": 0,
|
|
@@ -1299,42 +1342,42 @@ function Mt({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i
|
|
|
1299
1342
|
"aria-valuenow": s,
|
|
1300
1343
|
"aria-valuetext": i || void 0,
|
|
1301
1344
|
className: "game-ui-progress-track",
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1345
|
+
children: /* @__PURE__ */ N("svg", {
|
|
1303
1346
|
ref: f,
|
|
1304
1347
|
viewBox: "0 0 108 18",
|
|
1305
1348
|
preserveAspectRatio: "none",
|
|
1306
1349
|
"aria-hidden": "true",
|
|
1307
1350
|
focusable: "false",
|
|
1308
1351
|
children: [
|
|
1309
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ N("defs", { children: [/* @__PURE__ */ M("clipPath", {
|
|
1310
1353
|
id: `${u}-clip`,
|
|
1311
|
-
children: /* @__PURE__ */
|
|
1354
|
+
children: /* @__PURE__ */ M("path", {
|
|
1312
1355
|
"data-progress-clip": "",
|
|
1313
1356
|
d: _
|
|
1314
1357
|
})
|
|
1315
|
-
}), /* @__PURE__ */
|
|
1358
|
+
}), /* @__PURE__ */ N("linearGradient", {
|
|
1316
1359
|
id: `${u}-fill`,
|
|
1317
|
-
children: [/* @__PURE__ */
|
|
1360
|
+
children: [/* @__PURE__ */ M("stop", {
|
|
1318
1361
|
offset: "0%",
|
|
1319
1362
|
style: { stopColor: "var(--game-ui-cta-from)" }
|
|
1320
|
-
}), /* @__PURE__ */
|
|
1363
|
+
}), /* @__PURE__ */ M("stop", {
|
|
1321
1364
|
offset: "100%",
|
|
1322
1365
|
style: { stopColor: "var(--game-ui-cta-to)" }
|
|
1323
1366
|
})]
|
|
1324
1367
|
})] }),
|
|
1325
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ M("path", {
|
|
1326
1369
|
"data-progress-track": "",
|
|
1327
1370
|
d: _
|
|
1328
1371
|
}),
|
|
1329
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ M("path", {
|
|
1330
1373
|
"data-progress-front": "",
|
|
1331
|
-
d:
|
|
1374
|
+
d: $(100, m),
|
|
1332
1375
|
clipPath: `url(#${u}-clip)`,
|
|
1333
1376
|
fill: `url(#${u}-fill)`
|
|
1334
1377
|
})
|
|
1335
1378
|
]
|
|
1336
1379
|
})
|
|
1337
|
-
}), i || r ? /* @__PURE__ */
|
|
1380
|
+
}), i || r ? /* @__PURE__ */ M("span", {
|
|
1338
1381
|
className: "game-ui-progress-value",
|
|
1339
1382
|
children: i || `${Math.round(l)}%`
|
|
1340
1383
|
}) : null]
|
|
@@ -1342,45 +1385,45 @@ function Mt({ value: e, max: t = 100, label: n, showValue: r = !1, valueLabel: i
|
|
|
1342
1385
|
}
|
|
1343
1386
|
//#endregion
|
|
1344
1387
|
//#region src/feedback/GameToast/GameToast.tsx
|
|
1345
|
-
function
|
|
1346
|
-
return /* @__PURE__ */
|
|
1388
|
+
function zt({ children: e, tone: t = "info" }) {
|
|
1389
|
+
return /* @__PURE__ */ N("div", {
|
|
1347
1390
|
className: "game-ui-toast",
|
|
1348
1391
|
"data-toast-tone": t,
|
|
1349
1392
|
"data-game-ui-paint": "",
|
|
1350
1393
|
"data-game-ui-meaning": t === "success" ? "true" : void 0,
|
|
1351
1394
|
"data-game-ui-danger": t === "danger" ? "true" : void 0,
|
|
1352
|
-
style:
|
|
1395
|
+
style: Y(t === "success" ? "leaf" : "sky"),
|
|
1353
1396
|
role: t === "danger" ? "alert" : "status",
|
|
1354
|
-
children: [/* @__PURE__ */
|
|
1397
|
+
children: [/* @__PURE__ */ M(q, { static: !0 }), e]
|
|
1355
1398
|
});
|
|
1356
1399
|
}
|
|
1357
1400
|
//#endregion
|
|
1358
1401
|
//#region src/feedback/GameTooltip/GameTooltip.tsx
|
|
1359
|
-
function
|
|
1360
|
-
let n =
|
|
1361
|
-
return /* @__PURE__ */
|
|
1402
|
+
function Bt({ children: e, label: t }) {
|
|
1403
|
+
let n = D();
|
|
1404
|
+
return /* @__PURE__ */ N("span", {
|
|
1362
1405
|
className: "game-ui-tooltip",
|
|
1363
|
-
children: [Ve(e) ? ze(e, { "aria-describedby": [e.props["aria-describedby"], n].filter(Boolean).join(" ") }) : e, /* @__PURE__ */
|
|
1406
|
+
children: [Ve(e) ? ze(e, { "aria-describedby": [e.props["aria-describedby"], n].filter(Boolean).join(" ") }) : e, /* @__PURE__ */ N("span", {
|
|
1364
1407
|
id: n,
|
|
1365
1408
|
role: "tooltip",
|
|
1366
1409
|
"data-game-ui-paint": "",
|
|
1367
|
-
children: [/* @__PURE__ */
|
|
1410
|
+
children: [/* @__PURE__ */ M(q, { static: !0 }), t]
|
|
1368
1411
|
})]
|
|
1369
1412
|
});
|
|
1370
1413
|
}
|
|
1371
1414
|
//#endregion
|
|
1372
1415
|
//#region src/containers/GameDialog/GameDialog.tsx
|
|
1373
|
-
function
|
|
1374
|
-
let r =
|
|
1375
|
-
return /* @__PURE__ */
|
|
1416
|
+
function Vt({ children: e, className: t, title: n }) {
|
|
1417
|
+
let r = D();
|
|
1418
|
+
return /* @__PURE__ */ N("section", {
|
|
1376
1419
|
"aria-labelledby": r,
|
|
1377
1420
|
"aria-modal": "true",
|
|
1378
1421
|
className: ["game-ui-dialog", t].filter(Boolean).join(" "),
|
|
1379
1422
|
role: "dialog",
|
|
1380
|
-
children: [/* @__PURE__ */
|
|
1423
|
+
children: [/* @__PURE__ */ M("h2", {
|
|
1381
1424
|
id: r,
|
|
1382
1425
|
children: n
|
|
1383
|
-
}), /* @__PURE__ */
|
|
1426
|
+
}), /* @__PURE__ */ M("div", {
|
|
1384
1427
|
className: "game-ui-dialog-body",
|
|
1385
1428
|
children: e
|
|
1386
1429
|
})]
|
|
@@ -1388,24 +1431,24 @@ function Ft({ children: e, className: t, title: n }) {
|
|
|
1388
1431
|
}
|
|
1389
1432
|
//#endregion
|
|
1390
1433
|
//#region src/containers/GameHistoryPanel/GameHistoryPanel.tsx
|
|
1391
|
-
function
|
|
1392
|
-
return /* @__PURE__ */
|
|
1434
|
+
function Ht({ entries: e, label: t }) {
|
|
1435
|
+
return /* @__PURE__ */ M("section", {
|
|
1393
1436
|
"aria-label": t,
|
|
1394
1437
|
className: "game-ui-history",
|
|
1395
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1438
|
+
children: e.map((e) => /* @__PURE__ */ N("article", {
|
|
1396
1439
|
className: "game-ui-history-entry",
|
|
1397
1440
|
"data-entry-kind": e.kind,
|
|
1398
|
-
children: [/* @__PURE__ */
|
|
1441
|
+
children: [/* @__PURE__ */ N("div", {
|
|
1399
1442
|
className: "game-ui-history-entry-header",
|
|
1400
|
-
children: [/* @__PURE__ */
|
|
1401
|
-
}), /* @__PURE__ */
|
|
1443
|
+
children: [/* @__PURE__ */ M("strong", { children: e.speaker }), /* @__PURE__ */ M("span", { children: e.meta })]
|
|
1444
|
+
}), /* @__PURE__ */ M("p", { children: e.text })]
|
|
1402
1445
|
}, e.id))
|
|
1403
1446
|
});
|
|
1404
1447
|
}
|
|
1405
1448
|
//#endregion
|
|
1406
1449
|
//#region src/containers/GameHudActions/GameHudActions.tsx
|
|
1407
|
-
function
|
|
1408
|
-
return /* @__PURE__ */
|
|
1450
|
+
function Ut({ children: e, className: t, label: n, ...r }) {
|
|
1451
|
+
return /* @__PURE__ */ M("nav", {
|
|
1409
1452
|
"aria-label": n,
|
|
1410
1453
|
className: ["game-ui-hud-actions", t].filter(Boolean).join(" "),
|
|
1411
1454
|
"data-safe-area": "hud-actions",
|
|
@@ -1415,54 +1458,54 @@ function Lt({ children: e, className: t, label: n, ...r }) {
|
|
|
1415
1458
|
}
|
|
1416
1459
|
//#endregion
|
|
1417
1460
|
//#region src/containers/GamePanel/GamePanel.tsx
|
|
1418
|
-
function
|
|
1461
|
+
function Wt({ children: e, className: t, title: n, tone: r = "default", ...i }) {
|
|
1419
1462
|
let a = ["game-ui-panel", t].filter(Boolean).join(" ");
|
|
1420
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ N("section", {
|
|
1421
1464
|
...i,
|
|
1422
1465
|
className: a,
|
|
1423
1466
|
"data-panel-tone": r,
|
|
1424
|
-
children: [n ? /* @__PURE__ */
|
|
1467
|
+
children: [n ? /* @__PURE__ */ M("h3", { children: n }) : null, e]
|
|
1425
1468
|
});
|
|
1426
1469
|
}
|
|
1427
1470
|
//#endregion
|
|
1428
1471
|
//#region src/game/FirstSessionOnboarding/FirstSessionOnboarding.tsx
|
|
1429
|
-
function
|
|
1430
|
-
return n ? /* @__PURE__ */
|
|
1472
|
+
function Gt({ labels: e, onDismiss: t, open: n }) {
|
|
1473
|
+
return n ? /* @__PURE__ */ N("aside", {
|
|
1431
1474
|
"aria-labelledby": "swimmer-first-session-onboarding-title",
|
|
1432
1475
|
"aria-modal": "true",
|
|
1433
1476
|
className: "swimmer-first-session-onboarding",
|
|
1434
1477
|
role: "dialog",
|
|
1435
|
-
children: [/* @__PURE__ */
|
|
1478
|
+
children: [/* @__PURE__ */ M("div", { className: "swimmer-first-session-onboarding-scrim" }), /* @__PURE__ */ N("div", {
|
|
1436
1479
|
className: "swimmer-first-session-onboarding-card",
|
|
1437
1480
|
children: [
|
|
1438
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ M(Z, {
|
|
1439
1482
|
icon: "trophy",
|
|
1440
1483
|
size: "lg"
|
|
1441
1484
|
}),
|
|
1442
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ M(Q, {
|
|
1443
1486
|
tone: "warning",
|
|
1444
1487
|
children: e.badge
|
|
1445
1488
|
}),
|
|
1446
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ M("h2", {
|
|
1447
1490
|
id: "swimmer-first-session-onboarding-title",
|
|
1448
1491
|
children: e.title
|
|
1449
1492
|
}),
|
|
1450
|
-
/* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ M("p", { children: e.body }),
|
|
1494
|
+
/* @__PURE__ */ M("ol", {
|
|
1452
1495
|
className: "swimmer-first-session-onboarding-steps",
|
|
1453
|
-
children: e.steps.map((e, t) => /* @__PURE__ */
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1496
|
+
children: e.steps.map((e, t) => /* @__PURE__ */ N("li", { children: [
|
|
1497
|
+
/* @__PURE__ */ M("span", { children: String(t + 1).padStart(2, "0") }),
|
|
1498
|
+
/* @__PURE__ */ M("strong", { children: e.title }),
|
|
1499
|
+
/* @__PURE__ */ M("small", { children: e.body })
|
|
1457
1500
|
] }, e.title))
|
|
1458
1501
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ N("div", {
|
|
1460
1503
|
className: "swimmer-first-session-onboarding-actions",
|
|
1461
|
-
children: [/* @__PURE__ */
|
|
1504
|
+
children: [/* @__PURE__ */ M(X, {
|
|
1462
1505
|
onClick: t,
|
|
1463
1506
|
variant: "primary",
|
|
1464
1507
|
children: e.start
|
|
1465
|
-
}), /* @__PURE__ */
|
|
1508
|
+
}), /* @__PURE__ */ M(X, {
|
|
1466
1509
|
onClick: t,
|
|
1467
1510
|
variant: "ghost",
|
|
1468
1511
|
children: e.skip
|
|
@@ -1474,27 +1517,27 @@ function zt({ labels: e, onDismiss: t, open: n }) {
|
|
|
1474
1517
|
}
|
|
1475
1518
|
//#endregion
|
|
1476
1519
|
//#region src/game/GameAvatar/GameAvatar.tsx
|
|
1477
|
-
function
|
|
1520
|
+
function Kt(e) {
|
|
1478
1521
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
1479
1522
|
return t.length === 0 ? "?" : t.slice(0, 2).map((e) => e[0] ?? "").join("").toUpperCase();
|
|
1480
1523
|
}
|
|
1481
|
-
function
|
|
1482
|
-
return /* @__PURE__ */
|
|
1524
|
+
function qt({ className: e, name: t, size: n = "md", src: r, status: i = "none", surface: a = "flat" }) {
|
|
1525
|
+
return /* @__PURE__ */ N("span", {
|
|
1483
1526
|
className: ["game-ui-avatar", e].filter(Boolean).join(" "),
|
|
1484
1527
|
"data-avatar-size": n,
|
|
1485
1528
|
"data-avatar-status": i,
|
|
1486
1529
|
"data-game-ui-surface": a === "plaque" ? "plaque" : void 0,
|
|
1487
|
-
children: [r ? /* @__PURE__ */
|
|
1530
|
+
children: [r ? /* @__PURE__ */ M("img", {
|
|
1488
1531
|
alt: t,
|
|
1489
1532
|
src: r
|
|
1490
|
-
}) : /* @__PURE__ */
|
|
1533
|
+
}) : /* @__PURE__ */ N(Ue, { children: [/* @__PURE__ */ M("span", {
|
|
1491
1534
|
"aria-hidden": "true",
|
|
1492
1535
|
className: "game-ui-avatar-initials",
|
|
1493
|
-
children:
|
|
1494
|
-
}), /* @__PURE__ */
|
|
1536
|
+
children: Kt(t)
|
|
1537
|
+
}), /* @__PURE__ */ M("span", {
|
|
1495
1538
|
className: "game-ui-sr-only",
|
|
1496
1539
|
children: t
|
|
1497
|
-
})] }), i === "none" ? null : /* @__PURE__ */
|
|
1540
|
+
})] }), i === "none" ? null : /* @__PURE__ */ M("span", {
|
|
1498
1541
|
"aria-hidden": "true",
|
|
1499
1542
|
className: "game-ui-avatar-status"
|
|
1500
1543
|
})]
|
|
@@ -1502,26 +1545,26 @@ function Vt({ className: e, name: t, size: n = "md", src: r, status: i = "none",
|
|
|
1502
1545
|
}
|
|
1503
1546
|
//#endregion
|
|
1504
1547
|
//#region src/game/GameRadialMenu/GameRadialMenu.tsx
|
|
1505
|
-
function
|
|
1506
|
-
return /* @__PURE__ */
|
|
1548
|
+
function Jt({ items: e, label: t, onSelect: n }) {
|
|
1549
|
+
return /* @__PURE__ */ M("div", {
|
|
1507
1550
|
"aria-label": t,
|
|
1508
1551
|
className: "game-ui-radial-menu",
|
|
1509
1552
|
role: "group",
|
|
1510
1553
|
style: { "--radial-count": e.length },
|
|
1511
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1554
|
+
children: e.map((e, t) => /* @__PURE__ */ N("button", {
|
|
1512
1555
|
className: "game-ui-radial-item",
|
|
1513
1556
|
onClick: n ? () => n(e.id) : void 0,
|
|
1514
1557
|
style: { "--radial-index": t },
|
|
1515
1558
|
type: "button",
|
|
1516
1559
|
"data-game-ui-paint": "",
|
|
1517
|
-
children: [/* @__PURE__ */
|
|
1560
|
+
children: [/* @__PURE__ */ M(q, {}), e.label]
|
|
1518
1561
|
}, e.id))
|
|
1519
1562
|
});
|
|
1520
1563
|
}
|
|
1521
1564
|
//#endregion
|
|
1522
1565
|
//#region src/game/GameStageTile/GameStageTile.tsx
|
|
1523
|
-
function
|
|
1524
|
-
return /* @__PURE__ */
|
|
1566
|
+
function Yt({ badge: e, className: t, icon: n, kicker: r, selected: i = !1, summary: a, title: o, tone: s = "daily", type: c = "button", ...l }) {
|
|
1567
|
+
return /* @__PURE__ */ N("button", {
|
|
1525
1568
|
"aria-pressed": i,
|
|
1526
1569
|
className: ["game-ui-stage-tile", t].filter(Boolean).join(" "),
|
|
1527
1570
|
"data-stage-tone": s,
|
|
@@ -1529,26 +1572,26 @@ function Ut({ badge: e, className: t, icon: n, kicker: r, selected: i = !1, summ
|
|
|
1529
1572
|
...l,
|
|
1530
1573
|
"data-game-ui-paint": "",
|
|
1531
1574
|
children: [
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
n ? /* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ M(q, {}),
|
|
1576
|
+
n ? /* @__PURE__ */ M(Z, {
|
|
1534
1577
|
icon: n,
|
|
1535
1578
|
size: "lg"
|
|
1536
1579
|
}) : null,
|
|
1537
|
-
/* @__PURE__ */
|
|
1580
|
+
/* @__PURE__ */ N("span", {
|
|
1538
1581
|
className: "game-ui-stage-tile-copy",
|
|
1539
1582
|
children: [
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1542
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ M("small", { children: r }),
|
|
1584
|
+
/* @__PURE__ */ M("strong", { children: o }),
|
|
1585
|
+
/* @__PURE__ */ M("span", { children: a })
|
|
1543
1586
|
]
|
|
1544
1587
|
}),
|
|
1545
|
-
e ? /* @__PURE__ */
|
|
1588
|
+
e ? /* @__PURE__ */ M(Q, {
|
|
1546
1589
|
tone: i ? "success" : "neutral",
|
|
1547
1590
|
children: e
|
|
1548
1591
|
}) : null,
|
|
1549
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ M(J, {})
|
|
1550
1593
|
]
|
|
1551
1594
|
});
|
|
1552
1595
|
}
|
|
1553
1596
|
//#endregion
|
|
1554
|
-
export {
|
|
1597
|
+
export { J as A, Ke as B, Et as C, X as D, Ct as E, P as F, We as H, Je as I, F as L, ut as M, lt as N, Y as O, it as P, Ye as R, Ot as S, wt as T, qe as V, Mt as _, Wt as a, kt as b, Vt as c, Rt as d, It as f, Nt as g, Pt as h, Gt as i, ft as j, q as k, Bt as l, Q as m, Jt as n, Ut as o, Ft as p, qt as r, Ht as s, Yt as t, zt as u, jt as v, Tt as w, Z as x, At as y, Ge as z };
|