@tresjs/core 3.7.0-next.0 → 4.0.0-next.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/tres.js CHANGED
@@ -1,441 +1,490 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v3.7.0-next.0
3
+ * version: v4.0.0-next.0
4
4
  * (c) 2023
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { ref as L, computed as D, watchEffect as k, onUnmounted as O, shallowRef as S, watch as ae, reactive as ge, readonly as ye, provide as G, inject as he, createRenderer as we, defineComponent as J, useSlots as Ee, getCurrentInstance as K, onMounted as _e, openBlock as Ce, createElementBlock as Me, normalizeClass as Pe, normalizeStyle as Ae, h as X, Fragment as be } from "vue";
9
- import * as De from "three";
10
- import { PerspectiveCamera as W, OrthographicCamera as ke, Camera as Te, Clock as Se, Vector3 as xe, Color as F, REVISION as Le, SRGBColorSpace as Oe, ACESFilmicToneMapping as Be, PCFSoftShadowMap as Re, WebGLRenderer as N, LoadingManager as je, TextureLoader as He, Vector2 as Fe, Raycaster as ze, BufferAttribute as $e, Scene as Ie } from "three";
11
- import { createEventHook as x, useRafFn as ne, toValue as C, unrefElement as Ne, useDevicePixelRatio as Ve, usePointer as Ge, useElementBounding as We, useWindowSize as qe, useElementSize as Ue, useFps as Ye, useMemory as Je } from "@vueuse/core";
12
- const Ke = ({ sizes: e, scene: n }) => {
13
- const t = L([]), r = D(
8
+ var Me = Object.defineProperty;
9
+ var Pe = (e, r, t) => r in e ? Me(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
10
+ var G = (e, r, t) => (Pe(e, typeof r != "symbol" ? r + "" : r, t), t);
11
+ import { ref as B, computed as k, watchEffect as A, onUnmounted as U, shallowRef as D, watch as ie, reactive as le, readonly as Se, provide as Q, inject as ke, createRenderer as Te, defineComponent as Z, useSlots as Oe, getCurrentInstance as ee, onMounted as Ae, openBlock as xe, createElementBlock as De, normalizeClass as Le, normalizeStyle as Be, h as te, Fragment as je } from "vue";
12
+ import * as ue from "three";
13
+ import { PerspectiveCamera as Y, OrthographicCamera as Ie, Camera as Re, Clock as He, Vector3 as Ne, Color as N, MeshBasicMaterial as Ve, DoubleSide as $e, REVISION as Ue, SRGBColorSpace as Fe, ACESFilmicToneMapping as Ge, PCFSoftShadowMap as ze, WebGLRenderer as z, LoadingManager as We, TextureLoader as Qe, Vector2 as Ye, Raycaster as Je, BufferAttribute as Ke, Scene as qe } from "three";
14
+ import { createEventHook as L, useRafFn as ce, toValue as E, unrefElement as Xe, useDevicePixelRatio as Ze, usePointer as et, useElementBounding as tt, useWindowSize as rt, useElementSize as nt, useFps as ot, useMemory as at } from "@vueuse/core";
15
+ const st = ({ sizes: e, scene: r }) => {
16
+ const t = B([]), n = k(
14
17
  () => t.value[0]
15
- ), a = (l, c = !1) => {
16
- t.value.some(({ uuid: m }) => m === l.uuid) || (c ? u(l) : t.value.push(l));
17
- }, o = (l) => {
18
- t.value = t.value.filter(({ uuid: c }) => c !== l.uuid);
19
- }, u = (l) => {
20
- const c = l instanceof Te ? l : t.value.find((h) => h.uuid === l);
21
- if (!c)
18
+ ), a = (i, l = !1) => {
19
+ t.value.some(({ uuid: c }) => c === i.uuid) || (l ? o(i) : t.value.push(i));
20
+ }, s = (i) => {
21
+ t.value = t.value.filter(({ uuid: l }) => l !== i.uuid);
22
+ }, o = (i) => {
23
+ const l = i instanceof Re ? i : t.value.find((m) => m.uuid === i);
24
+ if (!l)
22
25
  return;
23
- const m = t.value.filter(({ uuid: h }) => h !== c.uuid);
24
- t.value = [c, ...m];
26
+ const c = t.value.filter(({ uuid: m }) => m !== l.uuid);
27
+ t.value = [l, ...c];
25
28
  };
26
- return k(() => {
27
- e.aspectRatio.value && t.value.forEach((l) => {
28
- l instanceof W && (l.aspect = e.aspectRatio.value), (l instanceof W || l instanceof ke) && l.updateProjectionMatrix();
29
+ return A(() => {
30
+ e.aspectRatio.value && t.value.forEach((i) => {
31
+ i instanceof Y && (i.aspect = e.aspectRatio.value), (i instanceof Y || i instanceof Ie) && i.updateProjectionMatrix();
29
32
  });
30
- }), n.userData.tres__registerCamera = a, n.userData.tres__deregisterCamera = o, O(() => {
33
+ }), r.userData.tres__registerCamera = a, r.userData.tres__deregisterCamera = s, U(() => {
31
34
  t.value = [];
32
35
  }), {
33
- camera: r,
36
+ camera: n,
34
37
  cameras: t,
35
38
  registerCamera: a,
36
- deregisterCamera: o,
37
- setCameraActive: u
39
+ deregisterCamera: s,
40
+ setCameraActive: o
38
41
  };
39
- }, oe = x(), se = x(), U = x(), T = new Se();
40
- let z = 0, $ = 0;
41
- const { pause: Xe, resume: Qe, isActive: Ze } = ne(
42
+ }, fe = L(), de = L(), q = L(), x = new He();
43
+ let V = 0, $ = 0;
44
+ const { pause: it, resume: lt, isActive: ut } = ce(
42
45
  () => {
43
- oe.trigger({ delta: z, elapsed: $, clock: T }), se.trigger({ delta: z, elapsed: $, clock: T }), U.trigger({ delta: z, elapsed: $, clock: T });
46
+ fe.trigger({ delta: V, elapsed: $, clock: x }), de.trigger({ delta: V, elapsed: $, clock: x }), q.trigger({ delta: V, elapsed: $, clock: x });
44
47
  },
45
48
  { immediate: !1 }
46
49
  );
47
- U.on(() => {
48
- z = T.getDelta(), $ = T.getElapsedTime();
50
+ q.on(() => {
51
+ V = x.getDelta(), $ = x.getElapsedTime();
49
52
  });
50
- const ie = () => ({
51
- onBeforeLoop: oe.on,
52
- onLoop: se.on,
53
- onAfterLoop: U.on,
54
- pause: Xe,
55
- resume: Qe,
56
- isActive: Ze
57
- }), bt = !0, Q = "[TresJS ▲ ■ ●] ";
58
- function B() {
59
- function e(r, a) {
60
- console.error(`${Q} ${r}`, a || "");
53
+ const me = () => ({
54
+ onBeforeLoop: fe.on,
55
+ onLoop: de.on,
56
+ onAfterLoop: q.on,
57
+ pause: it,
58
+ resume: lt,
59
+ isActive: ut
60
+ }), Zt = !0, re = "[TresJS ▲ ■ ●] ";
61
+ function j() {
62
+ function e(n, a) {
63
+ console.error(`${re} ${n}`, a || "");
61
64
  }
62
- function n(r) {
63
- console.warn(`${Q} ${r}`);
65
+ function r(n) {
66
+ console.warn(`${re} ${n}`);
64
67
  }
65
- function t(r, a) {
68
+ function t(n, a) {
66
69
  }
67
70
  return {
68
71
  logError: e,
69
- logWarning: n,
72
+ logWarning: r,
70
73
  logMessage: t
71
74
  };
72
75
  }
73
- function Dt(e) {
74
- return typeof e == "number" ? [e, e, e] : e instanceof xe ? [e.x, e.y, e.z] : e;
76
+ function er(e) {
77
+ return typeof e == "number" ? [e, e, e] : e instanceof Ne ? [e.x, e.y, e.z] : e;
75
78
  }
76
- function et(e) {
77
- return e instanceof F ? e : Array.isArray(e) ? new F(...e) : new F(e);
79
+ function ct(e) {
80
+ return e instanceof N ? e : Array.isArray(e) ? new N(...e) : new N(e);
78
81
  }
79
- const le = (e, n) => {
80
- for (const t of Object.keys(n))
81
- n[t] instanceof Object && Object.assign(n[t], le(e[t], n[t]));
82
- return Object.assign(e || {}, n), e;
83
- }, tt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", rt = /* @__PURE__ */ at(tt);
84
- function Z(e) {
82
+ class ft extends ue.Mesh {
83
+ constructor(...t) {
84
+ super(...t);
85
+ G(this, "type", "HightlightMesh");
86
+ G(this, "createTime");
87
+ this.createTime = Date.now();
88
+ }
89
+ onBeforeRender() {
90
+ const n = (Date.now() - this.createTime) / 1e3, o = 1 + 0.07 * Math.sin(2.5 * n);
91
+ this.scale.set(o, o, o);
92
+ }
93
+ }
94
+ const pe = (e, r) => {
95
+ for (const t of Object.keys(r))
96
+ r[t] instanceof Object && Object.assign(r[t], pe(e[t], r[t]));
97
+ return Object.assign(e || {}, r), e;
98
+ }, dt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", mt = /* @__PURE__ */ pt(dt);
99
+ function ne(e) {
85
100
  return e && e.nodeType === 1;
86
101
  }
87
- function j(e) {
88
- return e.replace(/-([a-z])/g, (n, t) => t.toUpperCase());
102
+ function R(e) {
103
+ return e.replace(/-([a-z])/g, (r, t) => t.toUpperCase());
89
104
  }
90
- function at(e, n) {
91
- const t = /* @__PURE__ */ Object.create(null), r = e.split(",");
92
- for (let a = 0; a < r.length; a++)
93
- t[r[a]] = !0;
94
- return n ? (a) => !!t[a.toLowerCase()] : (a) => !!t[a];
105
+ function pt(e, r) {
106
+ const t = /* @__PURE__ */ Object.create(null), n = e.split(",");
107
+ for (let a = 0; a < n.length; a++)
108
+ t[n[a]] = !0;
109
+ return r ? (a) => !!t[a.toLowerCase()] : (a) => !!t[a];
95
110
  }
96
- const nt = (e, n) => {
97
- const t = /* @__PURE__ */ new Set(), r = [];
111
+ const gt = (e, r) => {
112
+ const t = /* @__PURE__ */ new Set(), n = [];
98
113
  for (const a of e) {
99
- const o = n(a);
100
- t.has(o) || (t.add(o), r.push(a));
114
+ const s = r(a);
115
+ t.has(s) || (t.add(s), n.push(a));
101
116
  }
102
- return r;
103
- }, ee = (e, n) => {
104
- if (!n)
117
+ return n;
118
+ }, oe = (e, r) => {
119
+ if (!r)
105
120
  return;
106
- const t = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
107
- return t == null ? void 0 : t.reduce((r, a) => r && r[a], e);
108
- }, ot = (e, n, t) => {
109
- const r = Array.isArray(n) ? n : n.match(/([^[.\]])+/g);
110
- r && r.reduce((a, o, u) => (a[o] === void 0 && (a[o] = {}), u === r.length - 1 && (a[o] = t), a[o]), e);
121
+ const t = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
122
+ return t == null ? void 0 : t.reduce((n, a) => n && n[a], e);
123
+ }, vt = (e, r, t) => {
124
+ const n = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
125
+ n && n.reduce((a, s, o) => (a[s] === void 0 && (a[s] = {}), o === n.length - 1 && (a[s] = t), a[s]), e);
111
126
  };
112
- function ue(e, n) {
113
- if (Z(e) && Z(n)) {
114
- const a = e.attributes, o = n.attributes;
115
- return a.length !== o.length ? !1 : Array.from(a).every(({ name: u, value: l }) => n.getAttribute(u) === l);
127
+ function ge(e, r) {
128
+ if (ne(e) && ne(r)) {
129
+ const a = e.attributes, s = r.attributes;
130
+ return a.length !== s.length ? !1 : Array.from(a).every(({ name: o, value: i }) => r.getAttribute(o) === i);
116
131
  }
117
- if (e === n)
132
+ if (e === r)
118
133
  return !0;
119
- if (e === null || typeof e != "object" || n === null || typeof n != "object")
134
+ if (e === null || typeof e != "object" || r === null || typeof r != "object")
120
135
  return !1;
121
- const t = Object.keys(e), r = Object.keys(n);
122
- if (t.length !== r.length)
136
+ const t = Object.keys(e), n = Object.keys(r);
137
+ if (t.length !== n.length)
123
138
  return !1;
124
139
  for (const a of t)
125
- if (!r.includes(a) || !ue(e[a], n[a]))
140
+ if (!n.includes(a) || !ge(e[a], r[a]))
126
141
  return !1;
127
142
  return !0;
128
143
  }
129
- function st(e, n) {
130
- if (!Array.isArray(e) || !Array.isArray(n) || e.length !== n.length)
144
+ function ht(e, r) {
145
+ if (!Array.isArray(e) || !Array.isArray(r) || e.length !== r.length)
131
146
  return !1;
132
147
  for (let t = 0; t < e.length; t++)
133
- if (!ue(e[t], n[t]))
148
+ if (!ge(e[t], r[t]))
134
149
  return !1;
135
150
  return !0;
136
151
  }
137
- const it = Array.isArray;
138
- function ce(e) {
139
- var n, t;
140
- e.children && e.children.forEach((r) => ce(r));
141
- for (const r in e)
142
- (t = (n = e[r]) == null ? void 0 : n.dispose) == null || t.call(n), delete e[r];
143
- e.dispose && e.type !== "Scene" && e.dispose();
152
+ const yt = Array.isArray;
153
+ function _t(e, r, t, n) {
154
+ const a = (l) => {
155
+ if (l.uuid === r)
156
+ return l;
157
+ for (const c of l.children) {
158
+ const m = a(c);
159
+ if (m)
160
+ return m;
161
+ }
162
+ }, s = a(e);
163
+ if (!s) {
164
+ console.warn("Object with UUID not found in the scene.");
165
+ return;
166
+ }
167
+ let o = s;
168
+ for (let l = 0; l < t.length - 1; l++)
169
+ if (o[t[l]] !== void 0)
170
+ o = o[t[l]];
171
+ else {
172
+ console.warn(`Property path is not valid: ${t.join(".")}`);
173
+ return;
174
+ }
175
+ const i = t[t.length - 1];
176
+ o[i] !== void 0 ? o[i] = n : console.warn(`Property path is not valid: ${t.join(".")}`);
177
+ }
178
+ function wt(e) {
179
+ const r = new Ve({
180
+ color: 11003607,
181
+ // Highlight color, e.g., yellow
182
+ transparent: !0,
183
+ opacity: 0.2,
184
+ depthTest: !1,
185
+ // So the highlight is always visible
186
+ side: $e
187
+ // To e
188
+ });
189
+ return new ft(e.geometry.clone(), r);
144
190
  }
145
- const lt = Number.parseInt(Le.replace("dev", "")), H = {
191
+ const bt = Number.parseInt(Ue.replace("dev", "")), H = {
146
192
  realistic: {
147
193
  shadows: !0,
148
194
  physicallyCorrectLights: !0,
149
- outputColorSpace: Oe,
150
- toneMapping: Be,
195
+ outputColorSpace: Fe,
196
+ toneMapping: Ge,
151
197
  toneMappingExposure: 3,
152
198
  shadowMap: {
153
199
  enabled: !0,
154
- type: Re
200
+ type: ze
155
201
  }
156
202
  }
157
203
  };
158
- function ut({
204
+ function Et({
159
205
  scene: e,
160
- canvas: n,
206
+ canvas: r,
161
207
  options: t,
162
- disableRender: r,
163
- contextParts: { sizes: a, camera: o }
208
+ disableRender: n,
209
+ contextParts: { sizes: a, camera: s }
164
210
  }) {
165
- const u = D(() => ({
166
- alpha: C(t.alpha),
167
- depth: C(t.depth),
168
- canvas: Ne(n),
169
- context: C(t.context),
170
- stencil: C(t.stencil),
171
- antialias: C(t.antialias) === void 0 ? !0 : C(t.antialias),
172
- precision: C(t.precision),
173
- powerPreference: C(t.powerPreference),
174
- premultipliedAlpha: C(t.premultipliedAlpha),
175
- preserveDrawingBuffer: C(t.preserveDrawingBuffer),
176
- logarithmicDepthBuffer: C(t.logarithmicDepthBuffer),
177
- failIfMajorPerformanceCaveat: C(t.failIfMajorPerformanceCaveat)
178
- })), l = S(new N(u.value));
179
- ae(u, () => {
180
- l.value.dispose(), l.value = new N(u.value);
181
- }), k(() => {
182
- l.value.setSize(a.width.value, a.height.value);
211
+ const o = k(() => ({
212
+ alpha: E(t.alpha),
213
+ depth: E(t.depth),
214
+ canvas: Xe(r),
215
+ context: E(t.context),
216
+ stencil: E(t.stencil),
217
+ antialias: E(t.antialias) === void 0 ? !0 : E(t.antialias),
218
+ precision: E(t.precision),
219
+ powerPreference: E(t.powerPreference),
220
+ premultipliedAlpha: E(t.premultipliedAlpha),
221
+ preserveDrawingBuffer: E(t.preserveDrawingBuffer),
222
+ logarithmicDepthBuffer: E(t.logarithmicDepthBuffer),
223
+ failIfMajorPerformanceCaveat: E(t.failIfMajorPerformanceCaveat)
224
+ })), i = D(new z(o.value));
225
+ ie(o, () => {
226
+ i.value.dispose(), i.value = new z(o.value);
227
+ }), A(() => {
228
+ i.value.setSize(a.width.value, a.height.value);
183
229
  });
184
- const { pixelRatio: c } = Ve();
185
- k(() => {
186
- l.value.setPixelRatio(c.value);
230
+ const { pixelRatio: l } = Ze();
231
+ A(() => {
232
+ i.value.setPixelRatio(l.value);
187
233
  });
188
- const { logError: m } = B(), i = (() => {
189
- const p = new N(), w = {
234
+ const { logError: c } = j(), f = (() => {
235
+ const d = new z(), y = {
190
236
  shadowMap: {
191
- enabled: p.shadowMap.enabled,
192
- type: p.shadowMap.type
237
+ enabled: d.shadowMap.enabled,
238
+ type: d.shadowMap.type
193
239
  },
194
- toneMapping: p.toneMapping,
195
- toneMappingExposure: p.toneMappingExposure,
196
- outputColorSpace: p.outputColorSpace
240
+ toneMapping: d.toneMapping,
241
+ toneMappingExposure: d.toneMappingExposure,
242
+ outputColorSpace: d.outputColorSpace
197
243
  };
198
- return p.dispose(), w;
244
+ return d.dispose(), y;
199
245
  })();
200
- k(() => {
201
- const p = C(t.preset);
202
- p && (p in H || m(`Renderer Preset must be one of these: ${Object.keys(H).join(", ")}`), le(l.value, H[p]));
203
- const w = (P, A) => {
204
- const E = C(P), b = () => {
205
- if (p)
206
- return ee(H[p], A);
246
+ A(() => {
247
+ const d = E(t.preset);
248
+ d && (d in H || c(`Renderer Preset must be one of these: ${Object.keys(H).join(", ")}`), pe(i.value, H[d]));
249
+ const y = (M, P) => {
250
+ const w = E(M), S = () => {
251
+ if (d)
252
+ return oe(H[d], P);
207
253
  };
208
- if (E !== void 0)
209
- return E;
210
- const g = b();
211
- return g !== void 0 ? g : ee(i, A);
212
- }, v = (P, A) => ot(l.value, A, w(P, A));
213
- v(t.shadows, "shadowMap.enabled"), v(t.toneMapping, "toneMapping"), v(t.shadowMapType, "shadowMap.type"), lt < 150 && v(!t.useLegacyLights, "physicallyCorrectLights"), v(t.outputColorSpace, "outputColorSpace"), v(t.toneMappingExposure, "toneMappingExposure");
214
- const M = w(t.clearColor, "clearColor");
215
- M && l.value.setClearColor(
216
- M ? et(M) : new F(0)
254
+ if (w !== void 0)
255
+ return w;
256
+ const v = S();
257
+ return v !== void 0 ? v : oe(f, P);
258
+ }, p = (M, P) => vt(i.value, P, y(M, P));
259
+ p(t.shadows, "shadowMap.enabled"), p(t.toneMapping, "toneMapping"), p(t.shadowMapType, "shadowMap.type"), bt < 150 && p(!t.useLegacyLights, "physicallyCorrectLights"), p(t.outputColorSpace, "outputColorSpace"), p(t.toneMappingExposure, "toneMappingExposure");
260
+ const C = y(t.clearColor, "clearColor");
261
+ C && i.value.setClearColor(
262
+ C ? ct(C) : new N(0)
217
263
  // default clear color is not easily/efficiently retrievable from three
218
264
  );
219
265
  });
220
- const { pause: s, resume: f, onLoop: d } = ie();
221
- return d(() => {
222
- o.value && !C(r) && l.value.render(e, o.value);
223
- }), f(), O(() => {
224
- s(), l.value.dispose(), l.value.forceContextLoss();
266
+ const { pause: u, resume: g, onLoop: _ } = me();
267
+ return _(() => {
268
+ s.value && !E(n) && i.value.render(e, s.value);
269
+ }), g(), U(() => {
270
+ u(), i.value.dispose(), i.value.forceContextLoss();
225
271
  }), {
226
- renderer: l
272
+ renderer: i
227
273
  };
228
274
  }
229
- const te = (e) => typeof e == "function", ct = (e) => !!e && e.constructor === Array;
230
- function ft(e) {
231
- const n = { nodes: {}, materials: {} };
275
+ const ae = (e) => typeof e == "function", Ct = (e) => !!e && e.constructor === Array;
276
+ function Mt(e) {
277
+ const r = { nodes: {}, materials: {} };
232
278
  return e && e.traverse((t) => {
233
- t.name && (n.nodes[t.name] = t), t.material && !n.materials[t.material.name] && (n.materials[t.material.name] = t.material);
234
- }), n;
279
+ t.name && (r.nodes[t.name] = t), t.material && !r.materials[t.material.name] && (r.materials[t.material.name] = t.material);
280
+ }), r;
235
281
  }
236
- async function kt(e, n, t, r, a) {
237
- const { logError: o } = B(), u = new e();
238
- a && a(u), t && t(u);
239
- const c = (Array.isArray(n) ? n : [n]).map(
240
- (m) => new Promise((h, i) => {
241
- u.load(
242
- m,
243
- (s) => {
244
- s.scene && Object.assign(s, ft(s.scene)), h(s);
282
+ async function tr(e, r, t, n, a) {
283
+ const { logError: s } = j(), o = new e();
284
+ a && a(o), t && t(o);
285
+ const l = (Array.isArray(r) ? r : [r]).map(
286
+ (c) => new Promise((m, f) => {
287
+ o.load(
288
+ c,
289
+ (u) => {
290
+ u.scene && Object.assign(u, Mt(u.scene)), m(u);
245
291
  },
246
- r,
247
- (s) => i(o("[useLoader] - Failed to load resource", s))
292
+ n,
293
+ (u) => f(s("[useLoader] - Failed to load resource", u))
248
294
  );
249
295
  })
250
296
  );
251
- return ct(n) ? await Promise.all(c) : await c[0];
297
+ return Ct(r) ? await Promise.all(l) : await l[0];
252
298
  }
253
- async function Tt(e) {
254
- const n = new je(), t = new He(n), r = (a) => new Promise((o, u) => {
299
+ async function rr(e) {
300
+ const r = new We(), t = new Qe(r), n = (a) => new Promise((s, o) => {
255
301
  t.load(
256
302
  a,
257
- (l) => o(l),
303
+ (i) => s(i),
258
304
  () => null,
259
305
  () => {
260
- u(new Error("[useTextures] - Failed to load texture"));
306
+ o(new Error("[useTextures] - Failed to load texture"));
261
307
  }
262
308
  );
263
309
  });
264
- if (it(e)) {
265
- const a = await Promise.all(e.map((o) => r(o)));
310
+ if (yt(e)) {
311
+ const a = await Promise.all(e.map((s) => n(s)));
266
312
  return e.length > 1 ? a : a[0];
267
313
  } else {
268
314
  const {
269
315
  map: a,
270
- displacementMap: o,
271
- normalMap: u,
272
- roughnessMap: l,
273
- metalnessMap: c,
274
- aoMap: m,
275
- alphaMap: h,
276
- matcap: i
316
+ displacementMap: s,
317
+ normalMap: o,
318
+ roughnessMap: i,
319
+ metalnessMap: l,
320
+ aoMap: c,
321
+ alphaMap: m,
322
+ matcap: f
277
323
  } = e;
278
324
  return {
279
- map: a ? await r(a) : null,
280
- displacementMap: o ? await r(o) : null,
281
- normalMap: u ? await r(u) : null,
282
- roughnessMap: l ? await r(l) : null,
283
- metalnessMap: c ? await r(c) : null,
284
- aoMap: m ? await r(m) : null,
285
- alphaMap: h ? await r(h) : null,
286
- matcap: i ? await r(i) : null
325
+ map: a ? await n(a) : null,
326
+ displacementMap: s ? await n(s) : null,
327
+ normalMap: o ? await n(o) : null,
328
+ roughnessMap: i ? await n(i) : null,
329
+ metalnessMap: l ? await n(l) : null,
330
+ aoMap: c ? await n(c) : null,
331
+ alphaMap: m ? await n(m) : null,
332
+ matcap: f ? await n(f) : null
287
333
  };
288
334
  }
289
335
  }
290
- const mt = (e, { renderer: n, camera: t, raycaster: r }) => {
291
- const a = D(() => n.value.domElement), { x: o, y: u } = Ge({ target: a }), { width: l, height: c, top: m, left: h } = We(a), i = ({ x: g, y: _ }) => {
336
+ const Pt = (e, { renderer: r, camera: t, raycaster: n }) => {
337
+ const a = k(() => r.value.domElement), { x: s, y: o } = et({ target: a }), { width: i, height: l, top: c, left: m } = tt(a), f = ({ x: v, y: b }) => {
292
338
  if (a.value)
293
339
  return {
294
- x: (g - h.value) / l.value * 2 - 1,
295
- y: -((_ - m.value) / c.value) * 2 + 1
340
+ x: (v - m.value) / i.value * 2 - 1,
341
+ y: -((b - c.value) / l.value) * 2 + 1
296
342
  };
297
- }, s = ({ x: g, y: _ }) => {
343
+ }, u = ({ x: v, y: b }) => {
298
344
  if (t.value)
299
- return r.value.setFromCamera(new Fe(g, _), t.value), r.value.intersectObjects(e.value, !1);
300
- }, f = (g) => {
301
- const _ = i({
302
- x: (g == null ? void 0 : g.clientX) ?? o.value,
303
- y: (g == null ? void 0 : g.clientY) ?? u.value
345
+ return n.value.setFromCamera(new Ye(v, b), t.value), n.value.intersectObjects(e.value, !1);
346
+ }, g = (v) => {
347
+ const b = f({
348
+ x: (v == null ? void 0 : v.clientX) ?? s.value,
349
+ y: (v == null ? void 0 : v.clientY) ?? o.value
304
350
  });
305
- return _ ? s(_) || [] : [];
306
- }, d = D(() => f()), p = x(), w = x(), v = (g, _) => {
307
- g.trigger({ event: _, intersects: f(_) });
308
- }, M = (g) => {
309
- v(w, g);
351
+ return b ? u(b) || [] : [];
352
+ }, _ = k(() => g()), d = L(), y = L(), p = (v, b) => {
353
+ v.trigger({ event: b, intersects: g(b) });
354
+ }, C = (v) => {
355
+ p(y, v);
310
356
  };
311
- let P;
312
- const A = (g) => {
313
- var _;
314
- P = (_ = f(g)[0]) == null ? void 0 : _.object;
315
- }, E = (g) => {
316
- var _;
317
- g instanceof PointerEvent && P === ((_ = f(g)[0]) == null ? void 0 : _.object) && v(p, g);
318
- }, b = (g) => w.trigger({ event: g, intersects: [] });
319
- return a.value.addEventListener("pointerup", E), a.value.addEventListener("pointerdown", A), a.value.addEventListener("pointermove", M), a.value.addEventListener("pointerleave", b), O(() => {
320
- a != null && a.value && (a.value.removeEventListener("pointerup", E), a.value.removeEventListener("pointerdown", A), a.value.removeEventListener("pointermove", M), a.value.removeEventListener("pointerleave", b));
357
+ let M;
358
+ const P = (v) => {
359
+ var b;
360
+ M = (b = g(v)[0]) == null ? void 0 : b.object;
361
+ }, w = (v) => {
362
+ var b;
363
+ v instanceof PointerEvent && M === ((b = g(v)[0]) == null ? void 0 : b.object) && p(d, v);
364
+ }, S = (v) => y.trigger({ event: v, intersects: [] });
365
+ return a.value.addEventListener("pointerup", w), a.value.addEventListener("pointerdown", P), a.value.addEventListener("pointermove", C), a.value.addEventListener("pointerleave", S), U(() => {
366
+ a != null && a.value && (a.value.removeEventListener("pointerup", w), a.value.removeEventListener("pointerdown", P), a.value.removeEventListener("pointermove", C), a.value.removeEventListener("pointerleave", S));
321
367
  }), {
322
- intersects: d,
323
- onClick: (g) => p.on(g).off,
324
- onPointerMove: (g) => w.on(g).off
368
+ intersects: _,
369
+ onClick: (v) => d.on(v).off,
370
+ onPointerMove: (v) => y.on(v).off
325
371
  };
326
372
  };
327
- function St() {
328
- const { logWarning: e } = B();
329
- function n(o, u, l) {
330
- let c = null;
331
- return o.traverse((m) => {
332
- m[u] === l && (c = m);
333
- }), c || e(`Child with ${u} '${l}' not found.`), c;
373
+ function nr() {
374
+ const { logWarning: e } = j();
375
+ function r(s, o, i) {
376
+ let l = null;
377
+ return s.traverse((c) => {
378
+ c[o] === i && (l = c);
379
+ }), l || e(`Child with ${o} '${i}' not found.`), l;
334
380
  }
335
- function t(o, u, l) {
336
- const c = [];
337
- return o.traverse((m) => {
338
- m[u].includes(l) && c.push(m);
339
- }), c.length || e(`Children with ${u} '${l}' not found.`), c;
381
+ function t(s, o, i) {
382
+ const l = [];
383
+ return s.traverse((c) => {
384
+ c[o].includes(i) && l.push(c);
385
+ }), l.length || e(`Children with ${o} '${i}' not found.`), l;
340
386
  }
341
- function r(o, u) {
342
- return n(o, "name", u);
387
+ function n(s, o) {
388
+ return r(s, "name", o);
343
389
  }
344
- function a(o, u) {
345
- return t(o, "name", u);
390
+ function a(s, o) {
391
+ return t(s, "name", o);
346
392
  }
347
393
  return {
348
- seek: n,
349
- seekByName: r,
394
+ seek: r,
395
+ seekByName: n,
350
396
  seekAll: t,
351
397
  seekAllByName: a
352
398
  };
353
399
  }
354
- const pt = ({ scene: e, contextParts: n }) => {
355
- const t = ge({
400
+ const St = ({ scene: e, contextParts: r }) => {
401
+ const t = le({
356
402
  click: /* @__PURE__ */ new Map(),
357
403
  pointerMove: /* @__PURE__ */ new Map(),
358
404
  pointerEnter: /* @__PURE__ */ new Map(),
359
405
  pointerLeave: /* @__PURE__ */ new Map()
360
- }), r = L(/* @__PURE__ */ new Set()), a = (s) => {
361
- r.value.add(s);
362
- }, o = (s) => {
363
- r.value.delete(s);
364
- }, u = (s) => {
365
- Object.values(t).forEach((f) => f.delete(s)), o(s);
366
- }, l = (s) => {
367
- const { onClick: f, onPointerMove: d, onPointerEnter: p, onPointerLeave: w } = s;
368
- f && t.click.set(s, f), d && t.pointerMove.set(s, d), p && t.pointerEnter.set(s, p), w && t.pointerLeave.set(s, w);
406
+ }), n = B(/* @__PURE__ */ new Set()), a = (u) => {
407
+ n.value.add(u);
408
+ }, s = (u) => {
409
+ n.value.delete(u);
410
+ }, o = (u) => {
411
+ Object.values(t).forEach((g) => g.delete(u)), s(u);
412
+ }, i = (u) => {
413
+ const { onClick: g, onPointerMove: _, onPointerEnter: d, onPointerLeave: y } = u;
414
+ g && t.click.set(u, g), _ && t.pointerMove.set(u, _), d && t.pointerEnter.set(u, d), y && t.pointerLeave.set(u, y);
369
415
  };
370
- e.userData.tres__registerAtPointerEventHandler = l, e.userData.tres__deregisterAtPointerEventHandler = u, e.userData.tres__registerBlockingObjectAtPointerEventHandler = a, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = o;
371
- const c = D(
372
- () => nt(
416
+ e.userData.tres__registerAtPointerEventHandler = i, e.userData.tres__deregisterAtPointerEventHandler = o, e.userData.tres__registerBlockingObjectAtPointerEventHandler = a, e.userData.tres__deregisterBlockingObjectAtPointerEventHandler = s;
417
+ const l = k(
418
+ () => gt(
373
419
  [
374
- ...Array.from(r.value),
375
- ...Object.values(t).map((s) => Array.from(s.keys())).flat()
420
+ ...Array.from(n.value),
421
+ ...Object.values(t).map((u) => Array.from(u.keys())).flat()
376
422
  ],
377
- ({ uuid: s }) => s
423
+ ({ uuid: u }) => u
378
424
  )
379
- ), { onClick: m, onPointerMove: h } = mt(c, n);
380
- m(({ intersects: s, event: f }) => {
381
- var d;
382
- s.length && ((d = t.click.get(s[0].object)) == null || d(s[0], f));
425
+ ), { onClick: c, onPointerMove: m } = Pt(l, r);
426
+ c(({ intersects: u, event: g }) => {
427
+ var _;
428
+ u.length && ((_ = t.click.get(u[0].object)) == null || _(u[0], g));
383
429
  });
384
- let i;
385
- return h(({ intersects: s, event: f }) => {
386
- var M, P, A, E;
387
- const d = (M = s == null ? void 0 : s[0]) == null ? void 0 : M.object, { pointerLeave: p, pointerEnter: w, pointerMove: v } = t;
388
- i && i !== d && ((P = p.get(i)) == null || P(i, f)), d && (i !== d && ((A = w.get(d)) == null || A(s[0], f)), (E = v.get(d)) == null || E(s[0], f)), i = d || null;
430
+ let f;
431
+ return m(({ intersects: u, event: g }) => {
432
+ var C, M, P, w;
433
+ const _ = (C = u == null ? void 0 : u[0]) == null ? void 0 : C.object, { pointerLeave: d, pointerEnter: y, pointerMove: p } = t;
434
+ f && f !== _ && ((M = d.get(f)) == null || M(f, g)), _ && (f !== _ && ((P = y.get(_)) == null || P(u[0], g)), (w = p.get(_)) == null || w(u[0], g)), f = _ || null;
389
435
  }), {
390
- registerObject: l,
391
- deregisterObject: u
436
+ registerObject: i,
437
+ deregisterObject: o
392
438
  };
393
439
  };
394
- function dt(e) {
395
- let n = 0;
440
+ function ve(e) {
441
+ let r = 0;
396
442
  return e.traverse((t) => {
397
443
  if (t.isMesh && t.geometry) {
398
- const r = t.geometry, a = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, o = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, u = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, l = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, c = a + o + u + l;
399
- n += c;
444
+ const n = t.geometry, a = n.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, s = n.index ? n.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, o = n.attributes.normal ? n.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, i = n.attributes.uv ? n.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, l = a + s + o + i;
445
+ r += l;
400
446
  }
401
- }), n;
447
+ }), r;
448
+ }
449
+ function kt(e) {
450
+ return (e / 1024).toFixed(2);
402
451
  }
403
- const q = L({}), Y = (e) => Object.assign(q.value, e);
404
- function vt({
452
+ const J = B({}), X = (e) => Object.assign(J.value, e);
453
+ function Tt({
405
454
  scene: e,
406
- canvas: n,
455
+ canvas: r,
407
456
  windowSize: t,
408
- disableRender: r,
457
+ disableRender: n,
409
458
  rendererOptions: a
410
459
  }) {
411
- const o = D(
412
- () => C(t) ? qe() : Ue(C(n).parentElement)
413
- ), u = D(() => o.value.width.value), l = D(() => o.value.height.value), c = D(() => u.value / l.value), m = {
414
- height: l,
415
- width: u,
416
- aspectRatio: c
417
- }, h = S(e), {
418
- camera: i,
419
- cameras: s,
420
- registerCamera: f,
421
- deregisterCamera: d,
422
- setCameraActive: p
423
- } = Ke({ sizes: m, scene: e }), { renderer: w } = ut(
460
+ const s = k(
461
+ () => E(t) ? rt() : nt(E(r).parentElement)
462
+ ), o = k(() => s.value.width.value), i = k(() => s.value.height.value), l = k(() => o.value / i.value), c = {
463
+ height: i,
464
+ width: o,
465
+ aspectRatio: l
466
+ }, m = D(e), {
467
+ camera: f,
468
+ cameras: u,
469
+ registerCamera: g,
470
+ deregisterCamera: _,
471
+ setCameraActive: d
472
+ } = st({ sizes: c, scene: e }), { renderer: y } = Et(
424
473
  {
425
474
  scene: e,
426
- canvas: n,
475
+ canvas: r,
427
476
  options: a,
428
- contextParts: { sizes: m, camera: i },
429
- disableRender: r
477
+ contextParts: { sizes: c, camera: f },
478
+ disableRender: n
430
479
  }
431
- ), v = {
432
- sizes: m,
433
- scene: h,
434
- camera: i,
435
- cameras: ye(s),
436
- renderer: w,
437
- raycaster: S(new ze()),
438
- controls: L(null),
480
+ ), p = {
481
+ sizes: c,
482
+ scene: m,
483
+ camera: f,
484
+ cameras: Se(u),
485
+ renderer: y,
486
+ raycaster: D(new Je()),
487
+ controls: B(null),
439
488
  perf: {
440
489
  maxFrames: 160,
441
490
  fps: {
@@ -448,136 +497,136 @@ function vt({
448
497
  accumulator: []
449
498
  }
450
499
  },
451
- extend: Y,
452
- registerCamera: f,
453
- setCameraActive: p,
454
- deregisterCamera: d
500
+ extend: X,
501
+ registerCamera: g,
502
+ setCameraActive: d,
503
+ deregisterCamera: _
455
504
  };
456
- G("useTres", v);
457
- const M = 100, P = Ye({ every: M }), { isSupported: A, memory: E } = Je({ interval: M }), b = 160;
458
- let g = performance.now();
459
- const _ = ({ timestamp: R }) => {
460
- v.scene.value && (v.perf.memory.allocatedMem = dt(v.scene.value)), R - g >= M && (g = R, v.perf.fps.accumulator.push(P.value), v.perf.fps.accumulator.length > b && v.perf.fps.accumulator.shift(), v.perf.fps.value = P.value, A.value && E.value && (v.perf.memory.accumulator.push(E.value.usedJSHeapSize / 1024 / 1024), v.perf.memory.accumulator.length > b && v.perf.memory.accumulator.shift(), v.perf.memory.currentMem = v.perf.memory.accumulator.reduce((de, ve) => de + ve, 0) / v.perf.memory.accumulator.length));
505
+ Q("useTres", p);
506
+ const C = 100, M = ot({ every: C }), { isSupported: P, memory: w } = at({ interval: C }), S = 160;
507
+ let v = performance.now();
508
+ const b = ({ timestamp: I }) => {
509
+ p.scene.value && (p.perf.memory.allocatedMem = ve(p.scene.value)), I - v >= C && (v = I, p.perf.fps.accumulator.push(M.value), p.perf.fps.accumulator.length > S && p.perf.fps.accumulator.shift(), p.perf.fps.value = M.value, P.value && w.value && (p.perf.memory.accumulator.push(w.value.usedJSHeapSize / 1024 / 1024), p.perf.memory.accumulator.length > S && p.perf.memory.accumulator.shift(), p.perf.memory.currentMem = p.perf.memory.accumulator.reduce((Ee, Ce) => Ee + Ce, 0) / p.perf.memory.accumulator.length));
461
510
  };
462
- let I = 0;
463
- const me = 1, { pause: pe, resume: Ct } = ne(({ delta: R }) => {
464
- window.__TRES__DEVTOOLS__ && (_({ timestamp: performance.now() }), I += R, I >= me && (window.__TRES__DEVTOOLS__.cb(v), I = 0));
511
+ let F = 0;
512
+ const we = 1, { pause: be, resume: Yt } = ce(({ delta: I }) => {
513
+ window.__TRES__DEVTOOLS__ && (b({ timestamp: performance.now() }), F += I, F >= we && (window.__TRES__DEVTOOLS__.cb(p), F = 0));
465
514
  }, { immediate: !0 });
466
- return O(() => {
467
- pe();
468
- }), v;
515
+ return U(() => {
516
+ be();
517
+ }), p;
469
518
  }
470
- function gt() {
471
- const e = he("useTres");
519
+ function Ot() {
520
+ const e = ke("useTres");
472
521
  if (!e)
473
522
  throw new Error("useTresContext must be used together with useTresContextProvider");
474
523
  return e;
475
524
  }
476
- const xt = gt;
477
- let y = null;
478
- const { logError: re } = B(), V = [
525
+ const or = Ot;
526
+ let h = null;
527
+ const { logError: se } = j(), W = [
479
528
  "onClick",
480
529
  "onPointerMove",
481
530
  "onPointerEnter",
482
531
  "onPointerLeave"
483
- ], fe = {
484
- createElement(e, n, t, r) {
485
- var u, l;
486
- if (r || (r = {}), r.args || (r.args = []), e === "template" || rt(e))
532
+ ], At = {
533
+ createElement(e, r, t, n) {
534
+ var o, i;
535
+ if (n || (n = {}), n.args || (n.args = []), e === "template" || mt(e))
487
536
  return null;
488
- let a = e.replace("Tres", ""), o;
537
+ let a = e.replace("Tres", ""), s;
489
538
  if (e === "primitive") {
490
- (r == null ? void 0 : r.object) === void 0 && re("Tres primitives need a prop 'object'");
491
- const c = r.object;
492
- a = c.type, o = Object.assign(c, { type: a, attach: r.attach, primitive: !0 });
539
+ (n == null ? void 0 : n.object) === void 0 && se("Tres primitives need a prop 'object'");
540
+ const l = n.object;
541
+ a = l.type, s = Object.assign(l, { type: a, attach: n.attach, primitive: !0 });
493
542
  } else {
494
- const c = q.value[a];
495
- c || re(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), o = new c(...r.args);
543
+ const l = J.value[a];
544
+ l || se(`${a} is not defined on the THREE namespace. Use extend to add it to the catalog.`), s = new l(...n.args);
496
545
  }
497
- return o.isCamera && (r != null && r.position || o.position.set(3, 3, 3), r != null && r.lookAt || o.lookAt(0, 0, 0)), (r == null ? void 0 : r.attach) === void 0 && (o.isMaterial ? o.attach = "material" : o.isBufferGeometry && (o.attach = "geometry")), o.isObject3D && ((u = r == null ? void 0 : r.material) != null && u.isMaterial && (o.userData.tres__materialViaProp = !0), (l = r == null ? void 0 : r.geometry) != null && l.isBufferGeometry && (o.userData.tres__geometryViaProp = !0)), o.userData = {
498
- ...o.userData,
546
+ return s.isCamera && (n != null && n.position || s.position.set(3, 3, 3), n != null && n.lookAt || s.lookAt(0, 0, 0)), (n == null ? void 0 : n.attach) === void 0 && (s.isMaterial ? s.attach = "material" : s.isBufferGeometry && (s.attach = "geometry")), s.isObject3D && ((o = n == null ? void 0 : n.material) != null && o.isMaterial && (s.userData.tres__materialViaProp = !0), (i = n == null ? void 0 : n.geometry) != null && i.isBufferGeometry && (s.userData.tres__geometryViaProp = !0)), s.userData = {
547
+ ...s.userData,
499
548
  tres__name: a
500
- }, o;
549
+ }, s;
501
550
  },
502
- insert(e, n) {
503
- var r, a, o, u;
504
- n && n.isScene && (y = n);
505
- const t = n || y;
551
+ insert(e, r) {
552
+ var n, a, s, o;
553
+ r && r.isScene && (h = r);
554
+ const t = r || h;
506
555
  if (e != null && e.isObject3D) {
507
556
  if (e != null && e.isCamera) {
508
- if (!(y != null && y.userData.tres__registerCamera))
557
+ if (!(h != null && h.userData.tres__registerCamera))
509
558
  throw "could not find tres__registerCamera on scene's userData";
510
- (a = y == null ? void 0 : (r = y.userData).tres__registerCamera) == null || a.call(r, e);
559
+ (a = h == null ? void 0 : (n = h.userData).tres__registerCamera) == null || a.call(n, e);
511
560
  }
512
- if (e && V.some((l) => e[l])) {
513
- if (!(y != null && y.userData.tres__registerAtPointerEventHandler))
561
+ if (e && W.some((i) => e[i])) {
562
+ if (!(h != null && h.userData.tres__registerAtPointerEventHandler))
514
563
  throw "could not find tres__registerAtPointerEventHandler on scene's userData";
515
- (u = y == null ? void 0 : (o = y.userData).tres__registerAtPointerEventHandler) == null || u.call(o, e);
564
+ (o = h == null ? void 0 : (s = h.userData).tres__registerAtPointerEventHandler) == null || o.call(s, e);
516
565
  }
517
566
  }
518
567
  e != null && e.isObject3D && (t != null && t.isObject3D) ? (t.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? t.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[t == null ? void 0 : t.attach], t && (t[e.attach] = e));
519
568
  },
520
569
  remove(e) {
521
- var c, m, h;
522
- if (!e)
523
- return;
524
- const n = (i) => {
525
- var f, d;
526
- const s = i;
527
- i.userData.tres__materialViaProp || ((f = s.material) == null || f.dispose(), delete s.material), i.userData.tres__geometryViaProp || ((d = s.geometry) == null || d.dispose(), delete s.geometry);
528
- }, t = y == null ? void 0 : y.userData.tres__deregisterAtPointerEventHandler, r = y == null ? void 0 : y.userData.tres__deregisterBlockingObjectAtPointerEventHandler, a = (i) => {
529
- var s, f;
530
- if (!r)
531
- throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData";
532
- if ((f = y == null ? void 0 : (s = y.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(s, i), !t)
533
- throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
534
- i && V.some((d) => i[d]) && (t == null || t(i));
535
- }, o = (i) => {
536
- const s = y == null ? void 0 : y.userData.tres__deregisterCamera;
537
- if (!s)
538
- throw "could not find tres__deregisterCamera on scene's userData";
539
- i.isCamera && (s == null || s(i));
540
- }, u = e == null ? void 0 : e.primitive, l = !u && (e.dispose === void 0 ? e.dispose !== null : !1);
541
- if (e != null && e.isObject3D && ((c = e.parent) != null && c.isObject3D) && (e.parent.remove(e), (m = e.removeFromParent) == null || m.call(e)), !u && (e != null && e.isObject3D)) {
542
- e.children.forEach((i) => fe.remove(i)), n(e), o(e), a == null || a(e);
543
- for (const i in e)
544
- i !== "geometry" && i !== "material" && ((h = i.dispose) == null || h.call(i), delete e[i]);
570
+ var r, t;
571
+ if (e) {
572
+ if (e.isObject3D) {
573
+ const n = e, a = (c) => {
574
+ var f, u;
575
+ const m = c;
576
+ c.userData.tres__materialViaProp || ((f = m.material) == null || f.dispose(), m.material = void 0), c.userData.tres__geometryViaProp || ((u = m.geometry) == null || u.dispose(), m.geometry = void 0);
577
+ }, s = h == null ? void 0 : h.userData.tres__deregisterAtPointerEventHandler, o = h == null ? void 0 : h.userData.tres__deregisterBlockingObjectAtPointerEventHandler, i = (c) => {
578
+ var m, f;
579
+ if (!o)
580
+ throw "could not find tres__deregisterBlockingObjectAtPointerEventHandler on scene's userData";
581
+ if ((f = h == null ? void 0 : (m = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || f.call(m, c), !s)
582
+ throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
583
+ c && W.some((u) => c[u]) && (s == null || s(c));
584
+ }, l = (c) => {
585
+ const m = h == null ? void 0 : h.userData.tres__deregisterCamera;
586
+ if (!m)
587
+ throw "could not find tres__deregisterCamera on scene's userData";
588
+ c.isCamera && (m == null || m(c));
589
+ };
590
+ (r = e.removeFromParent) == null || r.call(e), n.traverse((c) => {
591
+ a(c), l(c), i == null || i(c);
592
+ }), a(n), l(n), i == null || i(n);
593
+ }
594
+ (t = e.dispose) == null || t.call(e);
545
595
  }
546
- l && e.dispose && e.type !== "Scene" && e.dispose();
547
596
  },
548
- patchProp(e, n, t, r) {
549
- var a, o, u, l;
597
+ patchProp(e, r, t, n) {
598
+ var a, s, o, i;
550
599
  if (e) {
551
- let c = e, m = n;
552
- if (e.isObject3D && m === "blocks-pointer-events") {
553
- r || r === "" ? (o = y == null ? void 0 : (a = y.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || o.call(a, e) : (l = y == null ? void 0 : (u = y.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || l.call(u, e);
600
+ let l = e, c = r;
601
+ if (e.isObject3D && c === "blocks-pointer-events") {
602
+ n || n === "" ? (s = h == null ? void 0 : (a = h.userData).tres__registerBlockingObjectAtPointerEventHandler) == null || s.call(a, e) : (i = h == null ? void 0 : (o = h.userData).tres__deregisterBlockingObjectAtPointerEventHandler) == null || i.call(o, e);
554
603
  return;
555
604
  }
556
- let h = j(m), i = c == null ? void 0 : c[h];
557
- if (m === "args") {
558
- const f = e, d = t ?? [], p = r ?? [], w = e.userData.tres__name || e.type;
559
- w && d.length && !st(d, p) && (c = Object.assign(f, new q.value[w](...r)));
605
+ let m = R(c), f = l == null ? void 0 : l[m];
606
+ if (c === "args") {
607
+ const g = e, _ = t ?? [], d = n ?? [], y = e.userData.tres__name || e.type;
608
+ y && _.length && !ht(_, d) && (l = Object.assign(g, new J.value[y](...n)));
560
609
  return;
561
610
  }
562
- if (c.type === "BufferGeometry") {
563
- if (m === "args")
611
+ if (l.type === "BufferGeometry") {
612
+ if (c === "args")
564
613
  return;
565
- c.setAttribute(
566
- j(m),
567
- new $e(...r)
614
+ l.setAttribute(
615
+ R(c),
616
+ new Ke(...n)
568
617
  );
569
618
  return;
570
619
  }
571
- if (m.includes("-") && i === void 0) {
572
- const f = m.split("-");
573
- i = f.reduce((d, p) => d[j(p)], c), m = f.pop(), h = m.toLowerCase(), i != null && i.set || (c = f.reduce((d, p) => d[j(p)], c));
620
+ if (c.includes("-") && f === void 0) {
621
+ const g = c.split("-");
622
+ f = g.reduce((_, d) => _[R(d)], l), c = g.pop(), m = c.toLowerCase(), f != null && f.set || (l = g.reduce((_, d) => _[R(d)], l));
574
623
  }
575
- let s = r;
576
- if (s === "" && (s = !0), te(i)) {
577
- V.includes(n) || (Array.isArray(s) ? e[h](...s) : e[h](s));
624
+ let u = n;
625
+ if (u === "" && (u = !0), ae(f)) {
626
+ W.includes(r) || (Array.isArray(u) ? e[m](...u) : e[m](u));
578
627
  return;
579
628
  }
580
- !(i != null && i.set) && !te(i) ? c[h] = s : i.constructor === s.constructor && (i != null && i.copy) ? i == null || i.copy(s) : Array.isArray(s) ? i.set(...s) : !i.isColor && i.setScalar ? i.setScalar(s) : i.set(s);
629
+ !(f != null && f.set) && !ae(f) ? l[m] = u : f.constructor === u.constructor && (f != null && f.copy) ? f == null || f.copy(u) : Array.isArray(u) ? f.set(...u) : !f.isColor && f.setScalar ? f.setScalar(u) : f.set(u);
581
630
  }
582
631
  },
583
632
  parentNode(e) {
@@ -592,9 +641,288 @@ const { logError: re } = B(), V = [
592
641
  setScopeId: () => void 0,
593
642
  cloneNode: () => void 0,
594
643
  insertStaticContent: () => void 0
595
- }, { render: yt } = we(fe);
596
- Y(De);
597
- const ht = ["data-scene"], wt = /* @__PURE__ */ J({
644
+ }, { render: xt } = Te(At);
645
+ X(ue);
646
+ function Dt() {
647
+ return he().__VUE_DEVTOOLS_GLOBAL_HOOK__;
648
+ }
649
+ function he() {
650
+ return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
651
+ }
652
+ const Lt = typeof Proxy == "function", Bt = "devtools-plugin:setup", jt = "plugin:settings:set";
653
+ let T, K;
654
+ function It() {
655
+ var e;
656
+ return T !== void 0 || (typeof window < "u" && window.performance ? (T = !0, K = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? (T = !0, K = global.perf_hooks.performance) : T = !1), T;
657
+ }
658
+ function Rt() {
659
+ return It() ? K.now() : Date.now();
660
+ }
661
+ class Ht {
662
+ constructor(r, t) {
663
+ this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = r, this.hook = t;
664
+ const n = {};
665
+ if (r.settings)
666
+ for (const o in r.settings) {
667
+ const i = r.settings[o];
668
+ n[o] = i.defaultValue;
669
+ }
670
+ const a = `__vue-devtools-plugin-settings__${r.id}`;
671
+ let s = Object.assign({}, n);
672
+ try {
673
+ const o = localStorage.getItem(a), i = JSON.parse(o);
674
+ Object.assign(s, i);
675
+ } catch {
676
+ }
677
+ this.fallbacks = {
678
+ getSettings() {
679
+ return s;
680
+ },
681
+ setSettings(o) {
682
+ try {
683
+ localStorage.setItem(a, JSON.stringify(o));
684
+ } catch {
685
+ }
686
+ s = o;
687
+ },
688
+ now() {
689
+ return Rt();
690
+ }
691
+ }, t && t.on(jt, (o, i) => {
692
+ o === this.plugin.id && this.fallbacks.setSettings(i);
693
+ }), this.proxiedOn = new Proxy({}, {
694
+ get: (o, i) => this.target ? this.target.on[i] : (...l) => {
695
+ this.onQueue.push({
696
+ method: i,
697
+ args: l
698
+ });
699
+ }
700
+ }), this.proxiedTarget = new Proxy({}, {
701
+ get: (o, i) => this.target ? this.target[i] : i === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(i) ? (...l) => (this.targetQueue.push({
702
+ method: i,
703
+ args: l,
704
+ resolve: () => {
705
+ }
706
+ }), this.fallbacks[i](...l)) : (...l) => new Promise((c) => {
707
+ this.targetQueue.push({
708
+ method: i,
709
+ args: l,
710
+ resolve: c
711
+ });
712
+ })
713
+ });
714
+ }
715
+ async setRealTarget(r) {
716
+ this.target = r;
717
+ for (const t of this.onQueue)
718
+ this.target.on[t.method](...t.args);
719
+ for (const t of this.targetQueue)
720
+ t.resolve(await this.target[t.method](...t.args));
721
+ }
722
+ }
723
+ function Nt(e, r) {
724
+ const t = e, n = he(), a = Dt(), s = Lt && t.enableEarlyProxy;
725
+ if (a && (n.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
726
+ a.emit(Bt, e, r);
727
+ else {
728
+ const o = s ? new Ht(t, a) : null;
729
+ (n.__VUE_DEVTOOLS_PLUGINS__ = n.__VUE_DEVTOOLS_PLUGINS__ || []).push({
730
+ pluginDescriptor: t,
731
+ setupFn: r,
732
+ proxy: o
733
+ }), o && r(o.proxiedTarget);
734
+ }
735
+ }
736
+ function Vt(e, r) {
737
+ const t = `▲ ■ ●${e}`;
738
+ typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, r) : r === "error" ? console.error(t) : r === "warn" ? console.warn(t) : console.log(t);
739
+ }
740
+ const ye = (e) => {
741
+ const r = {
742
+ id: e.uuid,
743
+ label: e.type,
744
+ children: [],
745
+ tags: []
746
+ };
747
+ e.name !== "" && r.tags.push({
748
+ label: e.name,
749
+ textColor: 5750629,
750
+ backgroundColor: 15793395
751
+ });
752
+ const t = ve(e);
753
+ return t > 0 && r.tags.push({
754
+ label: `${kt(t)} KB`,
755
+ textColor: 15707189,
756
+ backgroundColor: 16775644,
757
+ tooltip: "Memory usage"
758
+ }), e.type.includes("Light") && (r.tags.push({
759
+ label: `${e.intensity}`,
760
+ textColor: 9738662,
761
+ backgroundColor: 16316922,
762
+ tooltip: "Intensity"
763
+ }), r.tags.push({
764
+ label: `#${e.color.getHexString()}`,
765
+ textColor: 9738662,
766
+ backgroundColor: 16316922,
767
+ tooltip: "Color"
768
+ })), e.type.includes("Camera") && (r.tags.push({
769
+ label: `${e.fov}°`,
770
+ textColor: 9738662,
771
+ backgroundColor: 16316922,
772
+ tooltip: "Field of view"
773
+ }), r.tags.push({
774
+ // eslint-disable-next-line max-len
775
+ label: `x: ${Math.round(e.position.x)} y: ${Math.round(e.position.y)} z: ${Math.round(e.position.z)}`,
776
+ textColor: 9738662,
777
+ backgroundColor: 16316922,
778
+ tooltip: "Position"
779
+ })), r;
780
+ };
781
+ function _e(e, r) {
782
+ e.children.forEach((t) => {
783
+ if (t.type === "HightlightMesh")
784
+ return;
785
+ const n = ye(t);
786
+ r.children.push(n), _e(t, n);
787
+ });
788
+ }
789
+ const $t = [], O = "tres:inspector", Ut = le({
790
+ sceneGraph: null
791
+ });
792
+ function Ft(e, r) {
793
+ Nt(
794
+ {
795
+ id: "dev.esm.tres",
796
+ label: "TresJS 🪐",
797
+ logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
798
+ packageName: "tresjs",
799
+ homepage: "https://tresjs.org",
800
+ componentStateTypes: $t,
801
+ app: e
802
+ },
803
+ (t) => {
804
+ typeof t.now != "function" && Vt(
805
+ // eslint-disable-next-line max-len
806
+ "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."
807
+ ), t.addInspector({
808
+ id: O,
809
+ label: "TresJS 🪐",
810
+ icon: "account_tree",
811
+ treeFilterPlaceholder: "Search instances"
812
+ }), setInterval(() => {
813
+ t.sendInspectorTree(O);
814
+ }, 1e3), setInterval(() => {
815
+ t.notifyComponentUpdate();
816
+ }, 5e3), t.on.getInspectorTree((s) => {
817
+ if (s.inspectorId === O) {
818
+ const o = ye(r.scene.value);
819
+ _e(r.scene.value, o), Ut.sceneGraph = o, s.rootNodes = [o];
820
+ }
821
+ });
822
+ let n = null, a = null;
823
+ t.on.getInspectorState((s) => {
824
+ if (s.inspectorId === O) {
825
+ const [o] = r.scene.value.getObjectsByProperty("uuid", s.nodeId);
826
+ if (!o)
827
+ return;
828
+ if (a && n && n.parent && a.remove(n), o.isMesh) {
829
+ const i = wt(o);
830
+ o.add(i), n = i, a = o;
831
+ }
832
+ s.state = {
833
+ object: [
834
+ {
835
+ key: "uuid",
836
+ editable: !0,
837
+ value: o.uuid
838
+ },
839
+ {
840
+ key: "name",
841
+ editable: !0,
842
+ value: o.name
843
+ },
844
+ {
845
+ key: "type",
846
+ editable: !0,
847
+ value: o.type
848
+ },
849
+ {
850
+ key: "position",
851
+ editable: !0,
852
+ value: o.position
853
+ },
854
+ {
855
+ key: "rotation",
856
+ editable: !0,
857
+ value: o.rotation
858
+ },
859
+ {
860
+ key: "scale",
861
+ editable: !0,
862
+ value: o.scale
863
+ },
864
+ {
865
+ key: "geometry",
866
+ value: o.geometry
867
+ },
868
+ {
869
+ key: "material",
870
+ value: o.material
871
+ },
872
+ {
873
+ key: "color",
874
+ editable: !0,
875
+ value: o.color
876
+ },
877
+ {
878
+ key: "intensity",
879
+ editable: !0,
880
+ value: o.intensity
881
+ },
882
+ {
883
+ key: "castShadow",
884
+ editable: !0,
885
+ value: o.castShadow
886
+ },
887
+ {
888
+ key: "receiveShadow",
889
+ editable: !0,
890
+ value: o.receiveShadow
891
+ },
892
+ {
893
+ key: "frustumCulled",
894
+ editable: !0,
895
+ value: o.frustumCulled
896
+ },
897
+ {
898
+ key: "matrixAutoUpdate",
899
+ editable: !0,
900
+ value: o.matrixAutoUpdate
901
+ },
902
+ {
903
+ key: "matrixWorldNeedsUpdate",
904
+ editable: !0,
905
+ value: o.matrixWorldNeedsUpdate
906
+ },
907
+ {
908
+ key: "matrixWorld",
909
+ value: o.matrixWorld
910
+ },
911
+ {
912
+ key: "visible",
913
+ editable: !0,
914
+ value: o.visible
915
+ }
916
+ ]
917
+ };
918
+ }
919
+ }), t.on.editInspectorState((s) => {
920
+ s.inspectorId === O && _t(r.scene.value, s.nodeId, s.path, s.state.value);
921
+ });
922
+ }
923
+ );
924
+ }
925
+ const Gt = ["data-scene"], zt = /* @__PURE__ */ Z({
598
926
  __name: "TresCanvas",
599
927
  props: {
600
928
  shadows: { type: Boolean, default: void 0 },
@@ -620,113 +948,107 @@ const ht = ["data-scene"], wt = /* @__PURE__ */ J({
620
948
  logarithmicDepthBuffer: { type: Boolean, default: void 0 },
621
949
  failIfMajorPerformanceCaveat: { type: Boolean, default: void 0 }
622
950
  },
623
- setup(e, { expose: n }) {
624
- var d;
625
- const t = e, { logWarning: r } = B(), a = L(), o = S(new Ie());
626
- ie();
627
- const u = Ee(), l = (d = K()) == null ? void 0 : d.appContext.app;
628
- let c = null;
629
- const m = (p) => J({
951
+ setup(e, { expose: r }) {
952
+ var _;
953
+ const t = e, { logWarning: n } = j(), a = B(), s = D(new qe()), { resume: o } = me(), i = Oe(), l = (_ = ee()) == null ? void 0 : _.appContext.app, c = (d) => Z({
630
954
  setup() {
631
- var v;
632
- const w = (v = K()) == null ? void 0 : v.appContext;
633
- return w && (w.app = l), G("useTres", p), G("extend", Y), () => X(be, null, u != null && u.default ? u.default() : []);
955
+ var p;
956
+ const y = (p = ee()) == null ? void 0 : p.appContext;
957
+ return y && (y.app = l), Q("useTres", d), Q("extend", X), typeof window < "u" && Ft(y.app, d), () => te(je, null, i != null && i.default ? i.default() : []);
634
958
  }
635
- }), h = (p) => {
636
- c = m(p), yt(X(c), o.value);
637
- }, i = (p) => {
638
- ce(o.value), o.value = null;
639
- }, s = D(() => t.disableRender), f = S(null);
640
- return n({ context: f, dispose: () => i(f.value) }), _e(() => {
641
- const p = a;
642
- f.value = vt({
643
- scene: o.value,
644
- canvas: p,
959
+ }), m = (d) => {
960
+ const y = c(d);
961
+ xt(te(y), s.value);
962
+ }, f = (d, y = !1) => {
963
+ s.value.children = [], y && (d.renderer.value.dispose(), d.renderer.value.renderLists.dispose(), d.renderer.value.forceContextLoss()), m(d), o();
964
+ }, u = k(() => t.disableRender), g = D(null);
965
+ return r({ context: g, dispose: () => f(g.value, !0) }), Ae(() => {
966
+ const d = a;
967
+ g.value = Tt({
968
+ scene: s.value,
969
+ canvas: d,
645
970
  windowSize: t.windowSize,
646
- disableRender: s,
971
+ disableRender: u,
647
972
  rendererOptions: t
648
- }), pt({ scene: o.value, contextParts: f.value });
649
- const { registerCamera: w, camera: v, cameras: M, deregisterCamera: P } = f.value;
650
- h(f.value);
651
- const A = () => {
652
- const E = new W(
973
+ }), St({ scene: s.value, contextParts: g.value });
974
+ const { registerCamera: y, camera: p, cameras: C, deregisterCamera: M } = g.value;
975
+ m(g.value);
976
+ const P = () => {
977
+ const w = new Y(
653
978
  45,
654
979
  window.innerWidth / window.innerHeight,
655
980
  0.1,
656
981
  1e3
657
982
  );
658
- E.position.set(3, 3, 3), E.lookAt(0, 0, 0), w(E);
659
- const b = k(() => {
660
- M.value.length >= 2 && (E.removeFromParent(), P(E), b == null || b());
983
+ w.position.set(3, 3, 3), w.lookAt(0, 0, 0), y(w);
984
+ const S = A(() => {
985
+ C.value.length >= 2 && (w.removeFromParent(), M(w), S == null || S());
661
986
  });
662
987
  };
663
- ae(
988
+ ie(
664
989
  () => t.camera,
665
- (E, b) => {
666
- E && w(E), b && (b.removeFromParent(), P(b));
990
+ (w, S) => {
991
+ w && y(w), S && (S.removeFromParent(), M(S));
667
992
  },
668
993
  {
669
994
  immediate: !0
670
995
  }
671
- ), v.value || (r(
996
+ ), p.value || (n(
672
997
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
673
- ), A());
674
- }), O(() => {
675
- f.value && i(f.value);
676
- }), (p, w) => (Ce(), Me("canvas", {
998
+ ), P());
999
+ }), (d, y) => (xe(), De("canvas", {
677
1000
  ref_key: "canvas",
678
1001
  ref: a,
679
- "data-scene": o.value.uuid,
680
- class: Pe(p.$attrs.class),
681
- style: Ae({
1002
+ "data-scene": s.value.uuid,
1003
+ class: Le(d.$attrs.class),
1004
+ style: Be({
682
1005
  display: "block",
683
1006
  width: "100%",
684
1007
  height: "100%",
685
- position: p.windowSize ? "fixed" : "relative",
1008
+ position: d.windowSize ? "fixed" : "relative",
686
1009
  top: 0,
687
1010
  left: 0,
688
1011
  pointerEvents: "auto",
689
1012
  touchAction: "none",
690
- ...p.$attrs.style
1013
+ ...d.$attrs.style
691
1014
  })
692
- }, null, 14, ht));
1015
+ }, null, 14, Gt));
693
1016
  }
694
- }), Et = [
1017
+ }), Wt = [
695
1018
  "TresCanvas",
696
1019
  "TresLeches",
697
1020
  "TresScene"
698
- ], _t = {
1021
+ ], Qt = {
699
1022
  template: {
700
1023
  compilerOptions: {
701
- isCustomElement: (e) => e.startsWith("Tres") && !Et.includes(e) || e === "primitive"
1024
+ isCustomElement: (e) => e.startsWith("Tres") && !Wt.includes(e) || e === "primitive"
702
1025
  }
703
1026
  }
704
- }, Lt = _t, Ot = {
1027
+ }, ar = Qt, sr = {
705
1028
  install(e) {
706
- e.component("TresCanvas", wt);
1029
+ e.component("TresCanvas", zt);
707
1030
  }
708
1031
  };
709
1032
  export {
710
- wt as TresCanvas,
711
- q as catalogue,
712
- Ot as default,
713
- ce as dispose,
714
- Y as extend,
715
- bt as isProd,
716
- et as normalizeColor,
717
- Dt as normalizeVectorFlexibleParam,
718
- Lt as templateCompilerOptions,
719
- ft as trasverseObjects,
720
- Ke as useCamera,
721
- kt as useLoader,
722
- B as useLogger,
723
- pt as usePointerEventHandler,
724
- mt as useRaycaster,
725
- ie as useRenderLoop,
726
- ut as useRenderer,
727
- St as useSeek,
728
- Tt as useTexture,
729
- xt as useTres,
730
- gt as useTresContext,
731
- vt as useTresContextProvider
1033
+ zt as TresCanvas,
1034
+ J as catalogue,
1035
+ sr as default,
1036
+ X as extend,
1037
+ Zt as isProd,
1038
+ ct as normalizeColor,
1039
+ er as normalizeVectorFlexibleParam,
1040
+ ar as templateCompilerOptions,
1041
+ Mt as trasverseObjects,
1042
+ st as useCamera,
1043
+ tr as useLoader,
1044
+ j as useLogger,
1045
+ St as usePointerEventHandler,
1046
+ Pt as useRaycaster,
1047
+ me as useRenderLoop,
1048
+ Et as useRenderer,
1049
+ nr as useSeek,
1050
+ rr as useTexture,
1051
+ or as useTres,
1052
+ Ot as useTresContext,
1053
+ Tt as useTresContextProvider
732
1054
  };