@tresjs/core 2.4.0-next.4 → 2.4.0-next.6

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,466 +1,476 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v2.4.0-next.4
3
+ * version: v2.4.0-next.6
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 F, computed as M, watchEffect as x, onUnmounted as W, shallowRef as $, watch as J, reactive as ae, readonly as G, provide as oe, inject as re, createRenderer as se, defineComponent as ie, useSlots as ue, onMounted as le, openBlock as ce, createElementBlock as fe, normalizeStyle as pe } from "vue";
9
- import * as me from "three";
10
- import { PerspectiveCamera as z, OrthographicCamera as ve, Camera as Ee, Clock as de, SRGBColorSpace as ge, ACESFilmicToneMapping as ye, PCFSoftShadowMap as Ce, Vector3 as we, Color as k, WebGLRenderer as N, LoadingManager as _e, TextureLoader as Me, Raycaster as Re, Vector2 as Te, BufferAttribute as Pe, Scene as Ae } from "three";
11
- import { createEventHook as O, useRafFn as Le, toValue as y, unrefElement as Se, useDevicePixelRatio as xe, usePointer as De, useElementBounding as Oe, useWindowSize as he, useElementSize as be } from "@vueuse/core";
12
- const K = F({}), X = (e) => void Object.assign(K.value, e), Y = (e) => typeof e == "function", Q = (e) => !!e && e.constructor === Array, L = {
13
- REGISTER_CAMERA: "tres__registerCamera",
14
- IS_ACTIVE_CAMERA: "tres__isActiveCamera",
15
- GEOMETRY_VIA_PROP: "tres__geometryViaProp",
16
- MATERIAL_VIA_PROP: "tres__materialViaProp",
17
- DEREGISTER_CAMERA: "tres__deregisterCamera",
18
- REGISTER_AT_POINTER_EVENT_HANDLER: "tres__registerAtPointerEventHandler",
19
- DEREGISTER_AT_POINTER_EVENT_HANDLER: "tres__deregisterAtPointerEventHandler"
20
- };
21
- function ke({ sizes: e, scene: a }) {
22
- const { IS_ACTIVE_CAMERA: n, REGISTER_CAMERA: t, DEREGISTER_CAMERA: i } = L, o = F([]), l = M(
23
- () => o.value.find(({ userData: s }) => s[n])
24
- ), r = (s, c = !0) => {
25
- o.value.some(({ uuid: v }) => v === s.uuid) || (o.value.push(s), c && m(s));
26
- }, p = (s) => {
27
- if (s.userData[n]) {
28
- const c = o.value[o.value.length - 1];
29
- c && m(c.uuid);
8
+ import { ref as j, computed as P, watchEffect as b, onUnmounted as V, shallowRef as W, watch as J, reactive as re, readonly as I, provide as ae, inject as ne, createRenderer as oe, defineComponent as se, useSlots as ie, onMounted as ue, openBlock as le, createElementBlock as ce, normalizeStyle as fe } from "vue";
9
+ import * as pe from "three";
10
+ import { PerspectiveCamera as G, OrthographicCamera as me, Camera as ve, Clock as de, SRGBColorSpace as ge, ACESFilmicToneMapping as we, PCFSoftShadowMap as ye, Vector3 as Ce, Color as B, WebGLRenderer as z, LoadingManager as Me, TextureLoader as _e, Raycaster as Pe, Vector2 as Ee, BufferAttribute as Le, Scene as xe } from "three";
11
+ import { createEventHook as k, useRafFn as he, toValue as m, unrefElement as Te, useDevicePixelRatio as be, usePointer as De, useElementBounding as ke, useWindowSize as Se, useElementSize as Ae } from "@vueuse/core";
12
+ const K = j({}), X = (e) => void Object.assign(K.value, e), N = (e) => typeof e == "function", Y = (e) => !!e && e.constructor === Array;
13
+ function Be({ sizes: e, scene: n }) {
14
+ const t = j([]), r = P(
15
+ () => t.value.find(({ userData: a }) => a.tres__isActiveCamera)
16
+ ), o = (a, i = !0) => {
17
+ t.value.some(({ uuid: f }) => f === a.uuid) || (t.value.push(a), i && l(a));
18
+ }, u = (a) => {
19
+ if (a.userData.tres__isActiveCamera) {
20
+ const i = t.value[t.value.length - 1];
21
+ i && l(i.uuid);
30
22
  }
31
- o.value = o.value.filter(({ uuid: c }) => c !== s.uuid);
32
- }, m = (s) => {
33
- const c = s instanceof Ee ? s : o.value.find((v) => v.uuid === s);
34
- c && (o.value.forEach(({ userData: v }) => v[n] = !1), c.userData[n] = !0);
35
- }, f = () => {
36
- o.value = [];
23
+ t.value = t.value.filter(({ uuid: i }) => i !== a.uuid);
24
+ }, l = (a) => {
25
+ const i = a instanceof ve ? a : t.value.find((c) => c.uuid === a);
26
+ if (!i)
27
+ return;
28
+ t.value.forEach(({ userData: c }) => c.tres__isActiveCamera = !1);
29
+ const f = i;
30
+ f.userData.tres__isActiveCamera = !0;
31
+ }, s = () => {
32
+ t.value = [];
37
33
  };
38
- return x(() => {
39
- e.aspectRatio.value && o.value.forEach((s) => {
40
- s instanceof z && (s.aspect = e.aspectRatio.value), (s instanceof z || s instanceof ve) && s.updateProjectionMatrix();
34
+ return b(() => {
35
+ e.aspectRatio.value && t.value.forEach((a) => {
36
+ a instanceof G && (a.aspect = e.aspectRatio.value), (a instanceof G || a instanceof me) && a.updateProjectionMatrix();
41
37
  });
42
- }), a.userData[t] = r, a.userData[i] = p, W(() => {
43
- f();
38
+ }), n.userData.tres__registerCamera = o, n.userData.tres__deregisterCamera = u, V(() => {
39
+ s();
44
40
  }), {
45
- camera: l,
46
- cameras: o,
47
- addCamera: r,
48
- removeCamera: p,
49
- setCameraActive: m
41
+ camera: r,
42
+ cameras: t,
43
+ addCamera: o,
44
+ removeCamera: u,
45
+ setCameraActive: l
50
46
  };
51
47
  }
52
- const Z = O(), ee = O(), j = O(), D = new de();
53
- let I = 0, B = 0;
54
- const { pause: Ie, resume: Be, isActive: Ge } = Le(
48
+ const Q = k(), Z = k(), $ = k(), D = new de();
49
+ let O = 0, R = 0;
50
+ const { pause: Oe, resume: Re, isActive: ze } = he(
55
51
  () => {
56
- Z.trigger({ delta: I, elapsed: B, clock: D }), ee.trigger({ delta: I, elapsed: B, clock: D }), j.trigger({ delta: I, elapsed: B, clock: D });
52
+ Q.trigger({ delta: O, elapsed: R, clock: D }), Z.trigger({ delta: O, elapsed: R, clock: D }), $.trigger({ delta: O, elapsed: R, clock: D });
57
53
  },
58
54
  { immediate: !1 }
59
55
  );
60
- j.on(() => {
61
- I = D.getDelta(), B = D.getElapsedTime();
56
+ $.on(() => {
57
+ O = D.getDelta(), R = D.getElapsedTime();
62
58
  });
63
- const te = () => ({
64
- onBeforeLoop: Z.on,
65
- onLoop: ee.on,
66
- onAfterLoop: j.on,
67
- pause: Ie,
68
- resume: Be,
69
- isActive: Ge
70
- }), V = {
59
+ const ee = () => ({
60
+ onBeforeLoop: Q.on,
61
+ onLoop: Z.on,
62
+ onAfterLoop: $.on,
63
+ pause: Oe,
64
+ resume: Re,
65
+ isActive: ze
66
+ }), F = {
71
67
  realistic: {
72
68
  outputColorSpace: ge,
73
- toneMapping: ye,
69
+ toneMapping: we,
74
70
  toneMappingExposure: 3,
75
71
  shadowMap: {
76
72
  enabled: !0,
77
- type: Ce
73
+ type: ye
78
74
  }
79
75
  }
80
- }, ne = (e, a) => {
81
- for (const n of Object.keys(a))
82
- a[n] instanceof Object && Object.assign(a[n], ne(e[n], a[n]));
83
- return Object.assign(e || {}, a), e;
84
- }, Ne = "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", Ve = /* @__PURE__ */ He(Ne);
85
- function b(e) {
86
- return e.replace(/-([a-z])/g, (a, n) => n.toUpperCase());
76
+ }, te = (e, n) => {
77
+ for (const t of Object.keys(n))
78
+ n[t] instanceof Object && Object.assign(n[t], te(e[t], n[t]));
79
+ return Object.assign(e || {}, n), e;
80
+ }, Fe = "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", He = /* @__PURE__ */ Ge(Fe);
81
+ function A(e) {
82
+ return e.replace(/-([a-z])/g, (n, t) => t.toUpperCase());
87
83
  }
88
- function He(e, a) {
89
- const n = /* @__PURE__ */ Object.create(null), t = e.split(",");
90
- for (let i = 0; i < t.length; i++)
91
- n[t[i]] = !0;
92
- return a ? (i) => !!n[i.toLowerCase()] : (i) => !!n[i];
84
+ function Ge(e, n) {
85
+ const t = /* @__PURE__ */ Object.create(null), r = e.split(",");
86
+ for (let o = 0; o < r.length; o++)
87
+ t[r[o]] = !0;
88
+ return n ? (o) => !!t[o.toLowerCase()] : (o) => !!t[o];
93
89
  }
94
- const ze = (e, a) => {
95
- const n = /* @__PURE__ */ new Set(), t = [];
96
- for (const i of e) {
97
- const o = a(i);
98
- n.has(o) || (n.add(o), t.push(i));
90
+ const je = (e, n) => {
91
+ const t = /* @__PURE__ */ new Set(), r = [];
92
+ for (const o of e) {
93
+ const u = n(o);
94
+ t.has(u) || (t.add(u), r.push(o));
99
95
  }
100
- return t;
101
- }, ot = !0, U = "[TresJS ▲ ■ ●] ";
102
- function h() {
103
- function e(t, i) {
104
- console.error(`${U} ${t}`, i || "");
96
+ return r;
97
+ }, at = !0, q = "[TresJS ▲ ■ ●] ";
98
+ function S() {
99
+ function e(r, o) {
100
+ console.error(`${q} ${r}`, o || "");
105
101
  }
106
- function a(t) {
107
- console.warn(`${U} ${t}`);
102
+ function n(r) {
103
+ console.warn(`${q} ${r}`);
108
104
  }
109
- function n(t, i) {
105
+ function t(r, o) {
110
106
  }
111
107
  return {
112
108
  logError: e,
113
- logWarning: a,
114
- logMessage: n
109
+ logWarning: n,
110
+ logMessage: t
115
111
  };
116
112
  }
117
- function rt(e) {
118
- return typeof e == "number" ? [e, e, e] : e instanceof we ? [e.x, e.y, e.z] : e;
113
+ function nt(e) {
114
+ return typeof e == "number" ? [e, e, e] : e instanceof Ce ? [e.x, e.y, e.z] : e;
119
115
  }
120
- function Fe(e) {
121
- return e instanceof k ? e : Array.isArray(e) ? new k(...e) : new k(e);
116
+ function Ve(e) {
117
+ return e instanceof B ? e : Array.isArray(e) ? new B(...e) : new B(e);
122
118
  }
123
119
  function We({
124
120
  scene: e,
125
- canvas: a,
126
- options: n,
127
- disableRender: t,
128
- contextParts: { sizes: i, camera: o }
121
+ canvas: n,
122
+ options: t,
123
+ disableRender: r,
124
+ contextParts: { sizes: o, camera: u }
129
125
  }) {
130
- const l = M(() => ({
131
- alpha: y(n.alpha),
132
- depth: y(n.depth),
133
- canvas: Se(a),
134
- context: y(n.context),
135
- stencil: y(n.stencil),
136
- antialias: y(n.antialias),
137
- precision: y(n.precision),
138
- powerPreference: y(n.powerPreference),
139
- premultipliedAlpha: y(n.premultipliedAlpha),
140
- preserveDrawingBuffer: y(n.preserveDrawingBuffer),
141
- logarithmicDepthBuffer: y(n.logarithmicDepthBuffer),
142
- failIfMajorPerformanceCaveat: y(n.failIfMajorPerformanceCaveat)
143
- })), r = $(new N(l.value));
126
+ const l = P(() => ({
127
+ alpha: m(t.alpha),
128
+ depth: m(t.depth),
129
+ canvas: Te(n),
130
+ context: m(t.context),
131
+ stencil: m(t.stencil),
132
+ antialias: m(t.antialias) === void 0 ? (
133
+ // an opinionated default of tres
134
+ !0
135
+ ) : m(t.antialias),
136
+ precision: m(t.precision),
137
+ powerPreference: m(t.powerPreference),
138
+ premultipliedAlpha: m(t.premultipliedAlpha),
139
+ preserveDrawingBuffer: m(t.preserveDrawingBuffer),
140
+ logarithmicDepthBuffer: m(t.logarithmicDepthBuffer),
141
+ failIfMajorPerformanceCaveat: m(t.failIfMajorPerformanceCaveat)
142
+ })), s = W(new z(l.value));
144
143
  J(l, () => {
145
- r.value.dispose(), r.value = new N(l.value);
146
- }), x(() => {
147
- r.value.setSize(i.width.value, i.height.value);
144
+ s.value.dispose(), s.value = new z(l.value);
145
+ }), b(() => {
146
+ s.value.setSize(o.width.value, o.height.value);
148
147
  });
149
- const { pixelRatio: p } = xe();
150
- x(() => {
151
- r.value.setPixelRatio(p.value);
148
+ const { pixelRatio: a } = be();
149
+ b(() => {
150
+ s.value.setPixelRatio(a.value);
152
151
  });
153
- const { logError: m } = h(), s = (() => {
154
- const u = new N(), d = {
152
+ const { logError: i } = S(), c = (() => {
153
+ const d = new z(), v = {
155
154
  shadowMap: {
156
- enabled: u.shadowMap.enabled,
157
- type: u.shadowMap.type
155
+ enabled: d.shadowMap.enabled,
156
+ type: d.shadowMap.type
158
157
  },
159
- toneMapping: u.toneMapping,
160
- toneMappingExposure: u.toneMappingExposure,
161
- outputColorSpace: u.outputColorSpace,
162
- useLegacyLights: u.useLegacyLights
158
+ toneMapping: d.toneMapping,
159
+ toneMappingExposure: d.toneMappingExposure,
160
+ outputColorSpace: d.outputColorSpace,
161
+ useLegacyLights: d.useLegacyLights
163
162
  };
164
- return u.dispose(), d;
163
+ return d.dispose(), v;
165
164
  })();
166
- x(() => {
167
- const u = y(n.preset);
168
- if (u) {
169
- u in V || m("Renderer Preset must be one of these: " + Object.keys(V).join(", ")), ne(r.value, V[u]);
165
+ b(() => {
166
+ const d = m(t.preset);
167
+ if (d) {
168
+ d in F || i("Renderer Preset must be one of these: " + Object.keys(F).join(", ")), te(s.value, F[d]);
170
169
  return;
171
170
  }
172
- const d = y(n.shadows);
173
- r.value.shadowMap.enabled = d !== void 0 ? d : s.shadowMap.enabled;
174
- const g = y(n.shadowMapType);
175
- r.value.shadowMap.type = g !== void 0 ? g : s.shadowMap.type;
176
- const R = y(n.toneMapping);
177
- r.value.toneMapping = R !== void 0 ? R : s.toneMapping;
178
- const T = y(n.toneMappingExposure);
179
- r.value.toneMappingExposure = T !== void 0 ? T : s.toneMappingExposure;
180
- const P = y(n.outputColorSpace);
181
- r.value.outputColorSpace = P !== void 0 ? P : s.outputColorSpace;
182
- const S = y(n.useLegacyLights);
183
- r.value.useLegacyLights = S !== void 0 ? S : s.useLegacyLights;
184
- const A = y(n.clearColor);
185
- A && r.value.setClearColor(
186
- A ? Fe(A) : new k(0)
171
+ const v = m(t.shadows);
172
+ s.value.shadowMap.enabled = v !== void 0 ? v : c.shadowMap.enabled;
173
+ const y = m(t.shadowMapType);
174
+ s.value.shadowMap.type = y !== void 0 ? y : c.shadowMap.type;
175
+ const E = m(t.toneMapping);
176
+ s.value.toneMapping = E !== void 0 ? E : c.toneMapping;
177
+ const x = m(t.toneMappingExposure);
178
+ s.value.toneMappingExposure = x !== void 0 ? x : c.toneMappingExposure;
179
+ const h = m(t.outputColorSpace);
180
+ s.value.outputColorSpace = h !== void 0 ? h : c.outputColorSpace;
181
+ const T = m(t.useLegacyLights);
182
+ s.value.useLegacyLights = T !== void 0 ? T : c.useLegacyLights;
183
+ const L = m(t.clearColor);
184
+ L && s.value.setClearColor(
185
+ L ? Ve(L) : new B(0)
187
186
  // default clear color is not easily/efficiently retrievable from three
188
187
  );
189
188
  });
190
- const { pause: c, resume: v, onLoop: C } = te();
191
- return C(() => {
192
- o.value && !y(t) && r.value.render(e, o.value);
193
- }), v(), W(() => {
194
- c(), r.value.dispose(), r.value.forceContextLoss();
189
+ const { pause: w, resume: C, onLoop: _ } = ee();
190
+ return _(() => {
191
+ u.value && !m(r) && s.value.render(e, u.value);
192
+ }), C(), V(() => {
193
+ w(), s.value.dispose(), s.value.forceContextLoss();
195
194
  }), {
196
- renderer: r
195
+ renderer: s
197
196
  };
198
197
  }
199
198
  function $e(e) {
200
- const a = { nodes: {}, materials: {} };
201
- return e && e.traverse((n) => {
202
- n.name && (a.nodes[n.name] = n), n.material && !a.materials[n.material.name] && (a.materials[n.material.name] = n.material);
203
- }), a;
199
+ const n = { nodes: {}, materials: {} };
200
+ return e && e.traverse((t) => {
201
+ t.name && (n.nodes[t.name] = t), t.material && !n.materials[t.material.name] && (n.materials[t.material.name] = t.material);
202
+ }), n;
204
203
  }
205
- async function st(e, a, n, t, i) {
206
- const { logError: o } = h(), l = new e();
207
- i && i(l), n && n(l);
208
- const p = (Array.isArray(a) ? a : [a]).map(
209
- (m) => new Promise((f, s) => {
204
+ async function ot(e, n, t, r, o) {
205
+ const { logError: u } = S(), l = new e();
206
+ o && o(l), t && t(l);
207
+ const a = (Array.isArray(n) ? n : [n]).map(
208
+ (i) => new Promise((f, c) => {
210
209
  l.load(
211
- m,
212
- (c) => {
213
- c.scene && Object.assign(c, $e(c.scene)), f(c);
210
+ i,
211
+ (w) => {
212
+ w.scene && Object.assign(w, $e(w.scene)), f(w);
214
213
  },
215
- t,
216
- (c) => s(o("[useLoader] - Failed to load resource", c))
214
+ r,
215
+ (w) => c(u("[useLoader] - Failed to load resource", w))
217
216
  );
218
217
  })
219
218
  );
220
- return Q(a) ? await Promise.all(p) : await p[0];
219
+ return Y(n) ? await Promise.all(a) : await a[0];
221
220
  }
222
- async function it(e) {
223
- const a = new _e(), n = new Me(a), t = (i) => new Promise((o, l) => {
224
- n.load(
225
- i,
226
- (r) => o(r),
221
+ async function st(e) {
222
+ const n = new Me(), t = new _e(n), r = (o) => new Promise((u, l) => {
223
+ t.load(
224
+ o,
225
+ (s) => u(s),
227
226
  () => null,
228
227
  () => {
229
228
  l(new Error("[useTextures] - Failed to load texture"));
230
229
  }
231
230
  );
232
231
  });
233
- if (Q(e)) {
234
- const i = await Promise.all(e.map((o) => t(o)));
235
- return e.length > 1 ? i : i[0];
232
+ if (Y(e)) {
233
+ const o = await Promise.all(e.map((u) => r(u)));
234
+ return e.length > 1 ? o : o[0];
236
235
  } else {
237
236
  const {
238
- map: i,
239
- displacementMap: o,
237
+ map: o,
238
+ displacementMap: u,
240
239
  normalMap: l,
241
- roughnessMap: r,
242
- metalnessMap: p,
243
- aoMap: m,
240
+ roughnessMap: s,
241
+ metalnessMap: a,
242
+ aoMap: i,
244
243
  alphaMap: f,
245
- matcap: s
244
+ matcap: c
246
245
  } = e;
247
246
  return {
248
- map: i ? await t(i) : null,
249
- displacementMap: o ? await t(o) : null,
250
- normalMap: l ? await t(l) : null,
251
- roughnessMap: r ? await t(r) : null,
252
- metalnessMap: p ? await t(p) : null,
253
- aoMap: m ? await t(m) : null,
254
- alphaMap: f ? await t(f) : null,
255
- matcap: s ? await t(s) : null
247
+ map: o ? await r(o) : null,
248
+ displacementMap: u ? await r(u) : null,
249
+ normalMap: l ? await r(l) : null,
250
+ roughnessMap: s ? await r(s) : null,
251
+ metalnessMap: a ? await r(a) : null,
252
+ aoMap: i ? await r(i) : null,
253
+ alphaMap: f ? await r(f) : null,
254
+ matcap: c ? await r(c) : null
256
255
  };
257
256
  }
258
257
  }
259
- const je = (e, { renderer: a, camera: n }) => {
260
- const t = M(() => a.value.domElement), { x: i, y: o } = De({ target: t }), { width: l, height: r, top: p, left: m } = Oe(t), f = new Re(), s = ({ x: E, y: w }) => {
261
- if (t.value)
258
+ const Ie = (e, { renderer: n, camera: t }) => {
259
+ const r = P(() => n.value.domElement), { x: o, y: u } = De({ target: r }), { width: l, height: s, top: a, left: i } = ke(r), f = new Pe(), c = ({ x: p, y: M }) => {
260
+ if (r.value)
262
261
  return {
263
- x: (E - m.value) / l.value * 2 - 1,
264
- y: -((w - p.value) / r.value) * 2 + 1
262
+ x: (p - i.value) / l.value * 2 - 1,
263
+ y: -((M - a.value) / s.value) * 2 + 1
265
264
  };
266
- }, c = ({ x: E, y: w }) => {
267
- if (n.value)
268
- return f.setFromCamera(new Te(E, w), n.value), f.intersectObjects(e.value, !1);
269
- }, v = (E) => {
270
- const w = s({
271
- x: (E == null ? void 0 : E.clientX) ?? i.value,
272
- y: (E == null ? void 0 : E.clientY) ?? o.value
265
+ }, w = ({ x: p, y: M }) => {
266
+ if (t.value)
267
+ return f.setFromCamera(new Ee(p, M), t.value), f.intersectObjects(e.value, !1);
268
+ }, C = (p) => {
269
+ const M = c({
270
+ x: (p == null ? void 0 : p.clientX) ?? o.value,
271
+ y: (p == null ? void 0 : p.clientY) ?? u.value
273
272
  });
274
- return w ? c(w) || [] : [];
275
- }, C = M(() => v()), u = O(), d = O(), g = (E, w) => {
276
- E.trigger({ event: w, intersects: v(w) });
277
- }, R = (E) => {
278
- g(d, E);
273
+ return M ? w(M) || [] : [];
274
+ }, _ = P(() => C()), d = k(), v = k(), y = (p, M) => {
275
+ p.trigger({ event: M, intersects: C(M) });
276
+ }, E = (p) => {
277
+ y(v, p);
279
278
  };
280
- let T;
281
- const P = (E) => {
282
- var w;
283
- T = (w = v(E)[0]) == null ? void 0 : w.object;
284
- }, S = (E) => {
285
- var w;
286
- E instanceof PointerEvent && T === ((w = v(E)[0]) == null ? void 0 : w.object) && g(u, E);
287
- }, A = (E) => d.trigger({ event: E, intersects: [] });
288
- return t.value.addEventListener("pointerup", S), t.value.addEventListener("pointerdown", P), t.value.addEventListener("pointermove", R), t.value.addEventListener("pointerleave", A), W(() => {
289
- t != null && t.value && (t.value.removeEventListener("pointerup", S), t.value.removeEventListener("pointerdown", P), t.value.removeEventListener("pointermove", R), t.value.removeEventListener("pointerleave", A));
279
+ let x;
280
+ const h = (p) => {
281
+ var M;
282
+ x = (M = C(p)[0]) == null ? void 0 : M.object;
283
+ }, T = (p) => {
284
+ var M;
285
+ p instanceof PointerEvent && x === ((M = C(p)[0]) == null ? void 0 : M.object) && y(d, p);
286
+ }, L = (p) => v.trigger({ event: p, intersects: [] });
287
+ return r.value.addEventListener("pointerup", T), r.value.addEventListener("pointerdown", h), r.value.addEventListener("pointermove", E), r.value.addEventListener("pointerleave", L), V(() => {
288
+ r != null && r.value && (r.value.removeEventListener("pointerup", T), r.value.removeEventListener("pointerdown", h), r.value.removeEventListener("pointermove", E), r.value.removeEventListener("pointerleave", L));
290
289
  }), {
291
- intersects: C,
292
- onClick: (E) => u.on(E).off,
293
- onPointerMove: (E) => d.on(E).off
290
+ intersects: _,
291
+ onClick: (p) => d.on(p).off,
292
+ onPointerMove: (p) => v.on(p).off
294
293
  };
295
294
  };
296
- function ut() {
297
- const { logWarning: e } = h();
298
- function a(t, i, o) {
295
+ function it() {
296
+ const { logWarning: e } = S();
297
+ function n(r, o, u) {
299
298
  let l = null;
300
- return t.traverse((r) => {
301
- r[i] === o && (l = r);
302
- }), l || e(`Child with ${i} '${o}' not found.`), l;
299
+ return r.traverse((s) => {
300
+ s[o] === u && (l = s);
301
+ }), l || e(`Child with ${o} '${u}' not found.`), l;
303
302
  }
304
- function n(t, i) {
305
- return a(t, "name", i);
303
+ function t(r, o) {
304
+ return n(r, "name", o);
306
305
  }
307
306
  return {
308
- seek: a,
309
- seekByName: n
307
+ seek: n,
308
+ seekByName: t
310
309
  };
311
310
  }
312
- const Ye = (e, a) => {
313
- const n = ae({
311
+ const Ne = (e, n) => {
312
+ const t = re({
314
313
  click: /* @__PURE__ */ new Map(),
315
314
  pointerMove: /* @__PURE__ */ new Map(),
316
315
  pointerEnter: /* @__PURE__ */ new Map(),
317
316
  pointerLeave: /* @__PURE__ */ new Map()
318
- }), t = (s) => {
319
- Object.values(n).forEach((c) => c.delete(s));
320
- }, i = (s) => {
321
- const { onClick: c, onPointerMove: v, onPointerEnter: C, onPointerLeave: u } = s;
322
- c && n.click.set(s, c), v && n.pointerMove.set(s, v), C && n.pointerEnter.set(s, C), u && n.pointerLeave.set(s, u);
323
- }, { REGISTER_AT_POINTER_EVENT_HANDLER: o, DEREGISTER_AT_POINTER_EVENT_HANDLER: l } = L;
324
- e.userData[o] = i, e.userData[l] = t;
325
- const r = M(
326
- () => ze(
327
- Object.values(n).map((s) => Array.from(s.keys())).flat(),
328
- ({ uuid: s }) => s
317
+ }), r = (i) => {
318
+ Object.values(t).forEach((f) => f.delete(i));
319
+ }, o = (i) => {
320
+ const { onClick: f, onPointerMove: c, onPointerEnter: w, onPointerLeave: C } = i;
321
+ f && t.click.set(i, f), c && t.pointerMove.set(i, c), w && t.pointerEnter.set(i, w), C && t.pointerLeave.set(i, C);
322
+ };
323
+ e.userData.tres__registerAtPointerEventHandler = o, e.userData.tres__deregisterAtPointerEventHandler = r;
324
+ const u = P(
325
+ () => je(
326
+ Object.values(t).map((i) => Array.from(i.keys())).flat(),
327
+ ({ uuid: i }) => i
329
328
  )
330
- ), { onClick: p, onPointerMove: m } = je(r, a);
331
- p(({ intersects: s, event: c }) => {
332
- var v;
333
- s.length && ((v = n.click.get(s[0].object)) == null || v(s[0], c));
329
+ ), { onClick: l, onPointerMove: s } = Ie(u, n);
330
+ l(({ intersects: i, event: f }) => {
331
+ var c;
332
+ i.length && ((c = t.click.get(i[0].object)) == null || c(i[0], f));
334
333
  });
335
- let f;
336
- return m(({ intersects: s, event: c }) => {
337
- var g, R, T, P;
338
- const v = (g = s == null ? void 0 : s[0]) == null ? void 0 : g.object, { pointerLeave: C, pointerEnter: u, pointerMove: d } = n;
339
- f && f !== v && ((R = C.get(f)) == null || R(f, c)), v && (f !== v && ((T = u.get(v)) == null || T(s[0], c)), (P = d.get(v)) == null || P(s[0], c)), f = v || null;
334
+ let a;
335
+ return s(({ intersects: i, event: f }) => {
336
+ var d, v, y, E;
337
+ const c = (d = i == null ? void 0 : i[0]) == null ? void 0 : d.object, { pointerLeave: w, pointerEnter: C, pointerMove: _ } = t;
338
+ a && a !== c && ((v = w.get(a)) == null || v(a, f)), c && (a !== c && ((y = C.get(c)) == null || y(i[0], f)), (E = _.get(c)) == null || E(i[0], f)), a = c || null;
340
339
  }), {
341
- registerObject: i,
342
- deregisterObject: t
340
+ registerObject: o,
341
+ deregisterObject: r
343
342
  };
344
343
  };
345
- function Ue({
344
+ function qe({
346
345
  scene: e,
347
- canvas: a,
348
- windowSize: n,
349
- disableRender: t,
350
- rendererOptions: i
346
+ canvas: n,
347
+ windowSize: t,
348
+ disableRender: r,
349
+ rendererOptions: o
351
350
  }) {
352
- const o = M(
353
- () => y(n) ? he() : be(y(a).parentElement)
354
- ), l = M(() => o.value.width.value), r = M(() => o.value.height.value), p = M(() => l.value / r.value), m = {
355
- height: r,
351
+ const u = P(
352
+ () => m(t) ? Se() : Ae(m(n).parentElement)
353
+ ), l = P(() => u.value.width.value), s = P(() => u.value.height.value), a = P(() => l.value / s.value), i = {
354
+ height: s,
356
355
  width: l,
357
- aspectRatio: p
358
- }, f = $(e), {
359
- camera: s,
360
- cameras: c,
361
- addCamera: v,
362
- removeCamera: C,
363
- setCameraActive: u
364
- } = ke({ sizes: m, scene: e }), { renderer: d } = We(
356
+ aspectRatio: a
357
+ }, f = W(e), {
358
+ camera: c,
359
+ cameras: w,
360
+ addCamera: C,
361
+ removeCamera: _,
362
+ setCameraActive: d
363
+ } = Be({ sizes: i, scene: e }), { renderer: v } = We(
365
364
  {
366
365
  scene: e,
367
- canvas: a,
368
- options: i,
369
- contextParts: { sizes: m, camera: s },
370
- disableRender: t
366
+ canvas: n,
367
+ options: o,
368
+ contextParts: { sizes: i, camera: c },
369
+ disableRender: r
371
370
  }
372
- ), g = {
373
- sizes: m,
374
- scene: G(f),
375
- camera: s,
376
- cameras: G(c),
377
- renderer: G(d),
378
- addCamera: v,
379
- removeCamera: C,
380
- setCameraActive: u
371
+ ), y = {
372
+ sizes: i,
373
+ scene: I(f),
374
+ camera: c,
375
+ cameras: I(w),
376
+ renderer: v,
377
+ addCamera: C,
378
+ removeCamera: _,
379
+ setCameraActive: d
381
380
  };
382
- return oe("useTres", g), g;
381
+ return ae("useTres", y), y;
383
382
  }
384
- function lt() {
385
- const e = re("useTres");
383
+ function ut() {
384
+ const e = ne("useTres");
386
385
  if (!e)
387
386
  throw new Error("useTresContext must be used together with useTresContextProvider");
388
387
  return e;
389
388
  }
390
- let H = null, _ = null;
391
- const { logError: q } = h(), qe = {
392
- createElement(e, a, n, t) {
393
- var p, m;
394
- if (t || (t = {}), t.args || (t.args = []), e === "template" || Ve(e))
389
+ let H = null, g = null;
390
+ const { logError: U } = S(), Ue = {
391
+ createElement(e, n, t, r) {
392
+ var l, s;
393
+ if (r || (r = {}), r.args || (r.args = []), e === "template" || He(e))
395
394
  return null;
396
- let i = e.replace("Tres", ""), o;
395
+ let o = e.replace("Tres", ""), u;
397
396
  if (e === "primitive") {
398
- (t == null ? void 0 : t.object) === void 0 && q("Tres primitives need a prop 'object'");
399
- const f = t.object;
400
- i = f.type, o = Object.assign(f, { type: i, attach: t.attach, primitive: !0 });
397
+ (r == null ? void 0 : r.object) === void 0 && U("Tres primitives need a prop 'object'");
398
+ const a = r.object;
399
+ o = a.type, u = Object.assign(a, { type: o, attach: r.attach, primitive: !0 });
401
400
  } else {
402
- const f = K.value[i];
403
- f || q(`${i} is not defined on the THREE namespace. Use extend to add it to the catalog.`), o = new f(...t.args);
401
+ const a = K.value[o];
402
+ a || U(`${o} is not defined on the THREE namespace. Use extend to add it to the catalog.`), u = new a(...r.args);
404
403
  }
405
- o.isCamera && (t != null && t.position || o.position.set(3, 3, 3), t != null && t.lookAt || o.lookAt(0, 0, 0)), (t == null ? void 0 : t.attach) === void 0 && (o.isMaterial ? o.attach = "material" : o.isBufferGeometry && (o.attach = "geometry"));
406
- const { GEOMETRY_VIA_PROP: l, MATERIAL_VIA_PROP: r } = L;
407
- return o.isObject3D && ((p = t == null ? void 0 : t.material) != null && p.isMaterial && (o.userData[r] = !0), (m = t == null ? void 0 : t.geometry) != null && m.isBufferGeometry && (o.userData[l] = !0)), o;
404
+ return u.isCamera && (r != null && r.position || u.position.set(3, 3, 3), r != null && r.lookAt || u.lookAt(0, 0, 0)), (r == null ? void 0 : r.attach) === void 0 && (u.isMaterial ? u.attach = "material" : u.isBufferGeometry && (u.attach = "geometry")), u.isObject3D && ((l = r == null ? void 0 : r.material) != null && l.isMaterial && (u.userData.tres__materialViaProp = !0), (s = r == null ? void 0 : r.geometry) != null && s.isBufferGeometry && (u.userData.tres__geometryViaProp = !0)), u;
408
405
  },
409
- insert(e, a) {
410
- var n, t, i, o, l, r, p, m, f;
411
- if (a && a.isScene && (_ = a), (((n = e == null ? void 0 : e.__vnode) == null ? void 0 : n.type) === "TresGroup" || ((t = e == null ? void 0 : e.__vnode) == null ? void 0 : t.type) === "TresObject3D") && a === null && !((o = (i = e == null ? void 0 : e.__vnode) == null ? void 0 : i.ctx) != null && o.asyncResolved)) {
406
+ insert(e, n) {
407
+ var t, r, o, u, l, s, a, i, f;
408
+ if (n && n.isScene && (g = n), (((t = e == null ? void 0 : e.__vnode) == null ? void 0 : t.type) === "TresGroup" || ((r = e == null ? void 0 : e.__vnode) == null ? void 0 : r.type) === "TresObject3D") && n === null && !((u = (o = e == null ? void 0 : e.__vnode) == null ? void 0 : o.ctx) != null && u.asyncResolved)) {
412
409
  H = e;
413
410
  return;
414
411
  } else
415
- (l = e == null ? void 0 : e.__vnode) != null && l.type.includes("Controls") && a === null && (H = _);
416
- a || (a = H), e != null && e.isObject3D && (e != null && e.isCamera && ((p = (r = _ == null ? void 0 : _.userData) == null ? void 0 : r[L.REGISTER_CAMERA]) == null || p.call(r, e)), (e != null && e.onClick || e != null && e.onPointerMove || e != null && e.onPointerEnter || e != null && e.onPointerLeave) && ((f = (m = _ == null ? void 0 : _.userData) == null ? void 0 : m[L.REGISTER_AT_POINTER_EVENT_HANDLER]) == null || f.call(m, e))), e != null && e.isObject3D && (a != null && a.isObject3D) ? (a.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? a.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[a == null ? void 0 : a.attach], a && (a[e.attach] = e));
412
+ (l = e == null ? void 0 : e.__vnode) != null && l.type.includes("Controls") && n === null && (H = g);
413
+ if (n || (n = H), e != null && e.isObject3D) {
414
+ if (e != null && e.isCamera) {
415
+ if (!(g != null && g.userData.tres__registerCamera))
416
+ throw "could not find tres__registerCamera on scene's userData";
417
+ (a = g == null ? void 0 : (s = g.userData).tres__registerCamera) == null || a.call(s, e);
418
+ }
419
+ if (e != null && e.onClick || e != null && e.onPointerMove || e != null && e.onPointerEnter || e != null && e.onPointerLeave) {
420
+ if (!(g != null && g.userData.tres__registerAtPointerEventHandler))
421
+ throw "could not find tres__registerAtPointerEventHandler on scene's userData";
422
+ (f = g == null ? void 0 : (i = g.userData).tres__registerAtPointerEventHandler) == null || f.call(i, e);
423
+ }
424
+ }
425
+ e != null && e.isObject3D && (n != null && n.isObject3D) ? (n.add(e), e.dispatchEvent({ type: "added" })) : e != null && e.isFog ? n.fog = e : typeof (e == null ? void 0 : e.attach) == "string" && (e.__previousAttach = e[n == null ? void 0 : n.attach], n && (n[e.attach] = e));
417
426
  },
418
427
  remove(e) {
419
- var a, n, t, i;
428
+ var n, t;
420
429
  if (e) {
421
430
  if (e.isObject3D) {
422
- const o = e, {
423
- DEREGISTER_CAMERA: l,
424
- GEOMETRY_VIA_PROP: r,
425
- MATERIAL_VIA_PROP: p,
426
- DEREGISTER_AT_POINTER_EVENT_HANDLER: m
427
- } = L, f = (u) => {
428
- var d, g;
429
- u.userData[p] || (d = u.material) == null || d.dispose(), u.userData[r] || (g = u.geometry) == null || g.dispose();
430
- }, s = (a = _ == null ? void 0 : _.userData) == null ? void 0 : a[m], c = (u) => {
431
- (u != null && u.onClick || u != null && u.onPointerMove || u != null && u.onPointerEnter || u != null && u.onPointerLeave) && (s == null || s(u));
432
- }, v = (n = _ == null ? void 0 : _.userData) == null ? void 0 : n[l], C = (u) => {
433
- u.isCamera && v(u);
431
+ const r = e, o = (a) => {
432
+ var f, c;
433
+ const i = a;
434
+ a.userData.tres__materialViaProp || (f = i.material) == null || f.dispose(), a.userData.tres__geometryViaProp || (c = i.geometry) == null || c.dispose();
435
+ }, u = g == null ? void 0 : g.userData.tres__deregisterAtPointerEventHandler, l = (a) => {
436
+ if (!u)
437
+ throw "could not find tres__deregisterAtPointerEventHandler on scene's userData";
438
+ (a != null && a.onClick || a != null && a.onPointerMove || a != null && a.onPointerEnter || a != null && a.onPointerLeave) && (u == null || u(a));
439
+ }, s = (a) => {
440
+ const i = g == null ? void 0 : g.userData.tres__deregisterCamera;
441
+ if (!i)
442
+ throw "could not find tres__deregisterCamera on scene's userData";
443
+ a.isCamera && (i == null || i(a));
434
444
  };
435
- o.traverse((u) => {
436
- f(u), C(u), c == null || c(u);
437
- }), f(o), C(o), c == null || c(o);
445
+ r.traverse((a) => {
446
+ o(a), s(a), l == null || l(a);
447
+ }), o(r), s(r), l == null || l(r);
438
448
  }
439
- (t = e.removeFromParent) == null || t.call(e), (i = e.dispose) == null || i.call(e);
449
+ (n = e.removeFromParent) == null || n.call(e), (t = e.dispose) == null || t.call(e);
440
450
  }
441
451
  },
442
- patchProp(e, a, n, t) {
452
+ patchProp(e, n, t, r) {
443
453
  if (e) {
444
- let i = e, o = a, l = b(o), r = i == null ? void 0 : i[l];
445
- if (i.type === "BufferGeometry") {
446
- if (o === "args")
454
+ let o = e, u = n, l = A(u), s = o == null ? void 0 : o[l];
455
+ if (o.type === "BufferGeometry") {
456
+ if (u === "args")
447
457
  return;
448
- i.setAttribute(
449
- b(o),
450
- new Pe(...t)
458
+ o.setAttribute(
459
+ A(u),
460
+ new Le(...r)
451
461
  );
452
462
  return;
453
463
  }
454
- if (o.includes("-") && r === void 0) {
455
- const m = o.split("-");
456
- r = m.reduce((f, s) => f[b(s)], i), o = m.pop(), l = o.toLowerCase(), r != null && r.set || (i = m.reduce((f, s) => f[b(s)], i));
464
+ if (u.includes("-") && s === void 0) {
465
+ const i = u.split("-");
466
+ s = i.reduce((f, c) => f[A(c)], o), u = i.pop(), l = u.toLowerCase(), s != null && s.set || (o = i.reduce((f, c) => f[A(c)], o));
457
467
  }
458
- let p = t;
459
- if (p === "" && (p = !0), Y(r)) {
460
- Array.isArray(p) ? e[l](...p) : e[l](p);
468
+ let a = r;
469
+ if (a === "" && (a = !0), N(s)) {
470
+ Array.isArray(a) ? e[l](...a) : e[l](a);
461
471
  return;
462
472
  }
463
- !(r != null && r.set) && !Y(r) ? i[l] = p : r.constructor === p.constructor && (r != null && r.copy) ? r == null || r.copy(p) : Array.isArray(p) ? r.set(...p) : !r.isColor && r.setScalar ? r.setScalar(p) : r.set(p);
473
+ !(s != null && s.set) && !N(s) ? o[l] = a : s.constructor === a.constructor && (s != null && s.copy) ? s == null || s.copy(a) : Array.isArray(a) ? s.set(...a) : !s.isColor && s.setScalar ? s.setScalar(a) : s.set(a);
464
474
  }
465
475
  },
466
476
  parentNode(e) {
@@ -475,15 +485,15 @@ const { logError: q } = h(), qe = {
475
485
  setScopeId: () => void 0,
476
486
  cloneNode: () => void 0,
477
487
  insertStaticContent: () => void 0
478
- }, { createApp: Je } = se(qe), Ke = (e) => {
479
- const a = Je(n);
480
- function n() {
488
+ }, { createApp: Je } = oe(Ue), Ke = (e) => {
489
+ const n = Je(t);
490
+ function t() {
481
491
  return e && e.default ? e.default() : [];
482
492
  }
483
- return a;
493
+ return n;
484
494
  };
485
- X(me);
486
- const Xe = ["data-scene"], Qe = /* @__PURE__ */ ie({
495
+ X(pe);
496
+ const Xe = ["data-scene"], Ye = /* @__PURE__ */ se({
487
497
  __name: "TresCanvas",
488
498
  props: {
489
499
  shadows: { type: Boolean },
@@ -510,53 +520,49 @@ const Xe = ["data-scene"], Qe = /* @__PURE__ */ ie({
510
520
  failIfMajorPerformanceCaveat: { type: Boolean }
511
521
  },
512
522
  setup(e) {
513
- const a = e, { logWarning: n } = h(), t = F(), i = $(new Ae());
514
- te();
515
- const o = ue();
523
+ const n = e, { logWarning: t } = S(), r = j(), o = W(new xe());
524
+ ee();
525
+ const u = ie();
516
526
  let l;
517
- const r = (m) => {
518
- l = Ke(o), l.provide("useTres", m), l.provide("extend", X), l.mount(i.value);
519
- }, p = M(() => a.disableRender);
520
- return le(() => {
521
- const m = t, f = Ue({
522
- scene: i.value,
523
- canvas: m,
524
- windowSize: a.windowSize,
525
- disableRender: p,
526
- rendererOptions: {
527
- ...a,
528
- antialias: a.antialias === void 0 ? !0 : a.antialias
529
- // an opinionated default of tres
530
- }
527
+ const s = (i) => {
528
+ l = Ke(u), l.provide("useTres", i), l.provide("extend", X), l.mount(o.value);
529
+ }, a = P(() => n.disableRender);
530
+ return ue(() => {
531
+ const i = r, f = qe({
532
+ scene: o.value,
533
+ canvas: i,
534
+ windowSize: n.windowSize,
535
+ disableRender: a,
536
+ rendererOptions: n
531
537
  });
532
- Ye(i.value, f);
533
- const { addCamera: s, camera: c, cameras: v, removeCamera: C } = f;
534
- r(f);
535
- const u = () => {
536
- const d = new z(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
537
- d.position.set(3, 3, 3), d.lookAt(0, 0, 0), s(d);
538
- const g = x(
538
+ Ne(o.value, f);
539
+ const { addCamera: c, camera: w, cameras: C, removeCamera: _ } = f;
540
+ s(f);
541
+ const d = () => {
542
+ const v = new G(45, window.innerWidth / window.innerHeight, 0.1, 1e3);
543
+ v.position.set(3, 3, 3), v.lookAt(0, 0, 0), c(v);
544
+ const y = b(
539
545
  () => {
540
- v.value.length >= 2 && (d.removeFromParent(), C(d), g == null || g());
546
+ C.value.length >= 2 && (v.removeFromParent(), _(v), y == null || y());
541
547
  }
542
548
  );
543
549
  };
544
- J(() => a.camera, (d, g) => {
545
- d ? s(d) : g && (g.removeFromParent(), C(g));
550
+ J(() => n.camera, (v, y) => {
551
+ v ? c(v) : y && (y.removeFromParent(), _(y));
546
552
  }, {
547
553
  immediate: !0
548
- }), c.value || (n(
554
+ }), w.value || (t(
549
555
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
550
- ), u());
551
- }), (m, f) => (ce(), fe("canvas", {
556
+ ), d());
557
+ }), (i, f) => (le(), ce("canvas", {
552
558
  ref_key: "canvas",
553
- ref: t,
554
- "data-scene": i.value.uuid,
555
- style: pe({
559
+ ref: r,
560
+ "data-scene": o.value.uuid,
561
+ style: fe({
556
562
  display: "block",
557
563
  width: "100%",
558
564
  height: "100%",
559
- position: m.windowSize ? "fixed" : "relative",
565
+ position: i.windowSize ? "fixed" : "relative",
560
566
  top: 0,
561
567
  left: 0,
562
568
  pointerEvents: "auto",
@@ -565,40 +571,40 @@ const Xe = ["data-scene"], Qe = /* @__PURE__ */ ie({
565
571
  })
566
572
  }, null, 12, Xe));
567
573
  }
568
- }), Ze = [
574
+ }), Qe = [
569
575
  "TresCanvas",
570
576
  "TresLeches",
571
577
  "TresScene"
572
- ], et = {
578
+ ], Ze = {
573
579
  template: {
574
580
  compilerOptions: {
575
- isCustomElement: (e) => e.startsWith("Tres") && !Ze.includes(e) || e === "primitive"
581
+ isCustomElement: (e) => e.startsWith("Tres") && !Qe.includes(e) || e === "primitive"
576
582
  }
577
583
  }
578
- }, ct = et, ft = {
584
+ }, lt = Ze, ct = {
579
585
  install(e) {
580
- e.component("TresCanvas", Qe);
586
+ e.component("TresCanvas", Ye);
581
587
  }
582
588
  };
583
589
  export {
584
- Qe as TresCanvas,
590
+ Ye as TresCanvas,
585
591
  K as catalogue,
586
- ft as default,
592
+ ct as default,
587
593
  X as extend,
588
- ot as isProd,
589
- Fe as normalizeColor,
590
- rt as normalizeVectorFlexibleParam,
591
- ct as templateCompilerOptions,
594
+ at as isProd,
595
+ Ve as normalizeColor,
596
+ nt as normalizeVectorFlexibleParam,
597
+ lt as templateCompilerOptions,
592
598
  $e as trasverseObjects,
593
- ke as useCamera,
594
- st as useLoader,
595
- h as useLogger,
596
- Ye as usePointerEventHandler,
597
- je as useRaycaster,
598
- te as useRenderLoop,
599
+ Be as useCamera,
600
+ ot as useLoader,
601
+ S as useLogger,
602
+ Ne as usePointerEventHandler,
603
+ Ie as useRaycaster,
604
+ ee as useRenderLoop,
599
605
  We as useRenderer,
600
- ut as useSeek,
601
- it as useTexture,
602
- lt as useTresContext,
603
- Ue as useTresContextProvider
606
+ it as useSeek,
607
+ st as useTexture,
608
+ ut as useTresContext,
609
+ qe as useTresContextProvider
604
610
  };