@shopware-ag/dive 1.18.5-beta.2 → 1.18.5-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/build/AR-BzVanQ-t.js +722 -0
  2. package/build/AR-BzVanQ-t.js.map +1 -0
  3. package/build/AR-ySzrfSW3.cjs +2 -0
  4. package/build/AR-ySzrfSW3.cjs.map +1 -0
  5. package/build/IO-BTWL9Zfp.cjs +19 -0
  6. package/build/IO-BTWL9Zfp.cjs.map +1 -0
  7. package/build/{IO-BgiJzKrU.js → IO-CYzpSt1J.js} +257 -225
  8. package/build/IO-CYzpSt1J.js.map +1 -0
  9. package/build/{MediaCreator-4zmvmUWH.js → MediaCreator-BFa3Xfwk.js} +2 -2
  10. package/build/{MediaCreator-4zmvmUWH.js.map → MediaCreator-BFa3Xfwk.js.map} +1 -1
  11. package/build/{MediaCreator-BNxZVYyZ.cjs → MediaCreator-BqLcaXbl.cjs} +2 -2
  12. package/build/{MediaCreator-BNxZVYyZ.cjs.map → MediaCreator-BqLcaXbl.cjs.map} +1 -1
  13. package/build/{dive-_-yiZbhn.cjs → dive-BTQZqHRt.cjs} +3 -3
  14. package/build/{dive-_-yiZbhn.cjs.map → dive-BTQZqHRt.cjs.map} +1 -1
  15. package/build/{dive-Mi8g8Khn.js → dive-Dk0rFfvA.js} +35 -35
  16. package/build/{dive-Mi8g8Khn.js.map → dive-Dk0rFfvA.js.map} +1 -1
  17. package/build/dive.cjs +1 -1
  18. package/build/dive.js +1 -1
  19. package/build/src/ar/arquicklook/ARQuickLook.d.ts +2 -3
  20. package/package.json +1 -1
  21. package/src/ar/arquicklook/ARQuickLook.ts +75 -48
  22. package/src/ar/arquicklook/__test__/ARQuickLook.test.ts +45 -80
  23. package/src/ar/sceneviewer/__test__/SceneViewer.test.ts +0 -12
  24. package/build/AR-B-g0updz.js +0 -1450
  25. package/build/AR-B-g0updz.js.map +0 -1
  26. package/build/AR-BWQebw6-.cjs +0 -153
  27. package/build/AR-BWQebw6-.cjs.map +0 -1
  28. package/build/IO-BgiJzKrU.js.map +0 -1
  29. package/build/IO-CuYml7Y5.cjs +0 -2
  30. package/build/IO-CuYml7Y5.cjs.map +0 -1
  31. package/build/TextureUtils-CxpuVgwF.js +0 -38
  32. package/build/TextureUtils-CxpuVgwF.js.map +0 -1
  33. package/build/TextureUtils-DNG-yR77.cjs +0 -19
  34. package/build/TextureUtils-DNG-yR77.cjs.map +0 -1
@@ -1,6 +1,38 @@
1
- import { C as se, M as Q, V as v, Q as te, B as L, a as G, S as ne, N as re, b as H, R as ie, c as oe, P as D, I as ae, d as Y, e as ce, f as ue, g as le, h as he, L as fe, i as pe, j as de, k as xe, l as ge, m as Te, n as me, G as Me } from "./dive-Mi8g8Khn.js";
2
- import { d as z } from "./TextureUtils-CxpuVgwF.js";
3
- const K = {
1
+ import { P as oe, S as ae, U as ce, a as te, M as le, b as ue, c as K, W as fe, C as he, d as pe, e as ne, V as G, Q as de, B as L, f as k, g as xe, N as ge, h as W, R as Te, i as me, j as P, I as Me, k as ye, l as we, m as Ee, L as Ie, n as Ae, o as Re, p as be, q as Ne, r as Le, s as Se, G as _e } from "./dive-Dk0rFfvA.js";
2
+ let F, H, _, B;
3
+ function V(a, e = 1 / 0, s = null) {
4
+ H || (H = new oe(2, 2, 1, 1)), _ || (_ = new ae({
5
+ uniforms: { blitTexture: new ce(a) },
6
+ vertexShader: `
7
+ varying vec2 vUv;
8
+ void main(){
9
+ vUv = uv;
10
+ gl_Position = vec4(position.xy * 1.0,0.,.999999);
11
+ }`,
12
+ fragmentShader: `
13
+ uniform sampler2D blitTexture;
14
+ varying vec2 vUv;
15
+
16
+ void main(){
17
+ gl_FragColor = vec4(vUv.xy, 0, 1);
18
+
19
+ #ifdef IS_SRGB
20
+ gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );
21
+ #else
22
+ gl_FragColor = texture2D( blitTexture, vUv);
23
+ #endif
24
+ }`
25
+ })), _.uniforms.blitTexture.value = a, _.defines.IS_SRGB = a.colorSpace == te, _.needsUpdate = !0, B || (B = new le(H, _), B.frustumCulled = !1);
26
+ const n = new ue(), t = new K();
27
+ t.add(B), s === null && (s = F = new fe({ antialias: !1 }));
28
+ const i = Math.min(a.image.width, e), r = Math.min(a.image.height, e);
29
+ s.setSize(i, r), s.clear(), s.render(t, n);
30
+ const o = document.createElement("canvas"), c = o.getContext("2d");
31
+ o.width = i, o.height = r, c.drawImage(s.domElement, 0, 0, i, r);
32
+ const l = new he(o);
33
+ return l.minFilter = a.minFilter, l.magFilter = a.magFilter, l.wrapS = a.wrapS, l.wrapT = a.wrapT, l.name = a.name, F && (F.forceContextLoss(), F.dispose(), F = null), l;
34
+ }
35
+ const J = {
4
36
  POSITION: [
5
37
  "byte",
6
38
  "byte normalized",
@@ -28,34 +60,34 @@ const K = {
28
60
  "unsigned short"
29
61
  ]
30
62
  };
31
- class V {
63
+ class q {
32
64
  constructor() {
33
65
  this.pluginCallbacks = [], this.register(function(e) {
34
- return new Se(e);
66
+ return new ze(e);
35
67
  }), this.register(function(e) {
36
- return new _e(e);
68
+ return new ke(e);
37
69
  }), this.register(function(e) {
38
- return new Fe(e);
70
+ return new je(e);
39
71
  }), this.register(function(e) {
40
- return new Oe(e);
72
+ return new Ye(e);
41
73
  }), this.register(function(e) {
42
- return new ve(e);
74
+ return new Ke(e);
43
75
  }), this.register(function(e) {
44
- return new De(e);
76
+ return new We(e);
45
77
  }), this.register(function(e) {
46
- return new Ce(e);
78
+ return new He(e);
47
79
  }), this.register(function(e) {
48
- return new Ue(e);
80
+ return new Ve(e);
49
81
  }), this.register(function(e) {
50
- return new Be(e);
82
+ return new qe(e);
51
83
  }), this.register(function(e) {
52
- return new Ge(e);
84
+ return new Xe(e);
53
85
  }), this.register(function(e) {
54
- return new ze(e);
86
+ return new Je(e);
55
87
  }), this.register(function(e) {
56
- return new Pe(e);
88
+ return new Qe(e);
57
89
  }), this.register(function(e) {
58
- return new ke(e);
90
+ return new Ze(e);
59
91
  });
60
92
  }
61
93
  register(e) {
@@ -72,8 +104,8 @@ class V {
72
104
  * @param {Object} options options
73
105
  */
74
106
  parse(e, s, n, t) {
75
- const i = new Le(), r = [];
76
- for (let o = 0, a = this.pluginCallbacks.length; o < a; o++)
107
+ const i = new Pe(), r = [];
108
+ for (let o = 0, c = this.pluginCallbacks.length; o < c; o++)
77
109
  r.push(this.pluginCallbacks[o](i));
78
110
  i.setPlugins(r), i.write(e, s, t).catch(n);
79
111
  }
@@ -108,72 +140,72 @@ const T = {
108
140
  CLAMP_TO_EDGE: 33071,
109
141
  MIRRORED_REPEAT: 33648,
110
142
  REPEAT: 10497
111
- }, P = "KHR_mesh_quantization", R = {};
112
- R[ue] = T.NEAREST;
113
- R[le] = T.NEAREST_MIPMAP_NEAREST;
114
- R[he] = T.NEAREST_MIPMAP_LINEAR;
115
- R[fe] = T.LINEAR;
116
- R[pe] = T.LINEAR_MIPMAP_NEAREST;
117
- R[de] = T.LINEAR_MIPMAP_LINEAR;
118
- R[xe] = T.CLAMP_TO_EDGE;
119
- R[ge] = T.REPEAT;
120
- R[Te] = T.MIRRORED_REPEAT;
121
- const q = {
143
+ }, j = "KHR_mesh_quantization", R = {};
144
+ R[ye] = T.NEAREST;
145
+ R[we] = T.NEAREST_MIPMAP_NEAREST;
146
+ R[Ee] = T.NEAREST_MIPMAP_LINEAR;
147
+ R[Ie] = T.LINEAR;
148
+ R[Ae] = T.LINEAR_MIPMAP_NEAREST;
149
+ R[Re] = T.LINEAR_MIPMAP_LINEAR;
150
+ R[be] = T.CLAMP_TO_EDGE;
151
+ R[Ne] = T.REPEAT;
152
+ R[Le] = T.MIRRORED_REPEAT;
153
+ const Q = {
122
154
  scale: "scale",
123
155
  position: "translation",
124
156
  quaternion: "rotation",
125
157
  morphTargetInfluences: "weights"
126
- }, ye = new se(), W = 12, we = 1179937895, Ee = 2, X = 8, Ie = 1313821514, Ae = 5130562;
127
- function F(c, e) {
128
- return c.length === e.length && c.every(function(s, n) {
158
+ }, Ce = new pe(), Z = 12, Ue = 1179937895, ve = 2, $ = 8, Fe = 1313821514, Oe = 5130562;
159
+ function O(a, e) {
160
+ return a.length === e.length && a.every(function(s, n) {
129
161
  return s === e[n];
130
162
  });
131
163
  }
132
- function Re(c) {
133
- return new TextEncoder().encode(c).buffer;
164
+ function De(a) {
165
+ return new TextEncoder().encode(a).buffer;
134
166
  }
135
- function be(c) {
136
- return F(c.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
167
+ function Be(a) {
168
+ return O(a.elements, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
137
169
  }
138
- function Ne(c, e, s) {
170
+ function Ge(a, e, s) {
139
171
  const n = {
140
- min: new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),
141
- max: new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)
172
+ min: new Array(a.itemSize).fill(Number.POSITIVE_INFINITY),
173
+ max: new Array(a.itemSize).fill(Number.NEGATIVE_INFINITY)
142
174
  };
143
175
  for (let t = e; t < e + s; t++)
144
- for (let i = 0; i < c.itemSize; i++) {
176
+ for (let i = 0; i < a.itemSize; i++) {
145
177
  let r;
146
- c.itemSize > 4 ? r = c.array[t * c.itemSize + i] : (i === 0 ? r = c.getX(t) : i === 1 ? r = c.getY(t) : i === 2 ? r = c.getZ(t) : i === 3 && (r = c.getW(t)), c.normalized === !0 && (r = H.normalize(r, c.array))), n.min[i] = Math.min(n.min[i], r), n.max[i] = Math.max(n.max[i], r);
178
+ a.itemSize > 4 ? r = a.array[t * a.itemSize + i] : (i === 0 ? r = a.getX(t) : i === 1 ? r = a.getY(t) : i === 2 ? r = a.getZ(t) : i === 3 && (r = a.getW(t)), a.normalized === !0 && (r = W.normalize(r, a.array))), n.min[i] = Math.min(n.min[i], r), n.max[i] = Math.max(n.max[i], r);
147
179
  }
148
180
  return n;
149
181
  }
150
- function $(c) {
151
- return Math.ceil(c / 4) * 4;
182
+ function re(a) {
183
+ return Math.ceil(a / 4) * 4;
152
184
  }
153
- function k(c, e = 0) {
154
- const s = $(c.byteLength);
155
- if (s !== c.byteLength) {
185
+ function Y(a, e = 0) {
186
+ const s = re(a.byteLength);
187
+ if (s !== a.byteLength) {
156
188
  const n = new Uint8Array(s);
157
- if (n.set(new Uint8Array(c)), e !== 0)
158
- for (let t = c.byteLength; t < s; t++)
189
+ if (n.set(new Uint8Array(a)), e !== 0)
190
+ for (let t = a.byteLength; t < s; t++)
159
191
  n[t] = e;
160
192
  return n.buffer;
161
193
  }
162
- return c;
194
+ return a;
163
195
  }
164
- function J() {
196
+ function ee() {
165
197
  return typeof document > "u" && typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1) : document.createElement("canvas");
166
198
  }
167
- function Z(c, e) {
168
- if (c.toBlob !== void 0)
169
- return new Promise((n) => c.toBlob(n, e));
199
+ function se(a, e) {
200
+ if (a.toBlob !== void 0)
201
+ return new Promise((n) => a.toBlob(n, e));
170
202
  let s;
171
- return e === "image/jpeg" ? s = 0.92 : e === "image/webp" && (s = 0.8), c.convertToBlob({
203
+ return e === "image/jpeg" ? s = 0.92 : e === "image/webp" && (s = 0.8), a.convertToBlob({
172
204
  type: e,
173
205
  quality: s
174
206
  });
175
207
  }
176
- class Le {
208
+ class Pe {
177
209
  constructor() {
178
210
  this.plugins = [], this.options = {}, this.pending = [], this.buffers = [], this.byteOffset = 0, this.buffers = [], this.nodeMap = /* @__PURE__ */ new Map(), this.skins = [], this.extensionsUsed = {}, this.extensionsRequired = {}, this.uids = /* @__PURE__ */ new Map(), this.uid = 0, this.json = {
179
211
  asset: {
@@ -210,24 +242,24 @@ class Le {
210
242
  }, n), this.options.animations.length > 0 && (this.options.trs = !0), this.processInput(e), await Promise.all(this.pending);
211
243
  const t = this, i = t.buffers, r = t.json;
212
244
  n = t.options;
213
- const o = t.extensionsUsed, a = t.extensionsRequired, l = new Blob(i, { type: "application/octet-stream" }), f = Object.keys(o), u = Object.keys(a);
214
- if (f.length > 0 && (r.extensionsUsed = f), u.length > 0 && (r.extensionsRequired = u), r.buffers && r.buffers.length > 0 && (r.buffers[0].byteLength = l.size), n.binary === !0) {
245
+ const o = t.extensionsUsed, c = t.extensionsRequired, l = new Blob(i, { type: "application/octet-stream" }), h = Object.keys(o), u = Object.keys(c);
246
+ if (h.length > 0 && (r.extensionsUsed = h), u.length > 0 && (r.extensionsRequired = u), r.buffers && r.buffers.length > 0 && (r.buffers[0].byteLength = l.size), n.binary === !0) {
215
247
  const m = new FileReader();
216
248
  m.readAsArrayBuffer(l), m.onloadend = function() {
217
- const h = k(m.result), p = new DataView(new ArrayBuffer(X));
218
- p.setUint32(0, h.byteLength, !0), p.setUint32(4, Ae, !0);
219
- const d = k(Re(JSON.stringify(r)), 32), g = new DataView(new ArrayBuffer(X));
220
- g.setUint32(0, d.byteLength, !0), g.setUint32(4, Ie, !0);
221
- const y = new ArrayBuffer(W), b = new DataView(y);
222
- b.setUint32(0, we, !0), b.setUint32(4, Ee, !0);
223
- const O = W + g.byteLength + d.byteLength + p.byteLength + h.byteLength;
224
- b.setUint32(8, O, !0);
249
+ const f = Y(m.result), p = new DataView(new ArrayBuffer($));
250
+ p.setUint32(0, f.byteLength, !0), p.setUint32(4, Oe, !0);
251
+ const d = Y(De(JSON.stringify(r)), 32), g = new DataView(new ArrayBuffer($));
252
+ g.setUint32(0, d.byteLength, !0), g.setUint32(4, Fe, !0);
253
+ const y = new ArrayBuffer(Z), b = new DataView(y);
254
+ b.setUint32(0, Ue, !0), b.setUint32(4, ve, !0);
255
+ const D = Z + g.byteLength + d.byteLength + p.byteLength + f.byteLength;
256
+ b.setUint32(8, D, !0);
225
257
  const x = new Blob([
226
258
  y,
227
259
  g,
228
260
  d,
229
261
  p,
230
- h
262
+ f
231
263
  ], { type: "application/octet-stream" }), M = new FileReader();
232
264
  M.readAsArrayBuffer(x), M.onloadend = function() {
233
265
  s(M.result);
@@ -236,8 +268,8 @@ class Le {
236
268
  } else if (r.buffers && r.buffers.length > 0) {
237
269
  const m = new FileReader();
238
270
  m.readAsDataURL(l), m.onloadend = function() {
239
- const h = m.result;
240
- r.buffers[0].uri = h, s(r);
271
+ const f = m.result;
272
+ r.buffers[0].uri = f, s(r);
241
273
  };
242
274
  } else
243
275
  s(r);
@@ -284,7 +316,7 @@ class Le {
284
316
  */
285
317
  isNormalizedNormalAttribute(e) {
286
318
  if (this.cache.attributesNormalized.has(e)) return !1;
287
- const n = new v();
319
+ const n = new G();
288
320
  for (let t = 0, i = e.count; t < i; t++)
289
321
  if (Math.abs(n.fromBufferAttribute(e, t).length() - 1) > 5e-4) return !1;
290
322
  return !0;
@@ -299,7 +331,7 @@ class Le {
299
331
  createNormalizedNormalAttribute(e) {
300
332
  const s = this.cache;
301
333
  if (s.attributesNormalized.has(e)) return s.attributesNormalized.get(e);
302
- const n = e.clone(), t = new v();
334
+ const n = e.clone(), t = new G();
303
335
  for (let i = 0, r = n.count; i < r; i++)
304
336
  t.fromBufferAttribute(n, i), t.x === 0 && t.y === 0 && t.z === 0 ? t.setX(1) : t.normalize(), n.setXYZ(i, t.x, t.y, t.z);
305
337
  return s.attributesNormalized.set(e, n), n;
@@ -318,34 +350,34 @@ class Le {
318
350
  }
319
351
  buildMetalRoughTexture(e, s) {
320
352
  if (e === s) return e;
321
- function n(h) {
322
- return h.colorSpace === ce ? function(d) {
353
+ function n(f) {
354
+ return f.colorSpace === te ? function(d) {
323
355
  return d < 0.04045 ? d * 0.0773993808 : Math.pow(d * 0.9478672986 + 0.0521327014, 2.4);
324
356
  } : function(d) {
325
357
  return d;
326
358
  };
327
359
  }
328
- console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), e instanceof G && (e = z(e)), s instanceof G && (s = z(s));
329
- const t = e ? e.image : null, i = s ? s.image : null, r = Math.max(t ? t.width : 0, i ? i.width : 0), o = Math.max(t ? t.height : 0, i ? i.height : 0), a = J();
330
- a.width = r, a.height = o;
331
- const l = a.getContext("2d");
360
+ console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."), e instanceof k && (e = V(e)), s instanceof k && (s = V(s));
361
+ const t = e ? e.image : null, i = s ? s.image : null, r = Math.max(t ? t.width : 0, i ? i.width : 0), o = Math.max(t ? t.height : 0, i ? i.height : 0), c = ee();
362
+ c.width = r, c.height = o;
363
+ const l = c.getContext("2d");
332
364
  l.fillStyle = "#00ffff", l.fillRect(0, 0, r, o);
333
- const f = l.getImageData(0, 0, r, o);
365
+ const h = l.getImageData(0, 0, r, o);
334
366
  if (t) {
335
367
  l.drawImage(t, 0, 0, r, o);
336
- const h = n(e), p = l.getImageData(0, 0, r, o).data;
368
+ const f = n(e), p = l.getImageData(0, 0, r, o).data;
337
369
  for (let d = 2; d < p.length; d += 4)
338
- f.data[d] = h(p[d] / 256) * 256;
370
+ h.data[d] = f(p[d] / 256) * 256;
339
371
  }
340
372
  if (i) {
341
373
  l.drawImage(i, 0, 0, r, o);
342
- const h = n(s), p = l.getImageData(0, 0, r, o).data;
374
+ const f = n(s), p = l.getImageData(0, 0, r, o).data;
343
375
  for (let d = 1; d < p.length; d += 4)
344
- f.data[d] = h(p[d] / 256) * 256;
376
+ h.data[d] = f(p[d] / 256) * 256;
345
377
  }
346
- l.putImageData(f, 0, 0);
378
+ l.putImageData(h, 0, 0);
347
379
  const m = (e || s).clone();
348
- return m.source = new ne(a), m.colorSpace = re, m.channel = (e || s).channel, e && s && e.channel !== s.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), m;
380
+ return m.source = new xe(c), m.colorSpace = ge, m.channel = (e || s).channel, e && s && e.channel !== s.channel && console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."), m;
349
381
  }
350
382
  /**
351
383
  * Process a buffer to append to the default one.
@@ -381,23 +413,23 @@ class Le {
381
413
  default:
382
414
  o = 4;
383
415
  }
384
- let a = e.itemSize * o;
385
- i === T.ARRAY_BUFFER && (a = Math.ceil(a / 4) * 4);
386
- const l = $(t * a), f = new DataView(new ArrayBuffer(l));
416
+ let c = e.itemSize * o;
417
+ i === T.ARRAY_BUFFER && (c = Math.ceil(c / 4) * 4);
418
+ const l = re(t * c), h = new DataView(new ArrayBuffer(l));
387
419
  let u = 0;
388
420
  for (let p = n; p < n + t; p++) {
389
421
  for (let d = 0; d < e.itemSize; d++) {
390
422
  let g;
391
- e.itemSize > 4 ? g = e.array[p * e.itemSize + d] : (d === 0 ? g = e.getX(p) : d === 1 ? g = e.getY(p) : d === 2 ? g = e.getZ(p) : d === 3 && (g = e.getW(p)), e.normalized === !0 && (g = H.normalize(g, e.array))), s === T.FLOAT ? f.setFloat32(u, g, !0) : s === T.INT ? f.setInt32(u, g, !0) : s === T.UNSIGNED_INT ? f.setUint32(u, g, !0) : s === T.SHORT ? f.setInt16(u, g, !0) : s === T.UNSIGNED_SHORT ? f.setUint16(u, g, !0) : s === T.BYTE ? f.setInt8(u, g) : s === T.UNSIGNED_BYTE && f.setUint8(u, g), u += o;
423
+ e.itemSize > 4 ? g = e.array[p * e.itemSize + d] : (d === 0 ? g = e.getX(p) : d === 1 ? g = e.getY(p) : d === 2 ? g = e.getZ(p) : d === 3 && (g = e.getW(p)), e.normalized === !0 && (g = W.normalize(g, e.array))), s === T.FLOAT ? h.setFloat32(u, g, !0) : s === T.INT ? h.setInt32(u, g, !0) : s === T.UNSIGNED_INT ? h.setUint32(u, g, !0) : s === T.SHORT ? h.setInt16(u, g, !0) : s === T.UNSIGNED_SHORT ? h.setUint16(u, g, !0) : s === T.BYTE ? h.setInt8(u, g) : s === T.UNSIGNED_BYTE && h.setUint8(u, g), u += o;
392
424
  }
393
- u % a !== 0 && (u += a - u % a);
425
+ u % c !== 0 && (u += c - u % c);
394
426
  }
395
427
  const m = {
396
- buffer: this.processBuffer(f.buffer),
428
+ buffer: this.processBuffer(h.buffer),
397
429
  byteOffset: this.byteOffset,
398
430
  byteLength: l
399
431
  };
400
- return i !== void 0 && (m.target = i), i === T.ARRAY_BUFFER && (m.byteStride = a), this.byteOffset += l, r.bufferViews.push(m), {
432
+ return i !== void 0 && (m.target = i), i === T.ARRAY_BUFFER && (m.byteStride = c), this.byteOffset += l, r.bufferViews.push(m), {
401
433
  id: r.bufferViews.length - 1,
402
434
  byteLength: 0
403
435
  };
@@ -412,7 +444,7 @@ class Le {
412
444
  return n.bufferViews || (n.bufferViews = []), new Promise(function(t) {
413
445
  const i = new FileReader();
414
446
  i.readAsArrayBuffer(e), i.onloadend = function() {
415
- const r = k(i.result), o = {
447
+ const r = Y(i.result), o = {
416
448
  buffer: s.processBuffer(r),
417
449
  byteOffset: s.byteOffset,
418
450
  byteLength: r.byteLength
@@ -456,16 +488,16 @@ class Le {
456
488
  else
457
489
  throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: " + e.array.constructor.name);
458
490
  if (n === void 0 && (n = 0), (t === void 0 || t === 1 / 0) && (t = e.count), t === 0) return null;
459
- const a = Ne(e, n, t);
491
+ const c = Ge(e, n, t);
460
492
  let l;
461
493
  s !== void 0 && (l = e === s.index ? T.ELEMENT_ARRAY_BUFFER : T.ARRAY_BUFFER);
462
- const f = this.processBufferView(e, o, n, t, l), u = {
463
- bufferView: f.id,
464
- byteOffset: f.byteOffset,
494
+ const h = this.processBufferView(e, o, n, t, l), u = {
495
+ bufferView: h.id,
496
+ byteOffset: h.byteOffset,
465
497
  componentType: o,
466
498
  count: t,
467
- max: a.max,
468
- min: a.min,
499
+ max: c.max,
500
+ min: c.min,
469
501
  type: r[e.itemSize]
470
502
  };
471
503
  return e.normalized === !0 && (u.normalized = !0), i.accessors || (i.accessors = []), i.accessors.push(u) - 1;
@@ -480,35 +512,35 @@ class Le {
480
512
  */
481
513
  processImage(e, s, n, t = "image/png") {
482
514
  if (e !== null) {
483
- const i = this, r = i.cache, o = i.json, a = i.options, l = i.pending;
515
+ const i = this, r = i.cache, o = i.json, c = i.options, l = i.pending;
484
516
  r.images.has(e) || r.images.set(e, {});
485
- const f = r.images.get(e), u = t + ":flipY/" + n.toString();
486
- if (f[u] !== void 0) return f[u];
517
+ const h = r.images.get(e), u = t + ":flipY/" + n.toString();
518
+ if (h[u] !== void 0) return h[u];
487
519
  o.images || (o.images = []);
488
- const m = { mimeType: t }, h = J();
489
- h.width = Math.min(e.width, a.maxTextureSize), h.height = Math.min(e.height, a.maxTextureSize);
490
- const p = h.getContext("2d");
491
- if (n === !0 && (p.translate(0, h.height), p.scale(1, -1)), e.data !== void 0) {
492
- s !== ie && console.error("GLTFExporter: Only RGBAFormat is supported.", s), (e.width > a.maxTextureSize || e.height > a.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
520
+ const m = { mimeType: t }, f = ee();
521
+ f.width = Math.min(e.width, c.maxTextureSize), f.height = Math.min(e.height, c.maxTextureSize);
522
+ const p = f.getContext("2d");
523
+ if (n === !0 && (p.translate(0, f.height), p.scale(1, -1)), e.data !== void 0) {
524
+ s !== Te && console.error("GLTFExporter: Only RGBAFormat is supported.", s), (e.width > c.maxTextureSize || e.height > c.maxTextureSize) && console.warn("GLTFExporter: Image size is bigger than maxTextureSize", e);
493
525
  const g = new Uint8ClampedArray(e.height * e.width * 4);
494
526
  for (let y = 0; y < g.length; y += 4)
495
527
  g[y + 0] = e.data[y + 0], g[y + 1] = e.data[y + 1], g[y + 2] = e.data[y + 2], g[y + 3] = e.data[y + 3];
496
528
  p.putImageData(new ImageData(g, e.width, e.height), 0, 0);
497
529
  } else if (typeof HTMLImageElement < "u" && e instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && e instanceof ImageBitmap || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas)
498
- p.drawImage(e, 0, 0, h.width, h.height);
530
+ p.drawImage(e, 0, 0, f.width, f.height);
499
531
  else
500
532
  throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement, ImageBitmap or OffscreenCanvas.");
501
- a.binary === !0 ? l.push(
502
- Z(h, t).then((g) => i.processBufferViewImage(g)).then((g) => {
533
+ c.binary === !0 ? l.push(
534
+ se(f, t).then((g) => i.processBufferViewImage(g)).then((g) => {
503
535
  m.bufferView = g;
504
536
  })
505
- ) : h.toDataURL !== void 0 ? m.uri = h.toDataURL(t) : l.push(
506
- Z(h, t).then((g) => new FileReader().readAsDataURL(g)).then((g) => {
537
+ ) : f.toDataURL !== void 0 ? m.uri = f.toDataURL(t) : l.push(
538
+ se(f, t).then((g) => new FileReader().readAsDataURL(g)).then((g) => {
507
539
  m.uri = g;
508
540
  })
509
541
  );
510
542
  const d = o.images.push(m) - 1;
511
- return f[u] = d, d;
543
+ return h[u] = d, d;
512
544
  } else
513
545
  throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.");
514
546
  }
@@ -536,7 +568,7 @@ class Le {
536
568
  processTexture(e) {
537
569
  const n = this.options, t = this.cache, i = this.json;
538
570
  if (t.textures.has(e)) return t.textures.get(e);
539
- i.textures || (i.textures = []), e instanceof G && (e = z(e, n.maxTextureSize));
571
+ i.textures || (i.textures = []), e instanceof k && (e = V(e, n.maxTextureSize));
540
572
  let r = e.userData.mimeType;
541
573
  r === "image/webp" && (r = "image/png");
542
574
  const o = {
@@ -546,8 +578,8 @@ class Le {
546
578
  e.name && (o.name = e.name), this._invokeAll(function(l) {
547
579
  l.writeTexture && l.writeTexture(e, o);
548
580
  });
549
- const a = i.textures.push(o) - 1;
550
- return t.textures.set(e, a), a;
581
+ const c = i.textures.push(o) - 1;
582
+ return t.textures.set(e, c), c;
551
583
  }
552
584
  /**
553
585
  * Process material
@@ -563,12 +595,12 @@ class Le {
563
595
  const t = { pbrMetallicRoughness: {} };
564
596
  e.isMeshStandardMaterial !== !0 && e.isMeshBasicMaterial !== !0 && console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");
565
597
  const i = e.color.toArray().concat([e.opacity]);
566
- if (F(i, [1, 1, 1, 1]) || (t.pbrMetallicRoughness.baseColorFactor = i), e.isMeshStandardMaterial ? (t.pbrMetallicRoughness.metallicFactor = e.metalness, t.pbrMetallicRoughness.roughnessFactor = e.roughness) : (t.pbrMetallicRoughness.metallicFactor = 0.5, t.pbrMetallicRoughness.roughnessFactor = 0.5), e.metalnessMap || e.roughnessMap) {
567
- const o = this.buildMetalRoughTexture(e.metalnessMap, e.roughnessMap), a = {
598
+ if (O(i, [1, 1, 1, 1]) || (t.pbrMetallicRoughness.baseColorFactor = i), e.isMeshStandardMaterial ? (t.pbrMetallicRoughness.metallicFactor = e.metalness, t.pbrMetallicRoughness.roughnessFactor = e.roughness) : (t.pbrMetallicRoughness.metallicFactor = 0.5, t.pbrMetallicRoughness.roughnessFactor = 0.5), e.metalnessMap || e.roughnessMap) {
599
+ const o = this.buildMetalRoughTexture(e.metalnessMap, e.roughnessMap), c = {
568
600
  index: this.processTexture(o),
569
601
  channel: o.channel
570
602
  };
571
- this.applyTextureTransform(a, o), t.pbrMetallicRoughness.metallicRoughnessTexture = a;
603
+ this.applyTextureTransform(c, o), t.pbrMetallicRoughness.metallicRoughnessTexture = c;
572
604
  }
573
605
  if (e.map) {
574
606
  const o = {
@@ -601,7 +633,7 @@ class Le {
601
633
  };
602
634
  e.aoMapIntensity !== 1 && (o.strength = e.aoMapIntensity), this.applyTextureTransform(o, e.aoMap), t.occlusionTexture = o;
603
635
  }
604
- e.transparent ? t.alphaMode = "BLEND" : e.alphaTest > 0 && (t.alphaMode = "MASK", t.alphaCutoff = e.alphaTest), e.side === oe && (t.doubleSided = !0), e.name !== "" && (t.name = e.name), this.serializeUserData(e, t), this._invokeAll(function(o) {
636
+ e.transparent ? t.alphaMode = "BLEND" : e.alphaTest > 0 && (t.alphaMode = "MASK", t.alphaCutoff = e.alphaTest), e.side === me && (t.doubleSided = !0), e.name !== "" && (t.name = e.name), this.serializeUserData(e, t), this._invokeAll(function(o) {
605
637
  o.writeMaterial && o.writeMaterial(e, t);
606
638
  });
607
639
  const r = n.materials.push(t) - 1;
@@ -624,7 +656,7 @@ class Le {
624
656
  const r = e.geometry;
625
657
  let o;
626
658
  e.isLineSegments ? o = T.LINES : e.isLineLoop ? o = T.LINE_LOOP : e.isLine ? o = T.LINE_STRIP : e.isPoints ? o = T.POINTS : o = e.material.wireframe ? T.LINES : T.TRIANGLES;
627
- const a = {}, l = {}, f = [], u = [], m = {
659
+ const c = {}, l = {}, h = [], u = [], m = {
628
660
  uv: "TEXCOORD_0",
629
661
  uv1: "TEXCOORD_1",
630
662
  uv2: "TEXCOORD_2",
@@ -632,8 +664,8 @@ class Le {
632
664
  color: "COLOR_0",
633
665
  skinWeight: "WEIGHTS_0",
634
666
  skinIndex: "JOINTS_0"
635
- }, h = r.getAttribute("normal");
636
- h !== void 0 && !this.isNormalizedNormalAttribute(h) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), r.setAttribute("normal", this.createNormalizedNormalAttribute(h)));
667
+ }, f = r.getAttribute("normal");
668
+ f !== void 0 && !this.isNormalizedNormalAttribute(f) && (console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."), r.setAttribute("normal", this.createNormalizedNormalAttribute(f)));
637
669
  let p = null;
638
670
  for (let x in r.attributes) {
639
671
  if (x.slice(0, 5) === "morph") continue;
@@ -648,7 +680,7 @@ class Le {
648
680
  const A = this.processAccessor(p || M, r);
649
681
  A !== null && (x.startsWith("_") || this.detectMeshQuantization(x, M), l[x] = A, s.attributes.set(this.getUID(M), A));
650
682
  }
651
- if (h !== void 0 && r.setAttribute("normal", h), Object.keys(l).length === 0) return null;
683
+ if (f !== void 0 && r.setAttribute("normal", f), Object.keys(l).length === 0) return null;
652
684
  if (e.morphTargetInfluences !== void 0 && e.morphTargetInfluences.length > 0) {
653
685
  const x = [], M = [], w = {};
654
686
  if (e.morphTargetDictionary !== void 0)
@@ -656,27 +688,27 @@ class Le {
656
688
  w[e.morphTargetDictionary[E]] = E;
657
689
  for (let E = 0; E < e.morphTargetInfluences.length; ++E) {
658
690
  const A = {};
659
- let j = !1;
660
- for (const _ in r.morphAttributes) {
661
- if (_ !== "position" && _ !== "normal") {
662
- j || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), j = !0);
691
+ let X = !1;
692
+ for (const C in r.morphAttributes) {
693
+ if (C !== "position" && C !== "normal") {
694
+ X || (console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."), X = !0);
663
695
  continue;
664
696
  }
665
- const N = r.morphAttributes[_][E], B = _.toUpperCase(), C = r.attributes[_];
697
+ const N = r.morphAttributes[C][E], z = C.toUpperCase(), U = r.attributes[C];
666
698
  if (s.attributes.has(this.getUID(N, !0))) {
667
- A[B] = s.attributes.get(this.getUID(N, !0));
699
+ A[z] = s.attributes.get(this.getUID(N, !0));
668
700
  continue;
669
701
  }
670
- const U = N.clone();
702
+ const v = N.clone();
671
703
  if (!r.morphTargetsRelative)
672
- for (let I = 0, ee = N.count; I < ee; I++)
704
+ for (let I = 0, ie = N.count; I < ie; I++)
673
705
  for (let S = 0; S < N.itemSize; S++)
674
- S === 0 && U.setX(I, N.getX(I) - C.getX(I)), S === 1 && U.setY(I, N.getY(I) - C.getY(I)), S === 2 && U.setZ(I, N.getZ(I) - C.getZ(I)), S === 3 && U.setW(I, N.getW(I) - C.getW(I));
675
- A[B] = this.processAccessor(U, r), s.attributes.set(this.getUID(C, !0), A[B]);
706
+ S === 0 && v.setX(I, N.getX(I) - U.getX(I)), S === 1 && v.setY(I, N.getY(I) - U.getY(I)), S === 2 && v.setZ(I, N.getZ(I) - U.getZ(I)), S === 3 && v.setW(I, N.getW(I) - U.getW(I));
707
+ A[z] = this.processAccessor(v, r), s.attributes.set(this.getUID(U, !0), A[z]);
676
708
  }
677
709
  u.push(A), x.push(e.morphTargetInfluences[E]), e.morphTargetDictionary !== void 0 && M.push(w[E]);
678
710
  }
679
- a.weights = x, M.length > 0 && (a.extras = {}, a.extras.targetNames = M);
711
+ c.weights = x, M.length > 0 && (c.extras = {}, c.extras.targetNames = M);
680
712
  }
681
713
  const d = Array.isArray(e.material);
682
714
  if (d && r.groups.length === 0) return null;
@@ -698,13 +730,13 @@ class Le {
698
730
  (b[x].start !== void 0 || b[x].count !== void 0) && (A += ":" + b[x].start + ":" + b[x].count), s.attributes.has(A) ? w.indices = s.attributes.get(A) : (w.indices = this.processAccessor(r.index, r, b[x].start, b[x].count), s.attributes.set(A, w.indices)), w.indices === null && delete w.indices;
699
731
  }
700
732
  const E = this.processMaterial(y[b[x].materialIndex]);
701
- E !== null && (w.material = E), f.push(w);
733
+ E !== null && (w.material = E), h.push(w);
702
734
  }
703
- g === !0 && r.setIndex(null), a.primitives = f, n.meshes || (n.meshes = []), this._invokeAll(function(x) {
704
- x.writeMesh && x.writeMesh(e, a);
735
+ g === !0 && r.setIndex(null), c.primitives = h, n.meshes || (n.meshes = []), this._invokeAll(function(x) {
736
+ x.writeMesh && x.writeMesh(e, c);
705
737
  });
706
- const O = n.meshes.push(a) - 1;
707
- return s.meshes.set(i, O), O;
738
+ const D = n.meshes.push(c) - 1;
739
+ return s.meshes.set(i, D), D;
708
740
  }
709
741
  /**
710
742
  * If a vertex attribute with a
@@ -718,7 +750,7 @@ class Le {
718
750
  * @param {THREE.BufferAttribute} attribute
719
751
  */
720
752
  detectMeshQuantization(e, s) {
721
- if (this.extensionsUsed[P]) return;
753
+ if (this.extensionsUsed[j]) return;
722
754
  let n;
723
755
  switch (s.array.constructor) {
724
756
  case Int8Array:
@@ -738,7 +770,7 @@ class Le {
738
770
  }
739
771
  s.normalized && (n += " normalized");
740
772
  const t = e.split("_", 1)[0];
741
- K[t] && K[t].includes(n) && (this.extensionsUsed[P] = !0, this.extensionsRequired[P] = !0);
773
+ J[t] && J[t].includes(n) && (this.extensionsUsed[j] = !0, this.extensionsRequired[j] = !0);
742
774
  }
743
775
  /**
744
776
  * Process camera
@@ -758,7 +790,7 @@ class Le {
758
790
  znear: e.near < 0 ? 0 : e.near
759
791
  } : t.perspective = {
760
792
  aspectRatio: e.aspect,
761
- yfov: H.degToRad(e.fov),
793
+ yfov: W.degToRad(e.fov),
762
794
  zfar: e.far <= 0 ? 1e-3 : e.far,
763
795
  znear: e.near < 0 ? 0 : e.near
764
796
  }, e.name !== "" && (t.name = e.type), s.cameras.push(t) - 1;
@@ -775,20 +807,20 @@ class Le {
775
807
  */
776
808
  processAnimation(e, s) {
777
809
  const n = this.json, t = this.nodeMap;
778
- n.animations || (n.animations = []), e = V.Utils.mergeMorphTargetTracks(e.clone(), s);
810
+ n.animations || (n.animations = []), e = q.Utils.mergeMorphTargetTracks(e.clone(), s);
779
811
  const i = e.tracks, r = [], o = [];
780
- for (let a = 0; a < i.length; ++a) {
781
- const l = i[a], f = D.parseTrackName(l.name);
782
- let u = D.findNode(s, f.nodeName);
783
- const m = q[f.propertyName];
784
- if (f.objectName === "bones" && (u.isSkinnedMesh === !0 ? u = u.skeleton.getBoneByName(f.objectIndex) : u = void 0), !u || !m)
812
+ for (let c = 0; c < i.length; ++c) {
813
+ const l = i[c], h = P.parseTrackName(l.name);
814
+ let u = P.findNode(s, h.nodeName);
815
+ const m = Q[h.propertyName];
816
+ if (h.objectName === "bones" && (u.isSkinnedMesh === !0 ? u = u.skeleton.getBoneByName(h.objectIndex) : u = void 0), !u || !m)
785
817
  return console.warn('THREE.GLTFExporter: Could not export animation track "%s".', l.name), null;
786
- const h = 1;
818
+ const f = 1;
787
819
  let p = l.values.length / l.times.length;
788
- m === q.morphTargetInfluences && (p /= u.morphTargetInfluences.length);
820
+ m === Q.morphTargetInfluences && (p /= u.morphTargetInfluences.length);
789
821
  let d;
790
- l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (d = "CUBICSPLINE", p /= 3) : l.getInterpolation() === ae ? d = "STEP" : d = "LINEAR", o.push({
791
- input: this.processAccessor(new L(l.times, h)),
822
+ l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === !0 ? (d = "CUBICSPLINE", p /= 3) : l.getInterpolation() === Me ? d = "STEP" : d = "LINEAR", o.push({
823
+ input: this.processAccessor(new L(l.times, f)),
792
824
  output: this.processAccessor(new L(l.values, p)),
793
825
  interpolation: d
794
826
  }), r.push({
@@ -814,11 +846,11 @@ class Le {
814
846
  if (i === void 0) return null;
815
847
  const r = e.skeleton.bones[0];
816
848
  if (r === void 0) return null;
817
- const o = [], a = new Float32Array(i.bones.length * 16), l = new Q();
849
+ const o = [], c = new Float32Array(i.bones.length * 16), l = new ne();
818
850
  for (let u = 0; u < i.bones.length; ++u)
819
- o.push(n.get(i.bones[u])), l.copy(i.boneInverses[u]), l.multiply(e.bindMatrix).toArray(a, u * 16);
851
+ o.push(n.get(i.bones[u])), l.copy(i.boneInverses[u]), l.multiply(e.bindMatrix).toArray(c, u * 16);
820
852
  return s.skins === void 0 && (s.skins = []), s.skins.push({
821
- inverseBindMatrices: this.processAccessor(new L(a, 16)),
853
+ inverseBindMatrices: this.processAccessor(new L(c, 16)),
822
854
  joints: o,
823
855
  skeleton: n.get(r)
824
856
  }), t.skin = s.skins.length - 1;
@@ -833,20 +865,20 @@ class Le {
833
865
  s.nodes || (s.nodes = []);
834
866
  const i = {};
835
867
  if (n.trs) {
836
- const o = e.quaternion.toArray(), a = e.position.toArray(), l = e.scale.toArray();
837
- F(o, [0, 0, 0, 1]) || (i.rotation = o), F(a, [0, 0, 0]) || (i.translation = a), F(l, [1, 1, 1]) || (i.scale = l);
868
+ const o = e.quaternion.toArray(), c = e.position.toArray(), l = e.scale.toArray();
869
+ O(o, [0, 0, 0, 1]) || (i.rotation = o), O(c, [0, 0, 0]) || (i.translation = c), O(l, [1, 1, 1]) || (i.scale = l);
838
870
  } else
839
- e.matrixAutoUpdate && e.updateMatrix(), be(e.matrix) === !1 && (i.matrix = e.matrix.elements);
871
+ e.matrixAutoUpdate && e.updateMatrix(), Be(e.matrix) === !1 && (i.matrix = e.matrix.elements);
840
872
  if (e.name !== "" && (i.name = String(e.name)), this.serializeUserData(e, i), e.isMesh || e.isLine || e.isPoints) {
841
873
  const o = this.processMesh(e);
842
874
  o !== null && (i.mesh = o);
843
875
  } else e.isCamera && (i.camera = this.processCamera(e));
844
876
  if (e.isSkinnedMesh && this.skins.push(e), e.children.length > 0) {
845
877
  const o = [];
846
- for (let a = 0, l = e.children.length; a < l; a++) {
847
- const f = e.children[a];
848
- if (f.visible || n.onlyVisible === !1) {
849
- const u = this.processNode(f);
878
+ for (let c = 0, l = e.children.length; c < l; c++) {
879
+ const h = e.children[c];
880
+ if (h.visible || n.onlyVisible === !1) {
881
+ const u = this.processNode(h);
850
882
  u !== null && o.push(u);
851
883
  }
852
884
  }
@@ -869,9 +901,9 @@ class Le {
869
901
  e.name !== "" && (t.name = e.name), s.scenes.push(t);
870
902
  const i = [];
871
903
  for (let r = 0, o = e.children.length; r < o; r++) {
872
- const a = e.children[r];
873
- if (a.visible || n.onlyVisible === !1) {
874
- const l = this.processNode(a);
904
+ const c = e.children[r];
905
+ if (c.visible || n.onlyVisible === !1) {
906
+ const l = this.processNode(c);
875
907
  l !== null && i.push(l);
876
908
  }
877
909
  }
@@ -882,7 +914,7 @@ class Le {
882
914
  * @param {Array} objects List of objects to process
883
915
  */
884
916
  processObjects(e) {
885
- const s = new Y();
917
+ const s = new K();
886
918
  s.name = "AuxScene";
887
919
  for (let n = 0; n < e.length; n++)
888
920
  s.children.push(e[n]);
@@ -898,7 +930,7 @@ class Le {
898
930
  });
899
931
  const n = [];
900
932
  for (let t = 0; t < e.length; t++)
901
- e[t] instanceof Y ? this.processScene(e[t]) : n.push(e[t]);
933
+ e[t] instanceof K ? this.processScene(e[t]) : n.push(e[t]);
902
934
  n.length > 0 && this.processObjects(n);
903
935
  for (let t = 0; t < this.skins.length; ++t)
904
936
  this.processSkin(this.skins[t]);
@@ -913,7 +945,7 @@ class Le {
913
945
  e(this.plugins[s]);
914
946
  }
915
947
  }
916
- class Se {
948
+ class ze {
917
949
  constructor(e) {
918
950
  this.writer = e, this.name = "KHR_lights_punctual";
919
951
  }
@@ -929,7 +961,7 @@ class Se {
929
961
  o.push(r), s.extensions = s.extensions || {}, s.extensions[this.name] = { light: o.length - 1 };
930
962
  }
931
963
  }
932
- class _e {
964
+ class ke {
933
965
  constructor(e) {
934
966
  this.writer = e, this.name = "KHR_materials_unlit";
935
967
  }
@@ -939,7 +971,7 @@ class _e {
939
971
  s.extensions = s.extensions || {}, s.extensions[this.name] = {}, t[this.name] = !0, s.pbrMetallicRoughness.metallicFactor = 0, s.pbrMetallicRoughness.roughnessFactor = 0.9;
940
972
  }
941
973
  }
942
- class Ce {
974
+ class He {
943
975
  constructor(e) {
944
976
  this.writer = e, this.name = "KHR_materials_clearcoat";
945
977
  }
@@ -970,7 +1002,7 @@ class Ce {
970
1002
  s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
971
1003
  }
972
1004
  }
973
- class Ue {
1005
+ class Ve {
974
1006
  constructor(e) {
975
1007
  this.writer = e, this.name = "KHR_materials_iridescence";
976
1008
  }
@@ -994,7 +1026,7 @@ class Ue {
994
1026
  s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
995
1027
  }
996
1028
  }
997
- class Fe {
1029
+ class je {
998
1030
  constructor(e) {
999
1031
  this.writer = e, this.name = "KHR_materials_transmission";
1000
1032
  }
@@ -1011,7 +1043,7 @@ class Fe {
1011
1043
  s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1012
1044
  }
1013
1045
  }
1014
- class Oe {
1046
+ class Ye {
1015
1047
  constructor(e) {
1016
1048
  this.writer = e, this.name = "KHR_materials_volume";
1017
1049
  }
@@ -1028,7 +1060,7 @@ class Oe {
1028
1060
  i.attenuationDistance = e.attenuationDistance, i.attenuationColor = e.attenuationColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1029
1061
  }
1030
1062
  }
1031
- class ve {
1063
+ class Ke {
1032
1064
  constructor(e) {
1033
1065
  this.writer = e, this.name = "KHR_materials_ior";
1034
1066
  }
@@ -1038,12 +1070,12 @@ class ve {
1038
1070
  i.ior = e.ior, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1039
1071
  }
1040
1072
  }
1041
- class De {
1073
+ class We {
1042
1074
  constructor(e) {
1043
1075
  this.writer = e, this.name = "KHR_materials_specular";
1044
1076
  }
1045
1077
  writeMaterial(e, s) {
1046
- if (!e.isMeshPhysicalMaterial || e.specularIntensity === 1 && e.specularColor.equals(ye) && !e.specularIntensityMap && !e.specularColorMap) return;
1078
+ if (!e.isMeshPhysicalMaterial || e.specularIntensity === 1 && e.specularColor.equals(Ce) && !e.specularIntensityMap && !e.specularColorMap) return;
1047
1079
  const n = this.writer, t = n.extensionsUsed, i = {};
1048
1080
  if (e.specularIntensityMap) {
1049
1081
  const r = {
@@ -1062,7 +1094,7 @@ class De {
1062
1094
  i.specularFactor = e.specularIntensity, i.specularColorFactor = e.specularColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1063
1095
  }
1064
1096
  }
1065
- class Be {
1097
+ class qe {
1066
1098
  constructor(e) {
1067
1099
  this.writer = e, this.name = "KHR_materials_sheen";
1068
1100
  }
@@ -1086,7 +1118,7 @@ class Be {
1086
1118
  i.sheenRoughnessFactor = e.sheenRoughness, i.sheenColorFactor = e.sheenColor.toArray(), s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1087
1119
  }
1088
1120
  }
1089
- class Ge {
1121
+ class Xe {
1090
1122
  constructor(e) {
1091
1123
  this.writer = e, this.name = "KHR_materials_anisotropy";
1092
1124
  }
@@ -1100,7 +1132,7 @@ class Ge {
1100
1132
  i.anisotropyStrength = e.anisotropy, i.anisotropyRotation = e.anisotropyRotation, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1101
1133
  }
1102
1134
  }
1103
- class ze {
1135
+ class Je {
1104
1136
  constructor(e) {
1105
1137
  this.writer = e, this.name = "KHR_materials_emissive_strength";
1106
1138
  }
@@ -1110,7 +1142,7 @@ class ze {
1110
1142
  i.emissiveStrength = e.emissiveIntensity, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1111
1143
  }
1112
1144
  }
1113
- class Pe {
1145
+ class Qe {
1114
1146
  constructor(e) {
1115
1147
  this.writer = e, this.name = "EXT_materials_bump";
1116
1148
  }
@@ -1127,15 +1159,15 @@ class Pe {
1127
1159
  i.bumpFactor = e.bumpScale, s.extensions = s.extensions || {}, s.extensions[this.name] = i, t[this.name] = !0;
1128
1160
  }
1129
1161
  }
1130
- class ke {
1162
+ class Ze {
1131
1163
  constructor(e) {
1132
1164
  this.writer = e, this.name = "EXT_mesh_gpu_instancing";
1133
1165
  }
1134
1166
  writeNode(e, s) {
1135
1167
  if (!e.isInstancedMesh) return;
1136
- const n = this.writer, t = e, i = new Float32Array(t.count * 3), r = new Float32Array(t.count * 4), o = new Float32Array(t.count * 3), a = new Q(), l = new v(), f = new te(), u = new v();
1137
- for (let h = 0; h < t.count; h++)
1138
- t.getMatrixAt(h, a), a.decompose(l, f, u), l.toArray(i, h * 3), f.toArray(r, h * 4), u.toArray(o, h * 3);
1168
+ const n = this.writer, t = e, i = new Float32Array(t.count * 3), r = new Float32Array(t.count * 4), o = new Float32Array(t.count * 3), c = new ne(), l = new G(), h = new de(), u = new G();
1169
+ for (let f = 0; f < t.count; f++)
1170
+ t.getMatrixAt(f, c), c.decompose(l, h, u), l.toArray(i, f * 3), h.toArray(r, f * 4), u.toArray(o, f * 3);
1139
1171
  const m = {
1140
1172
  TRANSLATION: n.processAccessor(new L(i, 3)),
1141
1173
  ROTATION: n.processAccessor(new L(r, 4)),
@@ -1144,37 +1176,37 @@ class ke {
1144
1176
  t.instanceColor && (m._COLOR_0 = n.processAccessor(t.instanceColor)), s.extensions = s.extensions || {}, s.extensions[this.name] = { attributes: m }, n.extensionsUsed[this.name] = !0, n.extensionsRequired[this.name] = !0;
1145
1177
  }
1146
1178
  }
1147
- V.Utils = {
1148
- insertKeyframe: function(c, e) {
1149
- const n = c.getValueSize(), t = new c.TimeBufferType(c.times.length + 1), i = new c.ValueBufferType(c.values.length + n), r = c.createInterpolant(new c.ValueBufferType(n));
1179
+ q.Utils = {
1180
+ insertKeyframe: function(a, e) {
1181
+ const n = a.getValueSize(), t = new a.TimeBufferType(a.times.length + 1), i = new a.ValueBufferType(a.values.length + n), r = a.createInterpolant(new a.ValueBufferType(n));
1150
1182
  let o;
1151
- if (c.times.length === 0) {
1183
+ if (a.times.length === 0) {
1152
1184
  t[0] = e;
1153
- for (let a = 0; a < n; a++)
1154
- i[a] = 0;
1185
+ for (let c = 0; c < n; c++)
1186
+ i[c] = 0;
1155
1187
  o = 0;
1156
- } else if (e < c.times[0]) {
1157
- if (Math.abs(c.times[0] - e) < 1e-3) return 0;
1158
- t[0] = e, t.set(c.times, 1), i.set(r.evaluate(e), 0), i.set(c.values, n), o = 0;
1159
- } else if (e > c.times[c.times.length - 1]) {
1160
- if (Math.abs(c.times[c.times.length - 1] - e) < 1e-3)
1161
- return c.times.length - 1;
1162
- t[t.length - 1] = e, t.set(c.times, 0), i.set(c.values, 0), i.set(r.evaluate(e), c.values.length), o = t.length - 1;
1188
+ } else if (e < a.times[0]) {
1189
+ if (Math.abs(a.times[0] - e) < 1e-3) return 0;
1190
+ t[0] = e, t.set(a.times, 1), i.set(r.evaluate(e), 0), i.set(a.values, n), o = 0;
1191
+ } else if (e > a.times[a.times.length - 1]) {
1192
+ if (Math.abs(a.times[a.times.length - 1] - e) < 1e-3)
1193
+ return a.times.length - 1;
1194
+ t[t.length - 1] = e, t.set(a.times, 0), i.set(a.values, 0), i.set(r.evaluate(e), a.values.length), o = t.length - 1;
1163
1195
  } else
1164
- for (let a = 0; a < c.times.length; a++) {
1165
- if (Math.abs(c.times[a] - e) < 1e-3) return a;
1166
- if (c.times[a] < e && c.times[a + 1] > e) {
1167
- t.set(c.times.slice(0, a + 1), 0), t[a + 1] = e, t.set(c.times.slice(a + 1), a + 2), i.set(c.values.slice(0, (a + 1) * n), 0), i.set(r.evaluate(e), (a + 1) * n), i.set(c.values.slice((a + 1) * n), (a + 2) * n), o = a + 1;
1196
+ for (let c = 0; c < a.times.length; c++) {
1197
+ if (Math.abs(a.times[c] - e) < 1e-3) return c;
1198
+ if (a.times[c] < e && a.times[c + 1] > e) {
1199
+ t.set(a.times.slice(0, c + 1), 0), t[c + 1] = e, t.set(a.times.slice(c + 1), c + 2), i.set(a.values.slice(0, (c + 1) * n), 0), i.set(r.evaluate(e), (c + 1) * n), i.set(a.values.slice((c + 1) * n), (c + 2) * n), o = c + 1;
1168
1200
  break;
1169
1201
  }
1170
1202
  }
1171
- return c.times = t, c.values = i, o;
1203
+ return a.times = t, a.values = i, o;
1172
1204
  },
1173
- mergeMorphTargetTracks: function(c, e) {
1174
- const s = [], n = {}, t = c.tracks;
1205
+ mergeMorphTargetTracks: function(a, e) {
1206
+ const s = [], n = {}, t = a.tracks;
1175
1207
  for (let i = 0; i < t.length; ++i) {
1176
1208
  let r = t[i];
1177
- const o = D.parseTrackName(r.name), a = D.findNode(e, o.nodeName);
1209
+ const o = P.parseTrackName(r.name), c = P.findNode(e, o.nodeName);
1178
1210
  if (o.propertyName !== "morphTargetInfluences" || o.propertyIndex === void 0) {
1179
1211
  s.push(r);
1180
1212
  continue;
@@ -1182,35 +1214,35 @@ V.Utils = {
1182
1214
  if (r.createInterpolant !== r.InterpolantFactoryMethodDiscrete && r.createInterpolant !== r.InterpolantFactoryMethodLinear) {
1183
1215
  if (r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)
1184
1216
  throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");
1185
- console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), r = r.clone(), r.setInterpolation(me);
1217
+ console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."), r = r.clone(), r.setInterpolation(Se);
1186
1218
  }
1187
- const l = a.morphTargetInfluences.length, f = a.morphTargetDictionary[o.propertyIndex];
1188
- if (f === void 0)
1219
+ const l = c.morphTargetInfluences.length, h = c.morphTargetDictionary[o.propertyIndex];
1220
+ if (h === void 0)
1189
1221
  throw new Error("THREE.GLTFExporter: Morph target name not found: " + o.propertyIndex);
1190
1222
  let u;
1191
- if (n[a.uuid] === void 0) {
1223
+ if (n[c.uuid] === void 0) {
1192
1224
  u = r.clone();
1193
- const h = new u.ValueBufferType(l * u.times.length);
1225
+ const f = new u.ValueBufferType(l * u.times.length);
1194
1226
  for (let p = 0; p < u.times.length; p++)
1195
- h[p * l + f] = u.values[p];
1196
- u.name = (o.nodeName || "") + ".morphTargetInfluences", u.values = h, n[a.uuid] = u, s.push(u);
1227
+ f[p * l + h] = u.values[p];
1228
+ u.name = (o.nodeName || "") + ".morphTargetInfluences", u.values = f, n[c.uuid] = u, s.push(u);
1197
1229
  continue;
1198
1230
  }
1199
1231
  const m = r.createInterpolant(new r.ValueBufferType(1));
1200
- u = n[a.uuid];
1201
- for (let h = 0; h < u.times.length; h++)
1202
- u.values[h * l + f] = m.evaluate(u.times[h]);
1203
- for (let h = 0; h < r.times.length; h++) {
1204
- const p = this.insertKeyframe(u, r.times[h]);
1205
- u.values[p * l + f] = r.values[h];
1232
+ u = n[c.uuid];
1233
+ for (let f = 0; f < u.times.length; f++)
1234
+ u.values[f * l + h] = m.evaluate(u.times[f]);
1235
+ for (let f = 0; f < r.times.length; f++) {
1236
+ const p = this.insertKeyframe(u, r.times[f]);
1237
+ u.values[p * l + h] = r.values[f];
1206
1238
  }
1207
1239
  }
1208
- return c.tracks = s, c;
1240
+ return a.tracks = s, a;
1209
1241
  }
1210
1242
  };
1211
- class He {
1243
+ class $e {
1212
1244
  constructor() {
1213
- this._importer = new Me(), this._exporter = new V();
1245
+ this._importer = new _e(), this._exporter = new q();
1214
1246
  }
1215
1247
  Import(e, s) {
1216
1248
  return this._importer.loadAsync(e, (n) => {
@@ -1227,9 +1259,9 @@ class He {
1227
1259
  });
1228
1260
  }
1229
1261
  }
1230
- class Ye {
1262
+ class ss {
1231
1263
  constructor(e) {
1232
- this._scene = e, this._gltfIO = new He();
1264
+ this._scene = e, this._gltfIO = new $e();
1233
1265
  }
1234
1266
  Import(e, s) {
1235
1267
  switch (e) {
@@ -1252,6 +1284,6 @@ class Ye {
1252
1284
  }
1253
1285
  }
1254
1286
  export {
1255
- Ye as DIVEIO
1287
+ ss as DIVEIO
1256
1288
  };
1257
- //# sourceMappingURL=IO-BgiJzKrU.js.map
1289
+ //# sourceMappingURL=IO-CYzpSt1J.js.map