@tresjs/core 4.2.7 → 4.2.8

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/tres.js CHANGED
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v4.2.7
3
+ * version: v4.2.8
4
4
  * (c) 2024
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
8
  var bt = Object.defineProperty;
9
- var Pt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
10
- var me = (e, t, n) => Pt(e, typeof t != "symbol" ? t + "" : t, n);
11
- import { ref as H, computed as V, watchEffect as Te, onUnmounted as K, shallowRef as $, watch as ce, readonly as ye, unref as J, provide as _e, inject as Ct, isRef as Mt, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as xt, normalizeClass as kt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
9
+ var Ct = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
10
+ var me = (e, t, n) => Ct(e, typeof t != "symbol" ? t + "" : t, n);
11
+ import { ref as H, computed as V, watchEffect as Te, onUnmounted as K, shallowRef as $, watch as ce, readonly as ye, unref as J, provide as _e, inject as Mt, isRef as Pt, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as xt, normalizeClass as kt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
12
12
  import * as et from "three";
13
13
  import { PerspectiveCamera as we, Camera as Dt, Clock as tt, Vector3 as Se, Color as Z, Scene as nt, MathUtils as rt, MeshBasicMaterial as ot, DoubleSide as jt, REVISION as Bt, SRGBColorSpace as It, ACESFilmicToneMapping as st, PCFSoftShadowMap as Ht, NoToneMapping as $t, WebGLRenderer as he, TextureLoader as Ut, Vector2 as ge, Raycaster as Ft, BufferAttribute as Wt, Object3D as Nt, Line as zt, BufferGeometry as $e, Float32BufferAttribute as Ue, LineBasicMaterial as Gt, Mesh as Vt, BackSide as Yt, DirectionalLightHelper as qt, PointLightHelper as Jt, SpotLightHelper as Kt, HemisphereLightHelper as Qt, ArrowHelper as Xt } from "three";
14
14
  import { createEventHook as j, useRafFn as it, toValue as k, unrefElement as Zt, useDevicePixelRatio as en, usePointer as tn, useElementBounding as nn, useWindowSize as rn, useElementSize as on, refDebounced as Fe, tryOnScopeDispose as sn, useFps as an, useMemory as ln } from "@vueuse/core";
15
- const cn = "@tresjs/core", un = "module", fn = "4.2.7", dn = "pnpm@9.1.4", pn = "Declarative ThreeJS using Vue Components", mn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", hn = "MIT", gn = {
15
+ const cn = "@tresjs/core", un = "module", fn = "4.2.8", dn = "pnpm@9.1.4", pn = "Declarative ThreeJS using Vue Components", mn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", hn = "MIT", gn = {
16
16
  type: "git",
17
17
  url: "git+https://github.com/Tresjs/tres.git"
18
18
  }, vn = [
@@ -40,15 +40,15 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.7", dn = "pnpm@9.1.4", pn =
40
40
  types: "./dist/src/utils/index.d.ts"
41
41
  },
42
42
  "./*": "./*"
43
- }, wn = "./dist/tres.js", bn = "./dist/tres.js", Pn = "./dist/index.d.ts", Cn = [
43
+ }, wn = "./dist/tres.js", bn = "./dist/tres.js", Cn = "./dist/index.d.ts", Mn = [
44
44
  "*.d.ts",
45
45
  "dist"
46
- ], Mn = {
46
+ ], Pn = {
47
47
  access: "public"
48
48
  }, En = {
49
- dev: "cd playground && npm run dev",
49
+ dev: "cd playground/vue && npm run dev",
50
+ "dev:nuxt": "cd playground/nuxt && npm run dev",
50
51
  build: "vite build",
51
- playground: "cd playground && npm run dev",
52
52
  test: "vitest",
53
53
  "test:ci": "vitest run",
54
54
  "test:ui": "vitest --ui --coverage.enabled=true",
@@ -124,9 +124,9 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.7", dn = "pnpm@9.1.4", pn =
124
124
  exports: _n,
125
125
  main: wn,
126
126
  module: bn,
127
- types: Pn,
128
- files: Cn,
129
- publishConfig: Mn,
127
+ types: Cn,
128
+ files: Mn,
129
+ publishConfig: Pn,
130
130
  scripts: En,
131
131
  peerDependencies: Tn,
132
132
  dependencies: Sn,
@@ -228,14 +228,14 @@ Ae.on(() => {
228
228
  ue = ee.getDelta(), fe = ee.getElapsedTime();
229
229
  });
230
230
  let ze = !1;
231
- const Fr = () => (ze || (ze = !0, Ne()), {
231
+ const Ur = () => (ze || (ze = !0, Ne()), {
232
232
  onBeforeLoop: lt.on,
233
233
  onLoop: ct.on,
234
234
  onAfterLoop: Ae.on,
235
235
  pause: $n,
236
236
  resume: Ne,
237
237
  isActive: Un
238
- }), Wr = !0, se = "[TresJS ▲ ■ ●] ";
238
+ }), Fr = !0, se = "[TresJS ▲ ■ ●] ";
239
239
  function Y() {
240
240
  function e(...r) {
241
241
  typeof r[0] == "string" ? r[0] = se + r[0] : r.unshift(se), console.error(...r);
@@ -251,7 +251,7 @@ function Y() {
251
251
  logMessage: n
252
252
  };
253
253
  }
254
- function Nr(e) {
254
+ function Wr(e) {
255
255
  return typeof e == "number" ? [e, e, e] : e instanceof Se ? [e.x, e.y, e.z] : e;
256
256
  }
257
257
  function Fn(e) {
@@ -387,7 +387,7 @@ function tr(e, t) {
387
387
  t(e[r], r) && (e[n] = e[r], n++);
388
388
  return e.length = n, e;
389
389
  }
390
- function Pe(e, t) {
390
+ function Ce(e, t) {
391
391
  let n = e;
392
392
  if (t.includes("-")) {
393
393
  const r = t.split("-");
@@ -405,7 +405,7 @@ const Je = /-\d+$/;
405
405
  function nr(e, t, n) {
406
406
  if (at(n)) {
407
407
  if (Je.test(n)) {
408
- const l = n.replace(Je, ""), { target: i, key: a } = Pe(e, l);
408
+ const l = n.replace(Je, ""), { target: i, key: a } = Ce(e, l);
409
409
  if (!Array.isArray(i[a])) {
410
410
  const c = i[a], o = [];
411
411
  o.__tresDetach = () => {
@@ -413,7 +413,7 @@ function nr(e, t, n) {
413
413
  }, i[a] = o;
414
414
  }
415
415
  }
416
- const { target: r, key: s } = Pe(e, n);
416
+ const { target: r, key: s } = Ce(e, n);
417
417
  t.__tres.previousAttach = r[s], r[s] = Q(t);
418
418
  } else
419
419
  t.__tres.previousAttach = n(e, t);
@@ -421,7 +421,7 @@ function nr(e, t, n) {
421
421
  function rr(e, t, n) {
422
422
  var r, s, l;
423
423
  if (at(n)) {
424
- const { target: i, key: a } = Pe(e, n), c = t.__tres.previousAttach;
424
+ const { target: i, key: a } = Ce(e, n), c = t.__tres.previousAttach;
425
425
  c === void 0 ? delete i[a] : i[a] = c, "__tresDetach" in i && i.__tresDetach();
426
426
  } else
427
427
  (s = (r = t.__tres) == null ? void 0 : r.previousAttach) == null || s.call(r, e, t);
@@ -534,37 +534,37 @@ function ar({
534
534
  }, {
535
535
  immediate: !0
536
536
  }), ce(() => t.clearColor, c);
537
- const { pixelRatio: o } = en(), { logError: u } = Y(), f = (() => {
538
- const g = new he(), b = {
537
+ const { pixelRatio: o } = en(), { logError: u } = Y(), d = (() => {
538
+ const h = new he(), b = {
539
539
  shadowMap: {
540
- enabled: g.shadowMap.enabled,
541
- type: g.shadowMap.type
540
+ enabled: h.shadowMap.enabled,
541
+ type: h.shadowMap.type
542
542
  },
543
- toneMapping: g.toneMapping,
544
- toneMappingExposure: g.toneMappingExposure,
545
- outputColorSpace: g.outputColorSpace
543
+ toneMapping: h.toneMapping,
544
+ toneMappingExposure: h.toneMappingExposure,
545
+ outputColorSpace: h.outputColorSpace
546
546
  };
547
- return g.dispose(), b;
548
- })(), h = k(t.renderMode);
549
- return h === "on-demand" && s(), h === "manual" && setTimeout(() => {
547
+ return h.dispose(), b;
548
+ })(), g = k(t.renderMode);
549
+ return g === "on-demand" && s(), g === "manual" && setTimeout(() => {
550
550
  l();
551
551
  }, 100), Te(() => {
552
- const g = k(t.preset);
553
- g && (g in ae || u(`Renderer Preset must be one of these: ${Object.keys(ae).join(", ")}`), ut(a.value, ae[g])), or(a.value, o.value, k(t.dpr)), h === "always" && (r.frames.value = Math.max(1, r.frames.value));
554
- const b = (C, M) => {
555
- const P = k(C), E = () => {
556
- if (g)
557
- return Ve(ae[g], M);
552
+ const h = k(t.preset);
553
+ h && (h in ae || u(`Renderer Preset must be one of these: ${Object.keys(ae).join(", ")}`), ut(a.value, ae[h])), or(a.value, o.value, k(t.dpr)), g === "always" && (r.frames.value = Math.max(1, r.frames.value));
554
+ const b = (M, P) => {
555
+ const C = k(M), E = () => {
556
+ if (h)
557
+ return Ve(ae[h], P);
558
558
  };
559
- if (P !== void 0)
560
- return P;
559
+ if (C !== void 0)
560
+ return C;
561
561
  const S = E();
562
- return S !== void 0 ? S : Ve(f, M);
563
- }, y = (C, M) => qn(a.value, M, b(C, M));
562
+ return S !== void 0 ? S : Ve(d, P);
563
+ }, y = (M, P) => qn(a.value, P, b(M, P));
564
564
  y(t.shadows, "shadowMap.enabled"), y(t.toneMapping ?? st, "toneMapping"), y(t.shadowMapType, "shadowMap.type"), ir < 150 && y(!t.useLegacyLights, "physicallyCorrectLights"), y(t.outputColorSpace, "outputColorSpace"), y(t.toneMappingExposure, "toneMappingExposure");
565
- const d = b(t.clearColor, "clearColor");
566
- d && a.value.setClearColor(
567
- d ? Fn(d) : new Z(0)
565
+ const f = b(t.clearColor, "clearColor");
566
+ f && a.value.setClearColor(
567
+ f ? Fn(f) : new Z(0)
568
568
  // default clear color is not easily/efficiently retrievable from three
569
569
  );
570
570
  }), K(() => {
@@ -573,32 +573,31 @@ function ar({
573
573
  renderer: a
574
574
  };
575
575
  }
576
- const lr = (e) => !!e && e.constructor === Array;
577
- function cr(e) {
576
+ function lr(e) {
578
577
  const t = { nodes: {}, materials: {} };
579
578
  return e && e.traverse((n) => {
580
579
  n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
581
580
  }), t;
582
581
  }
583
- async function zr(e, t, n, r, s) {
582
+ async function Nr(e, t, n, r, s) {
584
583
  const { logError: l } = Y(), i = new e();
585
584
  s && s(i), n && n(i);
586
- const c = (Array.isArray(t) ? t : [t]).map(
587
- (o) => new Promise((u, v) => {
588
- i.load(
589
- o,
590
- (f) => {
591
- const h = f;
592
- h.scene && Object.assign(h, cr(h.scene)), u(h);
593
- },
594
- r,
595
- (f) => v(l("[useLoader] - Failed to load resource", f))
596
- );
597
- })
598
- );
599
- return lr(t) ? await Promise.all(c) : await c[0];
585
+ const a = Array.isArray(t) ? t : [t];
586
+ return await new Promise((c, o) => {
587
+ i.load(
588
+ a,
589
+ (u) => {
590
+ const v = u;
591
+ v.scene && Object.assign(v, lr(v.scene)), c(v);
592
+ },
593
+ r,
594
+ (u) => {
595
+ l("[useLoader] - Failed to load resource", u), o(u);
596
+ }
597
+ );
598
+ });
600
599
  }
601
- async function Gr(e, t) {
600
+ async function zr(e, t) {
602
601
  const n = new Ut(t), r = (s) => new Promise((l, i) => {
603
602
  n.load(
604
603
  s,
@@ -635,7 +634,7 @@ async function Gr(e, t) {
635
634
  };
636
635
  }
637
636
  }
638
- const ur = (e, t) => {
637
+ const cr = (e, t) => {
639
638
  const n = V(() => t.renderer.value.domElement), r = $([]), { x: s, y: l } = tn({ target: n });
640
639
  let i = 0;
641
640
  const { width: a, height: c, top: o, left: u } = nn(n), v = ({ x: m, y: T }) => {
@@ -644,16 +643,16 @@ const ur = (e, t) => {
644
643
  x: (m - u.value) / a.value * 2 - 1,
645
644
  y: -((T - o.value) / c.value) * 2 + 1
646
645
  };
647
- }, f = ({ x: m, y: T }) => {
646
+ }, d = ({ x: m, y: T }) => {
648
647
  if (t.camera.value)
649
648
  return t.raycaster.value.setFromCamera(new ge(m, T), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
650
- }, h = (m) => {
649
+ }, g = (m) => {
651
650
  const T = v({
652
651
  x: (m == null ? void 0 : m.clientX) ?? s.value,
653
652
  y: (m == null ? void 0 : m.clientY) ?? l.value
654
653
  });
655
- return T ? f(T) || [] : [];
656
- }, g = j(), b = j(), y = j(), d = j(), C = j(), M = j(), P = j(), E = j();
654
+ return T ? d(T) || [] : [];
655
+ }, h = j(), b = j(), y = j(), f = j(), M = j(), P = j(), C = j(), E = j();
657
656
  function S(m) {
658
657
  const T = {};
659
658
  for (const F in m)
@@ -677,7 +676,7 @@ const ur = (e, t) => {
677
676
  };
678
677
  let A;
679
678
  const L = (m) => {
680
- h(m), _(y, m), A = m;
679
+ g(m), _(y, m), A = m;
681
680
  }, p = () => {
682
681
  A && L(A);
683
682
  };
@@ -687,15 +686,15 @@ const ur = (e, t) => {
687
686
  w = (T = r.value[0]) == null ? void 0 : T.object, i = 0, x = new ge(
688
687
  (m == null ? void 0 : m.clientX) ?? s.value,
689
688
  (m == null ? void 0 : m.clientY) ?? l.value
690
- ), _(C, m);
689
+ ), _(M, m);
691
690
  };
692
691
  let B, R = !1;
693
692
  const ne = (m) => {
694
693
  var T, F, re;
695
- m instanceof PointerEvent && (r.value.length === 0 && _(M, m), w === ((T = r.value[0]) == null ? void 0 : T.object) && (D = new ge(
694
+ m instanceof PointerEvent && (r.value.length === 0 && _(P, m), w === ((T = r.value[0]) == null ? void 0 : T.object) && (D = new ge(
696
695
  (m == null ? void 0 : m.clientX) ?? s.value,
697
696
  (m == null ? void 0 : m.clientY) ?? l.value
698
- ), i = x == null ? void 0 : x.distanceTo(D), m.button === 0 ? (_(g, m), B === ((F = r.value[0]) == null ? void 0 : F.object) ? R = !0 : (B = (re = r.value[0]) == null ? void 0 : re.object, R = !1)) : m.button === 2 && _(P, m)), _(d, m));
697
+ ), i = x == null ? void 0 : x.distanceTo(D), m.button === 0 ? (_(h, m), B === ((F = r.value[0]) == null ? void 0 : F.object) ? R = !0 : (B = (re = r.value[0]) == null ? void 0 : re.object, R = !1)) : m.button === 2 && _(C, m)), _(f, m));
699
698
  }, ke = (m) => {
700
699
  R && (_(b, m), B = void 0, R = !1);
701
700
  }, Le = (m) => _(y, m), Re = (m) => _(E, m);
@@ -703,18 +702,18 @@ const ur = (e, t) => {
703
702
  n != null && n.value && (n.value.removeEventListener("pointerup", ne), n.value.removeEventListener("pointerdown", O), n.value.removeEventListener("pointermove", L), n.value.removeEventListener("pointerleave", Le), n.value.removeEventListener("dblclick", ke), n.value.removeEventListener("wheel", Re));
704
703
  }), {
705
704
  intersects: r,
706
- onClick: (m) => g.on(m).off,
705
+ onClick: (m) => h.on(m).off,
707
706
  onDblClick: (m) => b.on(m).off,
708
- onContextMenu: (m) => P.on(m).off,
707
+ onContextMenu: (m) => C.on(m).off,
709
708
  onPointerMove: (m) => y.on(m).off,
710
- onPointerUp: (m) => d.on(m).off,
711
- onPointerDown: (m) => C.on(m).off,
712
- onPointerMissed: (m) => M.on(m).off,
709
+ onPointerUp: (m) => f.on(m).off,
710
+ onPointerDown: (m) => M.on(m).off,
711
+ onPointerMissed: (m) => P.on(m).off,
713
712
  onWheel: (m) => E.on(m).off,
714
713
  forceUpdate: p
715
714
  };
716
715
  };
717
- function Vr() {
716
+ function Gr() {
718
717
  const { logWarning: e } = Y();
719
718
  function t(l, i, a) {
720
719
  let c = null;
@@ -750,11 +749,11 @@ function xe(e) {
750
749
  }
751
750
  }), t;
752
751
  }
753
- function fr(e) {
752
+ function ur(e) {
754
753
  return (e / 1024).toFixed(2);
755
754
  }
756
- const Ce = H({}), Me = (e) => Object.assign(Ce.value, e);
757
- function dr(e, t, n) {
755
+ const Me = H({}), Pe = (e) => Object.assign(Me.value, e);
756
+ function fr(e, t, n) {
758
757
  var L;
759
758
  const r = $(), s = $();
760
759
  e && (r.value = e), t && (s.value = t);
@@ -790,28 +789,28 @@ function dr(e, t, n) {
790
789
  const {
791
790
  onClick: u,
792
791
  onDblClick: v,
793
- onContextMenu: f,
794
- onPointerMove: h,
795
- onPointerDown: g,
792
+ onContextMenu: d,
793
+ onPointerMove: g,
794
+ onPointerDown: h,
796
795
  onPointerUp: b,
797
796
  onPointerMissed: y,
798
- onWheel: d,
799
- forceUpdate: C
800
- } = ur(a, t);
801
- b((p) => o("onPointerUp", p)), g((p) => o("onPointerDown", p)), u((p) => o("onClick", p)), v((p) => o("onDoubleClick", p)), f((p) => o("onContextMenu", p)), d((p) => o("onWheel", p));
802
- let M = [];
803
- h((p) => {
797
+ onWheel: f,
798
+ forceUpdate: M
799
+ } = cr(a, t);
800
+ b((p) => o("onPointerUp", p)), h((p) => o("onPointerDown", p)), u((p) => o("onClick", p)), v((p) => o("onDoubleClick", p)), d((p) => o("onContextMenu", p)), f((p) => o("onWheel", p));
801
+ let P = [];
802
+ g((p) => {
804
803
  const w = p.intersections.map(({ object: D }) => D), x = p.intersections;
805
- M.forEach(({ object: D }) => {
806
- w.includes(D) || (p.intersections = M, o("onPointerLeave", p), o("onPointerOut", p));
804
+ P.forEach(({ object: D }) => {
805
+ w.includes(D) || (p.intersections = P, o("onPointerLeave", p), o("onPointerOut", p));
807
806
  }), p.intersections = x, p.intersections.forEach(({ object: D }) => {
808
- M.includes(D) || (o("onPointerEnter", p), o("onPointerOver", p));
809
- }), o("onPointerMove", p), M = p.intersections;
807
+ P.includes(D) || (o("onPointerEnter", p), o("onPointerOver", p));
808
+ }), o("onPointerMove", p), P = p.intersections;
810
809
  });
811
- const P = [];
810
+ const C = [];
812
811
  y((p) => {
813
812
  const w = () => p.stopPropagating = !0;
814
- p.stopPropagation = w, P.forEach((x) => {
813
+ p.stopPropagation = w, C.forEach((x) => {
815
814
  p.stopPropagating || (p.eventObject = x, c(x.onPointerMissed, p));
816
815
  }), n("pointer-missed", { event: p });
817
816
  });
@@ -825,29 +824,29 @@ function dr(e, t, n) {
825
824
  }
826
825
  }
827
826
  function _(p) {
828
- oe(p) && N(p) && p.onPointerMissed && P.push(p);
827
+ oe(p) && N(p) && p.onPointerMissed && C.push(p);
829
828
  }
830
829
  function A(p) {
831
830
  if (oe(p) && N(p)) {
832
- const w = P.indexOf(p);
833
- w > -1 && P.splice(w, 1);
831
+ const w = C.indexOf(p);
832
+ w > -1 && C.splice(w, 1);
834
833
  }
835
834
  }
836
835
  return t.eventManager = {
837
- forceUpdate: C,
836
+ forceUpdate: M,
838
837
  registerObject: E,
839
838
  deregisterObject: S,
840
839
  registerPointerMissedObject: _,
841
840
  deregisterPointerMissedObject: A
842
841
  }, {
843
- forceUpdate: C,
842
+ forceUpdate: M,
844
843
  registerObject: E,
845
844
  deregisterObject: S,
846
845
  registerPointerMissedObject: _,
847
846
  deregisterPointerMissedObject: A
848
847
  };
849
848
  }
850
- function pr(e, t, n = 10) {
849
+ function dr(e, t, n = 10) {
851
850
  const r = k(e) ? rn() : on(V(() => k(t).parentElement)), s = ye(Fe(r.width, n)), l = ye(Fe(r.height, n)), i = V(() => s.value / l.value);
852
851
  return {
853
852
  height: l,
@@ -860,8 +859,8 @@ function ve() {
860
859
  let n = 0, r = !1;
861
860
  const s = () => {
862
861
  const o = Array.from(e.entries()).sort((u, v) => {
863
- const f = u[1].priority - v[1].priority;
864
- return f === 0 ? u[1].addI - v[1].addI : f;
862
+ const d = u[1].priority - v[1].priority;
863
+ return d === 0 ? u[1].addI - v[1].addI : d;
865
864
  });
866
865
  t.clear(), o.forEach((u) => t.add(u[0]));
867
866
  }, l = (o) => {
@@ -881,7 +880,7 @@ function ve() {
881
880
  return e.size;
882
881
  } };
883
882
  }
884
- function mr() {
883
+ function pr() {
885
884
  let e = !0, t = !0, n = !1;
886
885
  const r = new tt(!1), s = H(r.running), l = H(!1);
887
886
  let i;
@@ -889,11 +888,11 @@ function mr() {
889
888
  let c = null;
890
889
  const o = ve(), u = ve(), v = ve();
891
890
  S();
892
- let f = {};
893
- function h(_) {
894
- f = _;
891
+ let d = {};
892
+ function g(_) {
893
+ d = _;
895
894
  }
896
- function g(_, A, L = 0) {
895
+ function h(_, A, L = 0) {
897
896
  switch (A) {
898
897
  case "before":
899
898
  return o.on(_, L);
@@ -909,16 +908,16 @@ function mr() {
909
908
  function y() {
910
909
  t = !0, S(), cancelAnimationFrame(i);
911
910
  }
912
- function d() {
911
+ function f() {
913
912
  n = !1, S();
914
913
  }
915
- function C() {
914
+ function M() {
916
915
  n = !0, S();
917
916
  }
918
- function M() {
917
+ function P() {
919
918
  l.value = !0;
920
919
  }
921
- function P() {
920
+ function C() {
922
921
  l.value = !1;
923
922
  }
924
923
  function E() {
@@ -927,13 +926,13 @@ function mr() {
927
926
  return;
928
927
  }
929
928
  const _ = r.getDelta(), A = r.getElapsedTime(), L = {
930
- camera: J(f.camera),
931
- scene: J(f.scene),
932
- renderer: J(f.renderer),
933
- raycaster: J(f.raycaster),
934
- controls: J(f.controls),
935
- invalidate: f.invalidate,
936
- advance: f.advance
929
+ camera: J(d.camera),
930
+ scene: J(d.scene),
931
+ renderer: J(d.renderer),
932
+ raycaster: J(d.raycaster),
933
+ controls: J(d.controls),
934
+ invalidate: d.invalidate,
935
+ advance: d.advance
937
936
  }, p = { delta: _, elapsed: A, clock: r, ...L };
938
937
  s.value && o.trigger(p), l.value || (u.count ? u.trigger(p) : c && c(p)), s.value && v.trigger(p), i = requestAnimationFrame(E);
939
938
  }
@@ -943,41 +942,41 @@ function mr() {
943
942
  }
944
943
  return {
945
944
  loopId: a,
946
- register: (_, A, L) => g(_, A, L),
945
+ register: (_, A, L) => h(_, A, L),
947
946
  start: b,
948
947
  stop: y,
949
- pause: C,
950
- resume: d,
951
- pauseRender: M,
952
- resumeRender: P,
948
+ pause: M,
949
+ resume: f,
950
+ pauseRender: P,
951
+ resumeRender: C,
953
952
  isRenderPaused: l,
954
953
  isActive: s,
955
- setContext: h,
954
+ setContext: g,
956
955
  setReady: (_) => e = _
957
956
  };
958
957
  }
959
- function hr(e, t, n = 100) {
958
+ function mr(e, t, n = 100) {
960
959
  n = n <= 0 ? 100 : n;
961
960
  const r = j(), s = /* @__PURE__ */ new Set();
962
961
  let l = !1, i = !1, a = null;
963
962
  function c() {
964
- a && clearTimeout(a), !i && !l && e() ? (r.trigger(t), s.forEach((f) => f()), s.clear(), l = !0) : !i && !l && (a = setTimeout(c, n));
963
+ a && clearTimeout(a), !i && !l && e() ? (r.trigger(t), s.forEach((d) => d()), s.clear(), l = !0) : !i && !l && (a = setTimeout(c, n));
965
964
  }
966
965
  function o() {
967
966
  i = !0, a && clearTimeout(a);
968
967
  }
969
968
  c();
970
- const u = (f, ...h) => {
971
- f(...h);
969
+ const u = (d, ...g) => {
970
+ d(...g);
972
971
  };
973
972
  return {
974
- on: (f) => {
973
+ on: (d) => {
975
974
  if (l)
976
- return u(f, t), { off: () => {
975
+ return u(d, t), { off: () => {
977
976
  } };
978
977
  {
979
- const h = r.on(f);
980
- return s.add(h.off), r.on(f);
978
+ const g = r.on(d);
979
+ return s.add(g.off), r.on(d);
981
980
  }
982
981
  },
983
982
  off: r.off,
@@ -989,7 +988,7 @@ const te = /* @__PURE__ */ new WeakMap();
989
988
  function gt(e) {
990
989
  if (e = e || pe(), te.has(e))
991
990
  return te.get(e);
992
- const t = 100, n = Date.now(), l = hr(() => {
991
+ const t = 100, n = Date.now(), l = mr(() => {
993
992
  if (Date.now() - n >= t)
994
993
  return !0;
995
994
  {
@@ -999,12 +998,12 @@ function gt(e) {
999
998
  }, e);
1000
999
  return te.set(e, l), l;
1001
1000
  }
1002
- function Yr(e) {
1001
+ function Vr(e) {
1003
1002
  const t = pe();
1004
1003
  if (t)
1005
1004
  return te.has(t) ? te.get(t).on(e) : gt(t).on(e);
1006
1005
  }
1007
- function gr({
1006
+ function hr({
1008
1007
  scene: e,
1009
1008
  canvas: t,
1010
1009
  windowSize: n,
@@ -1012,24 +1011,24 @@ function gr({
1012
1011
  rendererOptions: s,
1013
1012
  emit: l
1014
1013
  }) {
1015
- const i = $(e), a = pr(n, t), {
1014
+ const i = $(e), a = dr(n, t), {
1016
1015
  camera: c,
1017
1016
  cameras: o,
1018
1017
  registerCamera: u,
1019
1018
  deregisterCamera: v,
1020
- setCameraActive: f
1021
- } = In({ sizes: a, scene: e }), h = {
1019
+ setCameraActive: d
1020
+ } = In({ sizes: a, scene: e }), g = {
1022
1021
  mode: H(s.renderMode || "always"),
1023
1022
  priority: H(0),
1024
1023
  frames: H(0),
1025
1024
  maxFrames: 60,
1026
- canBeInvalidated: V(() => h.mode.value === "on-demand" && h.frames.value === 0)
1025
+ canBeInvalidated: V(() => g.mode.value === "on-demand" && g.frames.value === 0)
1027
1026
  };
1028
- function g(O = 1) {
1029
- s.renderMode === "on-demand" && (h.frames.value = Math.min(h.maxFrames, h.frames.value + O));
1027
+ function h(O = 1) {
1028
+ s.renderMode === "on-demand" && (g.frames.value = Math.min(g.maxFrames, g.frames.value + O));
1030
1029
  }
1031
1030
  function b() {
1032
- s.renderMode === "manual" && (h.frames.value = 1);
1031
+ s.renderMode === "manual" && (g.frames.value = 1);
1033
1032
  }
1034
1033
  const { renderer: y } = ar(
1035
1034
  {
@@ -1038,10 +1037,10 @@ function gr({
1038
1037
  options: s,
1039
1038
  emit: l,
1040
1039
  // TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
1041
- contextParts: { sizes: a, camera: c, render: h, invalidate: g, advance: b },
1040
+ contextParts: { sizes: a, camera: c, render: g, invalidate: h, advance: b },
1042
1041
  disableRender: r
1043
1042
  }
1044
- ), d = {
1043
+ ), f = {
1045
1044
  sizes: a,
1046
1045
  scene: i,
1047
1046
  camera: c,
@@ -1061,47 +1060,47 @@ function gr({
1061
1060
  accumulator: []
1062
1061
  }
1063
1062
  },
1064
- render: h,
1063
+ render: g,
1065
1064
  advance: b,
1066
- extend: Me,
1067
- invalidate: g,
1065
+ extend: Pe,
1066
+ invalidate: h,
1068
1067
  registerCamera: u,
1069
- setCameraActive: f,
1068
+ setCameraActive: d,
1070
1069
  deregisterCamera: v,
1071
- loop: mr()
1070
+ loop: pr()
1072
1071
  };
1073
- _e("useTres", d), d.scene.value.__tres = {
1074
- root: d
1075
- }, d.loop.register(() => {
1076
- c.value && h.frames.value > 0 && (y.value.render(e, c.value), l("render", d.renderer.value)), h.priority.value = 0, h.mode.value === "always" ? h.frames.value = 1 : h.frames.value = Math.max(0, h.frames.value - 1);
1072
+ _e("useTres", f), f.scene.value.__tres = {
1073
+ root: f
1074
+ }, f.loop.register(() => {
1075
+ c.value && g.frames.value > 0 && (y.value.render(e, c.value), l("render", f.renderer.value)), g.priority.value = 0, g.mode.value === "always" ? g.frames.value = 1 : g.frames.value = Math.max(0, g.frames.value - 1);
1077
1076
  }, "render");
1078
- const { on: C, cancel: M } = gt(d);
1079
- d.loop.setReady(!1), d.loop.start(), C(() => {
1080
- l("ready", d), d.loop.setReady(!0), dr(e, d, l);
1077
+ const { on: M, cancel: P } = gt(f);
1078
+ f.loop.setReady(!1), f.loop.start(), M(() => {
1079
+ l("ready", f), f.loop.setReady(!0), fr(e, f, l);
1081
1080
  }), K(() => {
1082
- M(), d.loop.stop();
1081
+ P(), f.loop.stop();
1083
1082
  });
1084
- const P = 100, E = an({ every: P }), { isSupported: S, memory: _ } = ln({ interval: P }), A = 160;
1083
+ const C = 100, E = an({ every: C }), { isSupported: S, memory: _ } = ln({ interval: C }), A = 160;
1085
1084
  let L = performance.now();
1086
1085
  const p = ({ timestamp: O }) => {
1087
- d.scene.value && (d.perf.memory.allocatedMem = xe(d.scene.value)), O - L >= P && (L = O, d.perf.fps.accumulator.push(E.value), d.perf.fps.accumulator.length > A && d.perf.fps.accumulator.shift(), d.perf.fps.value = E.value, S.value && _.value && (d.perf.memory.accumulator.push(_.value.usedJSHeapSize / 1024 / 1024), d.perf.memory.accumulator.length > A && d.perf.memory.accumulator.shift(), d.perf.memory.currentMem = d.perf.memory.accumulator.reduce((B, R) => B + R, 0) / d.perf.memory.accumulator.length));
1086
+ f.scene.value && (f.perf.memory.allocatedMem = xe(f.scene.value)), O - L >= C && (L = O, f.perf.fps.accumulator.push(E.value), f.perf.fps.accumulator.length > A && f.perf.fps.accumulator.shift(), f.perf.fps.value = E.value, S.value && _.value && (f.perf.memory.accumulator.push(_.value.usedJSHeapSize / 1024 / 1024), f.perf.memory.accumulator.length > A && f.perf.memory.accumulator.shift(), f.perf.memory.currentMem = f.perf.memory.accumulator.reduce((B, R) => B + R, 0) / f.perf.memory.accumulator.length));
1088
1087
  };
1089
1088
  let w = 0;
1090
1089
  const x = 1, { pause: D } = it(({ delta: O }) => {
1091
- window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= x && (window.__TRES__DEVTOOLS__.cb(d), w = 0));
1090
+ window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= x && (window.__TRES__DEVTOOLS__.cb(f), w = 0));
1092
1091
  }, { immediate: !0 });
1093
1092
  return K(() => {
1094
1093
  D();
1095
- }), d;
1094
+ }), f;
1096
1095
  }
1097
1096
  function pe() {
1098
- const e = Ct("useTres");
1097
+ const e = Mt("useTres");
1099
1098
  if (!e)
1100
1099
  throw new Error("useTresContext must be used together with useTresContextProvider");
1101
1100
  return e;
1102
1101
  }
1103
- const qr = pe;
1104
- function Jr() {
1102
+ const Yr = pe;
1103
+ function qr() {
1105
1104
  const {
1106
1105
  camera: e,
1107
1106
  scene: t,
@@ -1121,14 +1120,14 @@ function Jr() {
1121
1120
  invalidate: i,
1122
1121
  advance: a
1123
1122
  });
1124
- function c(v, f = 0) {
1125
- return r.register(v, "before", f);
1123
+ function c(v, d = 0) {
1124
+ return r.register(v, "before", d);
1126
1125
  }
1127
1126
  function o(v) {
1128
1127
  return r.register(v, "render");
1129
1128
  }
1130
- function u(v, f = 0) {
1131
- return r.register(v, "after", f);
1129
+ function u(v, d = 0) {
1130
+ return r.register(v, "after", d);
1132
1131
  }
1133
1132
  return {
1134
1133
  pause: r.pause,
@@ -1141,7 +1140,7 @@ function Jr() {
1141
1140
  onAfterRender: u
1142
1141
  };
1143
1142
  }
1144
- function vr(e, t = {}, n = {}) {
1143
+ function gr(e, t = {}, n = {}) {
1145
1144
  let r = e;
1146
1145
  const s = (a) => {
1147
1146
  r = a;
@@ -1175,65 +1174,65 @@ const { logError: Ke } = Y(), Qe = [
1175
1174
  "onPointerMissed",
1176
1175
  "onLostPointerCapture",
1177
1176
  "onWheel"
1178
- ], yr = (e) => {
1177
+ ], vr = (e) => {
1179
1178
  const t = e.scene.value;
1180
- function n(o, u, v, f) {
1181
- if (f || (f = {}), f.args || (f.args = []), o === "template" || zn(o))
1179
+ function n(o, u, v, d) {
1180
+ if (d || (d = {}), d.args || (d.args = []), o === "template" || zn(o))
1182
1181
  return null;
1183
- let h = o.replace("Tres", ""), g;
1182
+ let g = o.replace("Tres", ""), h;
1184
1183
  if (o === "primitive") {
1185
- (!U(f.object) || Mt(f.object)) && Ke(
1184
+ (!U(d.object) || Pt(d.object)) && Ke(
1186
1185
  "Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"
1187
- ), h = f.object.type;
1186
+ ), g = d.object.type;
1188
1187
  const b = {};
1189
- g = vr(
1190
- f.object,
1188
+ h = gr(
1189
+ d.object,
1191
1190
  {
1192
- object: (d) => d,
1191
+ object: (f) => f,
1193
1192
  isPrimitive: () => !0,
1194
1193
  __tres: () => b
1195
1194
  },
1196
1195
  {
1197
- object: (d, C, M, P) => {
1198
- sr(d, M, P, { patchProp: l, remove: s, insert: r }, e);
1196
+ object: (f, M, P, C) => {
1197
+ sr(f, P, C, { patchProp: l, remove: s, insert: r }, e);
1199
1198
  },
1200
- __tres: (d) => {
1201
- Object.assign(b, d);
1199
+ __tres: (f) => {
1200
+ Object.assign(b, f);
1202
1201
  }
1203
1202
  }
1204
1203
  );
1205
1204
  } else {
1206
- const b = Ce.value[h];
1205
+ const b = Me.value[g];
1207
1206
  b || Ke(
1208
- `${h} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1209
- ), g = new b(...f.args);
1207
+ `${g} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1208
+ ), h = new b(...d.args);
1210
1209
  }
1211
- return g ? (g.isCamera && (f != null && f.position || g.position.set(3, 3, 3), f != null && f.lookAt || g.lookAt(0, 0, 0)), g = z(g, {
1212
- ...g.__tres,
1213
- type: h,
1214
- memoizedProps: f,
1210
+ return h ? (h.isCamera && (d != null && d.position || h.position.set(3, 3, 3), d != null && d.lookAt || h.lookAt(0, 0, 0)), h = z(h, {
1211
+ ...h.__tres,
1212
+ type: g,
1213
+ memoizedProps: d,
1215
1214
  eventCount: 0,
1216
1215
  primitive: o === "primitive",
1217
- attach: f.attach
1218
- }, e), g) : null;
1216
+ attach: d.attach
1217
+ }, e), h) : null;
1219
1218
  }
1220
1219
  function r(o, u) {
1221
- var h, g, b;
1220
+ var g, h, b;
1222
1221
  if (!o)
1223
1222
  return;
1224
1223
  u = u || t;
1225
- const v = o.__tres ? o : z(o, {}, e), f = u.__tres ? u : z(u, {}, e);
1226
- o = Q(v), u = Q(f), o.__tres && ((h = o.__tres) == null ? void 0 : h.eventCount) > 0 && ((g = e.eventManager) == null || g.registerObject(o)), e.registerCamera(o), (b = e.eventManager) == null || b.registerPointerMissedObject(o), v.__tres.attach ? nr(f, v, v.__tres.attach) : N(o) && N(f) && (f.add(o), o.dispatchEvent({ type: "added" })), v.__tres.parent = f, f.__tres.objects && !f.__tres.objects.includes(v) && f.__tres.objects.push(v);
1224
+ const v = o.__tres ? o : z(o, {}, e), d = u.__tres ? u : z(u, {}, e);
1225
+ o = Q(v), u = Q(d), o.__tres && ((g = o.__tres) == null ? void 0 : g.eventCount) > 0 && ((h = e.eventManager) == null || h.registerObject(o)), e.registerCamera(o), (b = e.eventManager) == null || b.registerPointerMissedObject(o), v.__tres.attach ? nr(d, v, v.__tres.attach) : N(o) && N(d) && (d.add(o), o.dispatchEvent({ type: "added" })), v.__tres.parent = d, d.__tres.objects && !d.__tres.objects.includes(v) && d.__tres.objects.push(v);
1227
1226
  }
1228
1227
  function s(o, u) {
1229
- var g, b, y, d;
1228
+ var h, b, y, f;
1230
1229
  if (!o)
1231
1230
  return;
1232
- o != null && o.__tres && ((g = o.__tres) == null ? void 0 : g.eventCount) > 0 && ((b = e.eventManager) == null || b.deregisterObject(o)), u = be(u) ? "default" : u;
1231
+ o != null && o.__tres && ((h = o.__tres) == null ? void 0 : h.eventCount) > 0 && ((b = e.eventManager) == null || b.deregisterObject(o)), u = be(u) ? "default" : u;
1233
1232
  const v = (y = o.__tres) == null ? void 0 : y.dispose;
1234
1233
  be(v) || (v === null ? u = !1 : u = v);
1235
- const f = (d = o.__tres) == null ? void 0 : d.primitive, h = u === "default" ? !f : !!u;
1236
- if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((C) => s(C, u)), h && o.children && [...o.children].forEach((C) => s(C, u)), mt(o, e), ht(o, e), h && !jn(o)) {
1234
+ const d = (f = o.__tres) == null ? void 0 : f.primitive, g = u === "default" ? !d : !!u;
1235
+ if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((M) => s(M, u)), g && o.children && [...o.children].forEach((M) => s(M, u)), mt(o, e), ht(o, e), g && !jn(o)) {
1237
1236
  if (G(u))
1238
1237
  u(o);
1239
1238
  else if (G(o.dispose))
@@ -1244,53 +1243,53 @@ const { logError: Ke } = Y(), Qe = [
1244
1243
  }
1245
1244
  "__tres" in o && delete o.__tres;
1246
1245
  }
1247
- function l(o, u, v, f) {
1248
- var C, M;
1246
+ function l(o, u, v, d) {
1247
+ var M, P;
1249
1248
  if (!o)
1250
1249
  return;
1251
- let h = o, g = u;
1252
- if (o.__tres && (o.__tres.memoizedProps[u] = f), u === "attach") {
1253
- const P = ((C = o.__tres) == null ? void 0 : C.parent) || o.parent;
1254
- s(o), z(o, { attach: f }, e), P && r(o, P);
1250
+ let g = o, h = u;
1251
+ if (o.__tres && (o.__tres.memoizedProps[u] = d), u === "attach") {
1252
+ const C = ((M = o.__tres) == null ? void 0 : M.parent) || o.parent;
1253
+ s(o), z(o, { attach: d }, e), C && r(o, C);
1255
1254
  return;
1256
1255
  }
1257
1256
  if (u === "dispose") {
1258
- o.__tres || (o = z(o, {}, e)), o.__tres.dispose = f;
1257
+ o.__tres || (o = z(o, {}, e)), o.__tres.dispose = d;
1259
1258
  return;
1260
1259
  }
1261
- if (N(o) && g === "blocks-pointer-events") {
1262
- f || f === "" ? o[g] = f : delete o[g];
1260
+ if (N(o) && h === "blocks-pointer-events") {
1261
+ d || d === "" ? o[h] = d : delete o[h];
1263
1262
  return;
1264
1263
  }
1265
1264
  Qe.includes(u) && o.__tres && (o.__tres.eventCount += 1);
1266
- let b = ie(g), y = h == null ? void 0 : h[b];
1267
- if (g === "args") {
1268
- const P = o, E = v ?? [], S = f ?? [], _ = ((M = o.__tres) == null ? void 0 : M.type) || o.type;
1269
- _ && E.length && !Jn(E, S) && (h = Object.assign(
1270
- P,
1271
- new Ce.value[_](...f)
1265
+ let b = ie(h), y = g == null ? void 0 : g[b];
1266
+ if (h === "args") {
1267
+ const C = o, E = v ?? [], S = d ?? [], _ = ((P = o.__tres) == null ? void 0 : P.type) || o.type;
1268
+ _ && E.length && !Jn(E, S) && (g = Object.assign(
1269
+ C,
1270
+ new Me.value[_](...d)
1272
1271
  ));
1273
1272
  return;
1274
1273
  }
1275
- if (h.type === "BufferGeometry") {
1276
- if (g === "args")
1274
+ if (g.type === "BufferGeometry") {
1275
+ if (h === "args")
1277
1276
  return;
1278
- h.setAttribute(
1279
- ie(g),
1280
- new Wt(...f)
1277
+ g.setAttribute(
1278
+ ie(h),
1279
+ new Wt(...d)
1281
1280
  );
1282
1281
  return;
1283
1282
  }
1284
- if (g.includes("-") && y === void 0) {
1285
- const P = g.split("-");
1286
- y = P.reduce((E, S) => E[ie(S)], h), g = P.pop(), b = g, y != null && y.set || (h = P.reduce((E, S) => E[ie(S)], h));
1283
+ if (h.includes("-") && y === void 0) {
1284
+ const C = h.split("-");
1285
+ y = C.reduce((E, S) => E[ie(S)], g), h = C.pop(), b = h, y != null && y.set || (g = C.reduce((E, S) => E[ie(S)], g));
1287
1286
  }
1288
- let d = f;
1289
- if (d === "" && (d = !0), G(y)) {
1290
- Qe.includes(u) || (de(d) ? o[b](...d) : o[b](d)), b.startsWith("on") && G(d) && (h[b] = d);
1287
+ let f = d;
1288
+ if (f === "" && (f = !0), G(y)) {
1289
+ Qe.includes(u) || (de(f) ? o[b](...f) : o[b](f)), b.startsWith("on") && G(f) && (g[b] = f);
1291
1290
  return;
1292
1291
  }
1293
- !(y != null && y.set) && !G(y) ? h[b] = d : y.constructor === d.constructor && (y != null && y.copy) ? y == null || y.copy(d) : de(d) ? y.set(...d) : !y.isColor && y.setScalar ? y.setScalar(d) : y.set(d), pt(o);
1292
+ !(y != null && y.set) && !G(y) ? g[b] = f : y.constructor === f.constructor && (y != null && y.copy) ? y == null || y.copy(f) : de(f) ? y.set(...f) : !y.isColor && y.setScalar ? y.setScalar(f) : y.set(f), pt(o);
1294
1293
  }
1295
1294
  function i(o) {
1296
1295
  var u;
@@ -1301,9 +1300,9 @@ const { logError: Ke } = Y(), Qe = [
1301
1300
  return u.name = o, u;
1302
1301
  }
1303
1302
  function c(o) {
1304
- var h;
1305
- const u = i(o), v = ((h = u == null ? void 0 : u.__tres) == null ? void 0 : h.objects) || [], f = v.indexOf(o);
1306
- return f < 0 || f >= v.length - 1 ? null : v[f + 1];
1303
+ var g;
1304
+ const u = i(o), v = ((g = u == null ? void 0 : u.__tres) == null ? void 0 : g.objects) || [], d = v.indexOf(o);
1305
+ return d < 0 || d >= v.length - 1 ? null : v[d + 1];
1307
1306
  }
1308
1307
  return {
1309
1308
  insert: r,
@@ -1322,13 +1321,13 @@ const { logError: Ke } = Y(), Qe = [
1322
1321
  insertStaticContent: () => void 0
1323
1322
  };
1324
1323
  };
1325
- function _r() {
1324
+ function yr() {
1326
1325
  return vt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
1327
1326
  }
1328
1327
  function vt() {
1329
1328
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
1330
1329
  }
1331
- const wr = typeof Proxy == "function", br = "devtools-plugin:setup", Pr = "plugin:settings:set";
1330
+ const _r = typeof Proxy == "function", wr = "devtools-plugin:setup", br = "plugin:settings:set";
1332
1331
  let q, Ee;
1333
1332
  function Cr() {
1334
1333
  var e;
@@ -1337,7 +1336,7 @@ function Cr() {
1337
1336
  function Mr() {
1338
1337
  return Cr() ? Ee.now() : Date.now();
1339
1338
  }
1340
- class Er {
1339
+ class Pr {
1341
1340
  constructor(t, n) {
1342
1341
  this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
1343
1342
  const r = {};
@@ -1367,7 +1366,7 @@ class Er {
1367
1366
  now() {
1368
1367
  return Mr();
1369
1368
  }
1370
- }, n && n.on(Pr, (i, a) => {
1369
+ }, n && n.on(br, (i, a) => {
1371
1370
  i === this.plugin.id && this.fallbacks.setSettings(a);
1372
1371
  }), this.proxiedOn = new Proxy({}, {
1373
1372
  get: (i, a) => this.target ? this.target.on[a] : (...c) => {
@@ -1399,12 +1398,12 @@ class Er {
1399
1398
  n.resolve(await this.target[n.method](...n.args));
1400
1399
  }
1401
1400
  }
1402
- function Tr(e, t) {
1403
- const n = e, r = vt(), s = _r(), l = wr && n.enableEarlyProxy;
1401
+ function Er(e, t) {
1402
+ const n = e, r = vt(), s = yr(), l = _r && n.enableEarlyProxy;
1404
1403
  if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
1405
- s.emit(br, e, t);
1404
+ s.emit(wr, e, t);
1406
1405
  else {
1407
- const i = l ? new Er(n, s) : null;
1406
+ const i = l ? new Pr(n, s) : null;
1408
1407
  (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1409
1408
  pluginDescriptor: n,
1410
1409
  setupFn: t,
@@ -1412,7 +1411,7 @@ function Tr(e, t) {
1412
1411
  }), i && t(i.proxiedTarget);
1413
1412
  }
1414
1413
  }
1415
- function Sr(e, t) {
1414
+ function Tr(e, t) {
1416
1415
  const n = `▲ ■ ●${e}`;
1417
1416
  typeof Xe == "function" ? Xe(n, t) : console.log(n);
1418
1417
  }
@@ -1433,7 +1432,7 @@ const yt = (e) => {
1433
1432
  });
1434
1433
  const n = xe(e);
1435
1434
  return n > 0 && t.tags.push({
1436
- label: `${fr(n)} KB`,
1435
+ label: `${ur(n)} KB`,
1437
1436
  textColor: 15707189,
1438
1437
  backgroundColor: 16775644,
1439
1438
  tooltip: "Memory usage"
@@ -1467,22 +1466,22 @@ function _t(e, t, n = "") {
1467
1466
  t.children.push(s), _t(r, s, n);
1468
1467
  });
1469
1468
  }
1470
- const Ar = [], X = "tres:inspector", xr = Et({
1469
+ const Sr = [], X = "tres:inspector", Ar = Et({
1471
1470
  sceneGraph: null
1472
1471
  });
1473
- function kr(e, t) {
1474
- Tr(
1472
+ function xr(e, t) {
1473
+ Er(
1475
1474
  {
1476
1475
  id: "dev.esm.tres",
1477
1476
  label: "TresJS 🪐",
1478
1477
  logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
1479
1478
  packageName: "tresjs",
1480
1479
  homepage: "https://tresjs.org",
1481
- componentStateTypes: Ar,
1480
+ componentStateTypes: Sr,
1482
1481
  app: e
1483
1482
  },
1484
1483
  (n) => {
1485
- typeof n.now != "function" && Sr(
1484
+ typeof n.now != "function" && Tr(
1486
1485
  "You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."
1487
1486
  ), n.addInspector({
1488
1487
  id: X,
@@ -1496,7 +1495,7 @@ function kr(e, t) {
1496
1495
  }, 5e3), n.on.getInspectorTree((l) => {
1497
1496
  if (l.inspectorId === X) {
1498
1497
  const i = yt(t.scene.value);
1499
- _t(t.scene.value, i, l.filter), xr.sceneGraph = i, l.rootNodes = [i];
1498
+ _t(t.scene.value, i, l.filter), Ar.sceneGraph = i, l.rootNodes = [i];
1500
1499
  }
1501
1500
  });
1502
1501
  let r = null, s = null;
@@ -1535,7 +1534,7 @@ function kr(e, t) {
1535
1534
  }
1536
1535
  );
1537
1536
  }
1538
- const Lr = ["data-scene", "data-tres"], Rr = /* @__PURE__ */ Be({
1537
+ const kr = ["data-scene", "data-tres"], Lr = /* @__PURE__ */ Be({
1539
1538
  __name: "TresCanvas",
1540
1539
  props: {
1541
1540
  shadows: { type: Boolean, default: void 0 },
@@ -1582,37 +1581,37 @@ const Lr = ["data-scene", "data-tres"], Rr = /* @__PURE__ */ Be({
1582
1581
  setup(e, { expose: t, emit: n }) {
1583
1582
  var y;
1584
1583
  const r = e, s = n, l = Tt(), { logWarning: i } = Y(), a = H(), c = $(new nt()), o = (y = Ie()) == null ? void 0 : y.appContext.app;
1585
- Me(et);
1586
- const u = (d, C = !1) => Be({
1584
+ Pe(et);
1585
+ const u = (f, M = !1) => Be({
1587
1586
  setup() {
1588
- var P;
1589
- const M = (P = Ie()) == null ? void 0 : P.appContext;
1590
- return M && (M.app = o), _e("useTres", d), _e("extend", Me), typeof window < "u" && kr(M == null ? void 0 : M.app, d), () => He(Ot, null, C ? [] : l.default());
1587
+ var C;
1588
+ const P = (C = Ie()) == null ? void 0 : C.appContext;
1589
+ return P && (P.app = o), _e("useTres", f), _e("extend", Pe), typeof window < "u" && xr(P == null ? void 0 : P.app, f), () => He(Ot, null, M ? [] : l.default());
1591
1590
  }
1592
- }), v = (d, C = !1) => {
1593
- const M = u(d, C), { render: P } = Rt(yr(d));
1594
- P(He(M), c.value);
1595
- }, f = (d, C = !1) => {
1596
- dt(d.scene.value), C && (d.renderer.value.dispose(), d.renderer.value.renderLists.dispose(), d.renderer.value.forceContextLoss()), c.value.__tres = {
1597
- root: d
1591
+ }), v = (f, M = !1) => {
1592
+ const P = u(f, M), { render: C } = Rt(vr(f));
1593
+ C(He(P), c.value);
1594
+ }, d = (f, M = !1) => {
1595
+ dt(f.scene.value), M && (f.renderer.value.dispose(), f.renderer.value.renderLists.dispose(), f.renderer.value.forceContextLoss()), c.value.__tres = {
1596
+ root: f
1598
1597
  };
1599
- }, h = V(() => r.disableRender), g = $(null);
1600
- t({ context: g, dispose: () => f(g.value, !0) });
1598
+ }, g = V(() => r.disableRender), h = $(null);
1599
+ t({ context: h, dispose: () => d(h.value, !0) });
1601
1600
  const b = () => {
1602
- f(g.value), v(g.value, !0);
1601
+ d(h.value), v(h.value, !0);
1603
1602
  };
1604
1603
  return St(() => {
1605
- const d = a;
1606
- g.value = gr({
1604
+ const f = a;
1605
+ h.value = hr({
1607
1606
  scene: c.value,
1608
- canvas: d,
1607
+ canvas: f,
1609
1608
  windowSize: r.windowSize ?? !1,
1610
- disableRender: h.value ?? !1,
1609
+ disableRender: g.value ?? !1,
1611
1610
  rendererOptions: r,
1612
1611
  emit: s
1613
1612
  });
1614
- const { registerCamera: C, camera: M, cameras: P, deregisterCamera: E } = g.value;
1615
- v(g.value);
1613
+ const { registerCamera: M, camera: P, cameras: C, deregisterCamera: E } = h.value;
1614
+ v(h.value);
1616
1615
  const S = () => {
1617
1616
  const _ = new we(
1618
1617
  45,
@@ -1620,52 +1619,52 @@ const Lr = ["data-scene", "data-tres"], Rr = /* @__PURE__ */ Be({
1620
1619
  0.1,
1621
1620
  1e3
1622
1621
  );
1623
- _.position.set(3, 3, 3), _.lookAt(0, 0, 0), C(_);
1622
+ _.position.set(3, 3, 3), _.lookAt(0, 0, 0), M(_);
1624
1623
  const A = Te(() => {
1625
- P.value.length >= 2 && (_.removeFromParent(), E(_), A == null || A());
1624
+ C.value.length >= 2 && (_.removeFromParent(), E(_), A == null || A());
1626
1625
  });
1627
1626
  };
1628
1627
  ce(
1629
1628
  () => r.camera,
1630
1629
  (_, A) => {
1631
- _ && C(_), A && (A.removeFromParent(), E(A));
1630
+ _ && M(_), A && (A.removeFromParent(), E(A));
1632
1631
  },
1633
1632
  {
1634
1633
  immediate: !0
1635
1634
  }
1636
- ), M.value || (i(
1635
+ ), P.value || (i(
1637
1636
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
1638
1637
  ), S());
1639
- }), K(b), (d, C) => (At(), xt("canvas", {
1638
+ }), K(b), (f, M) => (At(), xt("canvas", {
1640
1639
  ref_key: "canvas",
1641
1640
  ref: a,
1642
1641
  "data-scene": c.value.uuid,
1643
- class: kt(d.$attrs.class),
1642
+ class: kt(f.$attrs.class),
1644
1643
  "data-tres": `tresjs ${J(xn).version}`,
1645
1644
  style: Lt({
1646
1645
  display: "block",
1647
1646
  width: "100%",
1648
1647
  height: "100%",
1649
- position: d.windowSize ? "fixed" : "relative",
1648
+ position: f.windowSize ? "fixed" : "relative",
1650
1649
  top: 0,
1651
1650
  left: 0,
1652
1651
  pointerEvents: "auto",
1653
1652
  touchAction: "none",
1654
- ...d.$attrs.style
1653
+ ...f.$attrs.style
1655
1654
  })
1656
- }, null, 14, Lr));
1655
+ }, null, 14, kr));
1657
1656
  }
1658
- }), Or = [
1657
+ }), Rr = [
1659
1658
  "TresCanvas",
1660
1659
  "TresLeches",
1661
1660
  "TresScene"
1662
- ], Dr = {
1661
+ ], Or = {
1663
1662
  template: {
1664
1663
  compilerOptions: {
1665
- isCustomElement: (e) => e.startsWith("Tres") && !Or.includes(e) || e === "primitive"
1664
+ isCustomElement: (e) => e.startsWith("Tres") && !Rr.includes(e) || e === "primitive"
1666
1665
  }
1667
1666
  }
1668
- }, Kr = Dr, Qr = {
1667
+ }, Jr = Or, Kr = {
1669
1668
  mounted: (e, t) => {
1670
1669
  if (t.arg) {
1671
1670
  console.log(`v-log:${t.arg}`, e[t.arg]);
@@ -1699,19 +1698,19 @@ class wt extends zt {
1699
1698
  }
1700
1699
  const { logWarning: Ze } = Y();
1701
1700
  let le, W;
1702
- const jr = {
1701
+ const Dr = {
1703
1702
  DirectionalLight: qt,
1704
1703
  PointLight: Jt,
1705
1704
  SpotLight: Kt,
1706
1705
  HemisphereLight: Qt,
1707
1706
  RectAreaLight: wt
1708
- }, Xr = {
1707
+ }, Qr = {
1709
1708
  mounted: (e) => {
1710
1709
  if (!e.isLight) {
1711
1710
  Ze(`${e.type} is not a light`);
1712
1711
  return;
1713
1712
  }
1714
- le = jr[e.type], e.parent.add(new le(e, 1, e.color.getHex()));
1713
+ le = Dr[e.type], e.parent.add(new le(e, 1, e.color.getHex()));
1715
1714
  },
1716
1715
  updated: (e) => {
1717
1716
  W = e.parent.children.find((t) => t instanceof le), !(W instanceof wt) && W.update();
@@ -1723,14 +1722,14 @@ const jr = {
1723
1722
  }
1724
1723
  W = e.parent.children.find((t) => t instanceof le), W && W.dispose && W.dispose(), e.parent.remove(W);
1725
1724
  }
1726
- }, { logWarning: Br } = Y();
1725
+ }, { logWarning: jr } = Y();
1727
1726
  let I = null;
1728
- const Zr = {
1727
+ const Xr = {
1729
1728
  updated: (e, t) => {
1730
1729
  var s;
1731
1730
  const n = Zn(t);
1732
1731
  if (!n) {
1733
- Br(`v-distance-to: problem with binding value: ${t.value}`);
1732
+ jr(`v-distance-to: problem with binding value: ${t.value}`);
1734
1733
  return;
1735
1734
  }
1736
1735
  I && (I.dispose(), e.parent.remove(I));
@@ -1746,38 +1745,38 @@ const Zr = {
1746
1745
  unmounted: (e) => {
1747
1746
  I == null || I.dispose(), e.parent.remove(I);
1748
1747
  }
1749
- }, eo = {
1748
+ }, Zr = {
1750
1749
  install(e) {
1751
- e.component("TresCanvas", Rr);
1750
+ e.component("TresCanvas", Lr);
1752
1751
  }
1753
1752
  };
1754
1753
  export {
1755
- Rr as TresCanvas,
1756
- Ce as catalogue,
1757
- mr as createRenderLoop,
1758
- eo as default,
1754
+ Lr as TresCanvas,
1755
+ Me as catalogue,
1756
+ pr as createRenderLoop,
1757
+ Zr as default,
1759
1758
  dt as dispose,
1760
- Me as extend,
1761
- Wr as isProd,
1759
+ Pe as extend,
1760
+ Fr as isProd,
1762
1761
  Fn as normalizeColor,
1763
- Nr as normalizeVectorFlexibleParam,
1764
- Yr as onTresReady,
1765
- Kr as templateCompilerOptions,
1766
- cr as trasverseObjects,
1762
+ Wr as normalizeVectorFlexibleParam,
1763
+ Vr as onTresReady,
1764
+ Jr as templateCompilerOptions,
1765
+ lr as trasverseObjects,
1767
1766
  In as useCamera,
1768
- zr as useLoader,
1767
+ Nr as useLoader,
1769
1768
  Y as useLogger,
1770
- Jr as useLoop,
1771
- ur as useRaycaster,
1772
- Fr as useRenderLoop,
1769
+ qr as useLoop,
1770
+ cr as useRaycaster,
1771
+ Ur as useRenderLoop,
1773
1772
  ar as useRenderer,
1774
- Vr as useSeek,
1775
- Gr as useTexture,
1776
- qr as useTres,
1773
+ Gr as useSeek,
1774
+ zr as useTexture,
1775
+ Yr as useTres,
1777
1776
  pe as useTresContext,
1778
- gr as useTresContextProvider,
1779
- dr as useTresEventManager,
1780
- Zr as vDistanceTo,
1781
- Xr as vLightHelper,
1782
- Qr as vLog
1777
+ hr as useTresContextProvider,
1778
+ fr as useTresEventManager,
1779
+ Xr as vDistanceTo,
1780
+ Qr as vLightHelper,
1781
+ Kr as vLog
1783
1782
  };