@caperjs/core 0.6.1 → 0.7.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.
Files changed (53) hide show
  1. package/build/index.d.mts +6 -0
  2. package/build/index.mjs +7 -0
  3. package/build/plugins/solid.mjs +30 -0
  4. package/cli/doctor.mjs +128 -0
  5. package/cli/doctor.test.mjs +154 -0
  6. package/extras/llms.txt +192 -4
  7. package/extras/skills/caper/SKILL.md +51 -3
  8. package/lib/{CaptionsPlugin-BtVJiQs_.js → CaptionsPlugin-Boj-gm3A.js} +5 -5
  9. package/lib/{CaptionsPlugin-BtVJiQs_.js.map → CaptionsPlugin-Boj-gm3A.js.map} +1 -1
  10. package/lib/{DataAdapter-BtNz4yi2.js → DataAdapter-Cra9dJ6W.js} +9 -9
  11. package/lib/{DataAdapter-BtNz4yi2.js.map → DataAdapter-Cra9dJ6W.js.map} +1 -1
  12. package/lib/{DebugRenderer-DK8FAED1.js → DebugRenderer-19S58S4h.js} +2 -2
  13. package/lib/{DebugRenderer-DK8FAED1.js.map → DebugRenderer-19S58S4h.js.map} +1 -1
  14. package/lib/{DevToolsPlugin-BS9idGRi.js → DevToolsPlugin-BTSkRsdS.js} +2 -2
  15. package/lib/{DevToolsPlugin-BS9idGRi.js.map → DevToolsPlugin-BTSkRsdS.js.map} +1 -1
  16. package/lib/{GSAPPlugin-DVDbDVP8.js → GSAPPlugin-BcL7vjyw.js} +5 -5
  17. package/lib/{GSAPPlugin-DVDbDVP8.js.map → GSAPPlugin-BcL7vjyw.js.map} +1 -1
  18. package/lib/{LayoutPlugin-qQJ5qJud.js → LayoutPlugin-BDhSngz_.js} +4 -4
  19. package/lib/{LayoutPlugin-qQJ5qJud.js.map → LayoutPlugin-BDhSngz_.js.map} +1 -1
  20. package/lib/ScreenDebugPlugin-C6pxs_3O.js +103 -0
  21. package/lib/ScreenDebugPlugin-C6pxs_3O.js.map +1 -0
  22. package/lib/{SpinePlugin-CPNRM2J1.js → SpinePlugin-CrQhaK6r.js} +2 -2
  23. package/lib/{SpinePlugin-CPNRM2J1.js.map → SpinePlugin-CrQhaK6r.js.map} +1 -1
  24. package/lib/{StatsPlugin-BHihicBl.js → StatsPlugin-Cu625dmk.js} +2 -2
  25. package/lib/{StatsPlugin-BHihicBl.js.map → StatsPlugin-Cu625dmk.js.map} +1 -1
  26. package/lib/{VoiceOverPlugin-BdTHxgku.js → VoiceOverPlugin-D4rfHFyJ.js} +5 -5
  27. package/lib/{VoiceOverPlugin-BdTHxgku.js.map → VoiceOverPlugin-D4rfHFyJ.js.map} +1 -1
  28. package/lib/caper.mjs +98 -97
  29. package/lib/caper.mjs.map +1 -1
  30. package/lib/{const-BQItSP39.js → const-BQ2iMCtc.js} +180 -180
  31. package/lib/{const-BQItSP39.js.map → const-BQ2iMCtc.js.map} +1 -1
  32. package/lib/core/Application.d.ts.map +1 -1
  33. package/lib/plugins/ScreenDebugPlugin.d.ts +22 -0
  34. package/lib/plugins/ScreenDebugPlugin.d.ts.map +1 -0
  35. package/lib/plugins/ScreenDebugPlugin.test.d.ts +2 -0
  36. package/lib/plugins/ScreenDebugPlugin.test.d.ts.map +1 -0
  37. package/lib/plugins/index.d.ts +2 -0
  38. package/lib/plugins/index.d.ts.map +1 -1
  39. package/lib/plugins/screenDebugFlag.d.ts +2 -0
  40. package/lib/plugins/screenDebugFlag.d.ts.map +1 -0
  41. package/lib/plugins/screenDebugFlag.test.d.ts +2 -0
  42. package/lib/plugins/screenDebugFlag.test.d.ts.map +1 -0
  43. package/lib/{registries-DlqHRO90.js → registries-BmDw_GV1.js} +237 -221
  44. package/lib/registries-BmDw_GV1.js.map +1 -0
  45. package/package.json +1 -1
  46. package/src/core/Application.ts +8 -0
  47. package/src/plugins/ScreenDebugPlugin.test.ts +61 -0
  48. package/src/plugins/ScreenDebugPlugin.ts +174 -0
  49. package/src/plugins/index.ts +2 -0
  50. package/src/plugins/screenDebugFlag.test.ts +45 -0
  51. package/src/plugins/screenDebugFlag.ts +26 -0
  52. package/src/version.ts +1 -1
  53. package/lib/registries-DlqHRO90.js.map +0 -1
@@ -68,27 +68,27 @@ function _e(e, t, ...n) {
68
68
  }
69
69
  //#endregion
70
70
  //#region src/utils/env.ts
71
- var ve = process.env.NODE_ENV, v = ve === "development", ye = ve === "production";
71
+ var v = process.env.NODE_ENV, y = v === "development", ve = v === "production";
72
72
  //#endregion
73
73
  //#region src/utils/string.ts
74
- function y(e) {
74
+ function b(e) {
75
75
  return e ? e.charAt(0).toUpperCase() + e.slice(1) : "";
76
76
  }
77
- function be(e) {
78
- return e ? e.split(" ").map(y).join(" ") : "";
77
+ function ye(e) {
78
+ return e ? e.split(" ").map(b).join(" ") : "";
79
79
  }
80
80
  //#endregion
81
81
  //#region src/utils/console/Logger.ts
82
- var b = {
82
+ var x = {
83
83
  log: "background: #74b64c; color: black;",
84
84
  warn: "background: yellow; color: black;",
85
85
  error: "background: red; color: white;"
86
- }, xe = "background: #1f2937; color: #74b64c;", x = class e {
86
+ }, S = "background: #1f2937; color: #74b64c;", C = class e {
87
87
  static {
88
88
  this._instance = null;
89
89
  }
90
90
  constructor(t) {
91
- e._instance = this, e.mode = t === void 0 ? v ? "development" : "default" : t, [
91
+ e._instance = this, e.mode = t === void 0 ? y ? "development" : "default" : t, [
92
92
  "development",
93
93
  "default",
94
94
  "disabled"
@@ -119,30 +119,30 @@ var b = {
119
119
  static lifecycle(t, n = "init", ...r) {
120
120
  if (e.mode === "disabled") return;
121
121
  let i = `${t} ${n}`;
122
- if (e.mode === "default") return console.log(`%c ${y(n)} `, xe, i, ...r);
123
- console.groupCollapsed(`%c ${y(n)} `, xe, i, ...r), console.trace("%c Stack ", xe), console.groupEnd();
122
+ if (e.mode === "default") return console.log(`%c ${b(n)} `, S, i, ...r);
123
+ console.groupCollapsed(`%c ${b(n)} `, S, i, ...r), console.trace("%c Stack ", S), console.groupEnd();
124
124
  }
125
125
  static trace(t = "log", ...n) {
126
126
  if (e.mode !== "disabled") {
127
- if (t === "error") return console.error(`%c ${y(t)} `, b[t], ...n);
128
- if (e.mode === "default") return console.log(`%c ${y(t)} `, b[t], ...n);
129
- console.groupCollapsed(`%c ${y(t)} `, b[t], ...n), console.trace("%c Stack ", b[t]), console.groupEnd();
127
+ if (t === "error") return console.error(`%c ${b(t)} `, x[t], ...n);
128
+ if (e.mode === "default") return console.log(`%c ${b(t)} `, x[t], ...n);
129
+ console.groupCollapsed(`%c ${b(t)} `, x[t], ...n), console.trace("%c Stack ", x[t]), console.groupEnd();
130
130
  }
131
131
  }
132
- }, S = /* @__PURE__ */ function(e) {
132
+ }, w = /* @__PURE__ */ function(e) {
133
133
  return e.REQUIRED_ASSETS_START = "caper-required-assets-start", e.REQUIRED_ASSETS_PROGRESS = "caper-required-assets-progress", e.REQUIRED_ASSETS_COMPLETE = "caper-required-assets-complete", e.ASSETS_START = "caper-assets-start", e.ASSETS_PROGRESS = "caper-assets-progress", e.ASSETS_COMPLETE = "caper-assets-complete", e;
134
- }({}), Se = (e = 0) => new Promise((t) => setTimeout(t, e * 1e3)), Ce = (e = 0) => Se(e), C = (e) => e && typeof e.then == "function";
134
+ }({}), be = (e = 0) => new Promise((t) => setTimeout(t, e * 1e3)), xe = (e = 0) => be(e), T = (e) => e && typeof e.then == "function";
135
135
  //#endregion
136
136
  //#region src/utils/vite.ts
137
- function w(e) {
138
- x.error(e);
137
+ function E(e) {
138
+ C.error(e);
139
139
  }
140
140
  //#endregion
141
141
  //#region src/utils/promise/Queue.ts
142
- function we(...e) {
143
- return new Te(e);
142
+ function Se(...e) {
143
+ return new Ce(e);
144
144
  }
145
- var Te = class {
145
+ var Ce = class {
146
146
  constructor(e = []) {
147
147
  this._currentIndex = 0, this._isPaused = !1, this._isCanceled = !1, this._promises = e;
148
148
  }
@@ -175,7 +175,7 @@ var Te = class {
175
175
  this._results.push(t), this._currentIndex++, this._next();
176
176
  } catch (e) {
177
177
  let t = e instanceof Error ? e : Error(String(e));
178
- console.error("Queue didn't complete due to an error:", e), w({
178
+ console.error("Queue didn't complete due to an error:", e), E({
179
179
  message: `Queue didn't complete due to an error: ${t.message}`,
180
180
  stack: t.stack,
181
181
  id: e?.id
@@ -185,23 +185,23 @@ var Te = class {
185
185
  };
186
186
  //#endregion
187
187
  //#region src/utils/framework.ts
188
- function Ee(e) {
188
+ function we(e) {
189
189
  return typeof e == "function" && /^class\s/.test(Function.prototype.toString.call(e));
190
190
  }
191
- async function T(e) {
191
+ async function D(e) {
192
192
  let t, n;
193
- return C(e.module) ? (t = await e.module, n = e?.namedExport ? t[e.namedExport] : t.default) : typeof e.module == "function" ? Ee(e.module) ? (t = e.module, n = t) : (t = await e.module(), n = e?.namedExport ? t[e.namedExport] : t.default) : (t = e.module, n = t), n;
193
+ return T(e.module) ? (t = await e.module, n = e?.namedExport ? t[e.namedExport] : t.default) : typeof e.module == "function" ? we(e.module) ? (t = e.module, n = t) : (t = await e.module(), n = e?.namedExport ? t[e.namedExport] : t.default) : (t = e.module, n = t), n;
194
194
  }
195
195
  //#endregion
196
196
  //#region src/utils/map.ts
197
- function De(e, t) {
197
+ function Te(e, t) {
198
198
  let n;
199
199
  for (let r of e) {
200
200
  if (r[0] === t) return n;
201
201
  n = r;
202
202
  }
203
203
  }
204
- function Oe(e, t) {
204
+ function Ee(e, t) {
205
205
  let n, r = Array.from(e.entries());
206
206
  for (let e = r.length - 1; e >= 0; e--) {
207
207
  let i = r[e];
@@ -209,23 +209,23 @@ function Oe(e, t) {
209
209
  n = i;
210
210
  }
211
211
  }
212
- function ke(e) {
212
+ function De(e) {
213
213
  return Array.from(e.entries()).pop();
214
214
  }
215
- function Ae(e) {
215
+ function Oe(e) {
216
216
  return Array.from(e.entries()).shift();
217
217
  }
218
218
  //#endregion
219
219
  //#region src/utils/math.ts
220
- function je(e, t, n) {
220
+ function ke(e, t, n) {
221
221
  return Math.max(t, Math.min(n, e));
222
222
  }
223
- function Me(e, t, n) {
223
+ function Ae(e, t, n) {
224
224
  return e + (t - e) * n;
225
225
  }
226
226
  //#endregion
227
227
  //#region src/utils/misc.ts
228
- function Ne(e) {
228
+ function je(e) {
229
229
  if (e === void 0) return {
230
230
  width: 0,
231
231
  height: 0
@@ -249,7 +249,7 @@ function Ne(e) {
249
249
  height: e ?? 0
250
250
  };
251
251
  }
252
- function Pe(e, t) {
252
+ function Me(e, t) {
253
253
  let n = null;
254
254
  return function(...r) {
255
255
  n && clearTimeout(n), n = setTimeout(() => {
@@ -259,53 +259,53 @@ function Pe(e, t) {
259
259
  }
260
260
  //#endregion
261
261
  //#region src/utils/object.ts
262
- function Fe(e, t) {
262
+ function Ne(e, t) {
263
263
  return t.reduce((t, n) => n in e ? {
264
264
  ...t,
265
265
  [n]: e[n]
266
266
  } : t, {});
267
267
  }
268
- function Ie(e, t) {
268
+ function Pe(e, t) {
269
269
  return Object.entries(t).filter(([t]) => !e.includes(t)).reduce((e, [t, n]) => ({
270
270
  ...e,
271
271
  [t]: n
272
272
  }), {});
273
273
  }
274
- function E(e, t) {
275
- for (let n in t) t[n] !== void 0 && Object.prototype.toString.call(t[n]) === "[object Object]" && n in e && typeof e[n] == "object" ? e[n] = E(e[n], t[n]) : t[n] !== void 0 && (e[n] = t[n]);
274
+ function Fe(e, t) {
275
+ for (let n in t) t[n] !== void 0 && Object.prototype.toString.call(t[n]) === "[object Object]" && n in e && typeof e[n] == "object" ? e[n] = Fe(e[n], t[n]) : t[n] !== void 0 && (e[n] = t[n]);
276
276
  return e;
277
277
  }
278
278
  //#endregion
279
279
  //#region src/utils/point.ts
280
- function Le(e, t) {
280
+ function Ie(e, t) {
281
281
  return new c(e.x + t.x, e.y + t.y);
282
282
  }
283
- function Re(e, t) {
283
+ function Le(e, t) {
284
284
  e.x += t.x, e.y += t.y;
285
285
  }
286
- function ze(e, t) {
286
+ function Re(e, t) {
287
287
  return new c(e.x - t.x, e.y - t.y);
288
288
  }
289
- function Be(e, t) {
289
+ function ze(e, t) {
290
290
  e.x -= t.x, e.y -= t.y;
291
291
  }
292
- function Ve(e, t) {
292
+ function Be(e, t) {
293
293
  let n = new c(e.x, e.y);
294
294
  return n.x *= t, n.y *= t, n;
295
295
  }
296
+ function Ve(e, t) {
297
+ return Ae(e.x, e.y, t);
298
+ }
296
299
  function He(e, t) {
297
- return Me(e.x, e.y, t);
300
+ return Math.sqrt(Ue(e, t));
298
301
  }
299
302
  function Ue(e, t) {
300
- return Math.sqrt(We(e, t));
301
- }
302
- function We(e, t) {
303
303
  return (t.x - e.x) * (t.x - e.x) + (t.y - e.y) * (t.y - e.y);
304
304
  }
305
- function Ge(e) {
305
+ function We(e) {
306
306
  return Math.sqrt(e.x * e.x + e.y * e.y);
307
307
  }
308
- function Ke(e, t = !1, n = 0, r = 0) {
308
+ function Ge(e, t = !1, n = 0, r = 0) {
309
309
  if (e instanceof c) n = e.x, r = e.y;
310
310
  else if (Array.isArray(e)) n = e[0], r = e[1] === void 0 ? e[0] : e[1];
311
311
  else if (typeof e == "object") {
@@ -319,16 +319,16 @@ function Ke(e, t = !1, n = 0, r = 0) {
319
319
  }
320
320
  //#endregion
321
321
  //#region src/utils/web.ts
322
- function qe() {
322
+ function Ke() {
323
323
  return window.innerWidth > window.innerHeight ? "landscape" : "portrait";
324
324
  }
325
325
  //#endregion
326
326
  //#region src/core/config.ts
327
- async function Je(e) {
327
+ async function qe(e) {
328
328
  let t = globalThis.Caper?.get?.("pluginsList") ?? [];
329
329
  return e.map((e) => {
330
330
  let n = Array.isArray(e) ? e[0] : e, r = t.find((e) => e.id === n);
331
- if (!r) return x.warn(`Plugin ${e} not found`), null;
331
+ if (!r) return C.warn(`Plugin ${e} not found`), null;
332
332
  let i = e;
333
333
  return {
334
334
  id: r.id,
@@ -340,10 +340,10 @@ async function Je(e) {
340
340
  };
341
341
  }).filter(Boolean);
342
342
  }
343
- function Ye(e) {
343
+ function Je(e) {
344
344
  return e;
345
345
  }
346
- function Xe(e, t) {
346
+ function Ye(e, t) {
347
347
  if (e.length < 2) return e.slice();
348
348
  let n = /* @__PURE__ */ new Map();
349
349
  for (let t of e) n.set(t.id, t);
@@ -378,12 +378,12 @@ function Xe(e, t) {
378
378
  }
379
379
  }
380
380
  if (l.length !== e.length) {
381
- let t = e.filter((e) => !l.includes(e)).map((e) => e.id), r = Ze(t, n);
381
+ let t = e.filter((e) => !l.includes(e)).map((e) => e.id), r = Xe(t, n);
382
382
  throw Error(`Caper bootstrap failed: plugin dependency cycle detected: ${r.join(" → ")}\nPlugins involved: ${t.join(", ")}`);
383
383
  }
384
384
  return l;
385
385
  }
386
- function Ze(e, t) {
386
+ function Xe(e, t) {
387
387
  let n = /* @__PURE__ */ new Set(), r = [], i = new Set(e);
388
388
  function a(e) {
389
389
  if (n.has(e)) {
@@ -406,13 +406,13 @@ function Ze(e, t) {
406
406
  }
407
407
  //#endregion
408
408
  //#region src/mixins/factory/defaults.ts
409
- var D = null;
409
+ var Ze = null;
410
410
  function Qe(e) {
411
- D = e;
411
+ Ze = e;
412
412
  }
413
413
  function $e() {
414
- if (!D) throw Error("[caper] The factory method table hasn't been initialized. Import '@caperjs/core' (or its factory module) before deep-importing display/ui classes so the table is registered first.");
415
- return D;
414
+ if (!Ze) throw Error("[caper] The factory method table hasn't been initialized. Import '@caperjs/core' (or its factory module) before deep-importing display/ui classes so the table is registered first.");
415
+ return Ze;
416
416
  }
417
417
  //#endregion
418
418
  //#region src/core/interfaces/IStorageCapability.ts
@@ -685,7 +685,7 @@ var k = /* @__PURE__ */ h(((e) => {
685
685
  this.onError.disconnectAll();
686
686
  }
687
687
  _emitError(e) {
688
- x.error(`[Store.${e.operation}] adapter='${e.adapterId}' key='${e.key}': ${e.error.message}`), this.onError.emit(e);
688
+ C.error(`[Store.${e.operation}] adapter='${e.adapterId}' key='${e.key}': ${e.error.message}`), this.onError.emit(e);
689
689
  }
690
690
  getAdapter(e) {
691
691
  let t = this._app.getPlugin(e);
@@ -790,7 +790,7 @@ var N = class {
790
790
  for (let t = e.length - 1; t >= 0; t--) try {
791
791
  e[t]();
792
792
  } catch (e) {
793
- x.error(`Plugin "${this.id}" threw while running a disposer:`, e);
793
+ C.error(`Plugin "${this.id}" threw while running a disposer:`, e);
794
794
  }
795
795
  this._signalConnections.disconnectAll();
796
796
  }
@@ -827,13 +827,13 @@ var N = class {
827
827
  registerCoreFunctions() {
828
828
  this.getCoreFunctions().forEach((e) => {
829
829
  let t = e;
830
- Xn[t] = this[e];
830
+ $n[t] = this[e];
831
831
  });
832
832
  }
833
833
  registerCoreSignals() {
834
834
  this.getCoreSignals().forEach((e) => {
835
835
  let t = e;
836
- Yn[t] = this[e];
836
+ Qn[t] = this[e];
837
837
  });
838
838
  }
839
839
  getCoreFunctions() {
@@ -843,7 +843,7 @@ var N = class {
843
843
  return [];
844
844
  }
845
845
  }, ut = {
846
- preferWorkers: !v,
846
+ preferWorkers: !y,
847
847
  crossOrigin: "anonymous"
848
848
  };
849
849
  function dt(e) {
@@ -864,24 +864,24 @@ function P(e) {
864
864
  }
865
865
  var ft = class extends N {
866
866
  constructor(...e) {
867
- super(...e), this.id = "assets", this.onLoadStart = new j(), this.onLoadProgress = new j(), this.onLoadComplete = new j(), this.onLoadRequiredStart = new j(), this.onLoadRequiredProgress = new j(), this.onLoadRequiredComplete = new j(), this.onBackgroundLoadStart = new j(), this.onBackgroundAssetLoaded = new j(), this.onBackgroundBundlesLoaded = new j(), this._loadedBundles = /* @__PURE__ */ new Set(), this._loadedAssets = /* @__PURE__ */ new Set(), this._required = {}, this._background = {}, this._isLoadingRequired = !1, this.webRequiredStartEvent = new Event(S.REQUIRED_ASSETS_START, {
867
+ super(...e), this.id = "assets", this.onLoadStart = new j(), this.onLoadProgress = new j(), this.onLoadComplete = new j(), this.onLoadRequiredStart = new j(), this.onLoadRequiredProgress = new j(), this.onLoadRequiredComplete = new j(), this.onBackgroundLoadStart = new j(), this.onBackgroundAssetLoaded = new j(), this.onBackgroundBundlesLoaded = new j(), this._loadedBundles = /* @__PURE__ */ new Set(), this._loadedAssets = /* @__PURE__ */ new Set(), this._required = {}, this._background = {}, this._isLoadingRequired = !1, this.webRequiredStartEvent = new Event(w.REQUIRED_ASSETS_START, {
868
868
  bubbles: !0,
869
869
  cancelable: !1
870
- }), this.webRequiredProgressEvent = new CustomEvent(S.REQUIRED_ASSETS_PROGRESS, {
870
+ }), this.webRequiredProgressEvent = new CustomEvent(w.REQUIRED_ASSETS_PROGRESS, {
871
871
  bubbles: !0,
872
872
  cancelable: !1,
873
873
  detail: { progress: 0 }
874
- }), this.webRequiredCompleteEvent = new Event(S.REQUIRED_ASSETS_COMPLETE, {
874
+ }), this.webRequiredCompleteEvent = new Event(w.REQUIRED_ASSETS_COMPLETE, {
875
875
  bubbles: !0,
876
876
  cancelable: !1
877
- }), this.webStartEvent = new Event(S.ASSETS_START, {
877
+ }), this.webStartEvent = new Event(w.ASSETS_START, {
878
878
  bubbles: !0,
879
879
  cancelable: !1
880
- }), this.webProgressEvent = new CustomEvent(S.ASSETS_PROGRESS, {
880
+ }), this.webProgressEvent = new CustomEvent(w.ASSETS_PROGRESS, {
881
881
  bubbles: !0,
882
882
  cancelable: !1,
883
883
  detail: { progress: 0 }
884
- }), this.webCompleteEvent = new Event(S.ASSETS_COMPLETE, {
884
+ }), this.webCompleteEvent = new Event(w.ASSETS_COMPLETE, {
885
885
  bubbles: !0,
886
886
  cancelable: !1
887
887
  });
@@ -1060,7 +1060,7 @@ var ft = class extends N {
1060
1060
  this._isFullScreen = e, e ? this._requestFullscreen() : this._exitFullscreen();
1061
1061
  }
1062
1062
  setFullScreenElement(e) {
1063
- e || x.warn("No element passed to setFullScreenElement for fullscreen mode"), this._fullScreenElement = e;
1063
+ e || C.warn("No element passed to setFullScreenElement for fullscreen mode"), this._fullScreenElement = e;
1064
1064
  }
1065
1065
  get canFullscreen() {
1066
1066
  let e = this._fullScreenElement || $.containerElement;
@@ -1088,7 +1088,7 @@ var ft = class extends N {
1088
1088
  try {
1089
1089
  t.requestFullscreen ? t.requestFullscreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : t.msRequestFullscreen ? t.msRequestFullscreen() : t.mozRequestFullScreen && t.mozRequestFullScreen();
1090
1090
  } catch (e) {
1091
- x.error("Failed to request fullscreen:", e), this._isFullScreen = !1;
1091
+ C.error("Failed to request fullscreen:", e), this._isFullScreen = !1;
1092
1092
  }
1093
1093
  }
1094
1094
  _exitFullscreen() {
@@ -1148,7 +1148,7 @@ var mt = class extends N {
1148
1148
  }
1149
1149
  _handleKeyUp(e) {
1150
1150
  let t = F(e.key);
1151
- this._keysDown.delete(t), v && !this._warnedNoConsumers && this._keyUpSignals.size === 0 && this._keyDownSignals.size === 0 && (this._warnedNoConsumers = !0, x.warn("KeyboardPlugin received a key event but no consumers are connected, so keyboard actions will not fire. Ensure the InputPlugin controls are connected — e.g. an Application subclass overriding postInitialize() must not skip framework wiring, or call app.controls.connect().")), this.onGlobalKeyUp.emit({
1151
+ this._keysDown.delete(t), y && !this._warnedNoConsumers && this._keyUpSignals.size === 0 && this._keyDownSignals.size === 0 && (this._warnedNoConsumers = !0, C.warn("KeyboardPlugin received a key event but no consumers are connected, so keyboard actions will not fire. Ensure the InputPlugin controls are connected — e.g. an Application subclass overriding postInitialize() must not skip framework wiring, or call app.controls.connect().")), this.onGlobalKeyUp.emit({
1152
1152
  event: e,
1153
1153
  key: e.key
1154
1154
  });
@@ -1198,7 +1198,7 @@ var mt = class extends N {
1198
1198
  }
1199
1199
  sendAction(e, t) {
1200
1200
  if (!this._actions[e]) {
1201
- this._debug && x.warn(`Action ${e} is not defined`);
1201
+ this._debug && C.warn(`Action ${e} is not defined`);
1202
1202
  return;
1203
1203
  }
1204
1204
  let n = this._actions[e].context;
@@ -1211,7 +1211,7 @@ var mt = class extends N {
1211
1211
  this.getAction(e).emit(n), this.onActionDispatched.emit(n);
1212
1212
  return;
1213
1213
  }
1214
- this._debug && x.warn(`Action ${e} is not allowed for context ${this.context}`);
1214
+ this._debug && C.warn(`Action ${e} is not allowed for context ${this.context}`);
1215
1215
  }
1216
1216
  setActionContext(e) {
1217
1217
  return this.context = e, this.context;
@@ -1312,7 +1312,7 @@ function St(e, t) {
1312
1312
  }
1313
1313
  var Ct = /* @__PURE__ */ new Set();
1314
1314
  function wt(e, t) {
1315
- Ct.has(e) || (Ct.add(e), x.warn(t));
1315
+ Ct.has(e) || (Ct.add(e), C.warn(t));
1316
1316
  }
1317
1317
  function I(e, t) {
1318
1318
  if (typeof t == "number") return t;
@@ -1455,7 +1455,7 @@ var R = {
1455
1455
  this._enter.clear(), this._leave.clear(), this.onBreakpointChanged.disconnectAll(), super.destroy();
1456
1456
  }
1457
1457
  is(e) {
1458
- return this._isKnown(e) ? this._active.has(e) : (x.warn(`[breakpoints] unknown name '${e}'. Known: ${this._knownNames().join(", ")}.`), !1);
1458
+ return this._isKnown(e) ? this._active.has(e) : (C.warn(`[breakpoints] unknown name '${e}'. Known: ${this._knownNames().join(", ")}.`), !1);
1459
1459
  }
1460
1460
  atLeast(e) {
1461
1461
  let t = I(this._ladder, e);
@@ -1507,7 +1507,7 @@ var R = {
1507
1507
  return e in this._ladder.byName || this._modes.has(e) || kt.has(e);
1508
1508
  }
1509
1509
  _warnIfUnknown(e) {
1510
- this._isKnown(e) || this._warnedListenerNames.has(e) || (this._warnedListenerNames.add(e), x.warn(`[breakpoints] unknown name '${e}'. Known: ${this._knownNames().join(", ")}.`));
1510
+ this._isKnown(e) || this._warnedListenerNames.has(e) || (this._warnedListenerNames.add(e), C.warn(`[breakpoints] unknown name '${e}'. Known: ${this._knownNames().join(", ")}.`));
1511
1511
  }
1512
1512
  _knownNames() {
1513
1513
  return [
@@ -1564,7 +1564,7 @@ var R = {
1564
1564
  try {
1565
1565
  e.pause();
1566
1566
  } catch (t) {
1567
- x.error("Error pausing sound", e.id, t);
1567
+ C.error("Error pausing sound", e.id, t);
1568
1568
  }
1569
1569
  });
1570
1570
  });
@@ -1575,7 +1575,7 @@ var R = {
1575
1575
  try {
1576
1576
  e.resume();
1577
1577
  } catch (t) {
1578
- x.error("Error resuming sound", e.id, t);
1578
+ C.error("Error resuming sound", e.id, t);
1579
1579
  }
1580
1580
  });
1581
1581
  });
@@ -1607,7 +1607,7 @@ var R = {
1607
1607
  [...e].forEach((e) => e.destroy());
1608
1608
  }), this._sounds.clear();
1609
1609
  }
1610
- }, Mt = class {
1610
+ }, B = class {
1611
1611
  constructor(e, t, n) {
1612
1612
  this.id = e, this.channel = t, this.manager = n, this.onStart = new j(), this.onStop = new j(), this.onEnd = new j(), this.onPaused = new j(), this.onResumed = new j(), this.onProgress = new j(), this._volume = 1, this._muted = !1, this._isPlaying = !1, _(this), this.muted = this.channel.muted;
1613
1613
  }
@@ -1690,16 +1690,16 @@ var R = {
1690
1690
  _handleMediaResumed() {
1691
1691
  this._isPlaying = !0, this.onResumed.emit(this);
1692
1692
  }
1693
- }, Nt;
1694
- function Pt(e) {
1695
- return Nt = e, e;
1693
+ }, Mt;
1694
+ function Nt(e) {
1695
+ return Mt = e, e;
1696
1696
  }
1697
- function B() {
1698
- return Nt;
1697
+ function V() {
1698
+ return Mt;
1699
1699
  }
1700
1700
  //#endregion
1701
1701
  //#region ../../node_modules/.pnpm/@pixi+sound@6.0.1_pixi.js@8.20.0/node_modules/@pixi/sound/lib/filters/Filter.mjs
1702
- var Ft = class {
1702
+ var Pt = class {
1703
1703
  constructor(e, t) {
1704
1704
  this.init(e, t);
1705
1705
  }
@@ -1715,71 +1715,71 @@ var Ft = class {
1715
1715
  destroy() {
1716
1716
  this.disconnect(), this.destination = null, this.source = null;
1717
1717
  }
1718
- }, V = class {
1718
+ }, H = class {
1719
1719
  static setParamValue(e, t) {
1720
1720
  if (e.setValueAtTime) {
1721
- let n = B().context;
1721
+ let n = V().context;
1722
1722
  e.setValueAtTime(t, n.audioContext.currentTime);
1723
1723
  } else e.value = t;
1724
1724
  return t;
1725
1725
  }
1726
- }, H = class extends Ft {
1726
+ }, U = class extends Pt {
1727
1727
  constructor(e = 0, t = 0, n = 0, r = 0, i = 0, a = 0, o = 0, s = 0, c = 0, l = 0) {
1728
1728
  let u = [], d = [
1729
1729
  {
1730
- f: H.F32,
1730
+ f: U.F32,
1731
1731
  type: "lowshelf",
1732
1732
  gain: e
1733
1733
  },
1734
1734
  {
1735
- f: H.F64,
1735
+ f: U.F64,
1736
1736
  type: "peaking",
1737
1737
  gain: t
1738
1738
  },
1739
1739
  {
1740
- f: H.F125,
1740
+ f: U.F125,
1741
1741
  type: "peaking",
1742
1742
  gain: n
1743
1743
  },
1744
1744
  {
1745
- f: H.F250,
1745
+ f: U.F250,
1746
1746
  type: "peaking",
1747
1747
  gain: r
1748
1748
  },
1749
1749
  {
1750
- f: H.F500,
1750
+ f: U.F500,
1751
1751
  type: "peaking",
1752
1752
  gain: i
1753
1753
  },
1754
1754
  {
1755
- f: H.F1K,
1755
+ f: U.F1K,
1756
1756
  type: "peaking",
1757
1757
  gain: a
1758
1758
  },
1759
1759
  {
1760
- f: H.F2K,
1760
+ f: U.F2K,
1761
1761
  type: "peaking",
1762
1762
  gain: o
1763
1763
  },
1764
1764
  {
1765
- f: H.F4K,
1765
+ f: U.F4K,
1766
1766
  type: "peaking",
1767
1767
  gain: s
1768
1768
  },
1769
1769
  {
1770
- f: H.F8K,
1770
+ f: U.F8K,
1771
1771
  type: "peaking",
1772
1772
  gain: c
1773
1773
  },
1774
1774
  {
1775
- f: H.F16K,
1775
+ f: U.F16K,
1776
1776
  type: "highshelf",
1777
1777
  gain: l
1778
1778
  }
1779
1779
  ];
1780
- B().useLegacy || (u = d.map((e) => {
1781
- let t = B().context.audioContext.createBiquadFilter();
1782
- return t.type = e.type, V.setParamValue(t.Q, 1), t.frequency.value = e.f, V.setParamValue(t.gain, e.gain), t;
1780
+ V().useLegacy || (u = d.map((e) => {
1781
+ let t = V().context.audioContext.createBiquadFilter();
1782
+ return t.type = e.type, H.setParamValue(t.Q, 1), t.frequency.value = e.f, H.setParamValue(t.gain, e.gain), t;
1783
1783
  })), super(u[0], u[u.length - 1]), this.bands = u, this.bandsMap = {};
1784
1784
  for (let e = 0; e < this.bands.length; e++) {
1785
1785
  let t = this.bands[e];
@@ -1788,75 +1788,75 @@ var Ft = class {
1788
1788
  }
1789
1789
  setGain(e, t = 0) {
1790
1790
  if (!this.bandsMap[e]) throw Error(`No band found for frequency ${e}`);
1791
- V.setParamValue(this.bandsMap[e].gain, t);
1791
+ H.setParamValue(this.bandsMap[e].gain, t);
1792
1792
  }
1793
1793
  getGain(e) {
1794
1794
  if (!this.bandsMap[e]) throw Error(`No band found for frequency ${e}`);
1795
1795
  return this.bandsMap[e].gain.value;
1796
1796
  }
1797
1797
  set f32(e) {
1798
- this.setGain(H.F32, e);
1798
+ this.setGain(U.F32, e);
1799
1799
  }
1800
1800
  get f32() {
1801
- return this.getGain(H.F32);
1801
+ return this.getGain(U.F32);
1802
1802
  }
1803
1803
  set f64(e) {
1804
- this.setGain(H.F64, e);
1804
+ this.setGain(U.F64, e);
1805
1805
  }
1806
1806
  get f64() {
1807
- return this.getGain(H.F64);
1807
+ return this.getGain(U.F64);
1808
1808
  }
1809
1809
  set f125(e) {
1810
- this.setGain(H.F125, e);
1810
+ this.setGain(U.F125, e);
1811
1811
  }
1812
1812
  get f125() {
1813
- return this.getGain(H.F125);
1813
+ return this.getGain(U.F125);
1814
1814
  }
1815
1815
  set f250(e) {
1816
- this.setGain(H.F250, e);
1816
+ this.setGain(U.F250, e);
1817
1817
  }
1818
1818
  get f250() {
1819
- return this.getGain(H.F250);
1819
+ return this.getGain(U.F250);
1820
1820
  }
1821
1821
  set f500(e) {
1822
- this.setGain(H.F500, e);
1822
+ this.setGain(U.F500, e);
1823
1823
  }
1824
1824
  get f500() {
1825
- return this.getGain(H.F500);
1825
+ return this.getGain(U.F500);
1826
1826
  }
1827
1827
  set f1k(e) {
1828
- this.setGain(H.F1K, e);
1828
+ this.setGain(U.F1K, e);
1829
1829
  }
1830
1830
  get f1k() {
1831
- return this.getGain(H.F1K);
1831
+ return this.getGain(U.F1K);
1832
1832
  }
1833
1833
  set f2k(e) {
1834
- this.setGain(H.F2K, e);
1834
+ this.setGain(U.F2K, e);
1835
1835
  }
1836
1836
  get f2k() {
1837
- return this.getGain(H.F2K);
1837
+ return this.getGain(U.F2K);
1838
1838
  }
1839
1839
  set f4k(e) {
1840
- this.setGain(H.F4K, e);
1840
+ this.setGain(U.F4K, e);
1841
1841
  }
1842
1842
  get f4k() {
1843
- return this.getGain(H.F4K);
1843
+ return this.getGain(U.F4K);
1844
1844
  }
1845
1845
  set f8k(e) {
1846
- this.setGain(H.F8K, e);
1846
+ this.setGain(U.F8K, e);
1847
1847
  }
1848
1848
  get f8k() {
1849
- return this.getGain(H.F8K);
1849
+ return this.getGain(U.F8K);
1850
1850
  }
1851
1851
  set f16k(e) {
1852
- this.setGain(H.F16K, e);
1852
+ this.setGain(U.F16K, e);
1853
1853
  }
1854
1854
  get f16k() {
1855
- return this.getGain(H.F16K);
1855
+ return this.getGain(U.F16K);
1856
1856
  }
1857
1857
  reset() {
1858
1858
  this.bands.forEach((e) => {
1859
- V.setParamValue(e.gain, 0);
1859
+ H.setParamValue(e.gain, 0);
1860
1860
  });
1861
1861
  }
1862
1862
  destroy() {
@@ -1864,11 +1864,11 @@ var Ft = class {
1864
1864
  e.disconnect();
1865
1865
  }), this.bands = null, this.bandsMap = null;
1866
1866
  }
1867
- }, U = H;
1868
- U.F32 = 32, U.F64 = 64, U.F125 = 125, U.F250 = 250, U.F500 = 500, U.F1K = 1e3, U.F2K = 2e3, U.F4K = 4e3, U.F8K = 8e3, U.F16K = 16e3;
1867
+ }, W = U;
1868
+ W.F32 = 32, W.F64 = 64, W.F125 = 125, W.F250 = 250, W.F500 = 500, W.F1K = 1e3, W.F2K = 2e3, W.F4K = 4e3, W.F8K = 8e3, W.F16K = 16e3;
1869
1869
  //#endregion
1870
1870
  //#region ../../node_modules/.pnpm/@pixi+sound@6.0.1_pixi.js@8.20.0/node_modules/@pixi/sound/lib/htmlaudio/HTMLAudioContext.mjs
1871
- var It = class extends i {
1871
+ var Ft = class extends i {
1872
1872
  constructor() {
1873
1873
  super(...arguments), this.speed = 1, this.muted = !1, this.volume = 1, this.paused = !1;
1874
1874
  }
@@ -1896,9 +1896,9 @@ var It = class extends i {
1896
1896
  destroy() {
1897
1897
  this.removeAllListeners();
1898
1898
  }
1899
- }, Lt = 0, W = class extends i {
1899
+ }, It = 0, Lt = class extends i {
1900
1900
  constructor(e) {
1901
- super(), this.id = Lt++, this.init(e);
1901
+ super(), this.id = It++, this.init(e);
1902
1902
  }
1903
1903
  set(e, t) {
1904
1904
  if (this[e] === void 0) throw Error(`Property with name ${e} does not exist.`);
@@ -1996,7 +1996,7 @@ var It = class extends i {
1996
1996
  }
1997
1997
  play(e) {
1998
1998
  let { start: t, end: n, speed: r, loop: i, volume: a, muted: o } = e;
1999
- n && console.assert(n > t, "End time is before start time"), this._speed = r, this._volume = a, this._loop = !!i, this._muted = o, this.refresh(), this.loop && n !== null && (console.warn("Looping not support when specifying an \"end\" time"), this.loop = !1), this._start = t, this._end = n || this._duration, this._start = Math.max(0, this._start - W.PADDING), this._end = Math.min(this._end + W.PADDING, this._duration), this._source.onloadedmetadata = () => {
1999
+ n && console.assert(n > t, "End time is before start time"), this._speed = r, this._volume = a, this._loop = !!i, this._muted = o, this.refresh(), this.loop && n !== null && (console.warn("Looping not support when specifying an \"end\" time"), this.loop = !1), this._start = t, this._end = n || this._duration, this._start = Math.max(0, this._start - Lt.PADDING), this._end = Math.min(this._end + Lt.PADDING, this._duration), this._source.onloadedmetadata = () => {
2000
2000
  this._source && (this._source.currentTime = t, this._source.onloadedmetadata = null, this.emit("progress", t / this._duration, this._duration), d.shared.add(this._onUpdate, this));
2001
2001
  }, this._source.onended = this._onComplete.bind(this), this._source.play(), this.emit("start");
2002
2002
  }
@@ -2014,7 +2014,7 @@ var It = class extends i {
2014
2014
  toString() {
2015
2015
  return `[HTMLAudioInstance id=${this.id}]`;
2016
2016
  }
2017
- }, Rt = W;
2017
+ }, Rt = Lt;
2018
2018
  Rt.PADDING = .1;
2019
2019
  //#endregion
2020
2020
  //#region ../../node_modules/.pnpm/@pixi+sound@6.0.1_pixi.js@8.20.0/node_modules/@pixi/sound/lib/htmlaudio/HTMLAudioMedia.mjs
@@ -2184,7 +2184,7 @@ var Ut = 0, Wt = class extends i {
2184
2184
  let e = this._media.context, t = this._media.parent;
2185
2185
  this._source.loop = this._loop || t.loop;
2186
2186
  let n = e.volume * +!e.muted, r = t.volume * +!t.muted, i = this._volume * +!this._muted;
2187
- V.setParamValue(this._gain.gain, i * r * n), V.setParamValue(this._source.playbackRate, this._speed * t.speed * e.speed), this.applyFilters();
2187
+ H.setParamValue(this._gain.gain, i * r * n), H.setParamValue(this._source.playbackRate, this._speed * t.speed * e.speed), this.applyFilters();
2188
2188
  }
2189
2189
  applyFilters() {
2190
2190
  if (this._filters?.length) {
@@ -2312,7 +2312,7 @@ var Ut = 0, Wt = class extends i {
2312
2312
  }
2313
2313
  cloneBufferSource() {
2314
2314
  let e = this.bufferSource, t = this.context.audioContext.createBufferSource();
2315
- t.buffer = e.buffer, V.setParamValue(t.playbackRate, e.playbackRate.value), t.loop = e.loop;
2315
+ t.buffer = e.buffer, H.setParamValue(t.playbackRate, e.playbackRate.value), t.loop = e.loop;
2316
2316
  let n = this.context.audioContext.createGain();
2317
2317
  return t.connect(n), n.connect(this.destination), {
2318
2318
  source: t,
@@ -2399,7 +2399,7 @@ var Jt = class {
2399
2399
  loaded: null,
2400
2400
  loop: !1,
2401
2401
  ...t
2402
- }, Object.freeze(t), new q(B().useLegacy ? new zt() : new Jt(), t);
2402
+ }, Object.freeze(t), new q(V().useLegacy ? new zt() : new Jt(), t);
2403
2403
  }
2404
2404
  constructor(e, t) {
2405
2405
  this.media = e, this.options = t, this._instances = [], this._sprites = {}, this.media.init(this);
@@ -2415,7 +2415,7 @@ var Jt = class {
2415
2415
  return t.url;
2416
2416
  }
2417
2417
  get context() {
2418
- return B().context;
2418
+ return V().context;
2419
2419
  }
2420
2420
  pause() {
2421
2421
  return this.isPlaying = !1, this.paused = !0, this;
@@ -2647,7 +2647,7 @@ var Yt = class e extends Gt {
2647
2647
  this.init();
2648
2648
  }
2649
2649
  init() {
2650
- return this.supported && (this._webAudioContext = new Yt()), this._htmlAudioContext = new It(), this._sounds = {}, this.useLegacy = !this.supported, this;
2650
+ return this.supported && (this._webAudioContext = new Yt()), this._htmlAudioContext = new Ft(), this._sounds = {}, this.useLegacy = !this.supported, this;
2651
2651
  }
2652
2652
  get context() {
2653
2653
  return this._context;
@@ -2799,17 +2799,17 @@ var Yt = class e extends Gt {
2799
2799
  e ? r(e) : n(i), t.data?.loaded?.(e, i);
2800
2800
  }
2801
2801
  }));
2802
- return B().add(Zt(t), n), n;
2802
+ return V().add(Zt(t), n), n;
2803
2803
  },
2804
2804
  async unload(e, t) {
2805
- B().remove(Zt(t));
2805
+ V().remove(Zt(t));
2806
2806
  }
2807
2807
  }
2808
2808
  };
2809
2809
  ee.add(Qt);
2810
2810
  //#endregion
2811
2811
  //#region ../../node_modules/.pnpm/@pixi+sound@6.0.1_pixi.js@8.20.0/node_modules/@pixi/sound/lib/index.mjs
2812
- var Y = Pt(new Xt());
2812
+ var Y = Nt(new Xt());
2813
2813
  //#endregion
2814
2814
  //#region src/plugins/audio/AudioManagerPlugin.ts
2815
2815
  Y.add = function(e, t) {
@@ -2934,14 +2934,14 @@ var $t = class extends N {
2934
2934
  let n = e?.destination;
2935
2935
  return !n?.context || n.context === t;
2936
2936
  });
2937
- return n.length !== e.length && x.error("AudioManager: ignoring filter(s) built on a different AudioContext — playing dry. Build filter nodes on `app.audio.audioContext` (an app bundling its own copy of @pixi/sound gets a separate context)."), n.length ? n : void 0;
2937
+ return n.length !== e.length && C.error("AudioManager: ignoring filter(s) built on a different AudioContext — playing dry. Build filter nodes on `app.audio.audioContext` (an app bundling its own copy of @pixi/sound gets a separate context)."), n.length ? n : void 0;
2938
2938
  }
2939
2939
  async play(e, t = "sfx", n) {
2940
2940
  this._idMap.has(e) && (e = this._idMap.get(e));
2941
2941
  let r = this._channels.get(t);
2942
2942
  if (r) {
2943
2943
  e = this._verifySoundId(e);
2944
- let i = r.add(e, new Mt(e, r, this)), a = (n?.volume ?? 1) * r.volume * this.masterVolume;
2944
+ let i = r.add(e, new B(e, r, this)), a = (n?.volume ?? 1) * r.volume * this.masterVolume;
2945
2945
  return i.media = await Y.play(e, {
2946
2946
  ...n,
2947
2947
  filters: this._usableFilters(n?.filters),
@@ -2963,7 +2963,7 @@ var $t = class extends N {
2963
2963
  }
2964
2964
  async fadeIn(e, t = "music", n) {
2965
2965
  let r = this._channels.get(t);
2966
- r && (e = this._verifySoundId(e)), r?.get(e) || await this.play(e, t, { volume: 0 }), n?.volume === 0 && x.warn("fadeIn volume is 0", e, t, n);
2966
+ r && (e = this._verifySoundId(e)), r?.get(e) || await this.play(e, t, { volume: 0 }), n?.volume === 0 && C.warn("fadeIn volume is 0", e, t, n);
2967
2967
  let i = Object.assign({
2968
2968
  volume: n?.volume ?? 1,
2969
2969
  duration: 1,
@@ -2972,7 +2972,7 @@ var $t = class extends N {
2972
2972
  return this.fade(e, t, i);
2973
2973
  }
2974
2974
  async fadeOut(e, t = "music", n = { volume: 0 }) {
2975
- n ||= {}, n?.volume === void 0 && (n.volume = 0), n?.volume > 0 && x.warn("fadeOut volume should probably be 0", e, t, n);
2975
+ n ||= {}, n?.volume === void 0 && (n.volume = 0), n?.volume > 0 && C.warn("fadeOut volume should probably be 0", e, t, n);
2976
2976
  let r = Object.assign({
2977
2977
  volume: 0,
2978
2978
  duration: 1,
@@ -3025,7 +3025,7 @@ var $t = class extends N {
3025
3025
  ...n,
3026
3026
  autoPlay: !1
3027
3027
  };
3028
- let i = e.add(r, new Mt(r, e, this));
3028
+ let i = e.add(r, new B(r, e, this));
3029
3029
  i.media = t.instances[0], i.pause();
3030
3030
  } else throw Error(`Channel ${t} does not exist.`);
3031
3031
  }
@@ -3160,7 +3160,7 @@ var $t = class extends N {
3160
3160
  } else e = this.parent.toLocal(this.focusTarget.getGlobalPosition());
3161
3161
  let t = this.focusTarget.getFocusPosition();
3162
3162
  if (t) {
3163
- let n = Ke(t);
3163
+ let n = Ge(t);
3164
3164
  e.x += n.x, e.y += n.y;
3165
3165
  }
3166
3166
  this.position.set(e.x, e.y);
@@ -3255,7 +3255,7 @@ var $t = class extends N {
3255
3255
  (t === void 0 || t == null) && (t = this._currentLayerId ?? null);
3256
3256
  let r = this._layers.get(t);
3257
3257
  if (!r) {
3258
- x.error(`Layer with ID ${t} does not exist.`);
3258
+ C.error(`Layer with ID ${t} does not exist.`);
3259
3259
  return;
3260
3260
  }
3261
3261
  Array.isArray(e) || (e = [e]), e.forEach((e, t) => {
@@ -3282,12 +3282,12 @@ var $t = class extends N {
3282
3282
  addFocusLayer(e, t = !0, n) {
3283
3283
  e === void 0 && (e = this._layers.size);
3284
3284
  let r;
3285
- return this._layers.has(e) ? (x.error(`Layer with ID ${e} already exists.`), r = this._layers.get(e)) : (r = new tn(e), this._layers.set(e, r)), (t || this._currentLayerId === null) && this.setFocusLayer(e), n && this.addFocusable(n, e), r;
3285
+ return this._layers.has(e) ? (C.error(`Layer with ID ${e} already exists.`), r = this._layers.get(e)) : (r = new tn(e), this._layers.set(e, r)), (t || this._currentLayerId === null) && this.setFocusLayer(e), n && this.addFocusable(n, e), r;
3286
3286
  }
3287
3287
  removeFocusLayer(e, t = !0) {
3288
3288
  if (e === void 0 && t) return this._removeTopLayer();
3289
- this._layers.has(e) || x.warn(`Layer with ID ${e} does not exist.`);
3290
- let n = De(this._layers, e)?.[0];
3289
+ this._layers.has(e) || C.warn(`Layer with ID ${e} does not exist.`);
3290
+ let n = Te(this._layers, e)?.[0];
3291
3291
  this._layers.delete(e), this._postDelete(n);
3292
3292
  }
3293
3293
  restart(e = !1) {
@@ -3363,7 +3363,7 @@ var $t = class extends N {
3363
3363
  _next() {
3364
3364
  let e = this._getCurrentLayer()?.next();
3365
3365
  if (!e) {
3366
- x.error("FocusManager:: _next():: No focusable found in the current layer.");
3366
+ C.error("FocusManager:: _next():: No focusable found in the current layer.");
3367
3367
  return;
3368
3368
  }
3369
3369
  this._setTarget(e);
@@ -3371,7 +3371,7 @@ var $t = class extends N {
3371
3371
  _prev() {
3372
3372
  let e = this._getCurrentLayer()?.prev();
3373
3373
  if (!e) {
3374
- x.error("FocusManager:: _prev():: No focusable found in the current layer.");
3374
+ C.error("FocusManager:: _prev():: No focusable found in the current layer.");
3375
3375
  return;
3376
3376
  }
3377
3377
  this._setTarget(e);
@@ -3389,7 +3389,7 @@ var $t = class extends N {
3389
3389
  return this._currentLayerId == null ? null : this._layers.get(this._currentLayerId) || null;
3390
3390
  }
3391
3391
  _removeTopLayer() {
3392
- let e = ke(this._layers)?.[0], t = De(this._layers, e)?.[0];
3392
+ let e = De(this._layers)?.[0], t = Te(this._layers, e)?.[0];
3393
3393
  e !== void 0 && (this._layers.delete(e), this._postDelete(t));
3394
3394
  }
3395
3395
  _postDelete(e) {
@@ -3399,7 +3399,7 @@ var $t = class extends N {
3399
3399
  let n = this._getCurrentLayer(), r = this._focusTarget;
3400
3400
  if (this._focusTarget = e, r && this._active && this._clearFocusTarget(r), this.app.renderer.accessibility.isActive || this._keyboardActive) this._focusTarget ? (this._active ||= !0, this._options.usePixiAccessibility && !this._focusTarget._accessibleDiv && this.app.renderer.accessibility.postrender(), this._options.usePixiAccessibility && this.app.ticker.addOnce(() => {
3401
3401
  this._focusTarget?._accessibleDiv?.focus();
3402
- }), n?.hasFocusable(e) ? this._focusTarget && (this._focusTarget.focusIn(), this._focusTarget.isFocused = !0, this._focusTarget.onFocusIn.emit(this._focusTarget), n.setCurrentFocusable(this._focusTarget), this._updateOutliner()) : x.warn("The focusable", e, `does not exist on the current focus layer: ${this._currentLayerId}`)) : this._focusOutliner.clear();
3402
+ }), n?.hasFocusable(e) ? this._focusTarget && (this._focusTarget.focusIn(), this._focusTarget.isFocused = !0, this._focusTarget.onFocusIn.emit(this._focusTarget), n.setCurrentFocusable(this._focusTarget), this._updateOutliner()) : C.warn("The focusable", e, `does not exist on the current focus layer: ${this._currentLayerId}`)) : this._focusOutliner.clear();
3403
3403
  else if (this._focusOutliner.clear(), this._active && t) {
3404
3404
  this._active = !1, this.onFocusManagerDeactivated.emit();
3405
3405
  return;
@@ -3594,9 +3594,9 @@ var dn = class extends N {
3594
3594
  }
3595
3595
  t(e, t, n = this._locale) {
3596
3596
  let r = this._dicts[n];
3597
- if (!r) return x.error(`i18n:: No dictionary loaded for current locale: ${n}`), e;
3597
+ if (!r) return C.error(`i18n:: No dictionary loaded for current locale: ${n}`), e;
3598
3598
  let i = un(r, e), a = typeof i == "string" ? i : void 0;
3599
- if (!a) return x.error(`i18n:: No result found for the key ${e} in the locale: ${this._locale}`), e;
3599
+ if (!a) return C.error(`i18n:: No result found for the key ${e} in the locale: ${this._locale}`), e;
3600
3600
  let o = t?.variant;
3601
3601
  if (a = a.replace(/\[(.*?)\]/g, (e, t) => {
3602
3602
  let n = t.split("|");
@@ -3619,7 +3619,7 @@ var dn = class extends N {
3619
3619
  }
3620
3620
  parse(e, t = this._locale) {
3621
3621
  let n = this._dicts[t];
3622
- if (!n) return x.error(`i18n:: No dictionary loaded for current locale: ${this._locale}`), "";
3622
+ if (!n) return C.error(`i18n:: No dictionary loaded for current locale: ${this._locale}`), "";
3623
3623
  let r = e, i = r.match(/{(.*?)}/g);
3624
3624
  return i && i.forEach((e) => {
3625
3625
  let t = e.slice(1, -1);
@@ -3629,10 +3629,10 @@ var dn = class extends N {
3629
3629
  async loadLocale(e) {
3630
3630
  let n = this._options.files.find((t) => e === t.id);
3631
3631
  if (!n) {
3632
- x.error(`i18n:: Could not find locale file for ${e}`);
3632
+ C.error(`i18n:: Could not find locale file for ${e}`);
3633
3633
  return;
3634
3634
  }
3635
- this._dicts[e] = n.json ? await t.load(n.json) : await T(n);
3635
+ this._dicts[e] = n.json ? await t.load(n.json) : await D(n);
3636
3636
  }
3637
3637
  getCoreFunctions() {
3638
3638
  return [
@@ -3766,7 +3766,7 @@ var yn = class {
3766
3766
  this.combinations = n, this.combinationsMap = r, this.activeDownInputs = i, this.activeUpInputs = hn(this.upSection, e, t, this._warnMissingAction);
3767
3767
  }
3768
3768
  _warnMissingAction(e) {
3769
- this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), x.warn(`${this.logLabel}: scheme references unknown action "${e}"`));
3769
+ this._warnedMissingActions.has(e) || (this._warnedMissingActions.add(e), C.warn(`${this.logLabel}: scheme references unknown action "${e}"`));
3770
3770
  }
3771
3771
  }, xn = class extends bn {
3772
3772
  constructor() {
@@ -4291,7 +4291,7 @@ var jn = [
4291
4291
  }
4292
4292
  async hidePopup(e, t) {
4293
4293
  let n = this._activePopups.get(e);
4294
- if (n) return n.beforeHide(), await n.hide(), this.view.removeChild(n), this._activePopups.delete(e), this._currentPopupId = ke(this._activePopups)?.[0] || void 0, new Promise((r) => {
4294
+ if (n) return n.beforeHide(), await n.hide(), this.view.removeChild(n), this._activePopups.delete(e), this._currentPopupId = De(this._activePopups)?.[0] || void 0, new Promise((r) => {
4295
4295
  this.app.ticker.addOnce(() => {
4296
4296
  this.onHidePopup.emit({
4297
4297
  id: e,
@@ -4454,7 +4454,19 @@ var jn = [
4454
4454
  color: 4095
4455
4455
  });
4456
4456
  }
4457
- }, In = {
4457
+ }, In = "caper-screen-debug", Ln = "caper:screen-debug";
4458
+ function Rn() {
4459
+ if (typeof window > "u") return !1;
4460
+ let e = new URLSearchParams(window.location.search).get(In), t = e === "1" || e === "true", n = e === "0" || e === "false";
4461
+ try {
4462
+ return t ? (window.localStorage.setItem(Ln, "1"), !0) : n ? (window.localStorage.removeItem(Ln), !1) : window.localStorage.getItem(Ln) === "1";
4463
+ } catch {
4464
+ return t;
4465
+ }
4466
+ }
4467
+ //#endregion
4468
+ //#region src/plugins/SceneManagerPlugin.ts
4469
+ var zn = {
4458
4470
  view: null,
4459
4471
  hideWhen: "firstSceneEnter",
4460
4472
  zOrder: "top",
@@ -4462,7 +4474,7 @@ var jn = [
4462
4474
  assets: [],
4463
4475
  bundles: []
4464
4476
  }
4465
- }, Ln = class extends N {
4477
+ }, Bn = class extends N {
4466
4478
  constructor() {
4467
4479
  super(), this.id = "scenes", this.onSceneChangeStart = new j(), this.onSceneChangeComplete = new j(), this.view = new n(), this.isFirstScene = !0, this.list = [], this.groupOrder = [], this.debugGroupsList = [], this._sceneModules = /* @__PURE__ */ new Map(), this._pendingLoadProps = void 0, this._lastScene = null, this._defaultLoadMethod = "immediate", this._debugVisible = !1, this._useHash = !1, _(this);
4468
4480
  }
@@ -4473,14 +4485,14 @@ var jn = [
4473
4485
  this._defaultLoadMethod = e;
4474
4486
  }
4475
4487
  async initialize(e, t) {
4476
- if (this._debugVisible = this.app.config?.showSceneDebugMenu === !0 || v && this.app.config?.showSceneDebugMenu !== !1, this._useHash = t.config?.useHash === !0 || this._debugVisible, this.view.sortableChildren = !0, this.list = (Caper.get("sceneList") || []).filter((e) => e.active !== !1), this.groupOrder = t.config?.sceneGroupOrder || [], (this._debugVisible || this._useHash) && (this.defaultScene = this.getSceneFromHash() || ""), !this.splash) {
4488
+ if (this._debugVisible = this.app.config?.showSceneDebugMenu === !0 || y && this.app.config?.showSceneDebugMenu !== !1, this._useHash = t.config?.useHash === !0 || this._debugVisible, this.view.sortableChildren = !0, this.list = (Caper.get("sceneList") || []).filter((e) => e.active !== !1), this.groupOrder = t.config?.sceneGroupOrder || [], (this._debugVisible || this._useHash) && (this.defaultScene = this.getSceneFromHash() || ""), !this.splash) {
4477
4489
  this.splash = {
4478
4490
  view: null,
4479
4491
  hideWhen: "firstSceneEnter",
4480
4492
  zOrder: "top"
4481
4493
  };
4482
4494
  let e = {
4483
- ...In,
4495
+ ...zn,
4484
4496
  ...t.config?.splash ?? {}
4485
4497
  };
4486
4498
  e.view && (this.splash.view = typeof e.view == "function" ? new e.view() : e.view), this.splash.preload = e.preload;
@@ -4501,12 +4513,12 @@ var jn = [
4501
4513
  let n = typeof e == "string" ? e : e.id, r = typeof e == "string" ? this._defaultLoadMethod : e?.method || this._defaultLoadMethod;
4502
4514
  this.currentScene && (this._lastScene = this.currentScene);
4503
4515
  let i = this.list.find((e) => e.id === n);
4504
- if (!i) throw w({ message: `Scene item not found for id ${n}` }), Error(`Scene item not found for id ${n}`);
4516
+ if (!i) throw E({ message: `Scene item not found for id ${n}` }), Error(`Scene item not found for id ${n}`);
4505
4517
  if (i?.plugins?.length) for (let e of i.plugins) {
4506
4518
  let t = this.app.getUnloadedPlugin(e);
4507
4519
  t && await this.app.loadPlugin(t);
4508
4520
  }
4509
- switch (this._currentSceneId = n, this._queue = we(this._createCurrentScene), r) {
4521
+ switch (this._currentSceneId = n, this._queue = Se(this._createCurrentScene), r) {
4510
4522
  case "exitEnter":
4511
4523
  this._queue.add(this._exitLastScene, this._destroyLastScene, this._unloadLastScene, this._loadCurrentScene, this._initializeCurrentScene, this._addCurrentScene, this._enterCurrentScene, this._startCurrentScene);
4512
4524
  break;
@@ -4552,7 +4564,7 @@ var jn = [
4552
4564
  let e = this.list.find((e) => e.id === this._currentSceneId), t;
4553
4565
  if (this._sceneModules.has(this._currentSceneId)) t = this._sceneModules.get(this._currentSceneId);
4554
4566
  else {
4555
- let n = await T(e);
4567
+ let n = await D(e);
4556
4568
  if (!n) throw Error(`Couldn't load ${this._currentSceneId}"`);
4557
4569
  t = n[this._currentSceneId] ? n[this._currentSceneId] : n, t && this._sceneModules.set(this._currentSceneId, t);
4558
4570
  }
@@ -4652,7 +4664,7 @@ var jn = [
4652
4664
  };
4653
4665
  //#endregion
4654
4666
  //#region src/plugins/TimerPlugin.ts
4655
- function Rn() {
4667
+ function Vn() {
4656
4668
  try {
4657
4669
  let e = new Blob(["\n const timers = new Map();\n\n self.onmessage = (e) => {\n const { type, timerId, options, timeAdjustment } = e.data;\n \n switch (type) {\n case 'start': {\n let timer = timers.get(timerId);\n \n if (timer) {\n // Resume existing timer\n timer.startTime = performance.now() - (timer.pausedTime || 0);\n timer.interval = createInterval(timer, options, timerId);\n } else {\n // Create new timer\n timer = {\n startTime: performance.now(),\n duration: options.duration,\n loopCount: 0,\n pausedTime: 0,\n options // Store options with the timer\n };\n timer.interval = createInterval(timer, options, timerId);\n timers.set(timerId, timer);\n }\n break;\n }\n \n case 'stop': {\n const timer = timers.get(timerId);\n if (timer) {\n clearInterval(timer.interval);\n timer.interval = null;\n timer.pausedTime = performance.now() - timer.startTime;\n }\n break;\n }\n\n case 'reset': {\n const timer = timers.get(timerId);\n if (timer) {\n timer.startTime = performance.now();\n timer.loopCount = 0;\n timer.pausedTime = 0;\n }\n break;\n }\n\n case 'adjustTime': {\n const timer = timers.get(timerId);\n if (timer) {\n if (timer.duration !== undefined) {\n // For countdown timers, adjust the duration\n timer.duration = Math.max(0, timer.duration + timeAdjustment);\n } else {\n // For count-up timers, adjust the start time\n timer.startTime -= timeAdjustment;\n }\n }\n break;\n }\n }\n };\n\n function createInterval(timer, options, timerId) {\n return setInterval(() => {\n const currentTime = performance.now();\n const totalElapsed = currentTime - timer.startTime;\n \n if (timer.duration !== undefined) {\n // Calculate elapsed time within the current loop\n const loopElapsed = totalElapsed - (timer.loopCount * timer.duration);\n const remaining = Math.max(0, timer.duration - loopElapsed);\n \n self.postMessage({ type: 'tick', timerId, time: remaining });\n \n if (remaining <= 0) {\n self.postMessage({ type: 'complete', timerId, time: 0 });\n \n if (options.loop) {\n timer.loopCount++;\n } else {\n clearInterval(timer.interval);\n timers.delete(timerId);\n }\n }\n } else {\n self.postMessage({ type: 'tick', timerId, time: totalElapsed });\n }\n }, options.workerInterval || 16);\n }\n "], { type: "application/javascript" });
4658
4670
  return new Worker(URL.createObjectURL(e));
@@ -4660,7 +4672,7 @@ function Rn() {
4660
4672
  return null;
4661
4673
  }
4662
4674
  }
4663
- function zn(e, t = "mm:ss", n = "string") {
4675
+ function Hn(e, t = "mm:ss", n = "string") {
4664
4676
  let r = Math.floor(e / 1e3), i = Math.floor(r / 3600), a = Math.floor(r % 3600 / 60), o = r % 60, s = Math.floor(e % 1e3 / 10);
4665
4677
  if (n === "string") switch (t) {
4666
4678
  case "hh:mm:ss": return `${i.toString().padStart(2, "0")}:${a.toString().padStart(2, "0")}:${o.toString().padStart(2, "0")}`;
@@ -4675,9 +4687,9 @@ function zn(e, t = "mm:ss", n = "string") {
4675
4687
  ms: s
4676
4688
  };
4677
4689
  }
4678
- var Bn = class {
4690
+ var Un = class {
4679
4691
  constructor(e = {}, t) {
4680
- this.options = e, this.plugin = t, this.startTime = performance.now(), this.pausedTime = 0, this.isPaused = !0, this.isDestroyed = !1, this.timerId = ue(), e.useWorker && !t.hasWorkerSupport && (x.warn("Web Worker support not available, falling back to main thread timer"), e.useWorker = !1), this.isWorkerTimer = !!e.useWorker, e.autoStart && this.start();
4692
+ this.options = e, this.plugin = t, this.startTime = performance.now(), this.pausedTime = 0, this.isPaused = !0, this.isDestroyed = !1, this.timerId = ue(), e.useWorker && !t.hasWorkerSupport && (C.warn("Web Worker support not available, falling back to main thread timer"), e.useWorker = !1), this.isWorkerTimer = !!e.useWorker, e.autoStart && this.start();
4681
4693
  }
4682
4694
  start() {
4683
4695
  this.isPaused && (this.isPaused = !1, this.isWorkerTimer ? this.plugin.startWorkerTimer(this.timerId, this.options) : this.startTime = performance.now() - this.pausedTime);
@@ -4723,7 +4735,7 @@ var Bn = class {
4723
4735
  removeTime(e) {
4724
4736
  return this.addTime(-e);
4725
4737
  }
4726
- }, Vn = class extends N {
4738
+ }, Wn = class extends N {
4727
4739
  get hasWorkerSupport() {
4728
4740
  return this._hasWorkerSupport;
4729
4741
  }
@@ -4765,7 +4777,7 @@ var Bn = class {
4765
4777
  this.addTickerCallback(this.update), this.initWorker();
4766
4778
  }
4767
4779
  initWorker() {
4768
- typeof Worker < "u" ? (this.worker = Rn(), this.worker ? (this._hasWorkerSupport = !0, this.worker.onmessage = this.handleWorkerMessage) : (x.warn("Failed to create Web Worker for TimerPlugin, all timers will run on main thread"), this._hasWorkerSupport = !1)) : (x.warn("Web Workers not supported in this environment, all timers will run on main thread"), this._hasWorkerSupport = !1);
4780
+ typeof Worker < "u" ? (this.worker = Vn(), this.worker ? (this._hasWorkerSupport = !0, this.worker.onmessage = this.handleWorkerMessage) : (C.warn("Failed to create Web Worker for TimerPlugin, all timers will run on main thread"), this._hasWorkerSupport = !1)) : (C.warn("Web Workers not supported in this environment, all timers will run on main thread"), this._hasWorkerSupport = !1);
4769
4781
  }
4770
4782
  startWorkerTimer(e, t) {
4771
4783
  this.worker && (this.timerCallbacks.set(e, t), this.worker.postMessage({
@@ -4797,7 +4809,7 @@ var Bn = class {
4797
4809
  for (let e of this.mainThreadTimers) e.update();
4798
4810
  }
4799
4811
  createTimer(e) {
4800
- let t = new Bn(e, this);
4812
+ let t = new Un(e, this);
4801
4813
  return t.isWorker() ? this.workerTimers.add(t) : this.mainThreadTimers.add(t), this.onTimerCreated.emit(t), t;
4802
4814
  }
4803
4815
  destroyTimer(e) {
@@ -4822,9 +4834,9 @@ var Bn = class {
4822
4834
  timeAdjustment: t
4823
4835
  });
4824
4836
  }
4825
- }, Hn = class extends N {
4837
+ }, Gn = class extends N {
4826
4838
  constructor() {
4827
- super(), this.id = "webEvents", this.onResize = new j(), this.onVisibilityChanged = new j(), this.onOrientationChanged = new j(), this._debouncedEmitVisibility = Pe((e) => {
4839
+ super(), this.id = "webEvents", this.onResize = new j(), this.onVisibilityChanged = new j(), this.onOrientationChanged = new j(), this._debouncedEmitVisibility = Me((e) => {
4828
4840
  this.onVisibilityChanged.emit(e);
4829
4841
  }, 1), this._orientationTimeoutId = null, _(this);
4830
4842
  }
@@ -4871,13 +4883,13 @@ var Bn = class {
4871
4883
  return;
4872
4884
  }
4873
4885
  this._orientationTimeoutId !== null && clearTimeout(this._orientationTimeoutId), this._orientationTimeoutId = setTimeout(() => {
4874
- this._orientationTimeoutId = null, t = qe(), this.onOrientationChanged.emit({
4886
+ this._orientationTimeoutId = null, t = Ke(), this.onOrientationChanged.emit({
4875
4887
  orientation: t,
4876
4888
  screenOrientation: n
4877
4889
  });
4878
4890
  }, 10);
4879
4891
  }
4880
- }, Un = class extends N {
4892
+ }, Kn = class extends N {
4881
4893
  constructor(...e) {
4882
4894
  super(...e), this.name = "lookup", this.pathToContainer = /* @__PURE__ */ new Map(), this.containerToPath = /* @__PURE__ */ new Map();
4883
4895
  }
@@ -4934,15 +4946,15 @@ var Bn = class {
4934
4946
  for (; n && n.label && (t.unshift(n.label), n = n.parent, n?.label !== "Stage"););
4935
4947
  return t.length > 0 ? t.join("/") : "";
4936
4948
  }
4937
- }, Wn = [
4949
+ }, qn = [
4938
4950
  {
4939
4951
  id: "lookup",
4940
- module: Un,
4952
+ module: Kn,
4941
4953
  namedExport: "LookupPlugin"
4942
4954
  },
4943
4955
  {
4944
4956
  id: "webEvents",
4945
- module: Hn,
4957
+ module: Gn,
4946
4958
  namedExport: "WebEventsPlugin"
4947
4959
  },
4948
4960
  {
@@ -4967,7 +4979,7 @@ var Bn = class {
4967
4979
  },
4968
4980
  {
4969
4981
  id: "scenes",
4970
- module: Ln,
4982
+ module: Bn,
4971
4983
  namedExport: "SceneManagerPlugin"
4972
4984
  },
4973
4985
  {
@@ -5012,16 +5024,16 @@ var Bn = class {
5012
5024
  },
5013
5025
  {
5014
5026
  id: "timers",
5015
- module: Vn,
5027
+ module: Wn,
5016
5028
  namedExport: "TimerPlugin"
5017
5029
  }
5018
5030
  ];
5019
5031
  //#endregion
5020
5032
  //#region src/core/Application.ts
5021
- function Gn() {
5033
+ function Jn() {
5022
5034
  return typeof window < "u" ? window.devicePixelRatio > 1 ? 2 : 1 : 2;
5023
5035
  }
5024
- var Kn = {
5036
+ var Yn = {
5025
5037
  antialias: !1,
5026
5038
  autoStart: !0,
5027
5039
  resizeToContainer: !0,
@@ -5059,10 +5071,10 @@ var Kn = {
5059
5071
  wordWrap: !1,
5060
5072
  wordWrapWidth: 100
5061
5073
  },
5062
- resolution: Gn(),
5063
- useHash: v,
5064
- showSceneDebugMenu: v,
5065
- showStats: v,
5074
+ resolution: Jn(),
5075
+ useHash: y,
5076
+ showSceneDebugMenu: y,
5077
+ showStats: y,
5066
5078
  useStore: !0,
5067
5079
  useSpine: !1,
5068
5080
  useLayout: !1,
@@ -5071,12 +5083,12 @@ var Kn = {
5071
5083
  scenes: [],
5072
5084
  defaultSceneLoadMethod: "immediate",
5073
5085
  assets: { manifest: "./assets.json" }
5074
- }, qn = {
5086
+ }, Xn = {
5075
5087
  pauseAudio: !0,
5076
5088
  pauseAnimations: !0,
5077
5089
  pauseTicker: !0,
5078
5090
  pauseTimers: !0
5079
- }, Jn = {
5091
+ }, Zn = {
5080
5092
  pauseAudio: !1,
5081
5093
  pauseAnimations: !1,
5082
5094
  pauseTicker: !1,
@@ -5102,7 +5114,7 @@ var Kn = {
5102
5114
  }
5103
5115
  pause(e) {
5104
5116
  this._paused = !0, this._pauseConfig = {
5105
- ...e ? Jn : qn,
5117
+ ...e ? Zn : Xn,
5106
5118
  ...e
5107
5119
  }, this._pauseConfig.pauseAudio && this.audio.pause(), this._pauseConfig.pauseAnimations && p?.globalTimeline?.pause(), this._pauseConfig.pauseTicker && this.ticker.stop(), this._pauseConfig.pauseTimers && this.timers.pauseAllTimers(), this._pauseConfig.pauseOther && this._pauseConfig.pauseOther.forEach((e) => {
5108
5120
  typeof e?.pause == "function" && e.pause();
@@ -5269,13 +5281,13 @@ var Kn = {
5269
5281
  return "ontouchstart" in window || navigator.maxTouchPoints > 0;
5270
5282
  }
5271
5283
  get signal() {
5272
- return Yn;
5284
+ return Qn;
5273
5285
  }
5274
5286
  get signals() {
5275
5287
  return this.signal;
5276
5288
  }
5277
5289
  get func() {
5278
- return Xn;
5290
+ return $n;
5279
5291
  }
5280
5292
  get exec() {
5281
5293
  return this.func;
@@ -5285,7 +5297,7 @@ var Kn = {
5285
5297
  return this.scenes.splash.view && e.push(this.scenes.splash.view), this.scenes.transition && e.push(this.scenes.transition), this.captions?.view && e.push(this.captions.view), e;
5286
5298
  }
5287
5299
  static getInstance() {
5288
- return r.instance || x.warn("Application not created yet"), r.instance;
5300
+ return r.instance || C.warn("Application not created yet"), r.instance;
5289
5301
  }
5290
5302
  destroy(e, t) {
5291
5303
  this._plugins.forEach((e) => {
@@ -5297,26 +5309,26 @@ var Kn = {
5297
5309
  }
5298
5310
  async initialize(e, t) {
5299
5311
  if (r.instance) throw Error("Application is already initialized");
5300
- if (r.instance = this, this.config = E(Kn, e), this.signals.onResize = this.onResize, e.container && (r.containerElement = e.container), x.initialize(this.config.logger), this.config.resolution !== 1 && this.config.resolution !== 2) {
5312
+ if (r.instance = this, this.config = Fe(Yn, e), this.signals.onResize = this.onResize, e.container && (r.containerElement = e.container), C.initialize(this.config.logger), this.config.resolution !== 1 && this.config.resolution !== 2) {
5301
5313
  let e = this.config.resolution;
5302
- this.config.resolution = Gn(), x.warn(`App resolution must be 1 or 2, setting to ${this.config.resolution} instead of ${e}. Modify your app config to set the resolution to 1 or 2.`);
5314
+ this.config.resolution = Jn(), C.warn(`App resolution must be 1 or 2, setting to ${this.config.resolution} instead of ${e}. Modify your app config to set the resolution to 1 or 2.`);
5303
5315
  }
5304
5316
  if (await this.boot(this.config), await this.initAssets(), await this.init(this.config), this.stage.label = "Stage", this.config.defaultTextStyle && (l.defaultTextStyle = {
5305
- ...Kn.defaultTextStyle,
5317
+ ...Yn.defaultTextStyle,
5306
5318
  ...this.config.defaultTextStyle
5307
5319
  }), this.config.defaultDropShadow && (l.defaultDropShadow = this.config.defaultDropShadow), t) t.appendChild(this.canvas), this.setContainer(t);
5308
5320
  else throw Error("No element found to append the view to.");
5309
- return await this.registerDefaultPlugins(), v && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await Je(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"), r.instance;
5321
+ return await this.registerDefaultPlugins(), y && this.getPlugin("DevToolsPlugin").initializeDevTools(this), this.signals.onLoadRequiredComplete.connectOnce(this.requiredAssetsLoaded), await this._setup(), this.plugins = await qe(this.config.plugins || []), await this.registerPlugins(), await this.setup(), await this.loadDefaultScene(), this.renderer.canvas.focus(), this.config.container && this.config.container.classList.add("loaded"), r.instance;
5310
5322
  }
5311
5323
  getPlugin(e, t = !1) {
5312
5324
  let n = this._plugins.get(e);
5313
- return !n && t && x.warn(`Plugin with name "${e}" not found.`), n;
5325
+ return !n && t && C.warn(`Plugin with name "${e}" not found.`), n;
5314
5326
  }
5315
5327
  async _postInitialize() {
5316
5328
  for (let e of this._plugins.values()) try {
5317
5329
  await e.postInitialize(this);
5318
5330
  } catch (t) {
5319
- w({
5331
+ E({
5320
5332
  message: `Plugin "${e.id}" failed in postInitialize: ${t instanceof Error ? t.message : String(t)}`,
5321
5333
  stack: t instanceof Error ? t.stack : void 0
5322
5334
  }), this.onPluginError.emit({
@@ -5347,7 +5359,7 @@ var Kn = {
5347
5359
  }
5348
5360
  async loadPlugin(e, t = !1) {
5349
5361
  if (this._plugins.has(e.id)) return await this.registerPlugin(this._plugins.get(e.id), e.options);
5350
- let n = new (await (T(e)))(e.id);
5362
+ let n = new (await (D(e)))(e.id);
5351
5363
  n.id !== e.id && (n.id = e.id);
5352
5364
  let r = e.options;
5353
5365
  return t && !r && (r = this.config[n.id]), await this.registerPlugin(n, r);
@@ -5369,42 +5381,42 @@ var Kn = {
5369
5381
  }
5370
5382
  async boot(e) {
5371
5383
  this.config = {
5372
- ...Kn,
5384
+ ...Yn,
5373
5385
  ...e
5374
5386
  }, await this.preInitialize(this.config);
5375
5387
  }
5376
5388
  async preInitialize(e) {
5377
5389
  let { id: t } = e;
5378
- this._appName = t, v && await this.loadPlugin({
5390
+ this._appName = t, y && await this.loadPlugin({
5379
5391
  id: "DevToolsPlugin",
5380
- module: () => import("./DevToolsPlugin-BS9idGRi.js"),
5392
+ module: () => import("./DevToolsPlugin-BTSkRsdS.js"),
5381
5393
  namedExport: "DevToolsPlugin"
5382
5394
  }), e.useLayout && await this.loadPlugin({
5383
5395
  id: "LayoutPlugin",
5384
- module: () => import("./LayoutPlugin-qQJ5qJud.js"),
5396
+ module: () => import("./LayoutPlugin-BDhSngz_.js"),
5385
5397
  namedExport: "LayoutPlugin"
5386
5398
  }), await this.loadPlugin({
5387
5399
  id: "GSAPPlugin",
5388
- module: () => import("./GSAPPlugin-DVDbDVP8.js"),
5400
+ module: () => import("./GSAPPlugin-BcL7vjyw.js"),
5389
5401
  namedExport: "GSAPPlugin"
5390
5402
  }), e.useSpine && await this.loadPlugin({
5391
5403
  id: "SpinePlugin",
5392
- module: () => import("./SpinePlugin-CPNRM2J1.js"),
5404
+ module: () => import("./SpinePlugin-CrQhaK6r.js"),
5393
5405
  namedExport: "SpinePlugin"
5394
5406
  }), this.config.useStore && (this._store = new lt(), this._store.initialize(this), await this.loadPlugin({
5395
5407
  id: "data",
5396
- module: () => import("./DataAdapter-BtNz4yi2.js").then((e) => e.n),
5408
+ module: () => import("./DataAdapter-Cra9dJ6W.js").then((e) => e.n),
5397
5409
  namedExport: "DataAdapter",
5398
5410
  options: this.config.data
5399
5411
  }));
5400
5412
  }
5401
5413
  async registerPlugin(e, t) {
5402
- if (this._plugins.has(e.id)) return x.warn(`Plugin with id "${e.id}" already registered. Not registering.`), e.initialize(t, this);
5414
+ if (this._plugins.has(e.id)) return C.warn(`Plugin with id "${e.id}" already registered. Not registering.`), e.initialize(t, this);
5403
5415
  e.registerCoreFunctions(), e.registerCoreSignals(), this._plugins.set(e.id, e);
5404
5416
  try {
5405
5417
  return await e.initialize(t, this);
5406
5418
  } catch (t) {
5407
- w({
5419
+ E({
5408
5420
  message: `Plugin "${e.id}" failed to initialize: ${t instanceof Error ? t.message : String(t)}`,
5409
5421
  stack: t instanceof Error ? t.stack : void 0
5410
5422
  }), this.onPluginError.emit({
@@ -5416,36 +5428,40 @@ var Kn = {
5416
5428
  }
5417
5429
  }
5418
5430
  async registerDefaultPlugins() {
5419
- for (let e = 0; e < Wn.length; e++) {
5420
- let t = Wn[e];
5431
+ for (let e = 0; e < qn.length; e++) {
5432
+ let t = qn[e];
5421
5433
  await this.loadPlugin(t, !0);
5422
5434
  }
5423
- (this.config.showStats === !0 || v && this.config.showStats !== !1) && await this.loadPlugin({
5435
+ (this.config.showStats === !0 || y && this.config.showStats !== !1) && await this.loadPlugin({
5424
5436
  id: "stats",
5425
- module: () => import("./StatsPlugin-BHihicBl.js"),
5437
+ module: () => import("./StatsPlugin-Cu625dmk.js"),
5426
5438
  namedExport: "StatsPlugin"
5439
+ }), Rn() && await this.loadPlugin({
5440
+ id: "screenDebug",
5441
+ module: () => import("./ScreenDebugPlugin-C6pxs_3O.js").then((e) => e.n),
5442
+ namedExport: "ScreenDebugPlugin"
5427
5443
  }), this.config.useVoiceover && (await this.loadPlugin({
5428
5444
  id: "voiceover",
5429
- module: () => import("./VoiceOverPlugin-BdTHxgku.js"),
5445
+ module: () => import("./VoiceOverPlugin-D4rfHFyJ.js"),
5430
5446
  namedExport: "VoiceOverPlugin",
5431
5447
  options: this.config.voiceover || void 0
5432
5448
  }), await this.loadPlugin({
5433
5449
  id: "captions",
5434
- module: () => import("./CaptionsPlugin-BtVJiQs_.js"),
5450
+ module: () => import("./CaptionsPlugin-Boj-gm3A.js"),
5435
5451
  namedExport: "CaptionsPlugin",
5436
5452
  options: this.config.captions || void 0
5437
5453
  }));
5438
5454
  }
5439
5455
  async registerPlugins() {
5440
5456
  if (!this.plugins?.length) return;
5441
- let e = Xe(this.plugins, new Set(this._plugins.keys()));
5457
+ let e = Ye(this.plugins, new Set(this._plugins.keys()));
5442
5458
  for (let t of e) t.autoLoad && await this.loadPlugin(t);
5443
5459
  }
5444
5460
  async requiredAssetsLoaded() {}
5445
5461
  async setup() {}
5446
5462
  async initAssets() {
5447
5463
  let e = this.config.assets?.initOptions || {}, n = this.config.assets?.manifest || e.manifest;
5448
- C(n) && (n = await n), e.manifest = n, e.basePath = e.basePath || "./assets", await t.init(e), this.manifest = t.resolver._manifest;
5464
+ T(n) && (n = await n), e.manifest = n, e.basePath = e.basePath || "./assets", await t.init(e), this.manifest = t.resolver._manifest;
5449
5465
  }
5450
5466
  async loadDefaultScene() {
5451
5467
  return this.scenes.loadDefaultScene();
@@ -5467,8 +5483,8 @@ var Kn = {
5467
5483
  _addSplash() {
5468
5484
  this.scenes.splash.view && (this.scenes.splash.view.label = "Splash", this.stage.addChild(this.scenes.splash.view));
5469
5485
  }
5470
- }, Yn = {}, Xn = {};
5486
+ }, Qn = {}, $n = {};
5471
5487
  //#endregion
5472
- export { qe as $, jt as A, be as At, F as B, fe as Bt, dn as C, we as Ct, en as D, S as Dt, nn as E, Ce as Et, vt as F, he as Ft, lt as G, le as Gt, ft as H, ue as Ht, bt as I, _e as It, O as J, j as K, yt as L, me as Lt, R as M, v as Mt, gt as N, ye as Nt, $t as O, x as Ot, _t as P, _ as Pt, Xe as Q, ht as R, g as Rt, Z as S, Te as St, on as T, C as Tt, N as U, h as Ut, pt as V, pe as Vt, M as W, se as Wt, Ye as X, Qe as Y, Je as Z, Tn as _, Ae as _t, Hn as a, Ge as at, xn as b, De as bt, zn as c, ze as ct, Nn as d, Ie as dt, Le as et, Q as f, Fe as ft, Dn as g, Me as gt, On as h, je as ht, Un as i, He as it, At as j, ve as jt, Mt as k, y as kt, Ln as l, Be as lt, An as m, Ne as mt, Yn as n, Ue as nt, Bn as o, Ve as ot, jn as p, Pe as pt, A as q, $ as r, We as rt, Vn as s, Ke as st, Xn as t, Re as tt, Fn as u, E as ut, Cn as v, ke as vt, cn as w, Se as wt, fn as x, T as xt, Sn as y, Oe as yt, mt as z, de as zt };
5488
+ export { Ye as $, B as A, b as At, mt as B, de as Bt, Z as C, Ce as Ct, nn as D, xe as Dt, on as E, T as Et, _t as F, _ as Ft, M as G, se as Gt, pt as H, pe as Ht, vt as I, he as It, A as J, lt as K, le as Kt, bt as L, _e as Lt, At as M, v as Mt, R as N, y as Nt, en as O, w as Ot, gt as P, ve as Pt, qe as Q, yt as R, me as Rt, fn as S, D as St, cn as T, be as Tt, ft as U, ue as Ut, F as V, fe as Vt, N as W, h as Wt, Qe as X, O as Y, Je as Z, Dn as _, Ae as _t, Gn as a, Ve as at, Sn as b, Ee as bt, Hn as c, Ge as ct, Fn as d, Fe as dt, Ke as et, Nn as f, Pe as ft, On as g, ke as gt, An as h, je as ht, Kn as i, Ue as it, jt as j, ye as jt, $t as k, C as kt, Bn as l, Re as lt, jn as m, Me as mt, Qn as n, Le as nt, Un as o, We as ot, Q as p, Ne as pt, j as q, $ as r, He as rt, Wn as s, Be as st, $n as t, Ie as tt, Rn as u, ze as ut, Tn as v, Oe as vt, dn as w, Se as wt, xn as x, Te as xt, Cn as y, De as yt, ht as z, g as zt };
5473
5489
 
5474
- //# sourceMappingURL=registries-DlqHRO90.js.map
5490
+ //# sourceMappingURL=registries-BmDw_GV1.js.map