cos-design 3.0.2 → 3.1.0

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/index.js CHANGED
@@ -281,14 +281,15 @@ import './index.css';var d = {
281
281
  });
282
282
  }, w = {
283
283
  chargeContainer: "cos-chargeContainer-4t9qo",
284
+ text: "cos-text-2k7eH",
284
285
  contrast: "cos-contrast-PNep9",
285
286
  hueRotate: "cos-hueRotate-bMJ-k",
286
- text: "cos-text-2k7eH",
287
+ bubble: "cos-bubble-VXfOd",
287
288
  moveUp: "cos-moveUp-1Vz9j",
288
289
  circle: "cos-circle-m4vwX",
289
290
  circleRotate: "cos-circleRotate-bgFw5",
290
291
  button: "cos-button-myCst"
291
- }, ee = (e) => {
292
+ }, ee = 15, te = 258, ne = (e) => {
292
293
  let { initQuantity: t = 0, value: r, onChange: i, autoCharge: a = !0, interval: c = 500, step: d = .01 } = e, f = o(null), p = r !== void 0, [m, h] = s(() => y(t, 0, 100)), g = y(p ? r : m, 0, 100), _ = o(g), v = o(i);
293
294
  n(() => {
294
295
  v.current = i;
@@ -298,7 +299,8 @@ import './index.css';var d = {
298
299
  let e = f.current;
299
300
  if (!e) return;
300
301
  let t = () => {
301
- e.style.setProperty("--charge-h", `${e.clientHeight}px`);
302
+ let t = Math.max(0, e.clientHeight - te);
303
+ e.style.setProperty("--charge-rise-max", `${t}px`);
302
304
  };
303
305
  t();
304
306
  let n = new ResizeObserver(t);
@@ -318,42 +320,32 @@ import './index.css';var d = {
318
320
  d
319
321
  ]);
320
322
  let b = g.toFixed(2);
321
- return /* @__PURE__ */ l("div", {
323
+ return /* @__PURE__ */ u("div", {
322
324
  ref: f,
323
325
  className: w.chargeContainer,
324
- children: /* @__PURE__ */ u("div", {
326
+ "data-auto": a ? "true" : "false",
327
+ style: { "--charge-pct": g },
328
+ children: [/* @__PURE__ */ u("div", {
325
329
  className: w.contrast,
326
330
  children: [
327
- /* @__PURE__ */ u("div", {
328
- className: w.text,
329
- children: [b, "%"]
330
- }),
331
- /* @__PURE__ */ l("span", {}),
332
- /* @__PURE__ */ l("span", {}),
333
- /* @__PURE__ */ l("span", {}),
334
- /* @__PURE__ */ l("span", {}),
335
- /* @__PURE__ */ l("span", {}),
336
- /* @__PURE__ */ l("span", {}),
337
- /* @__PURE__ */ l("span", {}),
338
- /* @__PURE__ */ l("span", {}),
339
- /* @__PURE__ */ l("span", {}),
340
- /* @__PURE__ */ l("span", {}),
341
- /* @__PURE__ */ l("span", {}),
342
- /* @__PURE__ */ l("span", {}),
343
- /* @__PURE__ */ l("span", {}),
344
- /* @__PURE__ */ l("span", {}),
345
- /* @__PURE__ */ l("span", {}),
331
+ Array.from({ length: ee }, (e, t) => /* @__PURE__ */ l("span", {
332
+ className: w.bubble,
333
+ "data-index": t + 1
334
+ }, t)),
346
335
  /* @__PURE__ */ l("div", { className: w.circle }),
347
336
  /* @__PURE__ */ l("div", { className: w.button })
348
337
  ]
349
- })
338
+ }), /* @__PURE__ */ u("div", {
339
+ className: w.text,
340
+ children: [b, "%"]
341
+ })]
350
342
  });
351
343
  }, T = {
352
344
  clickSpark: "cos-clickSpark-db9Om",
353
345
  canvas: "cos-canvas-p9fnQ",
354
346
  content: "cos-content-7uE4T",
355
347
  hint: "cos-hint-UqpWX"
356
- }, te = ({ children: e, color: r = "#fbbf24", count: i = 16 }) => {
348
+ }, re = ({ children: e, color: r = "#fbbf24", count: i = 16 }) => {
357
349
  let a = o(null), s = o(null), c = o([]), d = o(0), f = t((e, t) => {
358
350
  for (let n = 0; n < i; n++) {
359
351
  let r = Math.PI * 2 * n / i + Math.random() * .3, a = Math.random() * 4 + 2;
@@ -415,7 +407,7 @@ import './index.css';var d = {
415
407
  confetti: "cos-confetti-MeNtU",
416
408
  canvas: "cos-canvas-0T3Vs",
417
409
  hint: "cos-hint-sGHEi"
418
- }, ne = [
410
+ }, ie = [
419
411
  "#ff6b6b",
420
412
  "#ffd93d",
421
413
  "#6bcb77",
@@ -423,7 +415,7 @@ import './index.css';var d = {
423
415
  "#a66cff",
424
416
  "#ff85c0",
425
417
  "#38bdf8"
426
- ], re = () => ne[Math.floor(Math.random() * ne.length)], ie = (e, t, n) => {
418
+ ], ae = () => ie[Math.floor(Math.random() * ie.length)], oe = (e, t, n) => {
427
419
  let r = e / 2, i = t * .6;
428
420
  return Array.from({ length: n }, () => {
429
421
  let e = (Math.random() - .5) * Math.PI, t = Math.random() * 12 + 6;
@@ -434,14 +426,14 @@ import './index.css';var d = {
434
426
  vy: Math.sin(e) * t - Math.random() * 8,
435
427
  rotation: Math.random() * 360,
436
428
  rotationSpeed: (Math.random() - .5) * 12,
437
- color: re(),
429
+ color: ae(),
438
430
  width: Math.random() * 8 + 4,
439
431
  height: Math.random() * 6 + 3,
440
432
  alpha: 1,
441
433
  gravity: Math.random() * .15 + .12
442
434
  };
443
435
  });
444
- }, ae = e(({ width: e = 800, height: r = 400, auto: a = !0, particleCount: s = 120 }, c) => {
436
+ }, se = e(({ width: e = 800, height: r = 400, auto: a = !0, particleCount: s = 120 }, c) => {
445
437
  let d = o(null), f = o([]), p = o(0), m = o({
446
438
  width: e,
447
439
  height: r,
@@ -454,7 +446,7 @@ import './index.css';var d = {
454
446
  };
455
447
  let h = t(() => {
456
448
  let { width: e, height: t, particleCount: n } = m.current;
457
- f.current.push(...ie(e, t, n));
449
+ f.current.push(...oe(e, t, n));
458
450
  }, []);
459
451
  return i(c, () => ({ burst: h }), [h]), n(() => {
460
452
  a && h();
@@ -494,11 +486,11 @@ import './index.css';var d = {
494
486
  })]
495
487
  });
496
488
  });
497
- ae.displayName = "Confetti";
498
- var oe = {
489
+ se.displayName = "Confetti";
490
+ var ce = {
499
491
  cyberGrid: "cos-cyberGrid-VgJwl",
500
492
  canvas: "cos-canvas--Mq-O"
501
- }, se = ({ width: e = 800, height: t = 500, color: r = "#00f0ff", speed: i = 1 }) => {
493
+ }, le = ({ width: e = 800, height: t = 500, color: r = "#00f0ff", speed: i = 1 }) => {
502
494
  let a = o(null), s = o(0), c = o(0);
503
495
  return n(() => {
504
496
  let n = a.current;
@@ -540,14 +532,14 @@ var oe = {
540
532
  i,
541
533
  e
542
534
  ]), /* @__PURE__ */ l("div", {
543
- className: oe.cyberGrid,
535
+ className: ce.cyberGrid,
544
536
  style: {
545
537
  width: e,
546
538
  height: t
547
539
  },
548
540
  children: /* @__PURE__ */ l("canvas", {
549
541
  ref: a,
550
- className: oe.canvas,
542
+ className: ce.canvas,
551
543
  style: {
552
544
  width: e,
553
545
  height: t
@@ -562,7 +554,7 @@ var oe = {
562
554
  ended: "cos-ended-c0dsD",
563
555
  pulse: "cos-pulse-krQd-",
564
556
  invalid: "cos-invalid-d6t-L"
565
- }, ce = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), le = (e) => {
557
+ }, ue = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : new Date(e).getTime(), de = (e) => {
566
558
  let t = Math.max(0, e - Date.now()), n = Math.floor(t / 1e3);
567
559
  return {
568
560
  total: t,
@@ -571,7 +563,7 @@ var oe = {
571
563
  minutes: Math.floor(n % 3600 / 60),
572
564
  seconds: n % 60
573
565
  };
574
- }, ue = [
566
+ }, fe = [
575
567
  {
576
568
  key: "days",
577
569
  label: "天"
@@ -588,8 +580,8 @@ var oe = {
588
580
  key: "seconds",
589
581
  label: "秒"
590
582
  }
591
- ], de = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: i = "#f472b6" }) => {
592
- let c = a(() => ce(e), [e]), d = !Number.isNaN(c), [, f] = s(0), p = o(!1), m = o(t), h = d ? le(c) : {
583
+ ], pe = ({ targetDate: e, onEnd: t, showLabels: r = !0, color: i = "#f472b6" }) => {
584
+ let c = a(() => ue(e), [e]), d = !Number.isNaN(c), [, f] = s(0), p = o(!1), m = o(t), h = d ? de(c) : {
593
585
  days: 0,
594
586
  hours: 0,
595
587
  minutes: 0,
@@ -600,7 +592,10 @@ var oe = {
600
592
  m.current = t;
601
593
  }, [t]), n(() => {
602
594
  if (!d) return;
603
- p.current = !1;
595
+ if (p.current = !1, Date.now() >= c) {
596
+ p.current = !0, m.current?.();
597
+ return;
598
+ }
604
599
  let e = window.setInterval(() => {
605
600
  f((e) => e + 1), Date.now() >= c && !p.current && (p.current = !0, m.current?.(), clearInterval(e));
606
601
  }, 1e3);
@@ -608,7 +603,7 @@ var oe = {
608
603
  }, [d, c]), d ? /* @__PURE__ */ u("div", {
609
604
  className: D.countdown,
610
605
  style: { "--countdown-color": i },
611
- children: [ue.map(({ key: e, label: t }) => /* @__PURE__ */ u("div", {
606
+ children: [fe.map(({ key: e, label: t }) => /* @__PURE__ */ u("div", {
612
607
  className: D.unit,
613
608
  children: [/* @__PURE__ */ l("div", {
614
609
  className: D.value,
@@ -628,10 +623,10 @@ var oe = {
628
623
  children: "无效的目标时间"
629
624
  })
630
625
  });
631
- }, fe = {
626
+ }, me = {
632
627
  dnaHelix: "cos-dnaHelix-nEQLW",
633
628
  canvas: "cos-canvas-uEV8B"
634
- }, pe = ({ width: e = 200, height: t = 360, speed: r = 1, color: i = "#38bdf8" }) => {
629
+ }, he = ({ width: e = 200, height: t = 360, speed: r = 1, color: i = "#38bdf8" }) => {
635
630
  let a = o(null);
636
631
  return n(() => {
637
632
  let n = a.current;
@@ -661,28 +656,28 @@ var oe = {
661
656
  r,
662
657
  e
663
658
  ]), /* @__PURE__ */ l("div", {
664
- className: fe.dnaHelix,
659
+ className: me.dnaHelix,
665
660
  style: {
666
661
  width: e,
667
662
  height: t
668
663
  },
669
664
  children: /* @__PURE__ */ l("canvas", {
670
665
  ref: a,
671
- className: fe.canvas,
666
+ className: me.canvas,
672
667
  style: {
673
668
  width: e,
674
669
  height: t
675
670
  }
676
671
  })
677
672
  });
678
- }, me = {
673
+ }, ge = {
679
674
  electricArc: "cos-electricArc-BFlY3",
680
675
  canvas: "cos-canvas-iowDx"
681
- }, O = (e, t, n, r, i, a) => {
676
+ }, _e = (e, t, n, r, i, a) => {
682
677
  if (a <= 0) return [[e, t], [n, r]];
683
- let o = (e + n) / 2, s = (t + r) / 2, c = n - e, l = r - t, u = Math.hypot(c, l) || 1, d = (Math.random() - .5) * i, f = -l / u * d, p = c / u * d, m = O(e, t, o + f, s + p, i * .6, a - 1), h = O(o + f, s + p, n, r, i * .6, a - 1);
678
+ let o = (e + n) / 2, s = (t + r) / 2, c = n - e, l = r - t, u = Math.hypot(c, l) || 1, d = (Math.random() - .5) * i, f = -l / u * d, p = c / u * d, m = _e(e, t, o + f, s + p, i * .6, a - 1), h = _e(o + f, s + p, n, r, i * .6, a - 1);
684
679
  return [...m.slice(0, -1), ...h];
685
- }, he = ({ width: e = 320, height: t = 160, color: r = "#67e8f9" }) => {
680
+ }, ve = ({ width: e = 320, height: t = 160, color: r = "#67e8f9" }) => {
686
681
  let i = o(null);
687
682
  return n(() => {
688
683
  let n = i.current;
@@ -697,7 +692,7 @@ var oe = {
697
692
  }), p = () => {
698
693
  if (u = requestAnimationFrame(p), d) return;
699
694
  o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t);
700
- let n = O(40, s, c, l, 40, 5);
695
+ let n = _e(40, s, c, l, 40, 5);
701
696
  o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = r, o.lineWidth = 2, o.shadowColor = r, o.shadowBlur = 12, o.stroke(), o.shadowBlur = 0, o.beginPath(), n.forEach(([e, t], n) => n === 0 ? o.moveTo(e, t) : o.lineTo(e, t)), o.strokeStyle = "#fff", o.lineWidth = .8, o.globalAlpha = .6, o.stroke(), o.globalAlpha = 1, [[40, s], [c, l]].forEach(([e, t]) => {
702
697
  o.beginPath(), o.arc(e, t, 6, 0, Math.PI * 2), o.fillStyle = r, o.fill();
703
698
  });
@@ -710,25 +705,25 @@ var oe = {
710
705
  t,
711
706
  e
712
707
  ]), /* @__PURE__ */ l("div", {
713
- className: me.electricArc,
708
+ className: ge.electricArc,
714
709
  style: {
715
710
  width: e,
716
711
  height: t
717
712
  },
718
713
  children: /* @__PURE__ */ l("canvas", {
719
714
  ref: i,
720
- className: me.canvas,
715
+ className: ge.canvas,
721
716
  style: {
722
717
  width: e,
723
718
  height: t
724
719
  }
725
720
  })
726
721
  });
727
- }, k = {
722
+ }, O = {
728
723
  cursorTrail: "cos-cursorTrail-fpz5p",
729
724
  canvas: "cos-canvas-Iuyp3",
730
725
  hint: "cos-hint-9GLHx"
731
- }, ge = ({ color: e = "#38bdf8", length: t = 20, width: r = 800, height: i = 400 }) => {
726
+ }, ye = ({ color: e = "#38bdf8", length: t = 20, width: r = 800, height: i = 400 }) => {
732
727
  let a = o(null), s = o([]), c = o({
733
728
  x: r / 2,
734
729
  y: i / 2
@@ -767,14 +762,14 @@ var oe = {
767
762
  t,
768
763
  r
769
764
  ]), /* @__PURE__ */ u("div", {
770
- className: k.cursorTrail,
765
+ className: O.cursorTrail,
771
766
  style: {
772
767
  width: r,
773
768
  height: i
774
769
  },
775
770
  children: [/* @__PURE__ */ l("canvas", {
776
771
  ref: a,
777
- className: k.canvas,
772
+ className: O.canvas,
778
773
  style: {
779
774
  width: r,
780
775
  height: i
@@ -787,11 +782,11 @@ var oe = {
787
782
  };
788
783
  }
789
784
  }), /* @__PURE__ */ l("p", {
790
- className: k.hint,
785
+ className: O.hint,
791
786
  children: "移动鼠标查看粒子轨迹"
792
787
  })]
793
788
  });
794
- }, A = {
789
+ }, k = {
795
790
  diceRoll: "cos-diceRoll-GDwjV",
796
791
  scene: "cos-scene-tmnKM",
797
792
  cube: "cos-cube-RklEa",
@@ -806,7 +801,7 @@ var oe = {
806
801
  face6: "cos-face6-Yp-MX",
807
802
  rollBtn: "cos-rollBtn-nXMWJ",
808
803
  result: "cos-result-kXzu9"
809
- }, _e = {
804
+ }, be = {
810
805
  1: {
811
806
  x: 0,
812
807
  y: 0
@@ -831,7 +826,7 @@ var oe = {
831
826
  x: 90,
832
827
  y: 0
833
828
  }
834
- }, ve = ({ onRoll: e, sides: t = 6 }) => {
829
+ }, xe = ({ onRoll: e, sides: t = 6 }) => {
835
830
  let [r, i] = s(!1), [a, c] = s(1), [d, f] = s({
836
831
  x: 0,
837
832
  y: 0,
@@ -843,7 +838,7 @@ var oe = {
843
838
  let h = () => {
844
839
  if (r) return;
845
840
  i(!0);
846
- let e = Math.floor(Math.random() * t) + 1, n = _e[e] ?? _e[1], a = 360 * (3 + Math.floor(Math.random() * 3)), o = 360 * (3 + Math.floor(Math.random() * 3));
841
+ let e = Math.floor(Math.random() * t) + 1, n = be[e] ?? be[1], a = 360 * (3 + Math.floor(Math.random() * 3)), o = 360 * (3 + Math.floor(Math.random() * 3));
847
842
  f({
848
843
  x: n.x + a,
849
844
  y: n.y + o,
@@ -881,19 +876,19 @@ var oe = {
881
876
  [75, 75]
882
877
  ]
883
878
  }[e] ?? []).map(([e, t], n) => /* @__PURE__ */ l("span", {
884
- className: A.dot,
879
+ className: k.dot,
885
880
  style: {
886
881
  left: `${e}%`,
887
882
  top: `${t}%`
888
883
  }
889
884
  }, n));
890
885
  return /* @__PURE__ */ u("div", {
891
- className: A.diceRoll,
886
+ className: k.diceRoll,
892
887
  children: [
893
888
  /* @__PURE__ */ l("div", {
894
- className: A.scene,
889
+ className: k.scene,
895
890
  children: /* @__PURE__ */ l("div", {
896
- className: `${A.cube} ${r ? A.rolling : ""}`,
891
+ className: `${k.cube} ${r ? k.rolling : ""}`,
897
892
  style: { transform: `rotateX(${d.x}deg) rotateY(${d.y}deg) rotateZ(${d.z}deg)` },
898
893
  children: [
899
894
  1,
@@ -903,36 +898,36 @@ var oe = {
903
898
  5,
904
899
  6
905
900
  ].map((e) => /* @__PURE__ */ l("div", {
906
- className: `${A.face} ${A[`face${e}`]}`,
901
+ className: `${k.face} ${k[`face${e}`]}`,
907
902
  children: g(e)
908
903
  }, e))
909
904
  })
910
905
  }),
911
906
  /* @__PURE__ */ l("button", {
912
907
  type: "button",
913
- className: A.rollBtn,
908
+ className: k.rollBtn,
914
909
  onClick: h,
915
910
  disabled: r,
916
911
  children: r ? "掷骰中..." : "掷骰子"
917
912
  }),
918
913
  !r && /* @__PURE__ */ u("p", {
919
- className: A.result,
914
+ className: k.result,
920
915
  children: ["点数: ", a]
921
916
  })
922
917
  ]
923
918
  });
924
- }, ye = {
919
+ }, A = {
925
920
  fireworks: "cos-fireworks-fsSqL",
926
921
  canvas: "cos-canvas-spL8G",
927
922
  hint: "cos-hint-5XDRH"
928
- }, be = [
923
+ }, Se = [
929
924
  "#ff6b6b",
930
925
  "#ffd93d",
931
926
  "#6bcb77",
932
927
  "#4d96ff",
933
928
  "#a66cff",
934
929
  "#ff85c0"
935
- ], xe = .12, Se = 240, Ce = () => be[Math.floor(Math.random() * be.length)], we = (e, t, n) => {
930
+ ], Ce = .12, we = 240, Te = () => Se[Math.floor(Math.random() * Se.length)], Ee = (e, t, n) => {
936
931
  let r = 60 + Math.floor(Math.random() * 30);
937
932
  return Array.from({ length: r }, () => {
938
933
  let r = Math.random() * Math.PI * 2, i = Math.random() * 4 + 2;
@@ -942,11 +937,11 @@ var oe = {
942
937
  vx: Math.cos(r) * i,
943
938
  vy: Math.sin(r) * i,
944
939
  alpha: 1,
945
- color: Math.random() > .3 ? n : Ce(),
940
+ color: Math.random() > .3 ? n : Te(),
946
941
  decay: Math.random() * .015 + .01
947
942
  };
948
943
  });
949
- }, Te = e(({ width: e = 800, height: r = 500, auto: a = !0 }, s) => {
944
+ }, De = e(({ width: e = 800, height: r = 500, auto: a = !0 }, s) => {
950
945
  let c = o(null), d = o([]), f = o(0), p = t((t) => {
951
946
  let n = t ?? Math.random() * e * .6 + e * .2;
952
947
  d.current.push({
@@ -954,7 +949,7 @@ var oe = {
954
949
  y: r,
955
950
  vy: -(Math.random() * 4 + 6),
956
951
  targetY: Math.random() * r * .35 + r * .15,
957
- color: Ce(),
952
+ color: Te(),
958
953
  exploded: !1,
959
954
  particles: [],
960
955
  age: 0
@@ -973,9 +968,9 @@ var oe = {
973
968
  }), u = () => {
974
969
  f.current = requestAnimationFrame(u), !s && (i.fillStyle = "rgb(15 23 42 / 25%)", i.fillRect(0, 0, e, r), d.current = d.current.filter((e) => {
975
970
  if (!e.exploded) {
976
- e.age += 1, e.y += e.vy, e.vy += xe, i.beginPath(), i.arc(e.x, e.y, 2.5, 0, Math.PI * 2), i.fillStyle = e.color, i.fill();
977
- let t = e.vy >= 0, n = e.y <= e.targetY, r = e.y < 0, a = e.age >= Se;
978
- return (t || n || r || a) && (e.exploded = !0, e.particles = we(e.x, e.y, e.color)), !0;
971
+ e.age += 1, e.y += e.vy, e.vy += Ce, i.beginPath(), i.arc(e.x, e.y, 2.5, 0, Math.PI * 2), i.fillStyle = e.color, i.fill();
972
+ let t = e.vy >= 0, n = e.y <= e.targetY, r = e.y < 0, a = e.age >= we;
973
+ return (t || n || r || a) && (e.exploded = !0, e.particles = Ee(e.x, e.y, e.color)), !0;
979
974
  }
980
975
  return e.particles = e.particles.filter((e) => (e.x += e.vx, e.y += e.vy, e.vy += .06, e.alpha -= e.decay, e.alpha <= 0 ? !1 : (i.beginPath(), i.arc(e.x, e.y, 2, 0, Math.PI * 2), i.fillStyle = e.color, i.globalAlpha = e.alpha, i.fill(), i.globalAlpha = 1, !0))), e.particles.length > 0;
981
976
  }));
@@ -989,14 +984,14 @@ var oe = {
989
984
  p,
990
985
  e
991
986
  ]), /* @__PURE__ */ u("div", {
992
- className: ye.fireworks,
987
+ className: A.fireworks,
993
988
  style: {
994
989
  width: e,
995
990
  height: r
996
991
  },
997
992
  children: [/* @__PURE__ */ l("canvas", {
998
993
  ref: c,
999
- className: ye.canvas,
994
+ className: A.canvas,
1000
995
  style: {
1001
996
  width: e,
1002
997
  height: r
@@ -1006,12 +1001,12 @@ var oe = {
1006
1001
  p(e.clientX - t.left);
1007
1002
  }
1008
1003
  }), /* @__PURE__ */ l("p", {
1009
- className: ye.hint,
1004
+ className: A.hint,
1010
1005
  children: "点击画布燃放烟花"
1011
1006
  })]
1012
1007
  });
1013
1008
  });
1014
- Te.displayName = "Fireworks";
1009
+ De.displayName = "Fireworks";
1015
1010
  var j = {
1016
1011
  flipCounter: "cos-flipCounter-3LuI0",
1017
1012
  digit: "cos-digit-yJRPy",
@@ -1024,7 +1019,7 @@ var j = {
1024
1019
  isFlipping: "cos-isFlipping-EVEdI",
1025
1020
  "fold-top": "cos-fold-top-v-6XJ",
1026
1021
  "unfold-bottom": "cos-unfold-bottom-e2gzU"
1027
- }, Ee = (e, t) => Math.max(0, Math.floor(e)).toString().padStart(t, "0").slice(-t), De = ({ digit: e, color: t, duration: r }) => {
1022
+ }, Oe = (e, t) => Math.max(0, Math.floor(e)).toString().padStart(t, "0").slice(-t), ke = ({ digit: e, color: t, duration: r }) => {
1028
1023
  let i = o(e), [a, d] = s(!1), [f, p] = s(e);
1029
1024
  n(() => {
1030
1025
  if (e === i.current) return;
@@ -1060,32 +1055,32 @@ var j = {
1060
1055
  ]
1061
1056
  })
1062
1057
  });
1063
- }, Oe = ({ value: e, digits: t = 4, color: n = "#38bdf8", duration: r = 600 }) => {
1064
- let i = Ee(e, t).split("");
1058
+ }, Ae = ({ value: e, digits: t = 4, color: n = "#38bdf8", duration: r = 600 }) => {
1059
+ let i = Oe(e, t).split("");
1065
1060
  return /* @__PURE__ */ l("div", {
1066
1061
  className: j.flipCounter,
1067
- children: i.map((e, t) => /* @__PURE__ */ l(De, {
1062
+ children: i.map((e, t) => /* @__PURE__ */ l(ke, {
1068
1063
  digit: e,
1069
1064
  color: n,
1070
1065
  duration: r
1071
1066
  }, t))
1072
1067
  });
1073
- }, ke = {
1068
+ }, je = {
1074
1069
  gradientFlow: "cos-gradientFlow-XhN16",
1075
1070
  text: "cos-text-ORuqk",
1076
1071
  flow: "cos-flow-9FzMA"
1077
- }, Ae = [
1072
+ }, Me = [
1078
1073
  "#ff00de",
1079
1074
  "#7c3aed",
1080
1075
  "#00f0ff",
1081
1076
  "#38bdf8",
1082
1077
  "#ff00de"
1083
- ], je = ({ text: e = "GRADIENT", colors: t = Ae, fontSize: n = 64 }) => {
1084
- let r = t.length >= 2 ? t.join(", ") : Ae.join(", ");
1078
+ ], Ne = ({ text: e = "GRADIENT", colors: t = Me, fontSize: n = 64 }) => {
1079
+ let r = t.length >= 2 ? t.join(", ") : Me.join(", ");
1085
1080
  return /* @__PURE__ */ l("div", {
1086
- className: ke.gradientFlow,
1081
+ className: je.gradientFlow,
1087
1082
  children: /* @__PURE__ */ l("h1", {
1088
- className: ke.text,
1083
+ className: je.text,
1089
1084
  style: {
1090
1085
  fontSize: n,
1091
1086
  backgroundImage: `linear-gradient(90deg, ${r})`
@@ -1093,15 +1088,15 @@ var j = {
1093
1088
  children: e
1094
1089
  })
1095
1090
  });
1096
- }, Me = {
1091
+ }, Pe = {
1097
1092
  glitchText: "cos-glitchText-dZ-sR",
1098
1093
  text: "cos-text-JsPHN",
1099
1094
  "glitch-1": "cos-glitch-1-s9pqH",
1100
1095
  "glitch-2": "cos-glitch-2-GhFB-"
1101
- }, Ne = ({ text: e = "GLITCH", color: t = "#f8fafc", glitchColor1: n = "#ff00de", glitchColor2: r = "#00f0ff", fontSize: i = 64 }) => /* @__PURE__ */ l("div", {
1102
- className: Me.glitchText,
1096
+ }, Fe = ({ text: e = "GLITCH", color: t = "#f8fafc", glitchColor1: n = "#ff00de", glitchColor2: r = "#00f0ff", fontSize: i = 64 }) => /* @__PURE__ */ l("div", {
1097
+ className: Pe.glitchText,
1103
1098
  children: /* @__PURE__ */ l("h1", {
1104
- className: Me.text,
1099
+ className: Pe.text,
1105
1100
  "data-text": e,
1106
1101
  style: {
1107
1102
  fontSize: i,
@@ -1111,16 +1106,16 @@ var j = {
1111
1106
  },
1112
1107
  children: e
1113
1108
  })
1114
- }), Pe = {
1109
+ }), Ie = {
1115
1110
  gravityBalls: "cos-gravityBalls-LdwFo",
1116
1111
  canvas: "cos-canvas-n7esd"
1117
- }, Fe = [
1112
+ }, Le = [
1118
1113
  "#38bdf8",
1119
1114
  "#a78bfa",
1120
1115
  "#f472b6",
1121
1116
  "#4ade80",
1122
1117
  "#fbbf24"
1123
- ], Ie = ({ width: e = 400, height: t = 300, ballCount: r = 12 }) => {
1118
+ ], Re = ({ width: e = 400, height: t = 300, ballCount: r = 12 }) => {
1124
1119
  let i = o(null), a = o([]);
1125
1120
  return n(() => {
1126
1121
  a.current = Array.from({ length: r }, () => ({
@@ -1129,7 +1124,7 @@ var j = {
1129
1124
  vx: (Math.random() - .5) * 4,
1130
1125
  vy: Math.random() * 2,
1131
1126
  r: Math.random() * 10 + 8,
1132
- color: Fe[Math.floor(Math.random() * Fe.length)]
1127
+ color: Le[Math.floor(Math.random() * Le.length)]
1133
1128
  }));
1134
1129
  }, [
1135
1130
  r,
@@ -1169,14 +1164,14 @@ var j = {
1169
1164
  cancelAnimationFrame(s), l();
1170
1165
  };
1171
1166
  }, [t, e]), /* @__PURE__ */ l("div", {
1172
- className: Pe.gravityBalls,
1167
+ className: Ie.gravityBalls,
1173
1168
  style: {
1174
1169
  width: e,
1175
1170
  height: t
1176
1171
  },
1177
1172
  children: /* @__PURE__ */ l("canvas", {
1178
1173
  ref: i,
1179
- className: Pe.canvas,
1174
+ className: Ie.canvas,
1180
1175
  style: {
1181
1176
  width: e,
1182
1177
  height: t
@@ -1190,7 +1185,7 @@ var j = {
1190
1185
  image: "cos-image-AV2XG",
1191
1186
  placeholder: "cos-placeholder-wuuL3",
1192
1187
  info: "cos-info-CNR0r"
1193
- }, Le = ({ title: e = "全息卡片", subtitle: t = "移动鼠标体验 3D 效果", image: n }) => {
1188
+ }, ze = ({ title: e = "全息卡片", subtitle: t = "移动鼠标体验 3D 效果", image: n }) => {
1194
1189
  let r = o(null);
1195
1190
  return /* @__PURE__ */ l("div", {
1196
1191
  className: M.wrap,
@@ -1232,7 +1227,7 @@ var j = {
1232
1227
  fillBg: "cos-fillBg-pwLI1",
1233
1228
  wave: "cos-wave-CBwgG",
1234
1229
  label: "cos-label-WYDqS"
1235
- }, Re = ({ value: e = 0, max: t = 100, size: i = 160, color: a = "#38bdf8" }) => {
1230
+ }, Be = ({ value: e = 0, max: t = 100, size: i = 160, color: a = "#38bdf8" }) => {
1236
1231
  let s = o(null), c = r().replace(/:/g, ""), d = y(t > 0 ? e / t * 100 : 0, 0, 100), f = 100 - d;
1237
1232
  return n(() => {
1238
1233
  let e = 0, t = 0, n = document.hidden, r = v((e) => {
@@ -1310,7 +1305,7 @@ var j = {
1310
1305
  liquidGlass: "cos-liquidGlass-Z3bQg",
1311
1306
  panel: "cos-panel-XYboD",
1312
1307
  content: "cos-content-MHfkS"
1313
- }, ze = ({ children: e = "液态玻璃面板", blur: t = 16, borderRadius: n = 20 }) => /* @__PURE__ */ l("div", {
1308
+ }, Ve = ({ children: e = "液态玻璃面板", blur: t = 16, borderRadius: n = 20 }) => /* @__PURE__ */ l("div", {
1314
1309
  className: P.liquidGlass,
1315
1310
  children: /* @__PURE__ */ l("div", {
1316
1311
  className: P.panel,
@@ -1323,14 +1318,14 @@ var j = {
1323
1318
  children: e
1324
1319
  })
1325
1320
  })
1326
- }), Be = {
1321
+ }), He = {
1327
1322
  magneticButton: "cos-magneticButton-GbRkE",
1328
1323
  btn: "cos-btn--b2BJ"
1329
- }, Ve = ({ children: e = "磁吸按钮", strength: t = .4, color: n = "#6366f1" }) => {
1324
+ }, Ue = ({ children: e = "磁吸按钮", strength: t = .4, color: n = "#6366f1" }) => {
1330
1325
  let r = o(null), i = o(null);
1331
1326
  return /* @__PURE__ */ l("div", {
1332
1327
  ref: r,
1333
- className: Be.magneticButton,
1328
+ className: He.magneticButton,
1334
1329
  onMouseMove: (e) => {
1335
1330
  let n = r.current, a = i.current;
1336
1331
  if (!n || !a) return;
@@ -1344,7 +1339,7 @@ var j = {
1344
1339
  children: /* @__PURE__ */ l("button", {
1345
1340
  ref: i,
1346
1341
  type: "button",
1347
- className: Be.btn,
1342
+ className: He.btn,
1348
1343
  style: { "--btn-color": n },
1349
1344
  children: e
1350
1345
  })
@@ -1356,7 +1351,7 @@ var j = {
1356
1351
  title: "cos-title-sDfhs",
1357
1352
  flicker: "cos-flicker-smHxl",
1358
1353
  subtitle: "cos-subtitle-CWheW"
1359
- }, He = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ", Ue = ({ width: e = 800, height: t = 500, density: r = .6, color: i = "#00ff41", showOverlay: a = !0, title: s = "MATRIX", subtitle: c = "数字雨效果" }) => {
1354
+ }, We = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*アイウエオカキクケコ", Ge = ({ width: e = 800, height: t = 500, density: r = .6, color: i = "#00ff41", showOverlay: a = !0, title: s = "MATRIX", subtitle: c = "数字雨效果" }) => {
1360
1355
  let d = o(null);
1361
1356
  return n(() => {
1362
1357
  let n = d.current;
@@ -1370,7 +1365,7 @@ var j = {
1370
1365
  u = e;
1371
1366
  }), p = () => {
1372
1367
  l = requestAnimationFrame(p), !u && (o.fillStyle = "rgb(0 0 0 / 8%)", o.fillRect(0, 0, e, t), o.font = "16px monospace", c.forEach((e, n) => {
1373
- let a = He[Math.floor(Math.random() * 53)], s = n / r * 16;
1368
+ let a = We[Math.floor(Math.random() * 53)], s = n / r * 16;
1374
1369
  o.fillStyle = i, o.fillText(a, s, e * 16), e * 16 > t && Math.random() > .975 && (c[n] = 0), c[n] += 1;
1375
1370
  }));
1376
1371
  };
@@ -1406,10 +1401,10 @@ var j = {
1406
1401
  })]
1407
1402
  })]
1408
1403
  });
1409
- }, We = {
1404
+ }, Ke = {
1410
1405
  mazeGenerator: "cos-mazeGenerator-QEa0s",
1411
1406
  canvas: "cos-canvas-emhxb"
1412
- }, Ge = ({ width: e = 400, height: t = 300, cellSize: r = 20, onGenerated: i }) => {
1407
+ }, qe = ({ width: e = 400, height: t = 300, cellSize: r = 20, onGenerated: i }) => {
1413
1408
  let a = o(null), s = o(i);
1414
1409
  return n(() => {
1415
1410
  s.current = i;
@@ -1476,14 +1471,17 @@ var j = {
1476
1471
  let m = 0, h = 0, g = c * l * 2, _ = document.hidden, y = v((e) => {
1477
1472
  _ = e;
1478
1473
  }), b = () => {
1479
- if (m = requestAnimationFrame(b), _) return;
1474
+ if (_) {
1475
+ m = requestAnimationFrame(b);
1476
+ return;
1477
+ }
1480
1478
  h = Math.min(g, h + 2), o.fillStyle = "#0f172a", o.fillRect(0, 0, e, t), o.strokeStyle = "#38bdf8", o.lineWidth = 1.5, o.shadowColor = "#38bdf8", o.shadowBlur = 4;
1481
1479
  let n = 0;
1482
1480
  for (let e = 0; e < l; e++) for (let t = 0; t < c; t++) {
1483
1481
  let i = u[e][t], a = t * r, s = e * r;
1484
1482
  i.top && n++ < h && (o.beginPath(), o.moveTo(a, s), o.lineTo(a + r, s), o.stroke()), i.right && n++ < h && (o.beginPath(), o.moveTo(a + r, s), o.lineTo(a + r, s + r), o.stroke()), e === l - 1 && i.bottom && n++ < h && (o.beginPath(), o.moveTo(a, s + r), o.lineTo(a + r, s + r), o.stroke()), t === 0 && i.left && n++ < h && (o.beginPath(), o.moveTo(a, s), o.lineTo(a, s + r), o.stroke());
1485
1483
  }
1486
- o.shadowBlur = 0;
1484
+ o.shadowBlur = 0, h < g && (m = requestAnimationFrame(b));
1487
1485
  };
1488
1486
  return b(), () => {
1489
1487
  cancelAnimationFrame(m), y();
@@ -1493,24 +1491,24 @@ var j = {
1493
1491
  t,
1494
1492
  e
1495
1493
  ]), /* @__PURE__ */ l("div", {
1496
- className: We.mazeGenerator,
1494
+ className: Ke.mazeGenerator,
1497
1495
  style: {
1498
1496
  width: e,
1499
1497
  height: t
1500
1498
  },
1501
1499
  children: /* @__PURE__ */ l("canvas", {
1502
1500
  ref: a,
1503
- className: We.canvas,
1501
+ className: Ke.canvas,
1504
1502
  style: {
1505
1503
  width: e,
1506
1504
  height: t
1507
1505
  }
1508
1506
  })
1509
1507
  });
1510
- }, Ke = {
1508
+ }, Je = {
1511
1509
  meteorRain: "cos-meteorRain-v8RNI",
1512
1510
  canvas: "cos-canvas-hyFMr"
1513
- }, qe = ({ width: e = 800, height: t = 500, meteorCount: r = 8 }) => {
1511
+ }, Ye = ({ width: e = 800, height: t = 500, meteorCount: r = 8 }) => {
1514
1512
  let i = o(null), a = o([]), s = o(0);
1515
1513
  return n(() => {
1516
1514
  a.current = Array.from({ length: r }, () => ({
@@ -1545,14 +1543,14 @@ var j = {
1545
1543
  cancelAnimationFrame(s.current), l();
1546
1544
  };
1547
1545
  }, [t, e]), /* @__PURE__ */ l("div", {
1548
- className: Ke.meteorRain,
1546
+ className: Je.meteorRain,
1549
1547
  style: {
1550
1548
  width: e,
1551
1549
  height: t
1552
1550
  },
1553
1551
  children: /* @__PURE__ */ l("canvas", {
1554
1552
  ref: i,
1555
- className: Ke.canvas,
1553
+ className: Je.canvas,
1556
1554
  style: {
1557
1555
  width: e,
1558
1556
  height: t
@@ -1565,7 +1563,7 @@ var j = {
1565
1563
  flicker: "cos-flicker-nXceV",
1566
1564
  "neon-flicker": "cos-neon-flicker-uDkmM",
1567
1565
  reflection: "cos-reflection-aEYj6"
1568
- }, Je = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ u("div", {
1566
+ }, Xe = ({ text: e = "NEON", color: t = "#ff00de", fontSize: n = 72, flicker: r = !0 }) => /* @__PURE__ */ u("div", {
1569
1567
  className: I.neonText,
1570
1568
  children: [/* @__PURE__ */ l("h1", {
1571
1569
  className: `${I.text} ${r ? I.flicker : ""}`,
@@ -1590,7 +1588,7 @@ var j = {
1590
1588
  "swing-right": "cos-swing-right-gEH1F",
1591
1589
  string: "cos-string-UpYWC",
1592
1590
  ball: "cos-ball-sj82r"
1593
- }, Ye = ({ ballCount: e = 5, color: t = "#38bdf8" }) => {
1591
+ }, Ze = ({ ballCount: e = 5, color: t = "#38bdf8" }) => {
1594
1592
  let n = Math.max(2, Math.min(e, 7));
1595
1593
  return /* @__PURE__ */ l("div", {
1596
1594
  className: L.newtonCradle,
@@ -1609,7 +1607,7 @@ var j = {
1609
1607
  canvas: "cos-canvas-hGVud",
1610
1608
  legend: "cos-legend-Np9Mm",
1611
1609
  swatch: "cos-swatch-xEKvA"
1612
- }, Xe = [
1610
+ }, Qe = [
1613
1611
  {
1614
1612
  label: "A",
1615
1613
  value: 30,
@@ -1630,7 +1628,7 @@ var j = {
1630
1628
  value: 25,
1631
1629
  color: "#4ade80"
1632
1630
  }
1633
- ], Ze = ({ data: e = Xe, size: t = 240 }) => {
1631
+ ], $e = ({ data: e = Qe, size: t = 240 }) => {
1634
1632
  let r = o(null);
1635
1633
  return n(() => {
1636
1634
  let n = r.current;
@@ -1685,11 +1683,11 @@ var j = {
1685
1683
  ] }, e.label))
1686
1684
  })]
1687
1685
  });
1688
- }, z = {
1686
+ }, et = {
1689
1687
  particleNetwork: "cos-particleNetwork-GSZq-",
1690
1688
  canvas: "cos-canvas-E-BGP",
1691
1689
  hint: "cos-hint-LEO5o"
1692
- }, Qe = ({ width: e = 800, height: r = 500, particleCount: i = 60, linkDistance: a = 120, repelRadius: s = 150, color: c = "#38bdf8" }) => {
1690
+ }, tt = ({ width: e = 800, height: r = 500, particleCount: i = 60, linkDistance: a = 120, repelRadius: s = 150, color: c = "#38bdf8" }) => {
1693
1691
  let d = o(null), f = o([]), p = o({
1694
1692
  x: -1e3,
1695
1693
  y: -1e3
@@ -1772,14 +1770,14 @@ var j = {
1772
1770
  };
1773
1771
  };
1774
1772
  return /* @__PURE__ */ u("div", {
1775
- className: z.particleNetwork,
1773
+ className: et.particleNetwork,
1776
1774
  style: {
1777
1775
  width: e,
1778
1776
  height: r
1779
1777
  },
1780
1778
  children: [/* @__PURE__ */ l("canvas", {
1781
1779
  ref: d,
1782
- className: z.canvas,
1780
+ className: et.canvas,
1783
1781
  style: {
1784
1782
  width: e,
1785
1783
  height: r
@@ -1789,14 +1787,14 @@ var j = {
1789
1787
  onTouchMove: _,
1790
1788
  onTouchEnd: y
1791
1789
  }), /* @__PURE__ */ l("p", {
1792
- className: z.hint,
1790
+ className: et.hint,
1793
1791
  children: "移动鼠标或手指与粒子互动"
1794
1792
  })]
1795
1793
  });
1796
- }, $e = {
1794
+ }, nt = {
1797
1795
  smokeFog: "cos-smokeFog-SYlts",
1798
1796
  canvas: "cos-canvas-iOJV7"
1799
- }, et = ({ width: e = 800, height: t = 500, density: r = .5 }) => {
1797
+ }, rt = ({ width: e = 800, height: t = 500, density: r = .5 }) => {
1800
1798
  let i = o(null), a = o([]), s = o(0);
1801
1799
  return n(() => {
1802
1800
  let n = Math.floor(20 + r * 40);
@@ -1836,24 +1834,24 @@ var j = {
1836
1834
  cancelAnimationFrame(s.current), u();
1837
1835
  };
1838
1836
  }, [t, e]), /* @__PURE__ */ l("div", {
1839
- className: $e.smokeFog,
1837
+ className: nt.smokeFog,
1840
1838
  style: {
1841
1839
  width: e,
1842
1840
  height: t
1843
1841
  },
1844
1842
  children: /* @__PURE__ */ l("canvas", {
1845
1843
  ref: i,
1846
- className: $e.canvas,
1844
+ className: nt.canvas,
1847
1845
  style: {
1848
1846
  width: e,
1849
1847
  height: t
1850
1848
  }
1851
1849
  })
1852
1850
  });
1853
- }, tt = {
1851
+ }, it = {
1854
1852
  snowfall: "cos-snowfall-Q-Dhg",
1855
1853
  canvas: "cos-canvas-bJVF8"
1856
- }, nt = ({ width: e = 800, height: r = 500, mode: i = "snow", count: a = 120 }) => {
1854
+ }, at = ({ width: e = 800, height: r = 500, mode: i = "snow", count: a = 120 }) => {
1857
1855
  let s = o(null), c = o([]), u = o(0), d = t((t) => ({
1858
1856
  x: Math.random() * e,
1859
1857
  y: t ?? Math.random() * r,
@@ -1900,24 +1898,24 @@ var j = {
1900
1898
  i,
1901
1899
  e
1902
1900
  ]), /* @__PURE__ */ l("div", {
1903
- className: tt.snowfall,
1901
+ className: it.snowfall,
1904
1902
  style: {
1905
1903
  width: e,
1906
1904
  height: r
1907
1905
  },
1908
1906
  children: /* @__PURE__ */ l("canvas", {
1909
1907
  ref: s,
1910
- className: tt.canvas,
1908
+ className: it.canvas,
1911
1909
  style: {
1912
1910
  width: e,
1913
1911
  height: r
1914
1912
  }
1915
1913
  })
1916
1914
  });
1917
- }, rt = {
1915
+ }, ot = {
1918
1916
  starfield: "cos-starfield-QTwia",
1919
1917
  canvas: "cos-canvas-C2t3g"
1920
- }, it = ({ width: e = 800, height: t = 500, starCount: r = 400, speed: i = 1 }) => {
1918
+ }, st = ({ width: e = 800, height: t = 500, starCount: r = 400, speed: i = 1 }) => {
1921
1919
  let a = o(null), s = o([]), c = o(0);
1922
1920
  return n(() => {
1923
1921
  s.current = Array.from({ length: r }, () => ({
@@ -1960,21 +1958,21 @@ var j = {
1960
1958
  r,
1961
1959
  e
1962
1960
  ]), /* @__PURE__ */ l("div", {
1963
- className: rt.starfield,
1961
+ className: ot.starfield,
1964
1962
  style: {
1965
1963
  width: e,
1966
1964
  height: t
1967
1965
  },
1968
1966
  children: /* @__PURE__ */ l("canvas", {
1969
1967
  ref: a,
1970
- className: rt.canvas,
1968
+ className: ot.canvas,
1971
1969
  style: {
1972
1970
  width: e,
1973
1971
  height: t
1974
1972
  }
1975
1973
  })
1976
1974
  });
1977
- }, B = {
1975
+ }, z = {
1978
1976
  progressChest: "cos-progressChest-Bqcv1",
1979
1977
  barWrap: "cos-barWrap-E2pnl",
1980
1978
  barTrack: "cos-barTrack-dKLhs",
@@ -1989,35 +1987,37 @@ var j = {
1989
1987
  treasure: "cos-treasure-nx-6S",
1990
1988
  pop: "cos-pop-uRZvT",
1991
1989
  label: "cos-label-61hRe"
1992
- }, at = ({ progress: e = 0, onOpen: t, label: r = "开启宝箱" }) => {
1993
- let i = o(!1), a = y(e, 0, 100), s = a >= 100;
1990
+ }, ct = ({ progress: e = 0, onOpen: t, label: r = "开启宝箱" }) => {
1991
+ let i = o(!1), a = o(t), s = y(e, 0, 100), c = s >= 100;
1994
1992
  return n(() => {
1995
- s && !i.current && (i.current = !0, t?.()), s || (i.current = !1);
1996
- }, [s, t]), /* @__PURE__ */ u("div", {
1997
- className: B.progressChest,
1993
+ a.current = t;
1994
+ }, [t]), n(() => {
1995
+ c && !i.current && (i.current = !0, a.current?.()), c || (i.current = !1);
1996
+ }, [c]), /* @__PURE__ */ u("div", {
1997
+ className: z.progressChest,
1998
1998
  children: [
1999
1999
  /* @__PURE__ */ u("div", {
2000
- className: B.barWrap,
2000
+ className: z.barWrap,
2001
2001
  children: [/* @__PURE__ */ l("div", {
2002
- className: B.barTrack,
2002
+ className: z.barTrack,
2003
2003
  children: /* @__PURE__ */ l("div", {
2004
- className: B.barFill,
2005
- style: { width: `${a}%` }
2004
+ className: z.barFill,
2005
+ style: { width: `${s}%` }
2006
2006
  })
2007
2007
  }), /* @__PURE__ */ u("span", {
2008
- className: B.pct,
2009
- children: [a.toFixed(0), "%"]
2008
+ className: z.pct,
2009
+ children: [s.toFixed(0), "%"]
2010
2010
  })]
2011
2011
  }),
2012
2012
  /* @__PURE__ */ u("div", {
2013
- className: `${B.chest} ${s ? B.open : ""}`,
2013
+ className: `${z.chest} ${c ? z.open : ""}`,
2014
2014
  children: [/* @__PURE__ */ u("div", {
2015
- className: B.lid,
2016
- children: [/* @__PURE__ */ l("div", { className: B.lidTop }), /* @__PURE__ */ l("div", { className: B.lock })]
2015
+ className: z.lid,
2016
+ children: [/* @__PURE__ */ l("div", { className: z.lidTop }), /* @__PURE__ */ l("div", { className: z.lock })]
2017
2017
  }), /* @__PURE__ */ l("div", {
2018
- className: B.body,
2019
- children: s && /* @__PURE__ */ u("div", {
2020
- className: B.treasure,
2018
+ className: z.body,
2019
+ children: c && /* @__PURE__ */ u("div", {
2020
+ className: z.treasure,
2021
2021
  children: [
2022
2022
  /* @__PURE__ */ l("span", { children: "💎" }),
2023
2023
  /* @__PURE__ */ l("span", { children: "✨" }),
@@ -2027,15 +2027,15 @@ var j = {
2027
2027
  })]
2028
2028
  }),
2029
2029
  /* @__PURE__ */ l("p", {
2030
- className: B.label,
2031
- children: s ? "宝箱已开启!" : r
2030
+ className: z.label,
2031
+ children: c ? "宝箱已开启!" : r
2032
2032
  })
2033
2033
  ]
2034
2034
  });
2035
- }, ot = {
2035
+ }, lt = {
2036
2036
  radarScan: "cos-radarScan-PZaG8",
2037
2037
  canvas: "cos-canvas-fUw5N"
2038
- }, st = ({ size: e = 300, color: t = "#22d3ee", blipCount: r = 5 }) => {
2038
+ }, ut = ({ size: e = 300, color: t = "#22d3ee", blipCount: r = 5 }) => {
2039
2039
  let i = o(null), a = o(0), s = o([]), c = o(0);
2040
2040
  return n(() => {
2041
2041
  s.current = Array.from({ length: r }, () => ({
@@ -2072,32 +2072,34 @@ var j = {
2072
2072
  t,
2073
2073
  e
2074
2074
  ]), /* @__PURE__ */ l("div", {
2075
- className: ot.radarScan,
2075
+ className: lt.radarScan,
2076
2076
  style: {
2077
2077
  width: e,
2078
2078
  height: e
2079
2079
  },
2080
2080
  children: /* @__PURE__ */ l("canvas", {
2081
2081
  ref: i,
2082
- className: ot.canvas,
2082
+ className: lt.canvas,
2083
2083
  style: {
2084
2084
  width: e,
2085
2085
  height: e
2086
2086
  }
2087
2087
  })
2088
2088
  });
2089
- }, V = {
2089
+ }, B = {
2090
2090
  redPacketRain: "cos-redPacketRain-eJ7FW",
2091
2091
  canvas: "cos-canvas-direH",
2092
2092
  hud: "cos-hud-InqMq",
2093
2093
  end: "cos-end-u0J7o",
2094
2094
  hint: "cos-hint-sO6ld"
2095
- }, ct = ({ duration: e = 1e4, onGrab: r }) => {
2096
- let i = o(null), a = o([]), c = o(0), d = o(0), f = o(0), [p, m] = s(0), [h, g] = s(!0), _ = o(!0);
2095
+ }, dt = ({ duration: e = 1e4, onGrab: r }) => {
2096
+ let i = o(null), a = o([]), c = o(0), d = o(0), f = o(0), [p, m] = s(0), [h, g] = s(!0), _ = o(!0), y = o(r);
2097
2097
  n(() => {
2098
+ y.current = r;
2099
+ }, [r]), n(() => {
2098
2100
  _.current = h;
2099
2101
  }, [h]);
2100
- let y = t(() => {
2102
+ let b = t(() => {
2101
2103
  a.current.push({
2102
2104
  id: d.current++,
2103
2105
  x: Math.random() * 350 + 25,
@@ -2130,49 +2132,49 @@ var j = {
2130
2132
  }), l = window.setTimeout(() => {
2131
2133
  _.current = !1, g(!1);
2132
2134
  }, e), u = () => {
2133
- c.current = requestAnimationFrame(u), !o && (f.current++, _.current && f.current % 20 == 0 && y(), r.fillStyle = "rgb(15 23 42 / 20%)", r.fillRect(0, 0, 400, 500), a.current = a.current.filter((e) => e.grabbed ? !1 : (e.y += e.speed, e.x += Math.sin(e.y * .02) * .5, r.save(), r.translate(e.x, e.y), r.rotate(e.rotation), r.fillStyle = "#dc2626", r.beginPath(), r.roundRect(-22, -28, 44, 56, 6), r.fill(), r.fillStyle = "#fbbf24", r.beginPath(), r.arc(0, -10, 8, 0, Math.PI * 2), r.fill(), r.fillStyle = "#fde68a", r.font = "bold 12px system-ui", r.textAlign = "center", r.fillText(`¥${e.amount}`, 0, 12), r.restore(), e.y < 560)));
2135
+ c.current = requestAnimationFrame(u), !o && (f.current++, _.current && f.current % 20 == 0 && b(), r.fillStyle = "rgb(15 23 42 / 20%)", r.fillRect(0, 0, 400, 500), a.current = a.current.filter((e) => e.grabbed ? !1 : (e.y += e.speed, e.x += Math.sin(e.y * .02) * .5, r.save(), r.translate(e.x, e.y), r.rotate(e.rotation), r.fillStyle = "#dc2626", r.beginPath(), r.roundRect(-22, -28, 44, 56, 6), r.fill(), r.fillStyle = "#fbbf24", r.beginPath(), r.arc(0, -10, 8, 0, Math.PI * 2), r.fill(), r.fillStyle = "#fde68a", r.font = "bold 12px system-ui", r.textAlign = "center", r.fillText(`¥${e.amount}`, 0, 12), r.restore(), e.y < 560)));
2134
2136
  };
2135
2137
  return u(), () => {
2136
2138
  cancelAnimationFrame(c.current), clearTimeout(l), s();
2137
2139
  };
2138
- }, [e, y]), /* @__PURE__ */ u("div", {
2139
- className: V.redPacketRain,
2140
+ }, [e, b]), /* @__PURE__ */ u("div", {
2141
+ className: B.redPacketRain,
2140
2142
  children: [
2141
2143
  /* @__PURE__ */ l("canvas", {
2142
2144
  ref: i,
2143
- className: V.canvas,
2145
+ className: B.canvas,
2144
2146
  style: {
2145
2147
  width: 400,
2146
2148
  height: 500
2147
2149
  },
2148
2150
  onClick: (e) => {
2149
- let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, i = e.clientY - t.top, o = !1;
2150
- a.current = a.current.map((e) => e.grabbed || o ? e : Math.abs(n - e.x) < 30 && Math.abs(i - e.y) < 35 ? (o = !0, m((t) => t + e.amount), r?.(e.amount), {
2151
+ let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = !1;
2152
+ a.current = a.current.map((e) => e.grabbed || i ? e : Math.abs(n - e.x) < 30 && Math.abs(r - e.y) < 35 ? (i = !0, m((t) => t + e.amount), y.current?.(e.amount), {
2151
2153
  ...e,
2152
2154
  grabbed: !0
2153
2155
  }) : e);
2154
2156
  }
2155
2157
  }),
2156
2158
  /* @__PURE__ */ u("div", {
2157
- className: V.hud,
2159
+ className: B.hud,
2158
2160
  children: [/* @__PURE__ */ u("span", { children: ["已抢: ¥", p] }), !h && /* @__PURE__ */ l("span", {
2159
- className: V.end,
2161
+ className: B.end,
2160
2162
  children: "红包雨结束"
2161
2163
  })]
2162
2164
  }),
2163
2165
  /* @__PURE__ */ l("p", {
2164
- className: V.hint,
2166
+ className: B.hint,
2165
2167
  children: "点击红包抢夺"
2166
2168
  })
2167
2169
  ]
2168
2170
  });
2169
- }, H = {
2171
+ }, V = {
2170
2172
  returnCityContainer: "cos-returnCityContainer-6XTxj",
2171
2173
  star: "cos-star-a59Dx",
2172
2174
  glassWrap: "cos-glassWrap-golMO",
2173
2175
  rotate: "cos-rotate-7X9Jj",
2174
2176
  glassItem: "cos-glassItem-OwlFI"
2175
- }, lt = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
2177
+ }, ft = ({ starCount: e, glassCount: t = 8, glassRadius: r = 150 }) => {
2176
2178
  let i = o(null), a = o(null);
2177
2179
  return n(() => {
2178
2180
  let n = i.current, o = a.current;
@@ -2181,13 +2183,13 @@ var j = {
2181
2183
  for (let e = 0; e < f; e++) {
2182
2184
  let e = window.setTimeout(() => {
2183
2185
  let e = document.createElement("div");
2184
- e.className = H.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
2186
+ e.className = V.star, e.style.top = `${Math.random() * d}px`, e.style.left = `${Math.random() * u}px`, n.append(e), c.push(e);
2185
2187
  }, Math.random() * 2e3);
2186
2188
  s.push(e);
2187
2189
  }
2188
2190
  for (let e = 0; e < t; e++) {
2189
2191
  let n = document.createElement("div");
2190
- n.className = H.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, o.appendChild(n), l.push(n);
2192
+ n.className = V.glassItem, n.style.transform = `rotateY(${360 / t * e}deg) translateZ(${r}px)`, o.appendChild(n), l.push(n);
2191
2193
  let i = window.setTimeout(() => {
2192
2194
  n.style.top = "0px", n.style.opacity = "1";
2193
2195
  }, e * 300);
@@ -2202,13 +2204,13 @@ var j = {
2202
2204
  r
2203
2205
  ]), /* @__PURE__ */ l("div", {
2204
2206
  ref: i,
2205
- className: H.returnCityContainer,
2207
+ className: V.returnCityContainer,
2206
2208
  children: /* @__PURE__ */ l("div", {
2207
2209
  ref: a,
2208
- className: H.glassWrap
2210
+ className: V.glassWrap
2209
2211
  })
2210
2212
  });
2211
- }, U = {
2213
+ }, H = {
2212
2214
  speedometer: "cos-speedometer-INc7F",
2213
2215
  svg: "cos-svg-HG-lE",
2214
2216
  track: "cos-track-5-922",
@@ -2218,37 +2220,37 @@ var j = {
2218
2220
  hub: "cos-hub-4WaHw",
2219
2221
  valueText: "cos-valueText--q4Xi",
2220
2222
  label: "cos-label-hOPy1"
2221
- }, W = (e, t, n, r) => {
2223
+ }, U = (e, t, n, r) => {
2222
2224
  let i = (r - 90) * Math.PI / 180;
2223
2225
  return {
2224
2226
  x: e + n * Math.cos(i),
2225
2227
  y: t + n * Math.sin(i)
2226
2228
  };
2227
- }, ut = ({ value: e = 0, max: t = 100, label: n = "SPEED", color: r = "#f97316" }) => {
2229
+ }, pt = ({ value: e = 0, max: t = 100, label: n = "SPEED", color: r = "#f97316" }) => {
2228
2230
  let i = -120 + y(t > 0 ? e / t : 0, 0, 1) * 240, o = a(() => {
2229
- let e = W(100, 100, 72, -120), t = W(100, 100, 72, 120);
2231
+ let e = U(100, 100, 72, -120), t = U(100, 100, 72, 120);
2230
2232
  return `M ${e.x} ${e.y} A 72 72 0 1 1 ${t.x} ${t.y}`;
2231
2233
  }, []), s = a(() => {
2232
- let e = W(100, 100, 72, -120), t = W(100, 100, 72, i), n = +(i - -120 > 180);
2234
+ let e = U(100, 100, 72, -120), t = U(100, 100, 72, i), n = +(i - -120 > 180);
2233
2235
  return `M ${e.x} ${e.y} A 72 72 0 ${n} 1 ${t.x} ${t.y}`;
2234
- }, [i]), c = W(100, 100, 58, i);
2236
+ }, [i]), c = U(100, 100, 58, i);
2235
2237
  return /* @__PURE__ */ u("div", {
2236
- className: U.speedometer,
2238
+ className: H.speedometer,
2237
2239
  style: { "--gauge-color": r },
2238
2240
  children: [/* @__PURE__ */ u("svg", {
2239
2241
  viewBox: "0 0 200 130",
2240
- className: U.svg,
2242
+ className: H.svg,
2241
2243
  children: [
2242
2244
  /* @__PURE__ */ l("path", {
2243
2245
  d: o,
2244
- className: U.track,
2246
+ className: H.track,
2245
2247
  fill: "none",
2246
2248
  strokeWidth: "12",
2247
2249
  strokeLinecap: "round"
2248
2250
  }),
2249
2251
  /* @__PURE__ */ l("path", {
2250
2252
  d: s,
2251
- className: U.valueArc,
2253
+ className: H.valueArc,
2252
2254
  fill: "none",
2253
2255
  strokeWidth: "12",
2254
2256
  strokeLinecap: "round"
@@ -2260,13 +2262,13 @@ var j = {
2260
2262
  60,
2261
2263
  120
2262
2264
  ].map((e) => {
2263
- let t = W(100, 100, 58, e), n = W(100, 100, 66, e);
2265
+ let t = U(100, 100, 58, e), n = U(100, 100, 66, e);
2264
2266
  return /* @__PURE__ */ l("line", {
2265
2267
  x1: t.x,
2266
2268
  y1: t.y,
2267
2269
  x2: n.x,
2268
2270
  y2: n.y,
2269
- className: U.tick
2271
+ className: H.tick
2270
2272
  }, e);
2271
2273
  }),
2272
2274
  /* @__PURE__ */ l("line", {
@@ -2274,27 +2276,27 @@ var j = {
2274
2276
  y1: "100",
2275
2277
  x2: c.x,
2276
2278
  y2: c.y,
2277
- className: U.needle
2279
+ className: H.needle
2278
2280
  }),
2279
2281
  /* @__PURE__ */ l("circle", {
2280
2282
  cx: "100",
2281
2283
  cy: "100",
2282
2284
  r: "6",
2283
- className: U.hub
2285
+ className: H.hub
2284
2286
  }),
2285
2287
  /* @__PURE__ */ l("text", {
2286
2288
  x: "100",
2287
2289
  y: "118",
2288
- className: U.valueText,
2290
+ className: H.valueText,
2289
2291
  children: Math.round(e)
2290
2292
  })
2291
2293
  ]
2292
2294
  }), /* @__PURE__ */ l("span", {
2293
- className: U.label,
2295
+ className: H.label,
2294
2296
  children: n
2295
2297
  })]
2296
2298
  });
2297
- }, G = {
2299
+ }, W = {
2298
2300
  timelinePulse: "cos-timelinePulse-kcBM6",
2299
2301
  axis: "cos-axis-9DWis",
2300
2302
  track: "cos-track-jG-HV",
@@ -2304,7 +2306,7 @@ var j = {
2304
2306
  dot: "cos-dot-HJEVy",
2305
2307
  pulse: "cos-pulse-N6FD1",
2306
2308
  name: "cos-name-7zefJ"
2307
- }, dt = ({ steps: e = [
2309
+ }, mt = ({ steps: e = [
2308
2310
  "Start",
2309
2311
  "Process",
2310
2312
  "Review",
@@ -2312,26 +2314,26 @@ var j = {
2312
2314
  ], current: t = 0, color: n = "#22d3ee" }) => {
2313
2315
  let r = y(t, 0, Math.max(0, e.length - 1)), i = e.length > 1 ? r / (e.length - 1) : 0;
2314
2316
  return /* @__PURE__ */ l("div", {
2315
- className: G.timelinePulse,
2317
+ className: W.timelinePulse,
2316
2318
  style: {
2317
2319
  "--pulse-color": n,
2318
2320
  "--step-count": e.length,
2319
2321
  "--progress-ratio": i
2320
2322
  },
2321
2323
  children: /* @__PURE__ */ u("div", {
2322
- className: G.axis,
2324
+ className: W.axis,
2323
2325
  children: [
2324
- /* @__PURE__ */ l("div", { className: G.track }),
2325
- /* @__PURE__ */ l("div", { className: G.progress }),
2326
+ /* @__PURE__ */ l("div", { className: W.track }),
2327
+ /* @__PURE__ */ l("div", { className: W.progress }),
2326
2328
  /* @__PURE__ */ l("ul", {
2327
- className: G.steps,
2329
+ className: W.steps,
2328
2330
  children: e.map((e, t) => {
2329
2331
  let n = t < r ? "done" : t === r ? "current" : "pending";
2330
2332
  return /* @__PURE__ */ u("li", {
2331
- className: G.step,
2333
+ className: W.step,
2332
2334
  "data-state": n,
2333
- children: [/* @__PURE__ */ l("span", { className: G.dot }), /* @__PURE__ */ l("span", {
2334
- className: G.name,
2335
+ children: [/* @__PURE__ */ l("span", { className: W.dot }), /* @__PURE__ */ l("span", {
2336
+ className: W.name,
2335
2337
  children: e
2336
2338
  })]
2337
2339
  }, e + t);
@@ -2340,11 +2342,11 @@ var j = {
2340
2342
  ]
2341
2343
  })
2342
2344
  });
2343
- }, K = {
2345
+ }, G = {
2344
2346
  rippleWater: "cos-rippleWater-wsinI",
2345
2347
  canvas: "cos-canvas-XOdSF",
2346
2348
  hint: "cos-hint-0JH5D"
2347
- }, ft = ({ width: e = 800, height: r = 500, color: i = "#38bdf8" }) => {
2349
+ }, ht = ({ width: e = 800, height: r = 500, color: i = "#38bdf8" }) => {
2348
2350
  let a = o(null), s = o([]), c = o(0), d = t((t, n) => {
2349
2351
  let i = a.current;
2350
2352
  if (!i) return;
@@ -2391,32 +2393,32 @@ var j = {
2391
2393
  r,
2392
2394
  e
2393
2395
  ]), /* @__PURE__ */ u("div", {
2394
- className: K.rippleWater,
2396
+ className: G.rippleWater,
2395
2397
  style: {
2396
2398
  width: e,
2397
2399
  height: r
2398
2400
  },
2399
2401
  children: [/* @__PURE__ */ l("canvas", {
2400
2402
  ref: a,
2401
- className: K.canvas,
2403
+ className: G.canvas,
2402
2404
  style: {
2403
2405
  width: e,
2404
2406
  height: r
2405
2407
  }
2406
2408
  }), /* @__PURE__ */ l("span", {
2407
- className: K.hint,
2409
+ className: G.hint,
2408
2410
  children: "点击水面产生涟漪"
2409
2411
  })]
2410
2412
  });
2411
- }, pt = {
2413
+ }, K = {
2412
2414
  scrambleText: "cos-scrambleText-hN4Wm",
2413
2415
  text: "cos-text-frsHs",
2414
2416
  cursor: "cos-cursor-3zQOy",
2415
2417
  blink: "cos-blink-OcKXu"
2416
- }, mt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", ht = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = mt }) => {
2418
+ }, gt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%&*", _t = ({ text: e = "DECRYPTED", duration: t = 2e3, charset: r = gt }) => {
2417
2419
  let [i, a] = s(""), c = o(0), d = o(0);
2418
2420
  return n(() => {
2419
- let n = r.length > 0 ? r : mt, i = e;
2421
+ let n = r.length > 0 ? r : gt, i = e;
2420
2422
  d.current = performance.now();
2421
2423
  let o = (e) => {
2422
2424
  let r = e - d.current, s = Math.min(r / t, 1), l = Math.floor(s * i.length);
@@ -2428,10 +2430,10 @@ var j = {
2428
2430
  t,
2429
2431
  r
2430
2432
  ]), /* @__PURE__ */ l("div", {
2431
- className: pt.scrambleText,
2433
+ className: K.scrambleText,
2432
2434
  children: /* @__PURE__ */ u("p", {
2433
- className: pt.text,
2434
- children: [i, /* @__PURE__ */ l("span", { className: pt.cursor })]
2435
+ className: K.text,
2436
+ children: [i, /* @__PURE__ */ l("span", { className: K.cursor })]
2435
2437
  })
2436
2438
  });
2437
2439
  }, q = {
@@ -2439,39 +2441,43 @@ var j = {
2439
2441
  prize: "cos-prize-X0z5V",
2440
2442
  canvas: "cos-canvas-JqIlr",
2441
2443
  hidden: "cos-hidden-Lsfbt"
2442
- }, gt = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
2443
- let d = o(null), f = o(!1), p = o(!1), [m, h] = s(!1), g = t((t) => {
2444
+ }, vt = ({ coverColor: e = "#94a3b8", prize: r = "🎉 恭喜中奖!", onReveal: i, width: a = 300, height: c = 180 }) => {
2445
+ let d = o(null), f = o(!1), p = o(!1), m = o(i), [h, g] = s(!1);
2446
+ n(() => {
2447
+ m.current = i;
2448
+ }, [i]);
2449
+ let _ = t((t) => {
2444
2450
  t.globalCompositeOperation = "source-over", t.fillStyle = e, t.fillRect(0, 0, a, c), t.fillStyle = "rgb(255 255 255 / 30%)", t.font = "bold 16px system-ui, sans-serif", t.textAlign = "center", t.fillText("刮开涂层", a / 2, c / 2);
2445
2451
  }, [
2446
2452
  e,
2447
2453
  c,
2448
2454
  a
2449
- ]), _ = t((e) => {
2455
+ ]), v = t((e) => {
2450
2456
  if (p.current) return;
2451
2457
  let t = e.getContext("2d");
2452
2458
  if (!t) return;
2453
2459
  let n = t.getImageData(0, 0, e.width, e.height), r = 0;
2454
2460
  for (let e = 3; e < n.data.length; e += 4) n.data[e] < 128 && r++;
2455
- r / (e.width * e.height) > .45 && (p.current = !0, h(!0), i?.());
2456
- }, [i]);
2461
+ r / (e.width * e.height) > .45 && (p.current = !0, g(!0), m.current?.());
2462
+ }, []);
2457
2463
  n(() => {
2458
2464
  let e = d.current;
2459
2465
  if (!e) return;
2460
2466
  let t = window.devicePixelRatio || 1;
2461
2467
  e.width = a * t, e.height = c * t;
2462
2468
  let n = e.getContext("2d");
2463
- n && (n.setTransform(t, 0, 0, t, 0, 0), g(n));
2469
+ n && (n.setTransform(t, 0, 0, t, 0, 0), _(n));
2464
2470
  }, [
2465
- g,
2471
+ _,
2466
2472
  c,
2467
2473
  a
2468
2474
  ]);
2469
- let v = (e, t) => {
2475
+ let y = (e, t) => {
2470
2476
  let n = d.current;
2471
2477
  if (!n || p.current) return;
2472
2478
  let r = n.getContext("2d");
2473
- r && (r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(e, t, 20, 0, Math.PI * 2), r.fill(), _(n));
2474
- }, y = (e) => {
2479
+ r && (r.globalCompositeOperation = "destination-out", r.beginPath(), r.arc(e, t, 20, 0, Math.PI * 2), r.fill(), v(n));
2480
+ }, b = (e) => {
2475
2481
  let t = d.current;
2476
2482
  if (!t) return null;
2477
2483
  let n = t.getBoundingClientRect();
@@ -2486,15 +2492,15 @@ var j = {
2486
2492
  x: e.clientX - n.left,
2487
2493
  y: e.clientY - n.top
2488
2494
  };
2489
- }, b = (e) => {
2490
- f.current = !0;
2491
- let t = y(e);
2492
- t && v(t.x, t.y);
2493
2495
  }, x = (e) => {
2496
+ f.current = !0;
2497
+ let t = b(e);
2498
+ t && y(t.x, t.y);
2499
+ }, S = (e) => {
2494
2500
  if (!f.current) return;
2495
- let t = y(e);
2496
- t && v(t.x, t.y);
2497
- }, S = () => {
2501
+ let t = b(e);
2502
+ t && y(t.x, t.y);
2503
+ }, C = () => {
2498
2504
  f.current = !1;
2499
2505
  };
2500
2506
  return /* @__PURE__ */ u("div", {
@@ -2508,18 +2514,18 @@ var j = {
2508
2514
  children: r
2509
2515
  }), /* @__PURE__ */ l("canvas", {
2510
2516
  ref: d,
2511
- className: `${q.canvas} ${m ? q.hidden : ""}`,
2517
+ className: `${q.canvas} ${h ? q.hidden : ""}`,
2512
2518
  style: {
2513
2519
  width: a,
2514
2520
  height: c
2515
2521
  },
2516
- onMouseDown: b,
2517
- onMouseMove: x,
2518
- onMouseUp: S,
2519
- onMouseLeave: S,
2520
- onTouchStart: b,
2521
- onTouchMove: x,
2522
- onTouchEnd: S
2522
+ onMouseDown: x,
2523
+ onMouseMove: S,
2524
+ onMouseUp: C,
2525
+ onMouseLeave: C,
2526
+ onTouchStart: x,
2527
+ onTouchMove: S,
2528
+ onTouchEnd: C
2523
2529
  })]
2524
2530
  });
2525
2531
  }, J = {
@@ -2531,14 +2537,14 @@ var j = {
2531
2537
  mask: "cos-mask-jdrj3",
2532
2538
  spinBtn: "cos-spinBtn-DvDE7",
2533
2539
  result: "cos-result-dLN5b"
2534
- }, _t = [
2540
+ }, yt = [
2535
2541
  "🍒",
2536
2542
  "🍋",
2537
2543
  "🍊",
2538
2544
  "🍇",
2539
2545
  "⭐",
2540
2546
  "7️⃣"
2541
- ], vt = (e) => 1 - (1 - e) ** 3, yt = ({ symbols: e = _t, onSpinEnd: r }) => {
2547
+ ], bt = (e) => 1 - (1 - e) ** 3, xt = ({ symbols: e = yt, onSpinEnd: r }) => {
2542
2548
  let [i, a] = s(!1), [c, d] = s([
2543
2549
  0,
2544
2550
  0,
@@ -2598,7 +2604,7 @@ var j = {
2598
2604
  if (d(r.map((e, t) => {
2599
2605
  let r = i - l - s[t];
2600
2606
  if (r < 0) return e;
2601
- let a = vt(Math.min(r / o, 1));
2607
+ let a = bt(Math.min(r / o, 1));
2602
2608
  return e + (n[t] - e) * a;
2603
2609
  })), !s.every((e) => i - l - e >= o)) m.current = requestAnimationFrame(f);
2604
2610
  else if (!u.cancelled) {
@@ -2627,27 +2633,27 @@ var j = {
2627
2633
  fromBottom: "cos-fromBottom-24D6g",
2628
2634
  fromLeft: "cos-fromLeft-OMiPY",
2629
2635
  fromRight: "cos-fromRight-EcMOR"
2630
- }, bt = [
2636
+ }, St = [
2631
2637
  "fromTop",
2632
2638
  "fromBottom",
2633
2639
  "fromLeft",
2634
2640
  "fromRight"
2635
- ], xt = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
2641
+ ], Ct = ({ text: e = "REVEAL", delay: t = 80, color: n = "#f8fafc" }) => /* @__PURE__ */ l("div", {
2636
2642
  className: Y.splitReveal,
2637
2643
  children: /* @__PURE__ */ l("h1", {
2638
2644
  className: Y.text,
2639
2645
  style: { "--reveal-color": n },
2640
2646
  children: e.split("").map((e, n) => /* @__PURE__ */ l("span", {
2641
- className: `${Y.char} ${Y[bt[n % bt.length]]}`,
2647
+ className: `${Y.char} ${Y[St[n % St.length]]}`,
2642
2648
  style: { animationDelay: `${n * t}ms` },
2643
2649
  children: e === " " ? "\xA0" : e
2644
2650
  }, `${e}-${n}`))
2645
2651
  })
2646
- }), St = {
2652
+ }), X = {
2647
2653
  spotlight: "cos-spotlight-OddY1",
2648
2654
  content: "cos-content-5I1Wy",
2649
2655
  overlay: "cos-overlay-F6CJ5"
2650
- }, Ct = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
2656
+ }, wt = ({ children: e, radius: n = 120, dimColor: r = "rgba(0, 0, 0, 0.85)" }) => {
2651
2657
  let i = o(null), a = t((e) => {
2652
2658
  let t = i.current;
2653
2659
  if (!t) return;
@@ -2656,18 +2662,18 @@ var j = {
2656
2662
  }, []);
2657
2663
  return /* @__PURE__ */ u("div", {
2658
2664
  ref: i,
2659
- className: St.spotlight,
2665
+ className: X.spotlight,
2660
2666
  style: {
2661
2667
  "--spot-radius": `${n}px`,
2662
2668
  "--dim-color": r
2663
2669
  },
2664
2670
  onMouseMove: a,
2665
2671
  children: [/* @__PURE__ */ l("div", {
2666
- className: St.content,
2672
+ className: X.content,
2667
2673
  children: e
2668
- }), /* @__PURE__ */ l("div", { className: St.overlay })]
2674
+ }), /* @__PURE__ */ l("div", { className: X.overlay })]
2669
2675
  });
2670
- }, X = {
2676
+ }, Z = {
2671
2677
  turntable: "cos-turntable-dkc32",
2672
2678
  wheelWrap: "cos-wheelWrap-n7lhc",
2673
2679
  canvas: "cos-canvas-A1-4x",
@@ -2675,7 +2681,7 @@ var j = {
2675
2681
  spinBtn: "cos-spinBtn-l9JIC",
2676
2682
  result: "cos-result-H8q2c",
2677
2683
  "fade-in": "cos-fade-in-U9bUC"
2678
- }, wt = [
2684
+ }, Tt = [
2679
2685
  "#FF6B6B",
2680
2686
  "#4ECDC4",
2681
2687
  "#FFE66D",
@@ -2684,19 +2690,19 @@ var j = {
2684
2690
  "#F472B6",
2685
2691
  "#34D399",
2686
2692
  "#FB923C"
2687
- ], Tt = [
2693
+ ], Et = [
2688
2694
  { label: "一等奖" },
2689
2695
  { label: "二等奖" },
2690
2696
  { label: "三等奖" },
2691
2697
  { label: "谢谢参与" },
2692
2698
  { label: "优惠券" },
2693
2699
  { label: "再来一次" }
2694
- ], Et = (e) => 1 - (1 - e) ** 3, Dt = ({ prizes: e = Tt, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
2700
+ ], Dt = (e) => 1 - (1 - e) ** 3, Ot = ({ prizes: e = Et, size: r = 360, spinDuration: i = 4e3, spinRounds: a = 5, buttonText: c = "开始抽奖", onSpinEnd: d }) => {
2695
2701
  let f = o(null), p = o(0), m = o(0), h = o(1), [g, _] = s(!1), [v, y] = s(null), b = o(d), x = o(null);
2696
2702
  n(() => {
2697
2703
  b.current = d;
2698
2704
  }, [d]);
2699
- let S = r + 48, C = (e, t) => t.color ?? wt[e % wt.length], w = t((t) => {
2705
+ let S = r + 48, C = (e, t) => t.color ?? Tt[e % Tt.length], w = t((t) => {
2700
2706
  let n = f.current;
2701
2707
  if (!n) return;
2702
2708
  let i = n.getContext("2d");
@@ -2731,22 +2737,22 @@ var j = {
2731
2737
  return Math.floor((360 - r + n / 2) % 360 / n) % e.length;
2732
2738
  };
2733
2739
  return /* @__PURE__ */ u("div", {
2734
- className: X.turntable,
2740
+ className: Z.turntable,
2735
2741
  style: {
2736
2742
  width: S,
2737
2743
  height: S + 80
2738
2744
  },
2739
2745
  children: [/* @__PURE__ */ u("div", {
2740
- className: X.wheelWrap,
2746
+ className: Z.wheelWrap,
2741
2747
  style: {
2742
2748
  width: S,
2743
2749
  height: S
2744
2750
  },
2745
2751
  children: [
2746
- /* @__PURE__ */ l("div", { className: X.pointer }),
2752
+ /* @__PURE__ */ l("div", { className: Z.pointer }),
2747
2753
  /* @__PURE__ */ l("canvas", {
2748
2754
  ref: f,
2749
- className: X.canvas,
2755
+ className: Z.canvas,
2750
2756
  style: {
2751
2757
  width: S,
2752
2758
  height: S
@@ -2754,7 +2760,7 @@ var j = {
2754
2760
  }),
2755
2761
  /* @__PURE__ */ l("button", {
2756
2762
  type: "button",
2757
- className: X.spinBtn,
2763
+ className: Z.spinBtn,
2758
2764
  onClick: () => {
2759
2765
  if (g || e.length === 0) return;
2760
2766
  _(!0), y(null);
@@ -2762,9 +2768,9 @@ var j = {
2762
2768
  x.current = l;
2763
2769
  let u = (t) => {
2764
2770
  if (l.cancelled) return;
2765
- let n = t - c, r = Math.min(n / i, 1), a = Et(r), d = s + (o - s) * a;
2771
+ let n = t - c, r = Math.min(n / i, 1), a = Dt(r), d = s + (o - s) * a;
2766
2772
  if (p.current = d, w(d), r < 1) m.current = requestAnimationFrame(u);
2767
- else {
2773
+ else if (!l.cancelled) {
2768
2774
  let t = ee(d), n = e[t];
2769
2775
  p.current = d, _(!1), y(n), b.current?.(n, t);
2770
2776
  }
@@ -2776,11 +2782,11 @@ var j = {
2776
2782
  })
2777
2783
  ]
2778
2784
  }), v && !g && /* @__PURE__ */ u("p", {
2779
- className: X.result,
2785
+ className: Z.result,
2780
2786
  children: ["恭喜获得:", /* @__PURE__ */ l("strong", { children: v.label })]
2781
2787
  })]
2782
2788
  });
2783
- }, Z = {
2789
+ }, Q = {
2784
2790
  typewriter: "cos-typewriter-7UhOL",
2785
2791
  terminal: "cos-terminal-NWNVN",
2786
2792
  dots: "cos-dots-oulNg",
@@ -2788,11 +2794,11 @@ var j = {
2788
2794
  prompt: "cos-prompt-Y4hVD",
2789
2795
  cursor: "cos-cursor-m8hGi",
2790
2796
  blink: "cos-blink-XykM7"
2791
- }, Ot = [
2797
+ }, kt = [
2792
2798
  "Hello, cos-design!",
2793
2799
  "欢迎来到组件库 ✨",
2794
2800
  "Build something fun 🚀"
2795
- ], kt = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
2801
+ ], At = ({ texts: e, speed: t, deleteSpeed: r, pause: i }) => {
2796
2802
  let [a, o] = s(""), [c, d] = s(0), [f, p] = s(!1);
2797
2803
  return n(() => {
2798
2804
  let n = e[c % e.length], s;
@@ -2814,85 +2820,85 @@ var j = {
2814
2820
  r,
2815
2821
  i
2816
2822
  ]), /* @__PURE__ */ l("div", {
2817
- className: Z.typewriter,
2823
+ className: Q.typewriter,
2818
2824
  children: /* @__PURE__ */ u("div", {
2819
- className: Z.terminal,
2825
+ className: Q.terminal,
2820
2826
  children: [/* @__PURE__ */ u("div", {
2821
- className: Z.dots,
2827
+ className: Q.dots,
2822
2828
  children: [
2823
2829
  /* @__PURE__ */ l("span", {}),
2824
2830
  /* @__PURE__ */ l("span", {}),
2825
2831
  /* @__PURE__ */ l("span", {})
2826
2832
  ]
2827
2833
  }), /* @__PURE__ */ u("p", {
2828
- className: Z.text,
2834
+ className: Q.text,
2829
2835
  children: [
2830
2836
  /* @__PURE__ */ l("span", {
2831
- className: Z.prompt,
2837
+ className: Q.prompt,
2832
2838
  children: ">"
2833
2839
  }),
2834
2840
  a,
2835
2841
  /* @__PURE__ */ l("span", {
2836
- className: Z.cursor,
2842
+ className: Q.cursor,
2837
2843
  children: "|"
2838
2844
  })
2839
2845
  ]
2840
2846
  })]
2841
2847
  })
2842
2848
  });
2843
- }, At = ({ texts: e = Ot, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
2844
- let i = e.length > 0 ? e : Ot;
2845
- return /* @__PURE__ */ l(kt, {
2849
+ }, jt = ({ texts: e = kt, speed: t = 100, deleteSpeed: n = 50, pause: r = 2e3 }) => {
2850
+ let i = e.length > 0 ? e : kt;
2851
+ return /* @__PURE__ */ l(At, {
2846
2852
  texts: i,
2847
2853
  speed: t,
2848
2854
  deleteSpeed: n,
2849
2855
  pause: r
2850
2856
  }, i.join("\0"));
2851
- }, Q = {
2857
+ }, $ = {
2852
2858
  waveButton: "cos-waveButton-Aa7G-",
2853
2859
  btn: "cos-btn-WJrEN",
2854
2860
  label: "cos-label-9BHOU",
2855
2861
  wave: "cos-wave-GycLU",
2856
2862
  ripple: "cos-ripple-5ZFpr"
2857
- }, jt = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
2858
- className: Q.waveButton,
2863
+ }, Mt = ({ text: e = "点我试试", color: t = "#38bdf8", className: n, style: r, ...i }) => /* @__PURE__ */ l("div", {
2864
+ className: $.waveButton,
2859
2865
  children: /* @__PURE__ */ u("button", {
2860
2866
  type: "button",
2861
- className: `${Q.btn} ${n ?? ""}`,
2867
+ className: `${$.btn} ${n ?? ""}`,
2862
2868
  style: {
2863
2869
  "--wave-color": t,
2864
2870
  ...r
2865
2871
  },
2866
2872
  ...i,
2867
2873
  children: [
2868
- /* @__PURE__ */ l("span", { className: Q.wave }),
2869
- /* @__PURE__ */ l("span", { className: Q.wave }),
2874
+ /* @__PURE__ */ l("span", { className: $.wave }),
2875
+ /* @__PURE__ */ l("span", { className: $.wave }),
2870
2876
  /* @__PURE__ */ l("span", {
2871
- className: Q.label,
2877
+ className: $.label,
2872
2878
  children: e
2873
2879
  })
2874
2880
  ]
2875
2881
  })
2876
- }), $ = {
2882
+ }), Nt = {
2877
2883
  waveText: "cos-waveText-Zy2Tp",
2878
2884
  text: "cos-text-el-KR",
2879
2885
  char: "cos-char-Y9-mV",
2880
2886
  wave: "cos-wave-jVRCz"
2881
- }, Mt = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
2882
- className: $.waveText,
2887
+ }, Pt = ({ text: e = "WAVE", amplitude: t = 12, color: n = "#38bdf8", fontSize: r = 56 }) => /* @__PURE__ */ l("div", {
2888
+ className: Nt.waveText,
2883
2889
  children: /* @__PURE__ */ l("h1", {
2884
- className: $.text,
2890
+ className: Nt.text,
2885
2891
  style: {
2886
2892
  fontSize: r,
2887
2893
  "--wave-color": n,
2888
2894
  "--wave-amp": `${t}px`
2889
2895
  },
2890
2896
  children: e.split("").map((e, t) => /* @__PURE__ */ l("span", {
2891
- className: $.char,
2897
+ className: Nt.char,
2892
2898
  style: { animationDelay: `${t * .1}s` },
2893
2899
  children: e === " " ? "\xA0" : e
2894
2900
  }, `${e}-${t}`))
2895
2901
  })
2896
2902
  });
2897
2903
  //#endregion
2898
- export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock, ee as Charge, te as ClickSpark, ae as Confetti, de as Countdown, ge as CursorTrail, se as CyberGrid, ve as DiceRoll, pe as DnaHelix, he as ElectricArc, Te as Fireworks, Oe as FlipCounter, Ne as GlitchText, je as GradientFlow, Ie as GravityBalls, Le as HolographicCard, ze as LiquidGlass, Re as LiquidProgress, Ve as MagneticButton, Ue as MatrixRain, Ge as MazeGenerator, qe as MeteorRain, Je as NeonText, Ye as NewtonCradle, Ze as OrbitalChart, Qe as ParticleNetwork, at as ProgressChest, st as RadarScan, ct as RedPacketRain, lt as ReturnCity, ft as RippleWater, ht as ScrambleText, gt as ScratchCard, yt as SlotMachine, et as SmokeFog, nt as Snowfall, ut as Speedometer, xt as SplitReveal, Ct as Spotlight, it as Starfield, dt as TimelinePulse, Dt as Turntable, At as Typewriter, jt as WaveButton, Mt as WaveText };
2904
+ export { x as AudioVisualizer, _ as Aurora, f as BarcodeScan, m as BurnAway, C as CanvasClock, ne as Charge, re as ClickSpark, se as Confetti, pe as Countdown, ye as CursorTrail, le as CyberGrid, xe as DiceRoll, he as DnaHelix, ve as ElectricArc, De as Fireworks, Ae as FlipCounter, Fe as GlitchText, Ne as GradientFlow, Re as GravityBalls, ze as HolographicCard, Ve as LiquidGlass, Be as LiquidProgress, Ue as MagneticButton, Ge as MatrixRain, qe as MazeGenerator, Ye as MeteorRain, Xe as NeonText, Ze as NewtonCradle, $e as OrbitalChart, tt as ParticleNetwork, ct as ProgressChest, ut as RadarScan, dt as RedPacketRain, ft as ReturnCity, ht as RippleWater, _t as ScrambleText, vt as ScratchCard, xt as SlotMachine, rt as SmokeFog, at as Snowfall, pt as Speedometer, Ct as SplitReveal, wt as Spotlight, st as Starfield, mt as TimelinePulse, Ot as Turntable, jt as Typewriter, Mt as WaveButton, Pt as WaveText };