@vectojs/core 1.9.2 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ var _chunkBA5HUUDFjs = require('./chunk-BA5HUUDF.js');
12
12
 
13
13
 
14
14
 
15
- var _chunkBPMNCGU7js = require('./chunk-BPMNCGU7.js');
15
+ var _chunkORCPCIJ7js = require('./chunk-ORCPCIJ7.js');
16
16
 
17
17
 
18
18
 
@@ -27,7 +27,7 @@ var _chunkBPMNCGU7js = require('./chunk-BPMNCGU7.js');
27
27
 
28
28
 
29
29
 
30
- var _chunkGKLTTGBRjs = require('./chunk-GKLTTGBR.js');
30
+ var _chunk2Z23LTH3js = require('./chunk-2Z23LTH3.js');
31
31
 
32
32
 
33
33
 
@@ -44,7 +44,7 @@ var PARTICLE_OFFSET_ORIGIN_X = 4;
44
44
  var PARTICLE_OFFSET_ORIGIN_Y = 5;
45
45
  var PARTICLE_OFFSET_SIZE = 6;
46
46
  var PARTICLE_OFFSET_LIFE = 7;
47
- var ComputeParticleEntity = (_class = class extends _chunkGKLTTGBRjs.Entity {
47
+ var ComputeParticleEntity = (_class = class extends _chunk2Z23LTH3js.Entity {
48
48
 
49
49
 
50
50
 
@@ -708,6 +708,8 @@ var Scene = (_class2 = class _Scene {
708
708
 
709
709
 
710
710
  __init44() {this.disableWindowResize = false}
711
+ /** See {@link SceneOptions.maxDPR}. `undefined` = uncapped (real DPR). */
712
+
711
713
  // WebGPU properties
712
714
  __init45() {this.destroyed = false}
713
715
  __init46() {this.device = null}
@@ -733,13 +735,75 @@ var Scene = (_class2 = class _Scene {
733
735
  __init59() {this.pointerLeaveListener = null}
734
736
  __init60() {this.hasWarnedZeroSize = false}
735
737
  __init61() {this.fontLoadHandler = null}
736
- constructor(canvas, options = {}) {;_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this);_class2.prototype.__init27.call(this);_class2.prototype.__init28.call(this);_class2.prototype.__init29.call(this);_class2.prototype.__init30.call(this);_class2.prototype.__init31.call(this);_class2.prototype.__init32.call(this);_class2.prototype.__init33.call(this);_class2.prototype.__init34.call(this);_class2.prototype.__init35.call(this);_class2.prototype.__init36.call(this);_class2.prototype.__init37.call(this);_class2.prototype.__init38.call(this);_class2.prototype.__init39.call(this);_class2.prototype.__init40.call(this);_class2.prototype.__init41.call(this);_class2.prototype.__init42.call(this);_class2.prototype.__init43.call(this);_class2.prototype.__init44.call(this);_class2.prototype.__init45.call(this);_class2.prototype.__init46.call(this);_class2.prototype.__init47.call(this);_class2.prototype.__init48.call(this);_class2.prototype.__init49.call(this);_class2.prototype.__init50.call(this);_class2.prototype.__init51.call(this);_class2.prototype.__init52.call(this);_class2.prototype.__init53.call(this);_class2.prototype.__init54.call(this);_class2.prototype.__init55.call(this);_class2.prototype.__init56.call(this);_class2.prototype.__init57.call(this);_class2.prototype.__init58.call(this);_class2.prototype.__init59.call(this);_class2.prototype.__init60.call(this);_class2.prototype.__init61.call(this);
738
+ // ── Dev-mode warning infrastructure ──────────────────────────────
739
+ //
740
+ // Enable with `Scene.devMode = true` or by setting `globalThis.__DEV__`.
741
+ // Auto-detected when `NODE_ENV === 'development'`.
742
+ //
743
+ // Checks run once every ~120 frames (~2s at 60fps) to keep overhead
744
+ // negligible even when dev mode is on.
745
+ /** Toggle development-mode runtime warnings globally. */
746
+ static __initStatic3() {this.devMode = false}
747
+ static _devModeDetected() {
748
+ if (_Scene.devMode) return true;
749
+ const gp = typeof globalThis !== "undefined" ? globalThis : void 0;
750
+ if (_optionalChain([gp, 'optionalAccess', _23 => _23.__DEV__])) return true;
751
+ if (_optionalChain([gp, 'optionalAccess', _24 => _24.process, 'optionalAccess', _25 => _25.env, 'optionalAccess', _26 => _26.NODE_ENV]) === "development") return true;
752
+ return false;
753
+ }
754
+
755
+ __init62() {this._devFrameCount = 0}
756
+ _devWarn(message) {
757
+ if (!this._devActive) return;
758
+ console.warn(`[vectojs/dev] ${message}`);
759
+ }
760
+ /** @internal Periodic dev checks — called once per frame in dev mode. */
761
+ _devRunChecks() {
762
+ this._devFrameCount++;
763
+ if (this._devFrameCount % 120 !== 0) return;
764
+ if (this.a11yElements) {
765
+ let interactiveCount = 0;
766
+ const walk = (node) => {
767
+ if (node.interactive && node.width > 0) interactiveCount++;
768
+ for (const c of node.children) walk(c);
769
+ };
770
+ walk(this.root);
771
+ for (const c of this.overlayRoot.children) walk(c);
772
+ const shadowCount = this.a11yElements.size;
773
+ if (shadowCount > interactiveCount + 2) {
774
+ this._devWarn(
775
+ `a11yElements (${shadowCount}) exceeds interactive entities (${interactiveCount}). Call scene.detachA11y(entity) before removing interactive children from the tree, or their shadow nodes leak.`
776
+ );
777
+ }
778
+ }
779
+ let checked = 0;
780
+ const walkProjections = (node) => {
781
+ if (checked > 10) return;
782
+ const proj = _optionalChain([node, 'access', _27 => _27.getContentProjection, 'optionalCall', _28 => _28()]);
783
+ if (_optionalChain([proj, 'optionalAccess', _29 => _29.text]) && proj.selectable !== false) {
784
+ const el = _optionalChain([this, 'access', _30 => _30.contentElements, 'optionalAccess', _31 => _31.get, 'call', _32 => _32(node.id)]);
785
+ if (el) {
786
+ const projectedText = el.textContent || "";
787
+ if (projectedText !== "" && projectedText !== proj.text) {
788
+ this._devWarn(
789
+ `Content projection mismatch for entity "${node.id}": projection says "${proj.text.slice(0, 60)}" but DOM shows "${projectedText.slice(0, 60)}". Ensure getContentProjection() output matches what drawSelf renders.`
790
+ );
791
+ }
792
+ }
793
+ }
794
+ checked++;
795
+ for (const c of node.children) walkProjections(c);
796
+ };
797
+ walkProjections(this.root);
798
+ }
799
+ constructor(canvas, options = {}) {;_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);_class2.prototype.__init10.call(this);_class2.prototype.__init11.call(this);_class2.prototype.__init12.call(this);_class2.prototype.__init13.call(this);_class2.prototype.__init14.call(this);_class2.prototype.__init15.call(this);_class2.prototype.__init16.call(this);_class2.prototype.__init17.call(this);_class2.prototype.__init18.call(this);_class2.prototype.__init19.call(this);_class2.prototype.__init20.call(this);_class2.prototype.__init21.call(this);_class2.prototype.__init22.call(this);_class2.prototype.__init23.call(this);_class2.prototype.__init24.call(this);_class2.prototype.__init25.call(this);_class2.prototype.__init26.call(this);_class2.prototype.__init27.call(this);_class2.prototype.__init28.call(this);_class2.prototype.__init29.call(this);_class2.prototype.__init30.call(this);_class2.prototype.__init31.call(this);_class2.prototype.__init32.call(this);_class2.prototype.__init33.call(this);_class2.prototype.__init34.call(this);_class2.prototype.__init35.call(this);_class2.prototype.__init36.call(this);_class2.prototype.__init37.call(this);_class2.prototype.__init38.call(this);_class2.prototype.__init39.call(this);_class2.prototype.__init40.call(this);_class2.prototype.__init41.call(this);_class2.prototype.__init42.call(this);_class2.prototype.__init43.call(this);_class2.prototype.__init44.call(this);_class2.prototype.__init45.call(this);_class2.prototype.__init46.call(this);_class2.prototype.__init47.call(this);_class2.prototype.__init48.call(this);_class2.prototype.__init49.call(this);_class2.prototype.__init50.call(this);_class2.prototype.__init51.call(this);_class2.prototype.__init52.call(this);_class2.prototype.__init53.call(this);_class2.prototype.__init54.call(this);_class2.prototype.__init55.call(this);_class2.prototype.__init56.call(this);_class2.prototype.__init57.call(this);_class2.prototype.__init58.call(this);_class2.prototype.__init59.call(this);_class2.prototype.__init60.call(this);_class2.prototype.__init61.call(this);_class2.prototype.__init62.call(this);
737
800
  this.canvas = canvas;
738
801
  this.debugA11y = _nullishCoalesce(options.debugA11y, () => ( false));
739
802
  this.disableWindowResize = _nullishCoalesce(options.disableWindowResize, () => ( false));
803
+ this.maxDPR = options.maxDPR;
740
804
  if (this.disableWindowResize) {
741
- const styleWidth = parseInlinePx(_optionalChain([canvas, 'access', _23 => _23.style, 'optionalAccess', _24 => _24.width]));
742
- const styleHeight = parseInlinePx(_optionalChain([canvas, 'access', _25 => _25.style, 'optionalAccess', _26 => _26.height]));
805
+ const styleWidth = parseInlinePx(_optionalChain([canvas, 'access', _33 => _33.style, 'optionalAccess', _34 => _34.width]));
806
+ const styleHeight = parseInlinePx(_optionalChain([canvas, 'access', _35 => _35.style, 'optionalAccess', _36 => _36.height]));
743
807
  this.width = _nullishCoalesce(styleWidth, () => ( (canvas.width || canvas.clientWidth || 0)));
744
808
  this.height = _nullishCoalesce(styleHeight, () => ( (canvas.height || canvas.clientHeight || 0)));
745
809
  } else {
@@ -747,15 +811,16 @@ var Scene = (_class2 = class _Scene {
747
811
  this.height = typeof window !== "undefined" ? window.innerHeight : canvas.clientHeight || canvas.height || 600;
748
812
  }
749
813
  const globalProcess = typeof globalThis !== "undefined" ? globalThis.process : void 0;
750
- const isTest = globalProcess && (_optionalChain([globalProcess, 'access', _27 => _27.env, 'optionalAccess', _28 => _28.NODE_ENV]) === "test" || _optionalChain([globalProcess, 'access', _29 => _29.env, 'optionalAccess', _30 => _30.VITEST]) === "true");
814
+ const isTest = globalProcess && (_optionalChain([globalProcess, 'access', _37 => _37.env, 'optionalAccess', _38 => _38.NODE_ENV]) === "test" || _optionalChain([globalProcess, 'access', _39 => _39.env, 'optionalAccess', _40 => _40.VITEST]) === "true");
751
815
  this.maxFPS = _nullishCoalesce(options.maxFPS, () => ( (isTest ? 0 : 60)));
752
816
  this.respectReducedMotion = _nullishCoalesce(options.respectReducedMotion, () => ( true));
753
817
  this.autoThrottle = _nullishCoalesce(options.autoThrottle, () => ( true));
754
818
  this.particleBackend = _nullishCoalesce(options.particleBackend, () => ( "auto"));
755
819
  this.a11ySyncInterval = _nullishCoalesce(options.a11ySyncInterval, () => ( 0));
756
820
  this.contentProjectionEnabled = _nullishCoalesce(options.contentProjection, () => ( true));
821
+ this._devActive = _Scene._devModeDetected();
757
822
  this.reducedMotionQuery = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)") : null;
758
- this.root = new class RootEntity extends _chunkGKLTTGBRjs.Entity {
823
+ this.root = new class RootEntity extends _chunk2Z23LTH3js.Entity {
759
824
  isPointInside() {
760
825
  return false;
761
826
  }
@@ -764,7 +829,7 @@ var Scene = (_class2 = class _Scene {
764
829
  }
765
830
  }("root");
766
831
  this.root._scene = this;
767
- this.overlayRoot = new class OverlayRoot extends _chunkGKLTTGBRjs.Entity {
832
+ this.overlayRoot = new class OverlayRoot extends _chunk2Z23LTH3js.Entity {
768
833
  isPointInside() {
769
834
  return false;
770
835
  }
@@ -775,9 +840,10 @@ var Scene = (_class2 = class _Scene {
775
840
  if (options.renderer) {
776
841
  this.renderer = options.renderer;
777
842
  } else {
778
- this.renderer = new (0, _chunkBPMNCGU7js.CanvasRenderer)(
843
+ this.renderer = new (0, _chunkORCPCIJ7js.CanvasRenderer)(
779
844
  canvas,
780
- this.disableWindowResize ? { width: this.width, height: this.height } : void 0
845
+ this.disableWindowResize ? { width: this.width, height: this.height } : void 0,
846
+ this.maxDPR
781
847
  );
782
848
  }
783
849
  if (typeof document !== "undefined") {
@@ -903,6 +969,7 @@ var Scene = (_class2 = class _Scene {
903
969
  if (canvas.parentElement) canvas.parentElement.appendChild(gl);
904
970
  const pr = _Scene.webglCreator ? _Scene.webglCreator(gl) : null;
905
971
  if (pr) {
972
+ pr.maxDPR = this.maxDPR;
906
973
  pr.resize(this.width, this.height);
907
974
  this.glCanvas = gl;
908
975
  this.pointRenderer = pr;
@@ -915,7 +982,7 @@ var Scene = (_class2 = class _Scene {
915
982
  };
916
983
  if (typeof document !== "undefined" && document.fonts) {
917
984
  this.fontLoadHandler = () => {
918
- _chunkGKLTTGBRjs.clearCssLineBoxMetrics.call(void 0, );
985
+ _chunk2Z23LTH3js.clearCssLineBoxMetrics.call(void 0, );
919
986
  this.contentFontEpoch++;
920
987
  this.markDirty();
921
988
  };
@@ -931,10 +998,10 @@ var Scene = (_class2 = class _Scene {
931
998
  }
932
999
  releaseContentSelectionForRebuild(el) {
933
1000
  const selection = typeof window !== "undefined" && typeof window.getSelection === "function" ? window.getSelection() : null;
934
- const ownsSelection = this.contentSelectionAnchor && el.contains(this.contentSelectionAnchor.node) || (_optionalChain([selection, 'optionalAccess', _31 => _31.anchorNode]) ? el.contains(selection.anchorNode) : false) || (_optionalChain([selection, 'optionalAccess', _32 => _32.focusNode]) ? el.contains(selection.focusNode) : false);
1001
+ const ownsSelection = this.contentSelectionAnchor && el.contains(this.contentSelectionAnchor.node) || (_optionalChain([selection, 'optionalAccess', _41 => _41.anchorNode]) ? el.contains(selection.anchorNode) : false) || (_optionalChain([selection, 'optionalAccess', _42 => _42.focusNode]) ? el.contains(selection.focusNode) : false);
935
1002
  if (!ownsSelection) return;
936
1003
  this.endContentSelectionDrag();
937
- _optionalChain([selection, 'optionalAccess', _33 => _33.removeAllRanges, 'call', _34 => _34()]);
1004
+ _optionalChain([selection, 'optionalAccess', _43 => _43.removeAllRanges, 'call', _44 => _44()]);
938
1005
  }
939
1006
  /**
940
1007
  * Expose the underlying {@link IRenderer} for advanced direct-draw operations.
@@ -946,7 +1013,7 @@ var Scene = (_class2 = class _Scene {
946
1013
  }
947
1014
  /** Convert browser viewport coordinates into this Scene's logical coordinates. */
948
1015
  clientToScene(clientX, clientY) {
949
- const rect = _optionalChain([this, 'access', _35 => _35.canvas, 'access', _36 => _36.getBoundingClientRect, 'optionalCall', _37 => _37()]);
1016
+ const rect = _optionalChain([this, 'access', _45 => _45.canvas, 'access', _46 => _46.getBoundingClientRect, 'optionalCall', _47 => _47()]);
950
1017
  if (!rect) return { x: clientX, y: clientY };
951
1018
  const cssWidth = rect.width || this.canvas.clientWidth || this.width;
952
1019
  const cssHeight = rect.height || this.canvas.clientHeight || this.height;
@@ -972,7 +1039,7 @@ var Scene = (_class2 = class _Scene {
972
1039
  cancelAnimationFrame(calibrationFrame);
973
1040
  }
974
1041
  this.contentGridCalibrationFrames.delete(entityId);
975
- _optionalChain([this, 'access', _38 => _38.contentGridCalibrationProbes, 'access', _39 => _39.get, 'call', _40 => _40(entityId), 'optionalAccess', _41 => _41.remove, 'call', _42 => _42()]);
1042
+ _optionalChain([this, 'access', _48 => _48.contentGridCalibrationProbes, 'access', _49 => _49.get, 'call', _50 => _50(entityId), 'optionalAccess', _51 => _51.remove, 'call', _52 => _52()]);
976
1043
  this.contentGridCalibrationProbes.delete(entityId);
977
1044
  delete el.dataset.vectoGridCalibrationPending;
978
1045
  delete el.dataset.vectoGridCalibration;
@@ -1088,8 +1155,8 @@ var Scene = (_class2 = class _Scene {
1088
1155
  this.canvas.removeEventListener("pointerleave", this.pointerLeaveListener);
1089
1156
  }
1090
1157
  }
1091
- _optionalChain([this, 'access', _43 => _43.a11yRoot, 'optionalAccess', _44 => _44.remove, 'call', _45 => _45()]);
1092
- _optionalChain([this, 'access', _46 => _46.portalRoot, 'optionalAccess', _47 => _47.remove, 'call', _48 => _48()]);
1158
+ _optionalChain([this, 'access', _53 => _53.a11yRoot, 'optionalAccess', _54 => _54.remove, 'call', _55 => _55()]);
1159
+ _optionalChain([this, 'access', _56 => _56.portalRoot, 'optionalAccess', _57 => _57.remove, 'call', _58 => _58()]);
1093
1160
  this.a11yElements.clear();
1094
1161
  for (const el of this.contentElements.values()) el.remove();
1095
1162
  this.contentElements.clear();
@@ -1102,10 +1169,10 @@ var Scene = (_class2 = class _Scene {
1102
1169
  for (const probe of this.contentGridCalibrationProbes.values()) probe.remove();
1103
1170
  this.contentGridCalibrationProbes.clear();
1104
1171
  this.endContentSelectionDrag();
1105
- _optionalChain([this, 'access', _49 => _49.pointRenderer, 'optionalAccess', _50 => _50.destroy, 'call', _51 => _51()]);
1106
- _optionalChain([this, 'access', _52 => _52.renderer, 'access', _53 => _53.dispose, 'optionalCall', _54 => _54()]);
1107
- _optionalChain([this, 'access', _55 => _55.glCanvas, 'optionalAccess', _56 => _56.remove, 'call', _57 => _57()]);
1108
- _optionalChain([this, 'access', _58 => _58.gpuCanvas, 'optionalAccess', _59 => _59.remove, 'call', _60 => _60()]);
1172
+ _optionalChain([this, 'access', _59 => _59.pointRenderer, 'optionalAccess', _60 => _60.destroy, 'call', _61 => _61()]);
1173
+ _optionalChain([this, 'access', _62 => _62.renderer, 'access', _63 => _63.dispose, 'optionalCall', _64 => _64()]);
1174
+ _optionalChain([this, 'access', _65 => _65.glCanvas, 'optionalAccess', _66 => _66.remove, 'call', _67 => _67()]);
1175
+ _optionalChain([this, 'access', _68 => _68.gpuCanvas, 'optionalAccess', _69 => _69.remove, 'call', _70 => _70()]);
1109
1176
  this.gpuCanvas = null;
1110
1177
  this.gpuContext = null;
1111
1178
  if (this.recoveryTimerId) {
@@ -1117,7 +1184,7 @@ var Scene = (_class2 = class _Scene {
1117
1184
  this.manager = null;
1118
1185
  }
1119
1186
  if (this.device) {
1120
- _optionalChain([this, 'access', _61 => _61.device, 'access', _62 => _62.destroy, 'optionalCall', _63 => _63()]);
1187
+ _optionalChain([this, 'access', _71 => _71.device, 'access', _72 => _72.destroy, 'optionalCall', _73 => _73()]);
1121
1188
  this.device = null;
1122
1189
  }
1123
1190
  }
@@ -1266,15 +1333,18 @@ var Scene = (_class2 = class _Scene {
1266
1333
  el.style.background = "transparent";
1267
1334
  }
1268
1335
  el.addEventListener("click", (e) => {
1269
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("click", node, e));
1336
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("click", node, e));
1337
+ });
1338
+ el.addEventListener("dblclick", (e) => {
1339
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("dblclick", node, e));
1270
1340
  });
1271
1341
  el.addEventListener("mouseenter", (e) => {
1272
1342
  if (this.debugA11y) el.style.backgroundColor = "rgba(56, 189, 248, 0.2)";
1273
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("hover", node, e, false));
1343
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("hover", node, e, false));
1274
1344
  });
1275
1345
  el.addEventListener("mouseleave", (e) => {
1276
1346
  if (this.debugA11y) el.style.backgroundColor = "rgba(56, 189, 248, 0.05)";
1277
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("pointerleave", node, e, false));
1347
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("pointerleave", node, e, false));
1278
1348
  });
1279
1349
  const capEl = el;
1280
1350
  const releasePointer = (event) => {
@@ -1290,32 +1360,32 @@ var Scene = (_class2 = class _Scene {
1290
1360
  };
1291
1361
  el.addEventListener("pointerdown", (e) => {
1292
1362
  if (typeof capEl.setPointerCapture === "function") capEl.setPointerCapture(e.pointerId);
1293
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("pointerdown", node, e));
1363
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("pointerdown", node, e));
1294
1364
  });
1295
1365
  el.addEventListener("pointerup", (e) => {
1296
1366
  releasePointer(e);
1297
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("pointerup", node, e));
1367
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("pointerup", node, e));
1298
1368
  });
1299
1369
  el.addEventListener("pointercancel", (e) => {
1300
1370
  releasePointer(e);
1301
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("pointercancel", node, e));
1371
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("pointercancel", node, e));
1302
1372
  });
1303
1373
  el.addEventListener(
1304
1374
  "pointermove",
1305
- (e) => node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("pointermove", node, e))
1375
+ (e) => node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("pointermove", node, e))
1306
1376
  );
1307
1377
  el.addEventListener(
1308
1378
  "wheel",
1309
1379
  (e) => {
1310
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("wheel", node, e));
1380
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("wheel", node, e));
1311
1381
  },
1312
1382
  { passive: false }
1313
1383
  );
1314
1384
  el.addEventListener("keydown", (e) => {
1315
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("keydown", node, e));
1385
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("keydown", node, e));
1316
1386
  });
1317
1387
  el.addEventListener("keyup", (e) => {
1318
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("keyup", node, e));
1388
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("keyup", node, e));
1319
1389
  });
1320
1390
  if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
1321
1391
  const input = el;
@@ -1342,7 +1412,7 @@ var Scene = (_class2 = class _Scene {
1342
1412
  });
1343
1413
  el.addEventListener("compositionupdate", (e) => {
1344
1414
  const data = _nullishCoalesce(e.data, () => ( ""));
1345
- composition = { start: _nullishCoalesce(_optionalChain([composition, 'optionalAccess', _64 => _64.start]), () => ( 0)), length: data.length };
1415
+ composition = { start: _nullishCoalesce(_optionalChain([composition, 'optionalAccess', _74 => _74.start]), () => ( 0)), length: data.length };
1346
1416
  forward();
1347
1417
  });
1348
1418
  el.addEventListener("compositionend", () => {
@@ -1375,7 +1445,7 @@ var Scene = (_class2 = class _Scene {
1375
1445
  el.addEventListener("keydown", (e) => {
1376
1446
  if (e.key === "Enter" || e.key === " ") {
1377
1447
  e.preventDefault();
1378
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("click", node, e));
1448
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("click", node, e));
1379
1449
  }
1380
1450
  });
1381
1451
  }
@@ -1409,7 +1479,7 @@ var Scene = (_class2 = class _Scene {
1409
1479
  this.syncOptionalAttribute(
1410
1480
  el,
1411
1481
  "href",
1412
- attrs.href === void 0 ? void 0 : _chunkBPMNCGU7js.sanitizeUrl.call(void 0, attrs.href)
1482
+ attrs.href === void 0 ? void 0 : _chunkORCPCIJ7js.sanitizeUrl.call(void 0, attrs.href)
1413
1483
  );
1414
1484
  this.syncOptionalAttribute(el, "target", attrs.target);
1415
1485
  }
@@ -1534,7 +1604,7 @@ var Scene = (_class2 = class _Scene {
1534
1604
  el.addEventListener(
1535
1605
  "wheel",
1536
1606
  (e2) => {
1537
- node.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)("wheel", node, e2));
1607
+ node.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)("wheel", node, e2));
1538
1608
  },
1539
1609
  { passive: false }
1540
1610
  );
@@ -1565,7 +1635,7 @@ var Scene = (_class2 = class _Scene {
1565
1635
  lineElement.style.position = "absolute";
1566
1636
  lineElement.dir = "auto";
1567
1637
  lineElement.style.left = `${line.x}px`;
1568
- lineElement.style.top = `${line.y + line.baseline - _chunkGKLTTGBRjs.cssLineBoxBaseline.call(void 0, lineFont, lineHeight2)}px`;
1638
+ lineElement.style.top = `${line.y + line.baseline - _chunk2Z23LTH3js.cssLineBoxBaseline.call(void 0, lineFont, lineHeight2)}px`;
1569
1639
  lineElement.style.whiteSpace = "pre";
1570
1640
  if (lineFont) lineElement.style.font = lineFont;
1571
1641
  lineElement.style.lineHeight = `${lineHeight2}px`;
@@ -1617,7 +1687,7 @@ var Scene = (_class2 = class _Scene {
1617
1687
  const { a, b, c, d, e, f } = node.getWorldTransform();
1618
1688
  const contentX = _nullishCoalesce(projection.contentX, () => ( 0));
1619
1689
  const contentY = _nullishCoalesce(projection.contentY, () => ( 0));
1620
- const baselineOffset = lines && lines.length > 0 ? 0 : projection.baseline === void 0 ? 0 : projection.baseline - _chunkGKLTTGBRjs.cssLineBoxBaseline.call(void 0, font, _nullishCoalesce(projection.lineHeight, () => ( 16)));
1690
+ const baselineOffset = lines && lines.length > 0 ? 0 : projection.baseline === void 0 ? 0 : projection.baseline - _chunk2Z23LTH3js.cssLineBoxBaseline.call(void 0, font, _nullishCoalesce(projection.lineHeight, () => ( 16)));
1621
1691
  const localY = contentY + baselineOffset;
1622
1692
  el.style.left = `${e + a * contentX + c * localY}px`;
1623
1693
  el.style.top = `${f + b * contentX + d * localY}px`;
@@ -1681,15 +1751,15 @@ var Scene = (_class2 = class _Scene {
1681
1751
  for (let lineIndex = 0; lineIndex < grid.lines.length; lineIndex++) {
1682
1752
  const gridLine = grid.lines[lineIndex];
1683
1753
  const projectedLine = projectionLines[lineIndex];
1684
- const lineHeight = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _65 => _65.lineHeight]), () => ( grid.lineHeight));
1685
- const baseline = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _66 => _66.baseline]), () => ( grid.baseline));
1686
- const lineFont = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _67 => _67.font]), () => ( grid.font));
1754
+ const lineHeight = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _75 => _75.lineHeight]), () => ( grid.lineHeight));
1755
+ const baseline = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _76 => _76.baseline]), () => ( grid.baseline));
1756
+ const lineFont = _nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _77 => _77.font]), () => ( grid.font));
1687
1757
  const lineElement = document.createElement("span");
1688
1758
  lineElement.dir = "ltr";
1689
1759
  lineElement.dataset.vectoGridLine = `${lineIndex}`;
1690
1760
  lineElement.style.position = "absolute";
1691
- lineElement.style.left = `${_nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _68 => _68.x]), () => ( 0))}px`;
1692
- lineElement.style.top = `${(_nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _69 => _69.y]), () => ( lineIndex * grid.lineHeight))) + baseline - _chunkGKLTTGBRjs.cssLineBoxBaseline.call(void 0, lineFont, lineHeight)}px`;
1761
+ lineElement.style.left = `${_nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _78 => _78.x]), () => ( 0))}px`;
1762
+ lineElement.style.top = `${(_nullishCoalesce(_optionalChain([projectedLine, 'optionalAccess', _79 => _79.y]), () => ( lineIndex * grid.lineHeight))) + baseline - _chunk2Z23LTH3js.cssLineBoxBaseline.call(void 0, lineFont, lineHeight)}px`;
1693
1763
  lineElement.style.width = `${gridLine.width}px`;
1694
1764
  lineElement.style.height = `${lineHeight}px`;
1695
1765
  lineElement.style.whiteSpace = "pre";
@@ -1785,7 +1855,7 @@ var Scene = (_class2 = class _Scene {
1785
1855
  if (previous !== void 0 && typeof cancelAnimationFrame === "function") {
1786
1856
  cancelAnimationFrame(previous);
1787
1857
  }
1788
- _optionalChain([this, 'access', _70 => _70.contentGridCalibrationProbes, 'access', _71 => _71.get, 'call', _72 => _72(entityId), 'optionalAccess', _73 => _73.remove, 'call', _74 => _74()]);
1858
+ _optionalChain([this, 'access', _80 => _80.contentGridCalibrationProbes, 'access', _81 => _81.get, 'call', _82 => _82(entityId), 'optionalAccess', _83 => _83.remove, 'call', _84 => _84()]);
1789
1859
  this.contentGridCalibrationProbes.delete(entityId);
1790
1860
  const calibrationStart = typeof performance !== "undefined" ? performance.now() : 0;
1791
1861
  const probe = document.createElement("div");
@@ -1815,7 +1885,7 @@ var Scene = (_class2 = class _Scene {
1815
1885
  const sourceLength = Number(_nullishCoalesce(target.dataset.vectoGridSourceLength, () => ( 0)));
1816
1886
  const targetWidth = Number(_nullishCoalesce(target.dataset.vectoGridAdvance, () => ( 0)));
1817
1887
  if (sourceLength <= 0 || targetWidth <= 0) continue;
1818
- const sourceText = _nullishCoalesce(_optionalChain([target, 'access', _75 => _75.textContent, 'optionalAccess', _76 => _76.slice, 'call', _77 => _77(0, sourceLength)]), () => ( ""));
1888
+ const sourceText = _nullishCoalesce(_optionalChain([target, 'access', _85 => _85.textContent, 'optionalAccess', _86 => _86.slice, 'call', _87 => _87(0, sourceLength)]), () => ( ""));
1819
1889
  if (!sourceText) continue;
1820
1890
  const measurementKey = JSON.stringify([
1821
1891
  target.style.font,
@@ -1965,12 +2035,12 @@ var Scene = (_class2 = class _Scene {
1965
2035
  syncOverlayGeometry() {
1966
2036
  const parent = this.canvas.parentElement;
1967
2037
  if (!parent) return;
1968
- const canvasRect = _optionalChain([this, 'access', _78 => _78.canvas, 'access', _79 => _79.getBoundingClientRect, 'optionalCall', _80 => _80()]);
1969
- const parentRect = _optionalChain([parent, 'access', _81 => _81.getBoundingClientRect, 'optionalCall', _82 => _82()]);
1970
- const cssWidth = _optionalChain([canvasRect, 'optionalAccess', _83 => _83.width]) || this.canvas.clientWidth || this.width;
1971
- const cssHeight = _optionalChain([canvasRect, 'optionalAccess', _84 => _84.height]) || this.canvas.clientHeight || this.height;
1972
- const left = (_nullishCoalesce(_optionalChain([canvasRect, 'optionalAccess', _85 => _85.left]), () => ( 0))) - (_nullishCoalesce(_optionalChain([parentRect, 'optionalAccess', _86 => _86.left]), () => ( 0))) - (parent.clientLeft || 0) + parent.scrollLeft;
1973
- const top = (_nullishCoalesce(_optionalChain([canvasRect, 'optionalAccess', _87 => _87.top]), () => ( 0))) - (_nullishCoalesce(_optionalChain([parentRect, 'optionalAccess', _88 => _88.top]), () => ( 0))) - (parent.clientTop || 0) + parent.scrollTop;
2038
+ const canvasRect = _optionalChain([this, 'access', _88 => _88.canvas, 'access', _89 => _89.getBoundingClientRect, 'optionalCall', _90 => _90()]);
2039
+ const parentRect = _optionalChain([parent, 'access', _91 => _91.getBoundingClientRect, 'optionalCall', _92 => _92()]);
2040
+ const cssWidth = _optionalChain([canvasRect, 'optionalAccess', _93 => _93.width]) || this.canvas.clientWidth || this.width;
2041
+ const cssHeight = _optionalChain([canvasRect, 'optionalAccess', _94 => _94.height]) || this.canvas.clientHeight || this.height;
2042
+ const left = (_nullishCoalesce(_optionalChain([canvasRect, 'optionalAccess', _95 => _95.left]), () => ( 0))) - (_nullishCoalesce(_optionalChain([parentRect, 'optionalAccess', _96 => _96.left]), () => ( 0))) - (parent.clientLeft || 0) + parent.scrollLeft;
2043
+ const top = (_nullishCoalesce(_optionalChain([canvasRect, 'optionalAccess', _97 => _97.top]), () => ( 0))) - (_nullishCoalesce(_optionalChain([parentRect, 'optionalAccess', _98 => _98.top]), () => ( 0))) - (parent.clientTop || 0) + parent.scrollTop;
1974
2044
  const scaleX = this.width > 0 ? cssWidth / this.width : 1;
1975
2045
  const scaleY = this.height > 0 ? cssHeight / this.height : 1;
1976
2046
  for (const root of [this.a11yRoot, this.portalRoot]) {
@@ -2095,7 +2165,7 @@ var Scene = (_class2 = class _Scene {
2095
2165
  * (and {@link respectReducedMotion} is on). `0` means uncapped.
2096
2166
  */
2097
2167
  effectiveMaxFPS() {
2098
- const reduced = this.respectReducedMotion && !!_optionalChain([this, 'access', _89 => _89.reducedMotionQuery, 'optionalAccess', _90 => _90.matches]);
2168
+ const reduced = this.respectReducedMotion && !!_optionalChain([this, 'access', _99 => _99.reducedMotionQuery, 'optionalAccess', _100 => _100.matches]);
2099
2169
  if (reduced)
2100
2170
  return this.maxFPS > 0 ? Math.min(this.maxFPS, REDUCED_MOTION_FPS) : REDUCED_MOTION_FPS;
2101
2171
  return this.maxFPS;
@@ -2273,7 +2343,7 @@ var Scene = (_class2 = class _Scene {
2273
2343
  }
2274
2344
  renderer.clear();
2275
2345
  if (isMainRenderer) {
2276
- _optionalChain([this, 'access', _91 => _91.pointRenderer, 'optionalAccess', _92 => _92.begin, 'call', _93 => _93()]);
2346
+ _optionalChain([this, 'access', _101 => _101.pointRenderer, 'optionalAccess', _102 => _102.begin, 'call', _103 => _103()]);
2277
2347
  }
2278
2348
  const vw = this.width;
2279
2349
  const vh = this.height;
@@ -2284,6 +2354,13 @@ var Scene = (_class2 = class _Scene {
2284
2354
  node.update(dt, time);
2285
2355
  if (!walkHadAnimation && node.hasPendingAnimations()) walkHadAnimation = true;
2286
2356
  if (!walkHadInteractive && node.interactive) walkHadInteractive = true;
2357
+ if (this._devActive && this._devFrameCount % 120 === 0) {
2358
+ if (node.update !== _chunk2Z23LTH3js.Entity.prototype.update && node.hasPendingAnimations === _chunk2Z23LTH3js.Entity.prototype.hasPendingAnimations) {
2359
+ this._devWarn(
2360
+ `Entity "${node.id}" overrides update() but not hasPendingAnimations(). Custom motion in update() without overriding hasPendingAnimations() causes the idle throttle to drop the animation to ~2fps. Override hasPendingAnimations() to return true while motion is in flight.`
2361
+ );
2362
+ }
2363
+ }
2287
2364
  }
2288
2365
  const cos = Math.cos(node.rotation);
2289
2366
  const sin = Math.sin(node.rotation);
@@ -2411,15 +2488,19 @@ var Scene = (_class2 = class _Scene {
2411
2488
  }
2412
2489
  renderer.flush();
2413
2490
  if (isMainRenderer) {
2414
- _optionalChain([this, 'access', _94 => _94.pointRenderer, 'optionalAccess', _95 => _95.flush, 'call', _96 => _96()]);
2491
+ _optionalChain([this, 'access', _104 => _104.pointRenderer, 'optionalAccess', _105 => _105.flush, 'call', _106 => _106()]);
2492
+ }
2493
+ _optionalChain([renderer, 'access', _107 => _107.present, 'optionalCall', _108 => _108()]);
2494
+ if (this._devActive) {
2495
+ this._devFrameCount++;
2496
+ this._devRunChecks();
2415
2497
  }
2416
- _optionalChain([renderer, 'access', _97 => _97.present, 'optionalCall', _98 => _98()]);
2417
2498
  }
2418
2499
  /**
2419
2500
  * Export the current scene state to a lightweight, flat SVG XML string.
2420
2501
  */
2421
2502
  toSVG() {
2422
- const renderer = new (0, _chunkBPMNCGU7js.SVGRenderer)(this.width, this.height);
2503
+ const renderer = new (0, _chunkORCPCIJ7js.SVGRenderer)(this.width, this.height);
2423
2504
  this.render(renderer, 0, 0);
2424
2505
  return renderer.toXMLString();
2425
2506
  }
@@ -2431,9 +2512,13 @@ var Scene = (_class2 = class _Scene {
2431
2512
  this.height = height;
2432
2513
  this.contentFontEpoch++;
2433
2514
  if (typeof this.renderer.resize === "function") {
2515
+ if ("maxDPR" in this.renderer) this.renderer.maxDPR = this.maxDPR;
2434
2516
  this.renderer.resize(width, height);
2435
2517
  }
2436
- _optionalChain([this, 'access', _99 => _99.pointRenderer, 'optionalAccess', _100 => _100.resize, 'call', _101 => _101(width, height)]);
2518
+ if (this.pointRenderer) {
2519
+ this.pointRenderer.maxDPR = this.maxDPR;
2520
+ this.pointRenderer.resize(width, height);
2521
+ }
2437
2522
  if (this.gpuCanvas) {
2438
2523
  this.gpuCanvas.width = width;
2439
2524
  this.gpuCanvas.height = height;
@@ -2613,7 +2698,7 @@ var Scene = (_class2 = class _Scene {
2613
2698
  }
2614
2699
  return null;
2615
2700
  }
2616
- }, _class2.__initStatic(), _class2.__initStatic2(), _class2);
2701
+ }, _class2.__initStatic(), _class2.__initStatic2(), _class2.__initStatic3(), _class2);
2617
2702
 
2618
2703
  // src/components/TextEntity.ts
2619
2704
  var sharedMeasurer;
@@ -2621,20 +2706,20 @@ function defaultMeasurer() {
2621
2706
  if (sharedMeasurer === void 0) sharedMeasurer = _chunkBA5HUUDFjs.createCanvasMeasurer.call(void 0, "sans-serif");
2622
2707
  return sharedMeasurer;
2623
2708
  }
2624
- var TextEntity = (_class3 = class extends _chunkGKLTTGBRjs.Entity {
2709
+ var TextEntity = (_class3 = class extends _chunk2Z23LTH3js.Entity {
2625
2710
 
2626
2711
 
2627
2712
 
2628
2713
 
2629
- __init62() {this.nodes = []}
2714
+ __init63() {this.nodes = []}
2630
2715
 
2631
- __init63() {this.fillStyle = "#94a3b8"}
2632
- __init64() {this.strokeStyle = null}
2633
- __init65() {this.hoveredFillStyle = "#ffffff"}
2634
- __init66() {this.lineWidth = 1}
2635
- __init67() {this.isHovered = false}
2716
+ __init64() {this.fillStyle = "#94a3b8"}
2717
+ __init65() {this.strokeStyle = null}
2718
+ __init66() {this.hoveredFillStyle = "#ffffff"}
2719
+ __init67() {this.lineWidth = 1}
2720
+ __init68() {this.isHovered = false}
2636
2721
  constructor(text, atlas, maxWidth, fontSize = 24) {
2637
- super();_class3.prototype.__init62.call(this);_class3.prototype.__init63.call(this);_class3.prototype.__init64.call(this);_class3.prototype.__init65.call(this);_class3.prototype.__init66.call(this);_class3.prototype.__init67.call(this);;
2722
+ super();_class3.prototype.__init63.call(this);_class3.prototype.__init64.call(this);_class3.prototype.__init65.call(this);_class3.prototype.__init66.call(this);_class3.prototype.__init67.call(this);_class3.prototype.__init68.call(this);;
2638
2723
  this.text = text;
2639
2724
  this.atlas = atlas;
2640
2725
  this.fontSize = fontSize;
@@ -2747,17 +2832,17 @@ var TextEntity = (_class3 = class extends _chunkGKLTTGBRjs.Entity {
2747
2832
  }, _class3);
2748
2833
 
2749
2834
  // src/components/GridTextEntity.ts
2750
- var GridTextEntity = (_class4 = class extends _chunkGKLTTGBRjs.Entity {
2835
+ var GridTextEntity = (_class4 = class extends _chunk2Z23LTH3js.Entity {
2751
2836
 
2752
- __init68() {this.fillStyle = "#ffffff"}
2753
- __init69() {this.grid = []}
2837
+ __init69() {this.fillStyle = "#ffffff"}
2838
+ __init70() {this.grid = []}
2754
2839
  // Array of rows
2755
- __init70() {this.cols = 0}
2756
- __init71() {this.rows = 0}
2840
+ __init71() {this.cols = 0}
2841
+ __init72() {this.rows = 0}
2757
2842
 
2758
2843
 
2759
2844
  constructor(_atlas, fontSize = 10) {
2760
- super();_class4.prototype.__init68.call(this);_class4.prototype.__init69.call(this);_class4.prototype.__init70.call(this);_class4.prototype.__init71.call(this);;
2845
+ super();_class4.prototype.__init69.call(this);_class4.prototype.__init70.call(this);_class4.prototype.__init71.call(this);_class4.prototype.__init72.call(this);;
2761
2846
  this.fontSize = fontSize;
2762
2847
  this.charWidth = fontSize * 1;
2763
2848
  this.charHeight = fontSize * 1.1;
@@ -2766,7 +2851,7 @@ var GridTextEntity = (_class4 = class extends _chunkGKLTTGBRjs.Entity {
2766
2851
  updateGrid(ascii) {
2767
2852
  this.grid = ascii;
2768
2853
  this.rows = ascii.length;
2769
- this.cols = _optionalChain([ascii, 'access', _102 => _102[0], 'optionalAccess', _103 => _103.length]) || 0;
2854
+ this.cols = _optionalChain([ascii, 'access', _109 => _109[0], 'optionalAccess', _110 => _110.length]) || 0;
2770
2855
  }
2771
2856
  isPointInside(_globalX, _globalY) {
2772
2857
  return false;
@@ -2841,7 +2926,7 @@ function distSqToSegment(px, py, x1, y1, x2, y2) {
2841
2926
  const ey = py - cy;
2842
2927
  return ex * ex + ey * ey;
2843
2928
  }
2844
- var SplineEntity = (_class5 = class extends _chunkGKLTTGBRjs.Entity {
2929
+ var SplineEntity = (_class5 = class extends _chunk2Z23LTH3js.Entity {
2845
2930
 
2846
2931
 
2847
2932
 
@@ -2849,23 +2934,23 @@ var SplineEntity = (_class5 = class extends _chunkGKLTTGBRjs.Entity {
2849
2934
 
2850
2935
 
2851
2936
 
2852
- __init72() {this.offscreen = null}
2853
- __init73() {this.baked = false}
2937
+ __init73() {this.offscreen = null}
2938
+ __init74() {this.baked = false}
2854
2939
  /** Logical (CSS-pixel) size of the baked bitmap — the blit destination size. */
2855
- __init74() {this.bakedWidth = 0}
2856
- __init75() {this.bakedHeight = 0}
2940
+ __init75() {this.bakedWidth = 0}
2941
+ __init76() {this.bakedHeight = 0}
2857
2942
  /** Gradient strokes can't be baked to a solid-color bitmap; they render per-frame. */
2858
2943
 
2859
2944
  /** Lazily-flattened polylines (one Float32Array of [x,y,...] per segment) for hit-testing. */
2860
- __init76() {this.polylines = null}
2945
+ __init77() {this.polylines = null}
2861
2946
  /**
2862
2947
  * When `true`, the renderer draws a rounded-rect outline of the entity's
2863
2948
  * local bounds after painting the curves. Useful for drag feedback and
2864
2949
  * debugging hit areas. Defaults to `false`.
2865
2950
  */
2866
- __init77() {this.showBounds = false}
2951
+ __init78() {this.showBounds = false}
2867
2952
  constructor(doc, opts = {}) {
2868
- super();_class5.prototype.__init72.call(this);_class5.prototype.__init73.call(this);_class5.prototype.__init74.call(this);_class5.prototype.__init75.call(this);_class5.prototype.__init76.call(this);_class5.prototype.__init77.call(this);;
2953
+ super();_class5.prototype.__init73.call(this);_class5.prototype.__init74.call(this);_class5.prototype.__init75.call(this);_class5.prototype.__init76.call(this);_class5.prototype.__init77.call(this);_class5.prototype.__init78.call(this);;
2869
2954
  this.doc = doc;
2870
2955
  this.lineWidth = _nullishCoalesce(opts.lineWidth, () => ( 2));
2871
2956
  this.cache = _nullishCoalesce(opts.cache, () => ( true));
@@ -2876,7 +2961,7 @@ var SplineEntity = (_class5 = class extends _chunkGKLTTGBRjs.Entity {
2876
2961
  this.width = this.bounds.width;
2877
2962
  this.height = this.bounds.height;
2878
2963
  const isGradient = (c) => c !== null && !Array.isArray(c);
2879
- this.containsGradient = (_nullishCoalesce(_optionalChain([this, 'access', _104 => _104.doc, 'access', _105 => _105.equations, 'optionalAccess', _106 => _106.some, 'call', _107 => _107((eq) => isGradient(eq.color_rgb))]), () => ( false))) || (_nullishCoalesce(_optionalChain([this, 'access', _108 => _108.doc, 'access', _109 => _109.paths, 'optionalAccess', _110 => _110.some, 'call', _111 => _111((p) => isGradient(p.color_rgb))]), () => ( false)));
2964
+ this.containsGradient = (_nullishCoalesce(_optionalChain([this, 'access', _111 => _111.doc, 'access', _112 => _112.equations, 'optionalAccess', _113 => _113.some, 'call', _114 => _114((eq) => isGradient(eq.color_rgb))]), () => ( false))) || (_nullishCoalesce(_optionalChain([this, 'access', _115 => _115.doc, 'access', _116 => _116.paths, 'optionalAccess', _117 => _117.some, 'call', _118 => _118((p) => isGradient(p.color_rgb))]), () => ( false)));
2880
2965
  this.interactive = true;
2881
2966
  }
2882
2967
  computeBounds() {
@@ -3116,7 +3201,7 @@ async function loadSpline(url) {
3116
3201
  }
3117
3202
 
3118
3203
  // src/components/Rect.ts
3119
- var Rect = class extends _chunkGKLTTGBRjs.Entity {
3204
+ var Rect = class extends _chunk2Z23LTH3js.Entity {
3120
3205
 
3121
3206
 
3122
3207
 
@@ -3165,7 +3250,7 @@ var Rect = class extends _chunkGKLTTGBRjs.Entity {
3165
3250
  };
3166
3251
 
3167
3252
  // src/components/Circle.ts
3168
- var Circle = class extends _chunkGKLTTGBRjs.Entity {
3253
+ var Circle = class extends _chunk2Z23LTH3js.Entity {
3169
3254
 
3170
3255
 
3171
3256
 
@@ -3225,7 +3310,7 @@ var Circle = class extends _chunkGKLTTGBRjs.Entity {
3225
3310
  };
3226
3311
 
3227
3312
  // src/components/Group.ts
3228
- var Group = class extends _chunkGKLTTGBRjs.Entity {
3313
+ var Group = class extends _chunk2Z23LTH3js.Entity {
3229
3314
  constructor(...children) {
3230
3315
  super();
3231
3316
  if (children.length > 0) this.add(...children);
@@ -3240,9 +3325,9 @@ var Group = class extends _chunkGKLTTGBRjs.Entity {
3240
3325
  // src/math/SpatialHashGrid.ts
3241
3326
  var SpatialHashGrid = (_class6 = class {
3242
3327
 
3243
- __init78() {this.grid = /* @__PURE__ */ new Map()}
3244
- __init79() {this.entityCells = /* @__PURE__ */ new Map()}
3245
- constructor(cellSize = 64) {;_class6.prototype.__init78.call(this);_class6.prototype.__init79.call(this);
3328
+ __init79() {this.grid = /* @__PURE__ */ new Map()}
3329
+ __init80() {this.entityCells = /* @__PURE__ */ new Map()}
3330
+ constructor(cellSize = 64) {;_class6.prototype.__init79.call(this);_class6.prototype.__init80.call(this);
3246
3331
  this.cellSize = cellSize;
3247
3332
  }
3248
3333
  hash(cx, cy) {
@@ -3296,7 +3381,7 @@ var SpatialHashGrid = (_class6 = class {
3296
3381
  const keys = this.entityCells.get(id);
3297
3382
  if (!keys) return;
3298
3383
  for (const key of keys) {
3299
- _optionalChain([this, 'access', _112 => _112.grid, 'access', _113 => _113.get, 'call', _114 => _114(key), 'optionalAccess', _115 => _115.delete, 'call', _116 => _116(id)]);
3384
+ _optionalChain([this, 'access', _119 => _119.grid, 'access', _120 => _120.get, 'call', _121 => _121(key), 'optionalAccess', _122 => _122.delete, 'call', _123 => _123(id)]);
3300
3385
  }
3301
3386
  this.entityCells.delete(id);
3302
3387
  }
@@ -3332,20 +3417,20 @@ var SpatialHashGrid = (_class6 = class {
3332
3417
  }, _class6);
3333
3418
 
3334
3419
  // src/tree/DOMPortalEntity.ts
3335
- var DOMPortalEntity = (_class7 = class extends _chunkGKLTTGBRjs.Entity {
3420
+ var DOMPortalEntity = (_class7 = class extends _chunk2Z23LTH3js.Entity {
3336
3421
 
3337
- __init80() {this.isDOMPortal = true}
3338
- __init81() {this.domListeners = []}
3339
- __init82() {this.resizeObserver = null}
3340
- __init83() {this.cachedWidth = 100}
3341
- __init84() {this.cachedHeight = 100}
3342
- __init85() {this.lastWidth = ""}
3343
- __init86() {this.lastHeight = ""}
3344
- __init87() {this.lastTransform = ""}
3345
- __init88() {this.lastZIndex = ""}
3346
- __init89() {this.lastOpacity = ""}
3422
+ __init81() {this.isDOMPortal = true}
3423
+ __init82() {this.domListeners = []}
3424
+ __init83() {this.resizeObserver = null}
3425
+ __init84() {this.cachedWidth = 100}
3426
+ __init85() {this.cachedHeight = 100}
3427
+ __init86() {this.lastWidth = ""}
3428
+ __init87() {this.lastHeight = ""}
3429
+ __init88() {this.lastTransform = ""}
3430
+ __init89() {this.lastZIndex = ""}
3431
+ __init90() {this.lastOpacity = ""}
3347
3432
  constructor(domElement, width, height, id) {
3348
- super(id);_class7.prototype.__init80.call(this);_class7.prototype.__init81.call(this);_class7.prototype.__init82.call(this);_class7.prototype.__init83.call(this);_class7.prototype.__init84.call(this);_class7.prototype.__init85.call(this);_class7.prototype.__init86.call(this);_class7.prototype.__init87.call(this);_class7.prototype.__init88.call(this);_class7.prototype.__init89.call(this);;
3433
+ super(id);_class7.prototype.__init81.call(this);_class7.prototype.__init82.call(this);_class7.prototype.__init83.call(this);_class7.prototype.__init84.call(this);_class7.prototype.__init85.call(this);_class7.prototype.__init86.call(this);_class7.prototype.__init87.call(this);_class7.prototype.__init88.call(this);_class7.prototype.__init89.call(this);_class7.prototype.__init90.call(this);;
3349
3434
  this.domElement = domElement;
3350
3435
  this.width = _nullishCoalesce(width, () => ( 0));
3351
3436
  this.height = _nullishCoalesce(height, () => ( 0));
@@ -3374,7 +3459,7 @@ var DOMPortalEntity = (_class7 = class extends _chunkGKLTTGBRjs.Entity {
3374
3459
  ];
3375
3460
  for (const type of events) {
3376
3461
  const handler = (e) => {
3377
- this.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)(type, this, e));
3462
+ this.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)(type, this, e));
3378
3463
  };
3379
3464
  this.domElement.addEventListener(type, handler);
3380
3465
  this.domListeners.push({ type, handler, capture: false });
@@ -3385,7 +3470,7 @@ var DOMPortalEntity = (_class7 = class extends _chunkGKLTTGBRjs.Entity {
3385
3470
  ];
3386
3471
  for (const { native, vecto } of hoverEvents) {
3387
3472
  const handler = (e) => {
3388
- this.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)(vecto, this, e, false));
3473
+ this.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)(vecto, this, e, false));
3389
3474
  };
3390
3475
  this.domElement.addEventListener(native, handler);
3391
3476
  this.domListeners.push({ type: native, handler, capture: false });
@@ -3393,7 +3478,7 @@ var DOMPortalEntity = (_class7 = class extends _chunkGKLTTGBRjs.Entity {
3393
3478
  const focusEvents = ["focus", "blur"];
3394
3479
  for (const type of focusEvents) {
3395
3480
  const handler = (e) => {
3396
- this.dispatchEvent(new (0, _chunkGKLTTGBRjs.VectoJSEvent)(type, this, e, true));
3481
+ this.dispatchEvent(new (0, _chunk2Z23LTH3js.VectoJSEvent)(type, this, e, true));
3397
3482
  };
3398
3483
  this.domElement.addEventListener(type, handler, true);
3399
3484
  this.domListeners.push({ type, handler, capture: true });
@@ -3432,8 +3517,8 @@ var DOMPortalEntity = (_class7 = class extends _chunkGKLTTGBRjs.Entity {
3432
3517
  }, _class7);
3433
3518
 
3434
3519
  // src/index.ts
3435
- Scene.registerWebGLPointRendererCreator(_chunkBPMNCGU7js.createWebGLPointRenderer);
3436
- Scene.registerWebGPUParticleSystemManager(_chunkBPMNCGU7js.WebGPUParticleSystemManager);
3520
+ Scene.registerWebGLPointRendererCreator(_chunkORCPCIJ7js.createWebGLPointRenderer);
3521
+ Scene.registerWebGPUParticleSystemManager(_chunkORCPCIJ7js.WebGPUParticleSystemManager);
3437
3522
 
3438
3523
 
3439
3524
 
@@ -3484,4 +3569,4 @@ Scene.registerWebGPUParticleSystemManager(_chunkBPMNCGU7js.WebGPUParticleSystemM
3484
3569
 
3485
3570
 
3486
3571
 
3487
- exports.ArabicShaper = _chunk4AR425ARjs.ArabicShaper; exports.BidiResolver = _chunk4AR425ARjs.BidiResolver; exports.CanvasRenderer = _chunkBPMNCGU7js.CanvasRenderer; exports.Circle = Circle; exports.ComputeParticleEntity = ComputeParticleEntity; exports.DOMPortalEntity = DOMPortalEntity; exports.Easing = _chunkGKLTTGBRjs.Easing; exports.Entity = _chunkGKLTTGBRjs.Entity; exports.GridTextEntity = GridTextEntity; exports.Group = Group; exports.LayoutEngine = _chunkBA5HUUDFjs.LayoutEngine; exports.LayoutResultBuffer = _chunkBA5HUUDFjs.LayoutResultBuffer; exports.LayoutWorkerManager = _chunk4AR425ARjs.LayoutWorkerManager; exports.MSDFFont = _chunkGKLTTGBRjs.MSDFFont; exports.MSDFTextEntity = _chunkGKLTTGBRjs.MSDFTextEntity; exports.PARTICLE_OFFSET_LIFE = PARTICLE_OFFSET_LIFE; exports.PARTICLE_OFFSET_ORIGIN_X = PARTICLE_OFFSET_ORIGIN_X; exports.PARTICLE_OFFSET_ORIGIN_Y = PARTICLE_OFFSET_ORIGIN_Y; exports.PARTICLE_OFFSET_POSITION_X = PARTICLE_OFFSET_POSITION_X; exports.PARTICLE_OFFSET_POSITION_Y = PARTICLE_OFFSET_POSITION_Y; exports.PARTICLE_OFFSET_SIZE = PARTICLE_OFFSET_SIZE; exports.PARTICLE_OFFSET_VELOCITY_X = PARTICLE_OFFSET_VELOCITY_X; exports.PARTICLE_OFFSET_VELOCITY_Y = PARTICLE_OFFSET_VELOCITY_Y; exports.PARTICLE_STRIDE_FLOATS = PARTICLE_STRIDE_FLOATS; exports.REDUCED_MOTION_FPS = REDUCED_MOTION_FPS; exports.Rect = Rect; exports.SVGEntity = _chunkGKLTTGBRjs.SVGEntity; exports.SVGRenderer = _chunkBPMNCGU7js.SVGRenderer; exports.Scene = Scene; exports.SpatialHashGrid = SpatialHashGrid; exports.SplineEntity = SplineEntity; exports.SpringDriver = _chunkGKLTTGBRjs.SpringDriver; exports.SpringPhysics = _chunkGKLTTGBRjs.SpringPhysics; exports.TextEntity = TextEntity; exports.TweenDriver = _chunkGKLTTGBRjs.TweenDriver; exports.VectoJSEvent = _chunkGKLTTGBRjs.VectoJSEvent; exports.WebGPUParticleSystemManager = _chunkBPMNCGU7js.WebGPUParticleSystemManager; exports.clearCssLineBoxMetrics = _chunkGKLTTGBRjs.clearCssLineBoxMetrics; exports.computeLineSegments = _chunkBA5HUUDFjs.computeLineSegments; exports.createCanvasMeasurer = _chunkBA5HUUDFjs.createCanvasMeasurer; exports.createWebGLPointRenderer = _chunkBPMNCGU7js.createWebGLPointRenderer; exports.cssLineBoxBaseline = _chunkGKLTTGBRjs.cssLineBoxBaseline; exports.isSafeUrl = _chunkBPMNCGU7js.isSafeUrl; exports.isTweenConfig = _chunkGKLTTGBRjs.isTweenConfig; exports.loadSpline = loadSpline; exports.parseColorToRGBA = _chunkBPMNCGU7js.parseColorToRGBA; exports.polySegmentToBezier = polySegmentToBezier; exports.prepareContentGrid = _chunkGKLTTGBRjs.prepareContentGrid; exports.sanitizeUrl = _chunkBPMNCGU7js.sanitizeUrl;
3572
+ exports.ArabicShaper = _chunk4AR425ARjs.ArabicShaper; exports.BidiResolver = _chunk4AR425ARjs.BidiResolver; exports.CanvasRenderer = _chunkORCPCIJ7js.CanvasRenderer; exports.Circle = Circle; exports.ComputeParticleEntity = ComputeParticleEntity; exports.DOMPortalEntity = DOMPortalEntity; exports.Easing = _chunk2Z23LTH3js.Easing; exports.Entity = _chunk2Z23LTH3js.Entity; exports.GridTextEntity = GridTextEntity; exports.Group = Group; exports.LayoutEngine = _chunkBA5HUUDFjs.LayoutEngine; exports.LayoutResultBuffer = _chunkBA5HUUDFjs.LayoutResultBuffer; exports.LayoutWorkerManager = _chunk4AR425ARjs.LayoutWorkerManager; exports.MSDFFont = _chunk2Z23LTH3js.MSDFFont; exports.MSDFTextEntity = _chunk2Z23LTH3js.MSDFTextEntity; exports.PARTICLE_OFFSET_LIFE = PARTICLE_OFFSET_LIFE; exports.PARTICLE_OFFSET_ORIGIN_X = PARTICLE_OFFSET_ORIGIN_X; exports.PARTICLE_OFFSET_ORIGIN_Y = PARTICLE_OFFSET_ORIGIN_Y; exports.PARTICLE_OFFSET_POSITION_X = PARTICLE_OFFSET_POSITION_X; exports.PARTICLE_OFFSET_POSITION_Y = PARTICLE_OFFSET_POSITION_Y; exports.PARTICLE_OFFSET_SIZE = PARTICLE_OFFSET_SIZE; exports.PARTICLE_OFFSET_VELOCITY_X = PARTICLE_OFFSET_VELOCITY_X; exports.PARTICLE_OFFSET_VELOCITY_Y = PARTICLE_OFFSET_VELOCITY_Y; exports.PARTICLE_STRIDE_FLOATS = PARTICLE_STRIDE_FLOATS; exports.REDUCED_MOTION_FPS = REDUCED_MOTION_FPS; exports.Rect = Rect; exports.SVGEntity = _chunk2Z23LTH3js.SVGEntity; exports.SVGRenderer = _chunkORCPCIJ7js.SVGRenderer; exports.Scene = Scene; exports.SpatialHashGrid = SpatialHashGrid; exports.SplineEntity = SplineEntity; exports.SpringDriver = _chunk2Z23LTH3js.SpringDriver; exports.SpringPhysics = _chunk2Z23LTH3js.SpringPhysics; exports.TextEntity = TextEntity; exports.TweenDriver = _chunk2Z23LTH3js.TweenDriver; exports.VectoJSEvent = _chunk2Z23LTH3js.VectoJSEvent; exports.WebGPUParticleSystemManager = _chunkORCPCIJ7js.WebGPUParticleSystemManager; exports.clearCssLineBoxMetrics = _chunk2Z23LTH3js.clearCssLineBoxMetrics; exports.computeLineSegments = _chunkBA5HUUDFjs.computeLineSegments; exports.createCanvasMeasurer = _chunkBA5HUUDFjs.createCanvasMeasurer; exports.createWebGLPointRenderer = _chunkORCPCIJ7js.createWebGLPointRenderer; exports.cssLineBoxBaseline = _chunk2Z23LTH3js.cssLineBoxBaseline; exports.isSafeUrl = _chunkORCPCIJ7js.isSafeUrl; exports.isTweenConfig = _chunk2Z23LTH3js.isTweenConfig; exports.loadSpline = loadSpline; exports.parseColorToRGBA = _chunkORCPCIJ7js.parseColorToRGBA; exports.polySegmentToBezier = polySegmentToBezier; exports.prepareContentGrid = _chunk2Z23LTH3js.prepareContentGrid; exports.sanitizeUrl = _chunkORCPCIJ7js.sanitizeUrl;