@gamebob/axon-surge 0.7.0 → 0.8.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.
@@ -1,4 +1,4 @@
1
- class B {
1
+ class K {
2
2
  listeners = /* @__PURE__ */ new Map();
3
3
  on(t, e) {
4
4
  return this.listeners.has(t) || this.listeners.set(t, /* @__PURE__ */ new Set()), this.listeners.get(t).add(e), () => this.off(t, e);
@@ -15,7 +15,7 @@ class B {
15
15
  this.listeners.clear();
16
16
  }
17
17
  }
18
- class H {
18
+ class W {
19
19
  animationFrameId = null;
20
20
  lastTime = 0;
21
21
  isRunning = !1;
@@ -36,7 +36,7 @@ class H {
36
36
  this.lastTime = t, this.updateCallback(e), this.renderCallback(), this.animationFrameId = requestAnimationFrame(this.tick);
37
37
  }
38
38
  }
39
- class K {
39
+ class V {
40
40
  position;
41
41
  radius = 32;
42
42
  integrity = 3;
@@ -60,7 +60,7 @@ class K {
60
60
  this.position = { x: t, y: e }, this.integrity = this.maxIntegrity, this.pulsePhase = 0;
61
61
  }
62
62
  }
63
- class O {
63
+ class D {
64
64
  id;
65
65
  position = { x: 0, y: 0 };
66
66
  velocity = { x: 0, y: 0 };
@@ -114,7 +114,7 @@ class O {
114
114
  this.active = !1, this.isGrabbed = !1, this.isThrown = !1, this.wasManipulated = !1, this.isDying = !1, this.deathType = "none", this.deathTimer = 0, this.sliceAngle = 0, this.position = { x: 0, y: 0 }, this.velocity = { x: 0, y: 0 }, this.rotation = 0, this.strategy = null, this.maxSpeed = 200;
115
115
  }
116
116
  }
117
- class W {
117
+ class F {
118
118
  pointerPosition = { x: 0, y: 0 };
119
119
  isPointerDown = !1;
120
120
  grabbedEnemy = null;
@@ -218,7 +218,7 @@ class W {
218
218
  this.grabbedEnemy = null, this.dragStart = null, this.pointerHistory = [], this.isPointerDown = !1;
219
219
  }
220
220
  }
221
- class V {
221
+ class Y {
222
222
  cellSize;
223
223
  grid = /* @__PURE__ */ new Map();
224
224
  constructor(t = 100) {
@@ -245,7 +245,7 @@ class V {
245
245
  return i;
246
246
  }
247
247
  }
248
- class F {
248
+ class J {
249
249
  hitstopTime = 0;
250
250
  shakeTime = 0;
251
251
  shakeDuration = 0.14;
@@ -285,7 +285,7 @@ class F {
285
285
  };
286
286
  }
287
287
  }
288
- const w = {
288
+ const R = {
289
289
  es: {
290
290
  title: "AXON SURGE",
291
291
  startButton: "INICIAR ENLACE",
@@ -631,7 +631,7 @@ const w = {
631
631
  tutorialStep2Text: "步骤 2: 朝目标快速挥动抛投",
632
632
  tutorialDragWarning: "最佳策略是快速挥动抛投!"
633
633
  }
634
- }, k = [
634
+ }, H = [
635
635
  "es",
636
636
  "en",
637
637
  "fr",
@@ -648,29 +648,29 @@ const w = {
648
648
  "ko",
649
649
  "zh"
650
650
  ];
651
- function R(E) {
652
- return k.includes(E);
651
+ function N(E) {
652
+ return H.includes(E);
653
653
  }
654
- const G = "axon_surge_language";
655
- class Y {
654
+ const k = "axon_surge_language", U = "axon_surge_language_explicit";
655
+ class Z {
656
656
  currentLanguage;
657
657
  constructor(t) {
658
658
  this.currentLanguage = this.detectLanguage(t);
659
659
  }
660
660
  detectLanguage(t) {
661
+ if (t && N(t))
662
+ return t;
661
663
  try {
662
- const e = localStorage.getItem(G);
663
- if (e && R(e))
664
- return e;
664
+ const e = localStorage.getItem(U) === "true", i = localStorage.getItem(k);
665
+ if (e && i && N(i))
666
+ return i;
665
667
  } catch {
666
668
  }
667
- if (t && R(t))
668
- return t;
669
669
  try {
670
- const e = (document.documentElement.lang || document.body?.getAttribute("lang") || "").toLowerCase();
670
+ const e = (document.documentElement.lang || document.body?.getAttribute("lang") || document.documentElement.getAttribute("data-lang") || "").toLowerCase();
671
671
  if (e) {
672
672
  const i = e.split("-")[0];
673
- if (i && R(i))
673
+ if (i && N(i))
674
674
  return i;
675
675
  }
676
676
  } catch {
@@ -679,33 +679,31 @@ class Y {
679
679
  const e = (navigator.language || navigator.languages && navigator.languages[0] || "").toLowerCase();
680
680
  if (e) {
681
681
  const i = e.split("-")[0];
682
- if (i && R(i))
682
+ if (i && N(i))
683
683
  return i;
684
684
  }
685
685
  } catch {
686
686
  }
687
687
  return "en";
688
688
  }
689
- setLanguage(t) {
690
- if (w[t]) {
691
- this.currentLanguage = t;
689
+ setLanguage(t, e = !0) {
690
+ if (R[t] && (this.currentLanguage = t, e))
692
691
  try {
693
- localStorage.setItem(G, t);
692
+ localStorage.setItem(k, t), localStorage.setItem(U, "true");
694
693
  } catch {
695
694
  }
696
- }
697
695
  }
698
696
  getLanguage() {
699
697
  return this.currentLanguage;
700
698
  }
701
699
  translate(t, e) {
702
- let s = (w[this.currentLanguage] || w.en)[t] || w.en[t] || String(t);
700
+ let s = (R[this.currentLanguage] || R.en)[t] || R.en[t] || String(t);
703
701
  return e && Object.entries(e).forEach(([a, l]) => {
704
702
  s = s.replace(`{${a}}`, String(l));
705
703
  }), s;
706
704
  }
707
705
  }
708
- class J {
706
+ class X {
709
707
  execute(t) {
710
708
  const { thrownEnemy: e, targetEnemy: i, shockwaves: s, particles: a, floatingTexts: l } = t;
711
709
  i.active = !1, s.push({
@@ -744,7 +742,7 @@ class J {
744
742
  });
745
743
  }
746
744
  }
747
- class Z {
745
+ class _ {
748
746
  execute(t) {
749
747
  const { thrownEnemy: e, pools: i, shockwaves: s, particles: a, floatingTexts: l, eventBus: r } = t, n = e.position;
750
748
  i.push({
@@ -790,7 +788,7 @@ class Z {
790
788
  }), e.active = !1, r.emit("onPoolCreated", { position: n });
791
789
  }
792
790
  }
793
- class X {
791
+ class $ {
794
792
  execute(t) {
795
793
  const { thrownEnemy: e, targetEnemy: i, allEnemies: s, shockwaves: a, particles: l, floatingTexts: r } = t, n = i.position;
796
794
  e.active = !1, i.active = !1, a.push({
@@ -839,7 +837,7 @@ class X {
839
837
  });
840
838
  }
841
839
  }
842
- class $ {
840
+ class z {
843
841
  execute(t) {
844
842
  const { thrownEnemy: e, targetEnemy: i, vortices: s, shockwaves: a } = t, l = {
845
843
  x: (e.position.x + i.position.x) / 2,
@@ -866,27 +864,27 @@ class $ {
866
864
  }
867
865
  class S {
868
866
  static createEnemy(t, e, i) {
869
- const s = `enemy_${Date.now()}_${Math.random()}`, a = new O(s);
867
+ const s = `enemy_${Date.now()}_${Math.random()}`, a = new D(s);
870
868
  return this.configureEnemy(a, t, e, i), a;
871
869
  }
872
870
  static configureEnemy(t, e, i, s) {
873
871
  t.type = e, t.position = { ...i }, t.active = !0, t.isGrabbed = !1, t.isThrown = !1;
874
872
  const a = s.x - i.x, l = s.y - i.y, r = Math.atan2(l, a);
875
873
  let n = 70, o = 100, h = 20, c = "#ff2a5f", u = null;
876
- e === "piercer" ? (n = 95, o = 140, h = 18, c = "#ff2a5f", u = new J()) : e === "spore" ? (n = 65, o = 90, h = 24, c = "#39ff14", u = new Z()) : e === "cluster" ? (n = 50, o = 75, h = 26, c = "#ffd700", u = new X()) : e === "parasite" ? (n = 80, o = 110, h = 22, c = "#9d4edd", u = new $()) : e === "micro" && (n = 130, o = 160, h = 12, c = "#ffd700"), t.radius = h, t.color = c, t.strategy = u, t.maxSpeed = o, t.velocity = {
874
+ e === "piercer" ? (n = 95, o = 140, h = 18, c = "#ff2a5f", u = new X()) : e === "spore" ? (n = 65, o = 90, h = 24, c = "#39ff14", u = new _()) : e === "cluster" ? (n = 50, o = 75, h = 26, c = "#ffd700", u = new $()) : e === "parasite" ? (n = 80, o = 110, h = 22, c = "#9d4edd", u = new z()) : e === "micro" && (n = 130, o = 160, h = 12, c = "#ffd700"), t.radius = h, t.color = c, t.strategy = u, t.maxSpeed = o, t.velocity = {
877
875
  x: Math.cos(r) * n,
878
876
  y: Math.sin(r) * n
879
877
  };
880
878
  }
881
879
  }
882
- class z {
880
+ class q {
883
881
  spatialHash;
884
882
  eventBus;
885
883
  i18n;
886
884
  currentThrowKills = 0;
887
885
  currentThrowPos = null;
888
886
  constructor(t, e) {
889
- this.spatialHash = new V(100), this.eventBus = t, this.i18n = e;
887
+ this.spatialHash = new Y(100), this.eventBus = t, this.i18n = e;
890
888
  }
891
889
  update(t, e, i, s, a, l, r, n, o, h, c, u, p, f) {
892
890
  this.spatialHash.clear();
@@ -907,8 +905,8 @@ class z {
907
905
  if (!x.active || x.isGrabbed || x.isDying || x.isThrown && x.type === "piercer") continue;
908
906
  const L = m.position.x - x.position.x, A = m.position.y - x.position.y, b = Math.hypot(L, A);
909
907
  if (b > 2 && b <= m.radius) {
910
- const M = Math.pow(1 - b / m.radius, 0.7), y = m.pullForce * M, g = Math.atan2(A, L);
911
- x.velocity.x += Math.cos(g) * y * t, x.velocity.y += Math.sin(g) * y * t, x.position.x += Math.cos(g) * y * t * 0.8, x.position.y += Math.sin(g) * y * t * 0.8;
908
+ const M = Math.pow(1 - b / m.radius, 0.7), T = m.pullForce * M, g = Math.atan2(A, L);
909
+ x.velocity.x += Math.cos(g) * T * t, x.velocity.y += Math.sin(g) * T * t, x.position.x += Math.cos(g) * T * t * 0.8, x.position.y += Math.sin(g) * T * t * 0.8;
912
910
  }
913
911
  }
914
912
  m.duration >= m.maxDuration && a.splice(d, 1);
@@ -934,11 +932,11 @@ class z {
934
932
  if (b.active && !b.isGrabbed) {
935
933
  b.triggerDissolveDeath();
936
934
  for (let M = 0; M < 8; M++) {
937
- const y = Math.random() * Math.PI * 2, g = 100 + Math.random() * 200;
935
+ const T = Math.random() * Math.PI * 2, g = 100 + Math.random() * 200;
938
936
  r.push({
939
937
  id: Math.random().toString(),
940
938
  position: { ...b.position },
941
- velocity: { x: Math.cos(y) * g, y: Math.sin(y) * g },
939
+ velocity: { x: Math.cos(T) * g, y: Math.sin(T) * g },
942
940
  color: "#00f0ff",
943
941
  radius: 3 + Math.random() * 3,
944
942
  alpha: 1,
@@ -961,10 +959,10 @@ class z {
961
959
  break;
962
960
  }
963
961
  }
964
- let T = !1;
962
+ let y = !1;
965
963
  for (const d of i)
966
964
  if (!(!d.active || !d.isThrown || d.isDying)) {
967
- if (T = !0, d.position.x < -120 || d.position.x > u + 120 || d.position.y < -120 || d.position.y > p + 120) {
965
+ if (y = !0, d.position.x < -120 || d.position.x > u + 120 || d.position.y < -120 || d.position.y > p + 120) {
968
966
  d.active = !1, d.isThrown = !1;
969
967
  continue;
970
968
  }
@@ -986,11 +984,11 @@ class z {
986
984
  maxLifetime: 0.45
987
985
  });
988
986
  for (let M = 0; M < 16; M++) {
989
- const y = Math.random() * Math.PI * 2, g = 150 + Math.random() * 300;
987
+ const T = Math.random() * Math.PI * 2, g = 150 + Math.random() * 300;
990
988
  r.push({
991
989
  id: Math.random().toString(),
992
990
  position: { ...m.position },
993
- velocity: { x: Math.cos(y) * g, y: Math.sin(y) * g },
991
+ velocity: { x: Math.cos(T) * g, y: Math.sin(T) * g },
994
992
  color: "#ff2a5f",
995
993
  radius: 3 + Math.random() * 3,
996
994
  alpha: 1,
@@ -1000,12 +998,12 @@ class z {
1000
998
  }
1001
999
  f && f();
1002
1000
  } else {
1003
- const M = d.type === m.type, y = M ? 360 : 250;
1001
+ const M = d.type === m.type, T = M ? 360 : 250;
1004
1002
  l.push({
1005
1003
  id: Math.random().toString(),
1006
1004
  position: { ...this.currentThrowPos },
1007
1005
  radius: 15,
1008
- maxRadius: y,
1006
+ maxRadius: T,
1009
1007
  color: d.color,
1010
1008
  alpha: 1,
1011
1009
  lifetime: 0,
@@ -1058,11 +1056,11 @@ class z {
1058
1056
  const I = g * Math.PI * 2 / 8, v = {
1059
1057
  x: this.currentThrowPos.x + Math.cos(I) * 15,
1060
1058
  y: this.currentThrowPos.y + Math.sin(I) * 15
1061
- }, D = S.createEnemy("micro", v, {
1059
+ }, G = S.createEnemy("micro", v, {
1062
1060
  x: v.x + Math.cos(I) * 220,
1063
1061
  y: v.y + Math.sin(I) * 220
1064
1062
  });
1065
- D.isThrown = !0, i.push(D);
1063
+ G.isThrown = !0, i.push(G);
1066
1064
  }
1067
1065
  this.killEnemyWithChainReaction(d, b, s, a, l, r, i), this.killEnemyWithChainReaction(m, b, s, a, l, r, i);
1068
1066
  } else
@@ -1070,7 +1068,7 @@ class z {
1070
1068
  for (const g of i) {
1071
1069
  if (g === d || g === m || !g.active || g.isGrabbed || g.isDying) continue;
1072
1070
  const I = g.position.x - this.currentThrowPos.x, v = g.position.y - this.currentThrowPos.y;
1073
- Math.hypot(I, v) <= y && (this.killEnemyWithChainReaction(g, b, s, a, l, r, i), this.currentThrowKills++);
1071
+ Math.hypot(I, v) <= T && (this.killEnemyWithChainReaction(g, b, s, a, l, r, i), this.currentThrowKills++);
1074
1072
  }
1075
1073
  f && f();
1076
1074
  break;
@@ -1078,7 +1076,7 @@ class z {
1078
1076
  }
1079
1077
  }
1080
1078
  }
1081
- h.value = this.currentThrowKills, !T && this.currentThrowKills > 0 && (this.currentThrowKills >= 2 && this.currentThrowPos && n.push({
1079
+ h.value = this.currentThrowKills, !y && this.currentThrowKills > 0 && (this.currentThrowKills >= 2 && this.currentThrowPos && n.push({
1082
1080
  id: Math.random().toString(),
1083
1081
  text: `MULTIKILL x${this.currentThrowKills}!`,
1084
1082
  position: { ...this.currentThrowPos },
@@ -1144,11 +1142,11 @@ class z {
1144
1142
  })) : t.type === "piercer" ? t.triggerSliceDeath(e) : t.triggerDissolveDeath();
1145
1143
  }
1146
1144
  }
1147
- class _ {
1145
+ class j {
1148
1146
  pool = [];
1149
1147
  constructor(t = 500) {
1150
1148
  for (let e = 0; e < t; e++) {
1151
- const i = new O(`pool_enemy_${e}`);
1149
+ const i = new D(`pool_enemy_${e}`);
1152
1150
  this.pool.push(i);
1153
1151
  }
1154
1152
  }
@@ -1156,7 +1154,7 @@ class _ {
1156
1154
  for (const e of this.pool)
1157
1155
  if (!e.active)
1158
1156
  return e.reset(), e;
1159
- const t = new O(`fallback_enemy_${Date.now()}_${Math.random()}`);
1157
+ const t = new D(`fallback_enemy_${Date.now()}_${Math.random()}`);
1160
1158
  return this.pool.push(t), t;
1161
1159
  }
1162
1160
  resetAll() {
@@ -1193,10 +1191,10 @@ class C {
1193
1191
  y: (Math.random() - 0.5) * 60
1194
1192
  }, c = { x: n.x + h.x, y: n.y + h.y }, u = t.get();
1195
1193
  S.configureEnemy(u, "spore", c, s);
1196
- const p = s.x - c.x, f = s.y - c.y, T = Math.atan2(f, p);
1194
+ const p = s.x - c.x, f = s.y - c.y, y = Math.atan2(f, p);
1197
1195
  u.velocity = {
1198
- x: Math.cos(T) * (50 + Math.random() * 20),
1199
- y: Math.sin(T) * (50 + Math.random() * 20)
1196
+ x: Math.cos(y) * (50 + Math.random() * 20),
1197
+ y: Math.sin(y) * (50 + Math.random() * 20)
1200
1198
  }, a.push(u);
1201
1199
  }
1202
1200
  return a;
@@ -1248,7 +1246,7 @@ class C {
1248
1246
  return a;
1249
1247
  }
1250
1248
  }
1251
- class q {
1249
+ class Q {
1252
1250
  wave = 1;
1253
1251
  pool;
1254
1252
  spawnTimer = 0;
@@ -1256,7 +1254,7 @@ class q {
1256
1254
  patternCooldown = 0;
1257
1255
  initialGracePeriod = 6;
1258
1256
  constructor() {
1259
- this.pool = new _(500);
1257
+ this.pool = new j(500);
1260
1258
  }
1261
1259
  reset() {
1262
1260
  this.wave = 1, this.spawnTimer = 0, this.waveTimer = 0, this.patternCooldown = 0;
@@ -1293,8 +1291,8 @@ class q {
1293
1291
  if (a === p) continue;
1294
1292
  const f = t[p];
1295
1293
  if (!f.active || f.isGrabbed || f.isDying) continue;
1296
- const T = l.position.x - f.position.x, d = l.position.y - f.position.y, m = Math.hypot(T, d);
1297
- m > 0 && m < 70 && (r += T / m, n += d / m, o++);
1294
+ const y = l.position.x - f.position.x, d = l.position.y - f.position.y, m = Math.hypot(y, d);
1295
+ m > 0 && m < 70 && (r += y / m, n += d / m, o++);
1298
1296
  }
1299
1297
  o > 0 && (r /= o, n /= o, l.velocity.x += r * 60 * e, l.velocity.y += n * 60 * e);
1300
1298
  const h = i.x - l.position.x, c = i.y - l.position.y, u = Math.hypot(h, c);
@@ -1312,7 +1310,7 @@ class q {
1312
1310
  }
1313
1311
  }
1314
1312
  }
1315
- const N = {
1313
+ const w = {
1316
1314
  bioluminescent: {
1317
1315
  bgInner: "#081220",
1318
1316
  bgMid: "#050b16",
@@ -1361,48 +1359,79 @@ const N = {
1361
1359
  tendrilMagenta: "#b5008c",
1362
1360
  tendrilCyan: "#0077b6"
1363
1361
  }
1364
- }, P = "axon_surge_theme";
1365
- class j {
1366
- currentTheme = "bioluminescent";
1362
+ }, P = "axon_surge_theme", O = "axon_surge_theme_explicit";
1363
+ class tt {
1364
+ currentTheme = "dark";
1367
1365
  isExplicit = !1;
1368
1366
  targetElement;
1369
1367
  constructor(t, e) {
1370
- if (e !== void 0 && (this.targetElement = e), t)
1371
- this.isExplicit = !0, this.setTheme(t);
1372
- else {
1373
- try {
1374
- const i = localStorage.getItem(P);
1375
- i && N[i] && (this.currentTheme = i, this.isExplicit = !0);
1376
- } catch {
1368
+ if (e !== void 0 && (this.targetElement = e), t && w[t]) {
1369
+ this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
1370
+ return;
1371
+ }
1372
+ try {
1373
+ const i = localStorage.getItem(O) === "true", s = localStorage.getItem(P);
1374
+ if (i && s && w[s]) {
1375
+ this.currentTheme = s, this.isExplicit = !0, this.applyThemeToDOM();
1376
+ return;
1377
1377
  }
1378
- this.isExplicit && this.applyThemeToDOM();
1378
+ } catch {
1379
1379
  }
1380
+ this.currentTheme = this.detectParentOrSystemTheme();
1380
1381
  }
1381
1382
  setTargetElement(t) {
1382
- this.targetElement = t, this.isExplicit && this.applyThemeToDOM();
1383
+ this.targetElement = t, this.isExplicit ? this.applyThemeToDOM() : this.currentTheme = this.detectParentOrSystemTheme();
1383
1384
  }
1384
- setTheme(t) {
1385
- if (N[t]) {
1386
- this.currentTheme = t, this.isExplicit = !0, this.applyThemeToDOM();
1387
- try {
1388
- localStorage.setItem(P, t);
1389
- } catch {
1390
- }
1391
- }
1385
+ setTheme(t, e = !0) {
1386
+ if (w[t])
1387
+ if (this.currentTheme = t, this.isExplicit = e, e) {
1388
+ this.applyThemeToDOM();
1389
+ try {
1390
+ localStorage.setItem(P, t), localStorage.setItem(O, "true");
1391
+ } catch {
1392
+ }
1393
+ } else
1394
+ this.removeThemeClasses();
1392
1395
  }
1393
1396
  clearExplicitTheme() {
1394
1397
  this.isExplicit = !1;
1395
1398
  try {
1396
- localStorage.removeItem(P);
1399
+ localStorage.removeItem(P), localStorage.removeItem(O);
1397
1400
  } catch {
1398
1401
  }
1399
- this.removeThemeClasses();
1402
+ this.removeThemeClasses(), this.currentTheme = this.detectParentOrSystemTheme();
1400
1403
  }
1401
1404
  getTheme() {
1402
- return this.currentTheme;
1405
+ return this.isExplicit || (this.currentTheme = this.detectParentOrSystemTheme()), this.currentTheme;
1403
1406
  }
1404
1407
  getPalette() {
1405
- return N[this.currentTheme] || N.bioluminescent;
1408
+ return w[this.getTheme()] || w.dark;
1409
+ }
1410
+ detectParentOrSystemTheme() {
1411
+ try {
1412
+ const t = [
1413
+ this.targetElement || null,
1414
+ this.targetElement?.parentElement || null,
1415
+ document.body,
1416
+ document.documentElement
1417
+ ];
1418
+ for (const e of t)
1419
+ if (e) {
1420
+ if (e.classList.contains("theme-light") || e.getAttribute("data-theme") === "light")
1421
+ return "light";
1422
+ if (e.classList.contains("theme-bioluminescent") || e.classList.contains("theme-bio") || e.getAttribute("data-theme") === "bioluminescent" || e.getAttribute("data-theme") === "bio")
1423
+ return "bioluminescent";
1424
+ if (e.classList.contains("theme-dark") || e.getAttribute("data-theme") === "dark")
1425
+ return "dark";
1426
+ }
1427
+ } catch {
1428
+ }
1429
+ try {
1430
+ if (window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches)
1431
+ return "light";
1432
+ } catch {
1433
+ }
1434
+ return "dark";
1406
1435
  }
1407
1436
  removeThemeClasses() {
1408
1437
  const t = ["theme-bioluminescent", "theme-dark", "theme-light"];
@@ -1414,7 +1443,7 @@ class j {
1414
1443
  this.targetElement && this.targetElement.classList.add(t), document.documentElement.classList.add(t);
1415
1444
  }
1416
1445
  }
1417
- class Q {
1446
+ class et {
1418
1447
  maxDistance = 450;
1419
1448
  maxThickness = 28;
1420
1449
  minThickness = 4;
@@ -1429,27 +1458,27 @@ class Q {
1429
1458
  if (h <= 0 || h > this.maxDistance) continue;
1430
1459
  const c = Math.min(1, Math.max(0, h / this.maxDistance)), u = this.minThickness + (this.maxThickness - this.minThickness) * c, p = this.minLength + (this.maxLength - this.minLength) * c, f = 0.35 + (1 - c) * 0.55;
1431
1460
  if (t.save(), t.globalAlpha = f, t.shadowColor = a.color, t.shadowBlur = 12 + (1 - c) * 16, t.strokeStyle = a.color, t.lineWidth = u, t.lineCap = "round", t.beginPath(), n === 0 || n === i) {
1432
- const T = Math.max(0, o - p / 2), d = Math.min(s, o + p / 2);
1433
- t.moveTo(n, T), t.lineTo(n, d);
1461
+ const y = Math.max(0, o - p / 2), d = Math.min(s, o + p / 2);
1462
+ t.moveTo(n, y), t.lineTo(n, d);
1434
1463
  } else {
1435
- const T = Math.max(0, n - p / 2), d = Math.min(i, n + p / 2);
1436
- t.moveTo(T, o), t.lineTo(d, o);
1464
+ const y = Math.max(0, n - p / 2), d = Math.min(i, n + p / 2);
1465
+ t.moveTo(y, o), t.lineTo(d, o);
1437
1466
  }
1438
1467
  t.stroke(), t.strokeStyle = "#ffffff", t.lineWidth = Math.max(1.5, u * 0.25), t.globalAlpha = f * 0.8, t.stroke(), t.restore();
1439
1468
  }
1440
1469
  }
1441
1470
  }
1442
- class tt {
1471
+ class it {
1443
1472
  render(t, e, i, s, a) {
1444
1473
  const l = (210 + (a - 1) * 38 + Math.sin(s * 0.12) * 15) % 360, r = `hsl(${l}, 45%, 8%)`, n = `hsl(${(l + 30) % 360}, 40%, 4%)`, o = `hsl(${(l + 60) % 360}, 50%, 2%)`, h = t.createRadialGradient(e / 2, i / 2, 40, e / 2, i / 2, Math.max(e, i));
1445
1474
  h.addColorStop(0, r), h.addColorStop(0.55, n), h.addColorStop(1, o), t.fillStyle = h, t.fillRect(0, 0, e, i);
1446
1475
  const c = (l + 75) % 360, u = e * 0.35 + Math.sin(s * 0.25) * 70, p = i * 0.45 + Math.cos(s * 0.2) * 60, f = t.createRadialGradient(u, p, 20, u, p, 400);
1447
1476
  f.addColorStop(0, `hsla(${c}, 65%, 12%, 0.35)`), f.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = f, t.beginPath(), t.arc(u, p, 400, 0, Math.PI * 2), t.fill();
1448
- const T = (l + 160) % 360, d = e * 0.68 + Math.cos(s * 0.28) * 60, m = i * 0.55 + Math.sin(s * 0.22) * 55, x = t.createRadialGradient(d, m, 20, d, m, 440);
1449
- x.addColorStop(0, `hsla(${T}, 60%, 10%, 0.3)`), x.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = x, t.beginPath(), t.arc(d, m, 440, 0, Math.PI * 2), t.fill();
1477
+ const y = (l + 160) % 360, d = e * 0.68 + Math.cos(s * 0.28) * 60, m = i * 0.55 + Math.sin(s * 0.22) * 55, x = t.createRadialGradient(d, m, 20, d, m, 440);
1478
+ x.addColorStop(0, `hsla(${y}, 60%, 10%, 0.3)`), x.addColorStop(1, "rgba(0, 0, 0, 0)"), t.fillStyle = x, t.beginPath(), t.arc(d, m, 440, 0, Math.PI * 2), t.fill();
1450
1479
  }
1451
1480
  }
1452
- class et {
1481
+ class st {
1453
1482
  render(t, e, i) {
1454
1483
  if (!e.isActive) return;
1455
1484
  const s = e.getLauncher(), a = e.getTarget();
@@ -1474,7 +1503,7 @@ class et {
1474
1503
  t.restore();
1475
1504
  }
1476
1505
  }
1477
- class it {
1506
+ class at {
1478
1507
  canvas;
1479
1508
  ctx;
1480
1509
  themeManager;
@@ -1482,12 +1511,12 @@ class it {
1482
1511
  bgRenderer;
1483
1512
  tutorialArrowRenderer;
1484
1513
  constructor(t, e) {
1485
- this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new Q(), this.bgRenderer = new tt(), this.tutorialArrowRenderer = new et();
1514
+ this.canvas = t, this.ctx = t.getContext("2d"), this.themeManager = e, this.indicatorRenderer = new et(), this.bgRenderer = new it(), this.tutorialArrowRenderer = new st();
1486
1515
  }
1487
1516
  render(t, e, i, s, a, l, r, n, o, h, c = 1, u) {
1488
1517
  if (!this.ctx) return;
1489
- const p = this.themeManager.getPalette(), { width: f, height: T } = this.canvas, d = n.getShakeOffset();
1490
- this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(this.ctx, f, T, t.pulsePhase, c), this.drawToxicPools(i, t.pulsePhase), this.drawGravityVortices(s, t.pulsePhase), this.drawShockwaves(a), this.drawCoreFilaments(t, p), this.drawParticles(l), this.indicatorRenderer.render(this.ctx, e, f, T), this.drawOrganicEnemies(e, t.pulsePhase, p), u && this.tutorialArrowRenderer.render(this.ctx, u, t.pulsePhase), o ? this.drawPsionicTendril(t.position, o.position, p) : t && this.drawHoverTendril(t.position, h, e, p), this.drawOrganicConsciousnessCore(t, p), this.drawFloatingTexts(r), n.flashAlpha > 0 && (this.ctx.fillStyle = `rgba(255, 255, 255, ${n.flashAlpha})`, this.ctx.fillRect(0, 0, f, T)), this.ctx.restore();
1518
+ const p = this.themeManager.getPalette(), { width: f, height: y } = this.canvas, d = n.getShakeOffset();
1519
+ this.ctx.save(), this.ctx.translate(d.x, d.y), this.bgRenderer.render(this.ctx, f, y, t.pulsePhase, c), this.drawToxicPools(i, t.pulsePhase), this.drawGravityVortices(s, t.pulsePhase), this.drawShockwaves(a), this.drawCoreFilaments(t, p), this.drawParticles(l), this.indicatorRenderer.render(this.ctx, e, f, y), this.drawOrganicEnemies(e, t.pulsePhase, p), u && this.tutorialArrowRenderer.render(this.ctx, u, t.pulsePhase), o ? this.drawPsionicTendril(t.position, o.position, p) : t && this.drawHoverTendril(t.position, h, e, p), this.drawOrganicConsciousnessCore(t, p), this.drawFloatingTexts(r), n.flashAlpha > 0 && (this.ctx.fillStyle = `rgba(255, 255, 255, ${n.flashAlpha})`, this.ctx.fillRect(0, 0, f, y)), this.ctx.restore();
1491
1520
  }
1492
1521
  drawToxicPools(t, e) {
1493
1522
  if (this.ctx)
@@ -1498,18 +1527,18 @@ class it {
1498
1527
  n.addColorStop(0, `rgba(57, 255, 20, ${a * 0.9})`), n.addColorStop(0.4, `rgba(16, 185, 129, ${a * 0.65})`), n.addColorStop(0.8, `rgba(5, 80, 45, ${a * 0.35})`), n.addColorStop(1, "rgba(2, 35, 15, 0)"), this.ctx.fillStyle = n, this.ctx.shadowColor = "#39ff14", this.ctx.shadowBlur = 30, this.ctx.beginPath();
1499
1528
  const o = 70;
1500
1529
  for (let h = 0; h <= o; h++) {
1501
- const c = h * Math.PI * 2 / o, u = Math.sin(c * 5 + e * 3) * 14, p = Math.cos(c * 3 - e * 2) * 9, f = i.radius + u + p, T = l + Math.cos(c) * f, d = r + Math.sin(c) * f;
1502
- h === 0 ? this.ctx.moveTo(T, d) : this.ctx.lineTo(T, d);
1530
+ const c = h * Math.PI * 2 / o, u = Math.sin(c * 5 + e * 3) * 14, p = Math.cos(c * 3 - e * 2) * 9, f = i.radius + u + p, y = l + Math.cos(c) * f, d = r + Math.sin(c) * f;
1531
+ h === 0 ? this.ctx.moveTo(y, d) : this.ctx.lineTo(y, d);
1503
1532
  }
1504
1533
  this.ctx.closePath(), this.ctx.fill(), this.ctx.strokeStyle = `rgba(57, 255, 20, ${a * 0.8})`, this.ctx.lineWidth = 2.5, this.ctx.beginPath();
1505
1534
  for (let h = 0; h <= o; h++) {
1506
- const c = h * Math.PI * 2 / o, u = Math.sin(c * 6 + e * 4) * 8, p = i.radius * 0.75 + u, f = l + Math.cos(c) * p, T = r + Math.sin(c) * p;
1507
- h === 0 ? this.ctx.moveTo(f, T) : this.ctx.lineTo(f, T);
1535
+ const c = h * Math.PI * 2 / o, u = Math.sin(c * 6 + e * 4) * 8, p = i.radius * 0.75 + u, f = l + Math.cos(c) * p, y = r + Math.sin(c) * p;
1536
+ h === 0 ? this.ctx.moveTo(f, y) : this.ctx.lineTo(f, y);
1508
1537
  }
1509
1538
  this.ctx.closePath(), this.ctx.stroke();
1510
1539
  for (let h = 0; h < 6; h++) {
1511
- const c = h * Math.PI * 0.33 + e * 1.5, u = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + h) * 0.3), p = l + Math.cos(c) * u, f = r + Math.sin(c) * u, T = 3 + Math.sin(e * 3 + h) * 2;
1512
- this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, f, Math.max(1, T), 0, Math.PI * 2), this.ctx.fill();
1540
+ const c = h * Math.PI * 0.33 + e * 1.5, u = i.radius * 0.5 * (0.3 + Math.sin(e * 2 + h) * 0.3), p = l + Math.cos(c) * u, f = r + Math.sin(c) * u, y = 3 + Math.sin(e * 3 + h) * 2;
1541
+ this.ctx.fillStyle = `rgba(255, 255, 255, ${a * 0.8})`, this.ctx.beginPath(), this.ctx.arc(p, f, Math.max(1, y), 0, Math.PI * 2), this.ctx.fill();
1513
1542
  }
1514
1543
  this.ctx.restore();
1515
1544
  }
@@ -1681,7 +1710,7 @@ class it {
1681
1710
  this.ctx.save(), this.ctx.globalAlpha = e.alpha, this.ctx.fillStyle = e.color, this.ctx.font = `900 ${e.size}px Orbitron, sans-serif`, this.ctx.textAlign = "center", this.ctx.shadowColor = e.color, this.ctx.shadowBlur = 12, this.ctx.fillText(e.text, e.position.x, e.position.y), this.ctx.restore();
1682
1711
  }
1683
1712
  }
1684
- class st {
1713
+ class nt {
1685
1714
  container;
1686
1715
  i18n;
1687
1716
  waveLabelElement;
@@ -1713,7 +1742,7 @@ class st {
1713
1742
  this.container.style.display = "none";
1714
1743
  }
1715
1744
  }
1716
- class at {
1745
+ class ot {
1717
1746
  container;
1718
1747
  i18n;
1719
1748
  onStartCallback;
@@ -1739,7 +1768,7 @@ class at {
1739
1768
  this.container.style.display = "none";
1740
1769
  }
1741
1770
  }
1742
- class nt {
1771
+ class rt {
1743
1772
  modal;
1744
1773
  card;
1745
1774
  i18n;
@@ -1784,13 +1813,13 @@ class nt {
1784
1813
  ko: "한국어 (KO)",
1785
1814
  zh: "中文 (ZH)"
1786
1815
  };
1787
- for (const y of k) {
1816
+ for (const T of H) {
1788
1817
  const g = document.createElement("option");
1789
- g.value = y, g.textContent = l[y], this.i18n.getLanguage() === y && (g.selected = !0), a.appendChild(g);
1818
+ g.value = T, g.textContent = l[T], this.i18n.getLanguage() === T && (g.selected = !0), a.appendChild(g);
1790
1819
  }
1791
1820
  a.addEventListener("change", () => {
1792
- const y = a.value;
1793
- this.i18n.setLanguage(y), this.onLanguageChangedCallback && this.onLanguageChangedCallback(y), this.renderContent();
1821
+ const T = a.value;
1822
+ this.i18n.setLanguage(T), this.onLanguageChangedCallback && this.onLanguageChangedCallback(T), this.renderContent();
1794
1823
  });
1795
1824
  const r = document.createElement("span");
1796
1825
  r.className = "axon-select-arrow", r.textContent = "▼", s.appendChild(a), s.appendChild(r), e.appendChild(i), e.appendChild(s);
@@ -1805,10 +1834,10 @@ class nt {
1805
1834
  { id: "dark", label: "DARK" },
1806
1835
  { id: "light", label: "LIGHT" }
1807
1836
  ];
1808
- for (const y of c) {
1837
+ for (const T of c) {
1809
1838
  const g = document.createElement("button");
1810
- g.type = "button", g.className = `axon-toggle-btn ${this.themeManager.getTheme() === y.id ? "active" : ""}`, g.textContent = y.label, g.addEventListener("click", () => {
1811
- this.themeManager.setTheme(y.id), this.renderContent();
1839
+ g.type = "button", g.className = `axon-toggle-btn ${this.themeManager.getTheme() === T.id ? "active" : ""}`, g.textContent = T.label, g.addEventListener("click", () => {
1840
+ this.themeManager.setTheme(T.id), this.renderContent();
1812
1841
  }), h.appendChild(g);
1813
1842
  }
1814
1843
  n.appendChild(o), n.appendChild(h);
@@ -1818,14 +1847,14 @@ class nt {
1818
1847
  p.textContent = this.i18n.translate("hapticsLabel");
1819
1848
  const f = document.createElement("div");
1820
1849
  f.className = "axon-toggle-group";
1821
- const T = [
1850
+ const y = [
1822
1851
  { enabled: !0, label: this.i18n.translate("hapticsOn") },
1823
1852
  { enabled: !1, label: this.i18n.translate("hapticsOff") }
1824
1853
  ];
1825
- for (const y of T) {
1854
+ for (const T of y) {
1826
1855
  const g = document.createElement("button");
1827
- g.type = "button", g.className = `axon-toggle-btn ${this.hapticsEnabled === y.enabled ? "active" : ""}`, g.textContent = y.label, g.addEventListener("click", () => {
1828
- this.hapticsEnabled = y.enabled, localStorage.setItem("axon_surge_haptics", String(y.enabled)), this.hapticsEnabled && this.platform.haptics.selectionChanged(), this.renderContent();
1856
+ g.type = "button", g.className = `axon-toggle-btn ${this.hapticsEnabled === T.enabled ? "active" : ""}`, g.textContent = T.label, g.addEventListener("click", () => {
1857
+ this.hapticsEnabled = T.enabled, localStorage.setItem("axon_surge_haptics", String(T.enabled)), this.hapticsEnabled && this.platform.haptics.selectionChanged(), this.renderContent();
1829
1858
  }), f.appendChild(g);
1830
1859
  }
1831
1860
  u.appendChild(p), u.appendChild(f);
@@ -1839,10 +1868,10 @@ class nt {
1839
1868
  { enabled: !0, label: this.i18n.translate("hapticsOn") },
1840
1869
  { enabled: !1, label: this.i18n.translate("hapticsOff") }
1841
1870
  ];
1842
- for (const y of A) {
1871
+ for (const T of A) {
1843
1872
  const g = document.createElement("button");
1844
- g.type = "button", g.className = `axon-toggle-btn ${L === y.enabled ? "active" : ""}`, g.textContent = y.label, g.addEventListener("click", () => {
1845
- localStorage.setItem("axon_surge_show_tutorial", String(y.enabled)), this.renderContent();
1873
+ g.type = "button", g.className = `axon-toggle-btn ${L === T.enabled ? "active" : ""}`, g.textContent = T.label, g.addEventListener("click", () => {
1874
+ localStorage.setItem("axon_surge_show_tutorial", String(T.enabled)), this.renderContent();
1846
1875
  }), x.appendChild(g);
1847
1876
  }
1848
1877
  d.appendChild(m), d.appendChild(x);
@@ -1863,8 +1892,8 @@ class nt {
1863
1892
  this.modal.close();
1864
1893
  }
1865
1894
  }
1866
- const U = "axon_surge_show_tutorial";
1867
- class ot {
1895
+ const B = "axon_surge_show_tutorial";
1896
+ class ht {
1868
1897
  isActive = !1;
1869
1898
  showWarning = !1;
1870
1899
  dummyLauncher = null;
@@ -1873,14 +1902,14 @@ class ot {
1873
1902
  initialTargetPos = { x: 0, y: 0 };
1874
1903
  isTutorialEnabled() {
1875
1904
  try {
1876
- return localStorage.getItem(U) !== "false";
1905
+ return localStorage.getItem(B) !== "false";
1877
1906
  } catch {
1878
1907
  return !0;
1879
1908
  }
1880
1909
  }
1881
1910
  setTutorialEnabled(t) {
1882
1911
  try {
1883
- localStorage.setItem(U, String(t));
1912
+ localStorage.setItem(B, String(t));
1884
1913
  } catch {
1885
1914
  }
1886
1915
  }
@@ -1940,7 +1969,7 @@ class ot {
1940
1969
  this.isActive = !1, this.showWarning = !1;
1941
1970
  }
1942
1971
  }
1943
- class rt {
1972
+ class lt {
1944
1973
  container;
1945
1974
  i18n;
1946
1975
  tutorialManager;
@@ -1976,7 +2005,7 @@ class rt {
1976
2005
  this.container.style.display = "none";
1977
2006
  }
1978
2007
  }
1979
- class ht {
2008
+ class ct {
1980
2009
  fillElement;
1981
2010
  killsCount = 0;
1982
2011
  currentLevel = 1;
@@ -2007,7 +2036,7 @@ class ht {
2007
2036
  this.fillElement && this.fillElement.parentElement && (this.fillElement.parentElement.style.display = "none");
2008
2037
  }
2009
2038
  }
2010
- class lt {
2039
+ class dt {
2011
2040
  haptics = {
2012
2041
  impact: async (t) => {
2013
2042
  if ("vibrate" in navigator) {
@@ -2047,7 +2076,7 @@ class lt {
2047
2076
  }
2048
2077
  };
2049
2078
  }
2050
- class ct {
2079
+ class ut {
2051
2080
  container;
2052
2081
  canvas;
2053
2082
  i18n;
@@ -2079,7 +2108,7 @@ class ct {
2079
2108
  isRunning = !1;
2080
2109
  isPaused = !1;
2081
2110
  constructor(t) {
2082
- this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new Y(t.language), this.themeManager = new j(t.theme, this.container), this.platform = t.platform || new lt(), this.canvas = document.createElement("canvas"), this.canvas.className = "axon-canvas", this.container.appendChild(this.canvas), this.resizeCanvas(), window.addEventListener("resize", () => this.resizeCanvas()), this.eventBus = new B(), this.core = new K(this.canvas.width / 2, this.canvas.height / 2), this.inputManager = new W(this.canvas), this.physicsEngine = new z(this.eventBus, this.i18n), this.waveDirector = new q(), this.renderer = new it(this.canvas, this.themeManager), this.juice = new F(), this.settingsModal = new nt(
2111
+ this.container = t.root, this.container.classList.add("axon-game-root"), this.i18n = new Z(t.language), this.themeManager = new tt(t.theme, this.container), this.platform = t.platform || new dt(), this.canvas = document.createElement("canvas"), this.canvas.className = "axon-canvas", this.container.appendChild(this.canvas), this.resizeCanvas(), window.addEventListener("resize", () => this.resizeCanvas()), this.eventBus = new K(), this.core = new V(this.canvas.width / 2, this.canvas.height / 2), this.inputManager = new F(this.canvas), this.physicsEngine = new q(this.eventBus, this.i18n), this.waveDirector = new Q(), this.renderer = new at(this.canvas, this.themeManager), this.juice = new J(), this.settingsModal = new rt(
2083
2112
  this.container,
2084
2113
  this.i18n,
2085
2114
  this.themeManager,
@@ -2088,20 +2117,26 @@ class ct {
2088
2117
  () => {
2089
2118
  this.isPaused = !1;
2090
2119
  }
2091
- ), this.interactiveTutorial = new ot(), this.tutorialOverlay = new rt(this.container, this.i18n, this.interactiveTutorial), this.hud = new st(this.container, this.i18n, () => {
2120
+ ), this.interactiveTutorial = new ht(), this.tutorialOverlay = new lt(this.container, this.i18n, this.interactiveTutorial), this.hud = new nt(this.container, this.i18n, () => {
2092
2121
  this.isPaused = !0, this.settingsModal.show();
2093
- }), this.hud.show(), this.progressBar = new ht(this.hud.progressSlot, (e) => {
2122
+ }), this.hud.show(), this.progressBar = new ct(this.hud.progressSlot, (e) => {
2094
2123
  this.waveDirector.wave = e;
2095
- }), this.startMenu = new at(this.container, this.i18n, () => this.startGame()), this.initAmbientArena(), this.gameLoop = new H(
2124
+ }), this.startMenu = new ot(this.container, this.i18n, () => this.startGame()), this.initAmbientArena(), this.gameLoop = new W(
2096
2125
  (e) => this.update(e),
2097
2126
  () => this.render()
2098
2127
  ), this.setupEvents(), this.gameLoop.start();
2099
2128
  }
2100
2129
  setLanguage(t) {
2101
- this.i18n.setLanguage(t), this.onLanguageChanged(t);
2130
+ this.i18n.setLanguage(t, !1), this.onLanguageChanged(t);
2102
2131
  }
2103
2132
  setTheme(t) {
2104
- this.themeManager.setTheme(t);
2133
+ this.themeManager.setTheme(t, !1);
2134
+ }
2135
+ getLanguage() {
2136
+ return this.i18n.getLanguage();
2137
+ }
2138
+ getTheme() {
2139
+ return this.themeManager.getTheme();
2105
2140
  }
2106
2141
  onLanguageChanged(t) {
2107
2142
  this.startMenu.renderContent(), this.hud.renderLabels(), this.tutorialOverlay.updateLanguage();
@@ -2207,15 +2242,18 @@ class ct {
2207
2242
  this.interactiveTutorial.isActive ? this.interactiveTutorial : void 0
2208
2243
  );
2209
2244
  }
2245
+ destroy() {
2246
+ this.gameLoop.stop(), this.canvas.remove();
2247
+ }
2210
2248
  }
2211
- function dt(E) {
2212
- return new ct(E);
2249
+ function pt(E) {
2250
+ return new ut(E);
2213
2251
  }
2214
2252
  export {
2215
- lt as BrowserPlatform,
2216
- ct as GameEngine,
2217
- k as LANGUAGES,
2218
- j as ThemeManager,
2219
- dt as createAxonSurge,
2220
- R as isLanguage
2253
+ dt as BrowserPlatform,
2254
+ ut as GameEngine,
2255
+ H as LANGUAGES,
2256
+ tt as ThemeManager,
2257
+ pt as createAxonSurge,
2258
+ N as isLanguage
2221
2259
  };
@@ -41,6 +41,8 @@ export declare class GameEngine {
41
41
  constructor(options: GameEngineOptions);
42
42
  setLanguage(language: Language): void;
43
43
  setTheme(theme: Theme): void;
44
+ getLanguage(): Language;
45
+ getTheme(): Theme;
44
46
  private onLanguageChanged;
45
47
  private initAmbientArena;
46
48
  private resizeCanvas;
@@ -48,5 +50,6 @@ export declare class GameEngine {
48
50
  startGame(): void;
49
51
  private update;
50
52
  private render;
53
+ destroy(): void;
51
54
  }
52
55
  //# sourceMappingURL=GameEngine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GameEngine.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C,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,WAAW,CAAc;IAEjC,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,aAAa,CAAsB;IAE3C,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,QAAQ,CAAkB;gBAEtB,OAAO,EAAE,iBAAiB;IA4D/B,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAKrC,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI5B,WAAW,IAAI,QAAQ;IAIvB,QAAQ,IAAI,KAAK;IAIxB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,YAAY;IAuBpB,OAAO,CAAC,WAAW;IA2CZ,SAAS,IAAI,IAAI;IA6BxB,OAAO,CAAC,MAAM;IA+Dd,OAAO,CAAC,MAAM;IAkBP,OAAO,IAAI,IAAI;CAIzB"}
@@ -3,7 +3,7 @@ export declare class I18nService {
3
3
  private currentLanguage;
4
4
  constructor(initialLanguage?: Language);
5
5
  private detectLanguage;
6
- setLanguage(language: Language): void;
6
+ setLanguage(language: Language, fromUserInteraction?: boolean): void;
7
7
  getLanguage(): Language;
8
8
  translate<K extends keyof Translations>(key: K, params?: Record<string, string | number>): string;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"I18nService.d.ts","sourceRoot":"","sources":["../../src/i18n/I18nService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIxD,qBAAa,WAAW;IACpB,OAAO,CAAC,eAAe,CAAW;gBAEtB,eAAe,CAAC,EAAE,QAAQ;IAItC,OAAO,CAAC,cAAc;IAmCf,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IASrC,WAAW,IAAI,QAAQ;IAIvB,SAAS,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;CAW3G"}
1
+ {"version":3,"file":"I18nService.d.ts","sourceRoot":"","sources":["../../src/i18n/I18nService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKxD,qBAAa,WAAW;IACpB,OAAO,CAAC,eAAe,CAAW;gBAEtB,eAAe,CAAC,EAAE,QAAQ;IAItC,OAAO,CAAC,cAAc;IAyCf,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,GAAE,OAAc,GAAG,IAAI;IAY1E,WAAW,IAAI,QAAQ;IAIvB,SAAS,CAAC,CAAC,SAAS,MAAM,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM;CAW3G"}
@@ -22,10 +22,11 @@ export declare class ThemeManager {
22
22
  private targetElement;
23
23
  constructor(initialTheme?: Theme, targetElement?: HTMLElement | undefined);
24
24
  setTargetElement(element: HTMLElement): void;
25
- setTheme(theme: Theme): void;
25
+ setTheme(theme: Theme, fromUserInteraction?: boolean): void;
26
26
  clearExplicitTheme(): void;
27
27
  getTheme(): Theme;
28
28
  getPalette(): ThemePalette;
29
+ private detectParentOrSystemTheme;
29
30
  private removeThemeClasses;
30
31
  private applyThemeToDOM;
31
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeManager.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,CAiDhD,CAAC;AAIF,qBAAa,YAAY;IACrB,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,aAAa,CAA0B;gBAEnC,YAAY,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,SAAS;IAsBlE,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAO5C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAW5B,kBAAkB,IAAI,IAAI;IAQ1B,QAAQ,IAAI,KAAK;IAIjB,UAAU,IAAI,YAAY;IAIjC,OAAO,CAAC,kBAAkB;I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1
1
  {
2
2
  "name": "@gamebob/axon-surge",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "main": "./dist/axon-surge.js",
6
6
  "module": "./dist/axon-surge.js",