@liquidcars/atlas 0.1.34 → 0.1.37

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.
@@ -42,54 +42,54 @@ function M(e, t) {
42
42
  function N(e, t, n, r, i) {
43
43
  return r + (e - t) * (i - r) / (n - t);
44
44
  }
45
- function ee(e, t, n) {
45
+ function P(e, t, n) {
46
46
  return e === t ? 0 : (n - e) / (t - e);
47
47
  }
48
- function P(e, t, n) {
48
+ function F(e, t, n) {
49
49
  return (1 - n) * e + n * t;
50
50
  }
51
- function F(e, t, n, r) {
52
- return P(e, t, 1 - Math.exp(-n * r));
51
+ function I(e, t, n, r) {
52
+ return F(e, t, 1 - Math.exp(-n * r));
53
53
  }
54
- function te(e, t = 1) {
54
+ function ee(e, t = 1) {
55
55
  return t - Math.abs(M(e, t * 2) - t);
56
56
  }
57
- function ne(e, t, n) {
57
+ function te(e, t, n) {
58
58
  return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * (3 - 2 * e));
59
59
  }
60
- function I(e, t, n) {
60
+ function L(e, t, n) {
61
61
  return e <= t ? 0 : e >= n ? 1 : (e = (e - t) / (n - t), e * e * e * (e * (e * 6 - 15) + 10));
62
62
  }
63
- function re(e, t) {
63
+ function ne(e, t) {
64
64
  return e + Math.floor(Math.random() * (t - e + 1));
65
65
  }
66
- function ie(e, t) {
66
+ function re(e, t) {
67
67
  return e + Math.random() * (t - e);
68
68
  }
69
- function ae(e) {
69
+ function R(e) {
70
70
  return e * (.5 - Math.random());
71
71
  }
72
- function L(e) {
72
+ function z(e) {
73
73
  e !== void 0 && (D = e);
74
74
  let t = D += 1831565813;
75
75
  return t = Math.imul(t ^ t >>> 15, t | 1), t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
76
76
  }
77
- function R(e) {
77
+ function B(e) {
78
78
  return e * O;
79
79
  }
80
- function oe(e) {
80
+ function ie(e) {
81
81
  return e * k;
82
82
  }
83
- function se(e) {
83
+ function ae(e) {
84
84
  return !(e & e - 1) && e !== 0;
85
85
  }
86
- function ce(e) {
86
+ function oe(e) {
87
87
  return 2 ** Math.ceil(Math.log(e) / Math.LN2);
88
88
  }
89
- function le(e) {
89
+ function se(e) {
90
90
  return 2 ** Math.floor(Math.log(e) / Math.LN2);
91
91
  }
92
- function ue(e, t, n, r, i) {
92
+ function ce(e, t, n, r, i) {
93
93
  let a = Math.cos, o = Math.sin, s = a(n / 2), c = o(n / 2), l = a((t + r) / 2), u = o((t + r) / 2), d = a((t - r) / 2), f = o((t - r) / 2), p = a((r - t) / 2), m = o((r - t) / 2);
94
94
  switch (i) {
95
95
  case "XYX":
@@ -113,7 +113,7 @@ function ue(e, t, n, r, i) {
113
113
  default: console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + i);
114
114
  }
115
115
  }
116
- function z(e, t) {
116
+ function le(e, t) {
117
117
  switch (t.constructor) {
118
118
  case Float32Array: return e;
119
119
  case Uint32Array: return e / 4294967295;
@@ -125,7 +125,7 @@ function z(e, t) {
125
125
  default: throw Error("Invalid component type.");
126
126
  }
127
127
  }
128
- function B(e, t) {
128
+ function ue(e, t) {
129
129
  switch (t.constructor) {
130
130
  case Float32Array: return e;
131
131
  case Uint32Array: return Math.round(e * 4294967295);
@@ -144,24 +144,24 @@ var de = {
144
144
  clamp: j,
145
145
  euclideanModulo: M,
146
146
  mapLinear: N,
147
- inverseLerp: ee,
148
- lerp: P,
149
- damp: F,
150
- pingpong: te,
151
- smoothstep: ne,
152
- smootherstep: I,
153
- randInt: re,
154
- randFloat: ie,
155
- randFloatSpread: ae,
156
- seededRandom: L,
157
- degToRad: R,
158
- radToDeg: oe,
159
- isPowerOfTwo: se,
160
- ceilPowerOfTwo: ce,
161
- floorPowerOfTwo: le,
162
- setQuaternionFromProperEuler: ue,
163
- normalize: B,
164
- denormalize: z
147
+ inverseLerp: P,
148
+ lerp: F,
149
+ damp: I,
150
+ pingpong: ee,
151
+ smoothstep: te,
152
+ smootherstep: L,
153
+ randInt: ne,
154
+ randFloat: re,
155
+ randFloatSpread: R,
156
+ seededRandom: z,
157
+ degToRad: B,
158
+ radToDeg: ie,
159
+ isPowerOfTwo: ae,
160
+ ceilPowerOfTwo: oe,
161
+ floorPowerOfTwo: se,
162
+ setQuaternionFromProperEuler: ce,
163
+ normalize: ue,
164
+ denormalize: le
165
165
  }, V = class e {
166
166
  constructor(t = 0, n = 0) {
167
167
  e.prototype.isVector2 = !0, this.x = t, this.y = n;
@@ -1975,8 +1975,8 @@ var Xe = /*@__PURE__*/ new Fe(), Ze = /*@__PURE__*/ new U(), Qe = /*@__PURE__*/
1975
1975
  return this.multiplyMatrices(e, this);
1976
1976
  }
1977
1977
  multiplyMatrices(e, t) {
1978
- let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], ee = r[7], P = r[11], F = r[15];
1979
- return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * ee, i[8] = a * C + o * D + s * j + c * P, i[12] = a * w + o * O + s * M + c * F, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * ee, i[9] = l * C + u * D + d * j + f * P, i[13] = l * w + u * O + d * M + f * F, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * ee, i[10] = p * C + m * D + h * j + g * P, i[14] = p * w + m * O + h * M + g * F, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * ee, i[11] = _ * C + v * D + y * j + b * P, i[15] = _ * w + v * O + y * M + b * F, this;
1978
+ let n = e.elements, r = t.elements, i = this.elements, a = n[0], o = n[4], s = n[8], c = n[12], l = n[1], u = n[5], d = n[9], f = n[13], p = n[2], m = n[6], h = n[10], g = n[14], _ = n[3], v = n[7], y = n[11], b = n[15], x = r[0], S = r[4], C = r[8], w = r[12], T = r[1], E = r[5], D = r[9], O = r[13], k = r[2], A = r[6], j = r[10], M = r[14], N = r[3], P = r[7], F = r[11], I = r[15];
1979
+ return i[0] = a * x + o * T + s * k + c * N, i[4] = a * S + o * E + s * A + c * P, i[8] = a * C + o * D + s * j + c * F, i[12] = a * w + o * O + s * M + c * I, i[1] = l * x + u * T + d * k + f * N, i[5] = l * S + u * E + d * A + f * P, i[9] = l * C + u * D + d * j + f * F, i[13] = l * w + u * O + d * M + f * I, i[2] = p * x + m * T + h * k + g * N, i[6] = p * S + m * E + h * A + g * P, i[10] = p * C + m * D + h * j + g * F, i[14] = p * w + m * O + h * M + g * I, i[3] = _ * x + v * T + y * k + b * N, i[7] = _ * S + v * E + y * A + b * P, i[11] = _ * C + v * D + y * j + b * F, i[15] = _ * w + v * O + y * M + b * I, this;
1980
1980
  }
1981
1981
  multiplyScalar(e) {
1982
1982
  let t = this.elements;
@@ -2854,7 +2854,7 @@ var X = class {
2854
2854
  }
2855
2855
  lerpHSL(e, t) {
2856
2856
  this.getHSL(Zt), e.getHSL(Qt);
2857
- let n = P(Zt.h, Qt.h, t), r = P(Zt.s, Qt.s, t), i = P(Zt.l, Qt.l, t);
2857
+ let n = F(Zt.h, Qt.h, t), r = F(Zt.s, Qt.s, t), i = F(Zt.l, Qt.l, t);
2858
2858
  return this.setHSL(n, r, i), this;
2859
2859
  }
2860
2860
  setFromVector3(e) {
@@ -3020,47 +3020,47 @@ var tn = 0, nn = class extends T {
3020
3020
  }
3021
3021
  getComponent(e, t) {
3022
3022
  let n = this.array[e * this.itemSize + t];
3023
- return this.normalized && (n = z(n, this.array)), n;
3023
+ return this.normalized && (n = le(n, this.array)), n;
3024
3024
  }
3025
3025
  setComponent(e, t, n) {
3026
- return this.normalized && (n = B(n, this.array)), this.array[e * this.itemSize + t] = n, this;
3026
+ return this.normalized && (n = ue(n, this.array)), this.array[e * this.itemSize + t] = n, this;
3027
3027
  }
3028
3028
  getX(e) {
3029
3029
  let t = this.array[e * this.itemSize];
3030
- return this.normalized && (t = z(t, this.array)), t;
3030
+ return this.normalized && (t = le(t, this.array)), t;
3031
3031
  }
3032
3032
  setX(e, t) {
3033
- return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize] = t, this;
3033
+ return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize] = t, this;
3034
3034
  }
3035
3035
  getY(e) {
3036
3036
  let t = this.array[e * this.itemSize + 1];
3037
- return this.normalized && (t = z(t, this.array)), t;
3037
+ return this.normalized && (t = le(t, this.array)), t;
3038
3038
  }
3039
3039
  setY(e, t) {
3040
- return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
3040
+ return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
3041
3041
  }
3042
3042
  getZ(e) {
3043
3043
  let t = this.array[e * this.itemSize + 2];
3044
- return this.normalized && (t = z(t, this.array)), t;
3044
+ return this.normalized && (t = le(t, this.array)), t;
3045
3045
  }
3046
3046
  setZ(e, t) {
3047
- return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
3047
+ return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
3048
3048
  }
3049
3049
  getW(e) {
3050
3050
  let t = this.array[e * this.itemSize + 3];
3051
- return this.normalized && (t = z(t, this.array)), t;
3051
+ return this.normalized && (t = le(t, this.array)), t;
3052
3052
  }
3053
3053
  setW(e, t) {
3054
- return this.normalized && (t = B(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
3054
+ return this.normalized && (t = ue(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
3055
3055
  }
3056
3056
  setXY(e, t, n) {
3057
- return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
3057
+ return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this;
3058
3058
  }
3059
3059
  setXYZ(e, t, n, r) {
3060
- return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array), r = B(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
3060
+ return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this;
3061
3061
  }
3062
3062
  setXYZW(e, t, n, r, i) {
3063
- return e *= this.itemSize, this.normalized && (t = B(t, this.array), n = B(n, this.array), r = B(r, this.array), i = B(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
3063
+ return e *= this.itemSize, this.normalized && (t = ue(t, this.array), n = ue(n, this.array), r = ue(r, this.array), i = ue(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = n, this.array[e + 2] = r, this.array[e + 3] = i, this;
3064
3064
  }
3065
3065
  onUpload(e) {
3066
3066
  return this.onUploadCallback = e, this;
@@ -5386,22 +5386,22 @@ var Ji = class e extends vn {
5386
5386
  }
5387
5387
  let j = [];
5388
5388
  for (let e = 0, t = D.length, n = t - 1, r = e + 1; e < t; e++, n++, r++) n === t && (n = 0), r === t && (r = 0), j[e] = A(D[e], D[n], D[r]);
5389
- let M = [], N, ee = j.concat();
5389
+ let M = [], N, P = j.concat();
5390
5390
  for (let e = 0, t = E; e < t; e++) {
5391
5391
  let t = w[e];
5392
5392
  N = [];
5393
5393
  for (let e = 0, n = t.length, r = n - 1, i = e + 1; e < n; e++, r++, i++) r === n && (r = 0), i === n && (i = 0), N[e] = A(t[e], t[r], t[i]);
5394
- M.push(N), ee = ee.concat(N);
5394
+ M.push(N), P = P.concat(N);
5395
5395
  }
5396
- let P;
5397
- if (p === 0) P = Gi.triangulateShape(D, w);
5396
+ let F;
5397
+ if (p === 0) F = Gi.triangulateShape(D, w);
5398
5398
  else {
5399
5399
  let e = [], t = [];
5400
5400
  for (let n = 0; n < p; n++) {
5401
5401
  let r = n / p, i = u * Math.cos(r * Math.PI / 2), a = d * Math.sin(r * Math.PI / 2) + f;
5402
5402
  for (let t = 0, n = D.length; t < n; t++) {
5403
5403
  let n = O(D[t], j[t], a);
5404
- ie(n.x, n.y, -i), r === 0 && e.push(n);
5404
+ re(n.x, n.y, -i), r === 0 && e.push(n);
5405
5405
  }
5406
5406
  for (let e = 0, n = E; e < n; e++) {
5407
5407
  let n = w[e];
@@ -5409,100 +5409,100 @@ var Ji = class e extends vn {
5409
5409
  let o = [];
5410
5410
  for (let e = 0, t = n.length; e < t; e++) {
5411
5411
  let t = O(n[e], N[e], a);
5412
- ie(t.x, t.y, -i), r === 0 && o.push(t);
5412
+ re(t.x, t.y, -i), r === 0 && o.push(t);
5413
5413
  }
5414
5414
  r === 0 && t.push(o);
5415
5415
  }
5416
5416
  }
5417
- P = Gi.triangulateShape(e, t);
5417
+ F = Gi.triangulateShape(e, t);
5418
5418
  }
5419
- let F = P.length, te = d + f;
5419
+ let I = F.length, ee = d + f;
5420
5420
  for (let e = 0; e < k; e++) {
5421
- let t = l ? O(C[e], ee[e], te) : C[e];
5422
- _ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y), ie(x.x, x.y, x.z)) : ie(t.x, t.y, 0);
5421
+ let t = l ? O(C[e], P[e], ee) : C[e];
5422
+ _ ? (b.copy(v.normals[0]).multiplyScalar(t.x), y.copy(v.binormals[0]).multiplyScalar(t.y), x.copy(g[0]).add(b).add(y), re(x.x, x.y, x.z)) : re(t.x, t.y, 0);
5423
5423
  }
5424
5424
  for (let e = 1; e <= s; e++) for (let t = 0; t < k; t++) {
5425
- let n = l ? O(C[t], ee[t], te) : C[t];
5426
- _ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y), ie(x.x, x.y, x.z)) : ie(n.x, n.y, c / s * e);
5425
+ let n = l ? O(C[t], P[t], ee) : C[t];
5426
+ _ ? (b.copy(v.normals[e]).multiplyScalar(n.x), y.copy(v.binormals[e]).multiplyScalar(n.y), x.copy(g[e]).add(b).add(y), re(x.x, x.y, x.z)) : re(n.x, n.y, c / s * e);
5427
5427
  }
5428
5428
  for (let e = p - 1; e >= 0; e--) {
5429
5429
  let t = e / p, n = u * Math.cos(t * Math.PI / 2), r = d * Math.sin(t * Math.PI / 2) + f;
5430
5430
  for (let e = 0, t = D.length; e < t; e++) {
5431
5431
  let t = O(D[e], j[e], r);
5432
- ie(t.x, t.y, c + n);
5432
+ re(t.x, t.y, c + n);
5433
5433
  }
5434
5434
  for (let e = 0, t = w.length; e < t; e++) {
5435
5435
  let t = w[e];
5436
5436
  N = M[e];
5437
5437
  for (let e = 0, i = t.length; e < i; e++) {
5438
5438
  let i = O(t[e], N[e], r);
5439
- _ ? ie(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : ie(i.x, i.y, c + n);
5439
+ _ ? re(i.x, i.y + g[s - 1].y, g[s - 1].x + n) : re(i.x, i.y, c + n);
5440
5440
  }
5441
5441
  }
5442
5442
  }
5443
- ne(), I();
5444
- function ne() {
5443
+ te(), L();
5444
+ function te() {
5445
5445
  let e = r.length / 3;
5446
5446
  if (l) {
5447
5447
  let e = 0, t = k * e;
5448
- for (let e = 0; e < F; e++) {
5449
- let n = P[e];
5450
- ae(n[2] + t, n[1] + t, n[0] + t);
5448
+ for (let e = 0; e < I; e++) {
5449
+ let n = F[e];
5450
+ R(n[2] + t, n[1] + t, n[0] + t);
5451
5451
  }
5452
5452
  e = s + p * 2, t = k * e;
5453
- for (let e = 0; e < F; e++) {
5454
- let n = P[e];
5455
- ae(n[0] + t, n[1] + t, n[2] + t);
5453
+ for (let e = 0; e < I; e++) {
5454
+ let n = F[e];
5455
+ R(n[0] + t, n[1] + t, n[2] + t);
5456
5456
  }
5457
5457
  } else {
5458
- for (let e = 0; e < F; e++) {
5459
- let t = P[e];
5460
- ae(t[2], t[1], t[0]);
5458
+ for (let e = 0; e < I; e++) {
5459
+ let t = F[e];
5460
+ R(t[2], t[1], t[0]);
5461
5461
  }
5462
- for (let e = 0; e < F; e++) {
5463
- let t = P[e];
5464
- ae(t[0] + k * s, t[1] + k * s, t[2] + k * s);
5462
+ for (let e = 0; e < I; e++) {
5463
+ let t = F[e];
5464
+ R(t[0] + k * s, t[1] + k * s, t[2] + k * s);
5465
5465
  }
5466
5466
  }
5467
5467
  n.addGroup(e, r.length / 3 - e, 0);
5468
5468
  }
5469
- function I() {
5469
+ function L() {
5470
5470
  let e = r.length / 3, t = 0;
5471
- re(D, t), t += D.length;
5471
+ ne(D, t), t += D.length;
5472
5472
  for (let e = 0, n = w.length; e < n; e++) {
5473
5473
  let n = w[e];
5474
- re(n, t), t += n.length;
5474
+ ne(n, t), t += n.length;
5475
5475
  }
5476
5476
  n.addGroup(e, r.length / 3 - e, 1);
5477
5477
  }
5478
- function re(e, t) {
5478
+ function ne(e, t) {
5479
5479
  let n = e.length;
5480
5480
  for (; --n >= 0;) {
5481
5481
  let r = n, i = n - 1;
5482
5482
  i < 0 && (i = e.length - 1);
5483
5483
  for (let e = 0, n = s + p * 2; e < n; e++) {
5484
5484
  let n = k * e, a = k * (e + 1);
5485
- L(t + r + n, t + i + n, t + i + a, t + r + a);
5485
+ z(t + r + n, t + i + n, t + i + a, t + r + a);
5486
5486
  }
5487
5487
  }
5488
5488
  }
5489
- function ie(e, t, n) {
5489
+ function re(e, t, n) {
5490
5490
  a.push(e), a.push(t), a.push(n);
5491
5491
  }
5492
- function ae(e, t, i) {
5493
- R(e), R(t), R(i);
5492
+ function R(e, t, i) {
5493
+ B(e), B(t), B(i);
5494
5494
  let a = r.length / 3, o = h.generateTopUV(n, r, a - 3, a - 2, a - 1);
5495
- oe(o[0]), oe(o[1]), oe(o[2]);
5495
+ ie(o[0]), ie(o[1]), ie(o[2]);
5496
5496
  }
5497
- function L(e, t, i, a) {
5498
- R(e), R(t), R(a), R(t), R(i), R(a);
5497
+ function z(e, t, i, a) {
5498
+ B(e), B(t), B(a), B(t), B(i), B(a);
5499
5499
  let o = r.length / 3, s = h.generateSideWallUV(n, r, o - 6, o - 3, o - 2, o - 1);
5500
- oe(s[0]), oe(s[1]), oe(s[3]), oe(s[1]), oe(s[2]), oe(s[3]);
5500
+ ie(s[0]), ie(s[1]), ie(s[3]), ie(s[1]), ie(s[2]), ie(s[3]);
5501
5501
  }
5502
- function R(e) {
5502
+ function B(e) {
5503
5503
  r.push(a[e * 3 + 0]), r.push(a[e * 3 + 1]), r.push(a[e * 3 + 2]);
5504
5504
  }
5505
- function oe(e) {
5505
+ function ie(e) {
5506
5506
  i.push(e.x), i.push(e.y);
5507
5507
  }
5508
5508
  }
@@ -9243,7 +9243,7 @@ function Cc(e, t, n, r, i, a, o) {
9243
9243
  let e = Za[w];
9244
9244
  O = e.vertexShader, k = e.fragmentShader;
9245
9245
  } else O = a.vertexShader, k = a.fragmentShader, c.update(a), A = c.getVertexShaderID(a), j = c.getFragmentShaderID(a);
9246
- let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), ee = _.isInstancedMesh === !0, P = _.isBatchedMesh === !0, F = !!a.map, te = !!a.matcap, ne = !!S, I = !!a.aoMap, re = !!a.lightMap, ie = !!a.bumpMap, ae = !!a.normalMap, L = !!a.displacementMap, R = !!a.emissiveMap, oe = !!a.metalnessMap, se = !!a.roughnessMap, ce = a.anisotropy > 0, le = a.clearcoat > 0, ue = a.dispersion > 0, z = a.iridescence > 0, B = a.sheen > 0, de = a.transmission > 0, V = ce && !!a.anisotropyMap, H = le && !!a.clearcoatMap, U = le && !!a.clearcoatNormalMap, fe = le && !!a.clearcoatRoughnessMap, W = z && !!a.iridescenceMap, G = z && !!a.iridescenceThicknessMap, K = B && !!a.sheenColorMap, pe = B && !!a.sheenRoughnessMap, q = !!a.specularMap, me = !!a.specularColorMap, J = !!a.specularIntensityMap, he = de && !!a.transmissionMap, ge = de && !!a.thicknessMap, _e = !!a.gradientMap, ve = !!a.alphaMap, ye = a.alphaTest > 0, be = !!a.alphaHash, xe = !!a.extensions, Se = 0;
9246
+ let M = e.getRenderTarget(), N = e.state.buffers.depth.getReversed(), P = _.isInstancedMesh === !0, F = _.isBatchedMesh === !0, I = !!a.map, ee = !!a.matcap, te = !!S, L = !!a.aoMap, ne = !!a.lightMap, re = !!a.bumpMap, R = !!a.normalMap, z = !!a.displacementMap, B = !!a.emissiveMap, ie = !!a.metalnessMap, ae = !!a.roughnessMap, oe = a.anisotropy > 0, se = a.clearcoat > 0, ce = a.dispersion > 0, le = a.iridescence > 0, ue = a.sheen > 0, de = a.transmission > 0, V = oe && !!a.anisotropyMap, H = se && !!a.clearcoatMap, U = se && !!a.clearcoatNormalMap, fe = se && !!a.clearcoatRoughnessMap, W = le && !!a.iridescenceMap, G = le && !!a.iridescenceThicknessMap, K = ue && !!a.sheenColorMap, pe = ue && !!a.sheenRoughnessMap, q = !!a.specularMap, me = !!a.specularColorMap, J = !!a.specularIntensityMap, he = de && !!a.transmissionMap, ge = de && !!a.thicknessMap, _e = !!a.gradientMap, ve = !!a.alphaMap, ye = a.alphaTest > 0, be = !!a.alphaHash, xe = !!a.extensions, Se = 0;
9247
9247
  a.toneMapped && (M === null || M.isXRRenderTarget === !0) && (Se = e.toneMapping);
9248
9248
  let Ce = {
9249
9249
  shaderID: w,
@@ -9257,40 +9257,40 @@ function Cc(e, t, n, r, i, a, o) {
9257
9257
  isRawShaderMaterial: a.isRawShaderMaterial === !0,
9258
9258
  glslVersion: a.glslVersion,
9259
9259
  precision: p,
9260
- batching: P,
9261
- batchingColor: P && _._colorsTexture !== null,
9262
- instancing: ee,
9263
- instancingColor: ee && _.instanceColor !== null,
9264
- instancingMorph: ee && _.morphTexture !== null,
9260
+ batching: F,
9261
+ batchingColor: F && _._colorsTexture !== null,
9262
+ instancing: P,
9263
+ instancingColor: P && _.instanceColor !== null,
9264
+ instancingMorph: P && _.morphTexture !== null,
9265
9265
  supportsVertexTextures: f,
9266
9266
  outputColorSpace: M === null ? e.outputColorSpace : M.isXRRenderTarget === !0 ? M.texture.colorSpace : b,
9267
9267
  alphaToCoverage: !!a.alphaToCoverage,
9268
- map: F,
9269
- matcap: te,
9270
- envMap: ne,
9271
- envMapMode: ne && S.mapping,
9268
+ map: I,
9269
+ matcap: ee,
9270
+ envMap: te,
9271
+ envMapMode: te && S.mapping,
9272
9272
  envMapCubeUVHeight: C,
9273
- aoMap: I,
9274
- lightMap: re,
9275
- bumpMap: ie,
9276
- normalMap: ae,
9277
- displacementMap: f && L,
9278
- emissiveMap: R,
9279
- normalMapObjectSpace: ae && a.normalMapType === 1,
9280
- normalMapTangentSpace: ae && a.normalMapType === 0,
9281
- metalnessMap: oe,
9282
- roughnessMap: se,
9283
- anisotropy: ce,
9273
+ aoMap: L,
9274
+ lightMap: ne,
9275
+ bumpMap: re,
9276
+ normalMap: R,
9277
+ displacementMap: f && z,
9278
+ emissiveMap: B,
9279
+ normalMapObjectSpace: R && a.normalMapType === 1,
9280
+ normalMapTangentSpace: R && a.normalMapType === 0,
9281
+ metalnessMap: ie,
9282
+ roughnessMap: ae,
9283
+ anisotropy: oe,
9284
9284
  anisotropyMap: V,
9285
- clearcoat: le,
9285
+ clearcoat: se,
9286
9286
  clearcoatMap: H,
9287
9287
  clearcoatNormalMap: U,
9288
9288
  clearcoatRoughnessMap: fe,
9289
- dispersion: ue,
9290
- iridescence: z,
9289
+ dispersion: ce,
9290
+ iridescence: le,
9291
9291
  iridescenceMap: W,
9292
9292
  iridescenceThicknessMap: G,
9293
- sheen: B,
9293
+ sheen: ue,
9294
9294
  sheenColorMap: K,
9295
9295
  sheenRoughnessMap: pe,
9296
9296
  specularMap: q,
@@ -9305,15 +9305,15 @@ function Cc(e, t, n, r, i, a, o) {
9305
9305
  alphaTest: ye,
9306
9306
  alphaHash: be,
9307
9307
  combine: a.combine,
9308
- mapUv: F && h(a.map.channel),
9309
- aoMapUv: I && h(a.aoMap.channel),
9310
- lightMapUv: re && h(a.lightMap.channel),
9311
- bumpMapUv: ie && h(a.bumpMap.channel),
9312
- normalMapUv: ae && h(a.normalMap.channel),
9313
- displacementMapUv: L && h(a.displacementMap.channel),
9314
- emissiveMapUv: R && h(a.emissiveMap.channel),
9315
- metalnessMapUv: oe && h(a.metalnessMap.channel),
9316
- roughnessMapUv: se && h(a.roughnessMap.channel),
9308
+ mapUv: I && h(a.map.channel),
9309
+ aoMapUv: L && h(a.aoMap.channel),
9310
+ lightMapUv: ne && h(a.lightMap.channel),
9311
+ bumpMapUv: re && h(a.bumpMap.channel),
9312
+ normalMapUv: R && h(a.normalMap.channel),
9313
+ displacementMapUv: z && h(a.displacementMap.channel),
9314
+ emissiveMapUv: B && h(a.emissiveMap.channel),
9315
+ metalnessMapUv: ie && h(a.metalnessMap.channel),
9316
+ roughnessMapUv: ae && h(a.roughnessMap.channel),
9317
9317
  anisotropyMapUv: V && h(a.anisotropyMap.channel),
9318
9318
  clearcoatMapUv: H && h(a.clearcoatMap.channel),
9319
9319
  clearcoatNormalMapUv: U && h(a.clearcoatNormalMap.channel),
@@ -9328,10 +9328,10 @@ function Cc(e, t, n, r, i, a, o) {
9328
9328
  transmissionMapUv: he && h(a.transmissionMap.channel),
9329
9329
  thicknessMapUv: ge && h(a.thicknessMap.channel),
9330
9330
  alphaMapUv: ve && h(a.alphaMap.channel),
9331
- vertexTangents: !!y.attributes.tangent && (ae || ce),
9331
+ vertexTangents: !!y.attributes.tangent && (R || oe),
9332
9332
  vertexColors: a.vertexColors,
9333
9333
  vertexAlphas: a.vertexColors === !0 && !!y.attributes.color && y.attributes.color.itemSize === 4,
9334
- pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (F || ve),
9334
+ pointsUvs: _.isPoints === !0 && !!y.attributes.uv && (I || ve),
9335
9335
  fog: !!v,
9336
9336
  useFog: a.fog === !0,
9337
9337
  fogExp2: !!v && v.isFogExp2,
@@ -9362,8 +9362,8 @@ function Cc(e, t, n, r, i, a, o) {
9362
9362
  shadowMapEnabled: e.shadowMap.enabled && u.length > 0,
9363
9363
  shadowMapType: e.shadowMap.type,
9364
9364
  toneMapping: Se,
9365
- decodeVideoTexture: F && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
9366
- decodeVideoTextureEmissive: R && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
9365
+ decodeVideoTexture: I && a.map.isVideoTexture === !0 && Y.getTransfer(a.map.colorSpace) === "srgb",
9366
+ decodeVideoTextureEmissive: B && a.emissiveMap.isVideoTexture === !0 && Y.getTransfer(a.emissiveMap.colorSpace) === "srgb",
9367
9367
  premultipliedAlpha: a.premultipliedAlpha,
9368
9368
  doubleSided: a.side === 2,
9369
9369
  flipSided: a.side === 1,
@@ -9371,7 +9371,7 @@ function Cc(e, t, n, r, i, a, o) {
9371
9371
  depthPacking: a.depthPacking || 0,
9372
9372
  index0AttributeName: a.index0AttributeName,
9373
9373
  extensionClipCullDistance: xe && a.extensions.clipCullDistance === !0 && r.has("WEBGL_clip_cull_distance"),
9374
- extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || P) && r.has("WEBGL_multi_draw"),
9374
+ extensionMultiDraw: (xe && a.extensions.multiDraw === !0 || F) && r.has("WEBGL_multi_draw"),
9375
9375
  rendererExtensionParallelShaderCompile: r.has("KHR_parallel_shader_compile"),
9376
9376
  customProgramCacheKey: a.customProgramCacheKey()
9377
9377
  };
@@ -9931,7 +9931,7 @@ function Bc(e, t) {
9931
9931
  return r;
9932
9932
  },
9933
9933
  setTest: function(t) {
9934
- t ? L(e.DEPTH_TEST) : R(e.DEPTH_TEST);
9934
+ t ? z(e.DEPTH_TEST) : B(e.DEPTH_TEST);
9935
9935
  },
9936
9936
  setMask: function(t) {
9937
9937
  i !== t && !n && (e.depthMask(t), i = t);
@@ -9983,7 +9983,7 @@ function Bc(e, t) {
9983
9983
  let t = !1, n = null, r = null, i = null, a = null, o = null, s = null, c = null, l = null;
9984
9984
  return {
9985
9985
  setTest: function(n) {
9986
- t || (n ? L(e.STENCIL_TEST) : R(e.STENCIL_TEST));
9986
+ t || (n ? z(e.STENCIL_TEST) : B(e.STENCIL_TEST));
9987
9987
  },
9988
9988
  setMask: function(r) {
9989
9989
  n !== r && !t && (e.stencilMask(r), n = r);
@@ -10005,27 +10005,27 @@ function Bc(e, t) {
10005
10005
  }
10006
10006
  };
10007
10007
  }
10008
- let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0, ee = e.getParameter(e.VERSION);
10009
- ee.indexOf("WebGL") === -1 ? ee.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(ee)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(ee)[1]), M = N >= 1);
10010
- let P = null, F = {}, te = e.getParameter(e.SCISSOR_BOX), ne = e.getParameter(e.VIEWPORT), I = new Ae().fromArray(te), re = new Ae().fromArray(ne);
10011
- function ie(t, n, r, i) {
10008
+ let a = new n(), o = new r(), s = new i(), c = /* @__PURE__ */ new WeakMap(), l = /* @__PURE__ */ new WeakMap(), u = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, j = e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS), M = !1, N = 0, P = e.getParameter(e.VERSION);
10009
+ P.indexOf("WebGL") === -1 ? P.indexOf("OpenGL ES") !== -1 && (N = parseFloat(/^OpenGL ES (\d)/.exec(P)[1]), M = N >= 2) : (N = parseFloat(/^WebGL (\d)/.exec(P)[1]), M = N >= 1);
10010
+ let F = null, I = {}, ee = e.getParameter(e.SCISSOR_BOX), te = e.getParameter(e.VIEWPORT), L = new Ae().fromArray(ee), ne = new Ae().fromArray(te);
10011
+ function re(t, n, r, i) {
10012
10012
  let a = /* @__PURE__ */ new Uint8Array(4), o = e.createTexture();
10013
10013
  e.bindTexture(t, o), e.texParameteri(t, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(t, e.TEXTURE_MAG_FILTER, e.NEAREST);
10014
10014
  for (let o = 0; o < r; o++) t === e.TEXTURE_3D || t === e.TEXTURE_2D_ARRAY ? e.texImage3D(n, 0, e.RGBA, 1, 1, i, 0, e.RGBA, e.UNSIGNED_BYTE, a) : e.texImage2D(n + o, 0, e.RGBA, 1, 1, 0, e.RGBA, e.UNSIGNED_BYTE, a);
10015
10015
  return o;
10016
10016
  }
10017
- let ae = {};
10018
- ae[e.TEXTURE_2D] = ie(e.TEXTURE_2D, e.TEXTURE_2D, 1), ae[e.TEXTURE_CUBE_MAP] = ie(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), ae[e.TEXTURE_2D_ARRAY] = ie(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), ae[e.TEXTURE_3D] = ie(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), L(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), L(e.CULL_FACE), z(0);
10019
- function L(t) {
10017
+ let R = {};
10018
+ R[e.TEXTURE_2D] = re(e.TEXTURE_2D, e.TEXTURE_2D, 1), R[e.TEXTURE_CUBE_MAP] = re(e.TEXTURE_CUBE_MAP, e.TEXTURE_CUBE_MAP_POSITIVE_X, 6), R[e.TEXTURE_2D_ARRAY] = re(e.TEXTURE_2D_ARRAY, e.TEXTURE_2D_ARRAY, 1, 1), R[e.TEXTURE_3D] = re(e.TEXTURE_3D, e.TEXTURE_3D, 1, 1), a.setClear(0, 0, 0, 1), o.setClear(1), s.setClear(0), z(e.DEPTH_TEST), o.setFunc(3), de(!1), V(1), z(e.CULL_FACE), le(0);
10019
+ function z(t) {
10020
10020
  u[t] !== !0 && (e.enable(t), u[t] = !0);
10021
10021
  }
10022
- function R(t) {
10022
+ function B(t) {
10023
10023
  u[t] !== !1 && (e.disable(t), u[t] = !1);
10024
10024
  }
10025
- function oe(t, n) {
10025
+ function ie(t, n) {
10026
10026
  return d[t] !== n && (e.bindFramebuffer(t, n), d[t] = n, t === e.DRAW_FRAMEBUFFER && (d[e.FRAMEBUFFER] = n), t === e.FRAMEBUFFER && (d[e.DRAW_FRAMEBUFFER] = n), !0);
10027
10027
  }
10028
- function se(t, n) {
10028
+ function ae(t, n) {
10029
10029
  let r = p, i = !1;
10030
10030
  if (t) {
10031
10031
  r = f.get(n), r === void 0 && (r = [], f.set(n, r));
@@ -10037,16 +10037,16 @@ function Bc(e, t) {
10037
10037
  } else r[0] !== e.BACK && (r[0] = e.BACK, i = !0);
10038
10038
  i && e.drawBuffers(r);
10039
10039
  }
10040
- function ce(t) {
10040
+ function oe(t) {
10041
10041
  return m !== t && (e.useProgram(t), m = t, !0);
10042
10042
  }
10043
- let le = {
10043
+ let se = {
10044
10044
  100: e.FUNC_ADD,
10045
10045
  101: e.FUNC_SUBTRACT,
10046
10046
  102: e.FUNC_REVERSE_SUBTRACT
10047
10047
  };
10048
- le[103] = e.MIN, le[104] = e.MAX;
10049
- let ue = {
10048
+ se[103] = e.MIN, se[104] = e.MAX;
10049
+ let ce = {
10050
10050
  200: e.ZERO,
10051
10051
  201: e.ONE,
10052
10052
  202: e.SRC_COLOR,
@@ -10063,12 +10063,12 @@ function Bc(e, t) {
10063
10063
  213: e.CONSTANT_ALPHA,
10064
10064
  214: e.ONE_MINUS_CONSTANT_ALPHA
10065
10065
  };
10066
- function z(t, n, r, i, a, o, s, c, l, u) {
10066
+ function le(t, n, r, i, a, o, s, c, l, u) {
10067
10067
  if (t === 0) {
10068
- h === !0 && (R(e.BLEND), h = !1);
10068
+ h === !0 && (B(e.BLEND), h = !1);
10069
10069
  return;
10070
10070
  }
10071
- if (h === !1 && (L(e.BLEND), h = !0), t !== 5) {
10071
+ if (h === !1 && (z(e.BLEND), h = !0), t !== 5) {
10072
10072
  if (t !== g || u !== T) {
10073
10073
  if ((_ !== 100 || b !== 100) && (e.blendEquation(e.FUNC_ADD), _ = 100, b = 100), u) switch (t) {
10074
10074
  case 1:
@@ -10104,43 +10104,43 @@ function Bc(e, t) {
10104
10104
  }
10105
10105
  return;
10106
10106
  }
10107
- a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(le[n], le[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(ue[r], ue[i], ue[o], ue[s]), v = r, y = i, x = o, S = s), (c.equals(C) === !1 || l !== w) && (e.blendColor(c.r, c.g, c.b, l), C.copy(c), w = l), g = t, T = !1;
10107
+ a ||= n, o ||= r, s ||= i, (n !== _ || a !== b) && (e.blendEquationSeparate(se[n], se[a]), _ = n, b = a), (r !== v || i !== y || o !== x || s !== S) && (e.blendFuncSeparate(ce[r], ce[i], ce[o], ce[s]), v = r, y = i, x = o, S = s), (c.equals(C) === !1 || l !== w) && (e.blendColor(c.r, c.g, c.b, l), C.copy(c), w = l), g = t, T = !1;
10108
10108
  }
10109
- function B(t, n) {
10110
- t.side === 2 ? R(e.CULL_FACE) : L(e.CULL_FACE);
10109
+ function ue(t, n) {
10110
+ t.side === 2 ? B(e.CULL_FACE) : z(e.CULL_FACE);
10111
10111
  let r = t.side === 1;
10112
- n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? z(0) : z(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
10112
+ n && (r = !r), de(r), t.blending === 1 && t.transparent === !1 ? le(0) : le(t.blending, t.blendEquation, t.blendSrc, t.blendDst, t.blendEquationAlpha, t.blendSrcAlpha, t.blendDstAlpha, t.blendColor, t.blendAlpha, t.premultipliedAlpha), o.setFunc(t.depthFunc), o.setTest(t.depthTest), o.setMask(t.depthWrite), a.setMask(t.colorWrite);
10113
10113
  let i = t.stencilWrite;
10114
- s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? L(e.SAMPLE_ALPHA_TO_COVERAGE) : R(e.SAMPLE_ALPHA_TO_COVERAGE);
10114
+ s.setTest(i), i && (s.setMask(t.stencilWriteMask), s.setFunc(t.stencilFunc, t.stencilRef, t.stencilFuncMask), s.setOp(t.stencilFail, t.stencilZFail, t.stencilZPass)), U(t.polygonOffset, t.polygonOffsetFactor, t.polygonOffsetUnits), t.alphaToCoverage === !0 ? z(e.SAMPLE_ALPHA_TO_COVERAGE) : B(e.SAMPLE_ALPHA_TO_COVERAGE);
10115
10115
  }
10116
10116
  function de(t) {
10117
10117
  E !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), E = t);
10118
10118
  }
10119
10119
  function V(t) {
10120
- t === 0 ? R(e.CULL_FACE) : (L(e.CULL_FACE), t !== D && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), D = t;
10120
+ t === 0 ? B(e.CULL_FACE) : (z(e.CULL_FACE), t !== D && (t === 1 ? e.cullFace(e.BACK) : t === 2 ? e.cullFace(e.FRONT) : e.cullFace(e.FRONT_AND_BACK))), D = t;
10121
10121
  }
10122
10122
  function H(t) {
10123
10123
  t !== O && (M && e.lineWidth(t), O = t);
10124
10124
  }
10125
10125
  function U(t, n, r) {
10126
- t ? (L(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : R(e.POLYGON_OFFSET_FILL);
10126
+ t ? (z(e.POLYGON_OFFSET_FILL), (k !== n || A !== r) && (e.polygonOffset(n, r), k = n, A = r)) : B(e.POLYGON_OFFSET_FILL);
10127
10127
  }
10128
10128
  function fe(t) {
10129
- t ? L(e.SCISSOR_TEST) : R(e.SCISSOR_TEST);
10129
+ t ? z(e.SCISSOR_TEST) : B(e.SCISSOR_TEST);
10130
10130
  }
10131
10131
  function W(t) {
10132
- t === void 0 && (t = e.TEXTURE0 + j - 1), P !== t && (e.activeTexture(t), P = t);
10132
+ t === void 0 && (t = e.TEXTURE0 + j - 1), F !== t && (e.activeTexture(t), F = t);
10133
10133
  }
10134
10134
  function G(t, n, r) {
10135
- r === void 0 && (r = P === null ? e.TEXTURE0 + j - 1 : P);
10136
- let i = F[r];
10135
+ r === void 0 && (r = F === null ? e.TEXTURE0 + j - 1 : F);
10136
+ let i = I[r];
10137
10137
  i === void 0 && (i = {
10138
10138
  type: void 0,
10139
10139
  texture: void 0
10140
- }, F[r] = i), (i.type !== t || i.texture !== n) && (P !== r && (e.activeTexture(r), P = r), e.bindTexture(t, n || ae[t]), i.type = t, i.texture = n);
10140
+ }, I[r] = i), (i.type !== t || i.texture !== n) && (F !== r && (e.activeTexture(r), F = r), e.bindTexture(t, n || R[t]), i.type = t, i.texture = n);
10141
10141
  }
10142
10142
  function K() {
10143
- let t = F[P];
10143
+ let t = I[F];
10144
10144
  t !== void 0 && t.type !== void 0 && (e.bindTexture(t.type, null), t.type = void 0, t.texture = void 0);
10145
10145
  }
10146
10146
  function pe() {
@@ -10214,10 +10214,10 @@ function Bc(e, t) {
10214
10214
  }
10215
10215
  }
10216
10216
  function be(t) {
10217
- I.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), I.copy(t));
10217
+ L.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), L.copy(t));
10218
10218
  }
10219
10219
  function xe(t) {
10220
- re.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), re.copy(t));
10220
+ ne.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), ne.copy(t));
10221
10221
  }
10222
10222
  function Se(t, n) {
10223
10223
  let r = l.get(n);
@@ -10230,7 +10230,7 @@ function Bc(e, t) {
10230
10230
  c.get(n) !== r && (e.uniformBlockBinding(n, r, t.__bindingPointIndex), c.set(n, r));
10231
10231
  }
10232
10232
  function we() {
10233
- e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {}, P = null, F = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, I.set(0, 0, e.canvas.width, e.canvas.height), re.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
10233
+ e.disable(e.BLEND), e.disable(e.CULL_FACE), e.disable(e.DEPTH_TEST), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SCISSOR_TEST), e.disable(e.STENCIL_TEST), e.disable(e.SAMPLE_ALPHA_TO_COVERAGE), e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ONE, e.ZERO), e.blendFuncSeparate(e.ONE, e.ZERO, e.ONE, e.ZERO), e.blendColor(0, 0, 0, 0), e.colorMask(!0, !0, !0, !0), e.clearColor(0, 0, 0, 0), e.depthMask(!0), e.depthFunc(e.LESS), o.setReversed(!1), e.clearDepth(1), e.stencilMask(4294967295), e.stencilFunc(e.ALWAYS, 0, 4294967295), e.stencilOp(e.KEEP, e.KEEP, e.KEEP), e.clearStencil(0), e.cullFace(e.BACK), e.frontFace(e.CCW), e.polygonOffset(0, 0), e.activeTexture(e.TEXTURE0), e.bindFramebuffer(e.FRAMEBUFFER, null), e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null), e.bindFramebuffer(e.READ_FRAMEBUFFER, null), e.useProgram(null), e.lineWidth(1), e.scissor(0, 0, e.canvas.width, e.canvas.height), e.viewport(0, 0, e.canvas.width, e.canvas.height), u = {}, F = null, I = {}, d = {}, f = /* @__PURE__ */ new WeakMap(), p = [], m = null, h = !1, g = null, _ = null, v = null, y = null, b = null, x = null, S = null, C = new X(0, 0, 0), w = 0, T = !1, E = null, D = null, O = null, k = null, A = null, L.set(0, 0, e.canvas.width, e.canvas.height), ne.set(0, 0, e.canvas.width, e.canvas.height), a.reset(), o.reset(), s.reset();
10234
10234
  }
10235
10235
  return {
10236
10236
  buffers: {
@@ -10238,13 +10238,13 @@ function Bc(e, t) {
10238
10238
  depth: o,
10239
10239
  stencil: s
10240
10240
  },
10241
- enable: L,
10242
- disable: R,
10243
- bindFramebuffer: oe,
10244
- drawBuffers: se,
10245
- useProgram: ce,
10246
- setBlending: z,
10247
- setMaterial: B,
10241
+ enable: z,
10242
+ disable: B,
10243
+ bindFramebuffer: ie,
10244
+ drawBuffers: ae,
10245
+ useProgram: oe,
10246
+ setBlending: le,
10247
+ setMaterial: ue,
10248
10248
  setFlipSided: de,
10249
10249
  setCullFace: V,
10250
10250
  setLineWidth: H,
@@ -10325,7 +10325,7 @@ function Vc(o, s, c, l, u, d, p) {
10325
10325
  }
10326
10326
  function j(e) {
10327
10327
  let t = e.target;
10328
- t.removeEventListener("dispose", j), ee(t);
10328
+ t.removeEventListener("dispose", j), P(t);
10329
10329
  }
10330
10330
  function M(e) {
10331
10331
  let t = l.get(e);
@@ -10343,7 +10343,7 @@ function Vc(o, s, c, l, u, d, p) {
10343
10343
  let n = e.source, r = y.get(n);
10344
10344
  delete r[t.__cacheKey], p.memory.textures--;
10345
10345
  }
10346
- function ee(e) {
10346
+ function P(e) {
10347
10347
  let t = l.get(e);
10348
10348
  if (e.depthTexture && (e.depthTexture.dispose(), l.remove(e.depthTexture)), e.isWebGLCubeRenderTarget) for (let e = 0; e < 6; e++) {
10349
10349
  if (Array.isArray(t.__webglFramebuffer[e])) for (let n = 0; n < t.__webglFramebuffer[e].length; n++) o.deleteFramebuffer(t.__webglFramebuffer[e][n]);
@@ -10363,67 +10363,67 @@ function Vc(o, s, c, l, u, d, p) {
10363
10363
  }
10364
10364
  l.remove(e);
10365
10365
  }
10366
- let P = 0;
10367
- function F() {
10368
- P = 0;
10366
+ let F = 0;
10367
+ function I() {
10368
+ F = 0;
10369
10369
  }
10370
- function te() {
10371
- let e = P;
10372
- return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), P += 1, e;
10370
+ function ee() {
10371
+ let e = F;
10372
+ return e >= u.maxTextures && console.warn("THREE.WebGLTextures: Trying to use " + e + " texture units while this GPU supports only " + u.maxTextures), F += 1, e;
10373
10373
  }
10374
- function ne(e) {
10374
+ function te(e) {
10375
10375
  let t = [];
10376
10376
  return t.push(e.wrapS), t.push(e.wrapT), t.push(e.wrapR || 0), t.push(e.magFilter), t.push(e.minFilter), t.push(e.anisotropy), t.push(e.internalFormat), t.push(e.format), t.push(e.type), t.push(e.generateMipmaps), t.push(e.premultiplyAlpha), t.push(e.flipY), t.push(e.unpackAlignment), t.push(e.colorSpace), t.join();
10377
10377
  }
10378
- function I(e, t) {
10378
+ function L(e, t) {
10379
10379
  let n = l.get(e);
10380
10380
  if (e.isVideoTexture && _e(e), e.isRenderTargetTexture === !1 && e.isExternalTexture !== !0 && e.version > 0 && n.__version !== e.version) {
10381
10381
  let r = e.image;
10382
10382
  if (r === null) console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");
10383
10383
  else if (r.complete === !1) console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");
10384
10384
  else {
10385
- z(n, e, t);
10385
+ le(n, e, t);
10386
10386
  return;
10387
10387
  }
10388
10388
  } else e.isExternalTexture && (n.__webglTexture = e.sourceTexture ? e.sourceTexture : null);
10389
10389
  c.bindTexture(o.TEXTURE_2D, n.__webglTexture, o.TEXTURE0 + t);
10390
10390
  }
10391
- function re(e, t) {
10391
+ function ne(e, t) {
10392
10392
  let n = l.get(e);
10393
10393
  if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
10394
- z(n, e, t);
10394
+ le(n, e, t);
10395
10395
  return;
10396
10396
  }
10397
10397
  c.bindTexture(o.TEXTURE_2D_ARRAY, n.__webglTexture, o.TEXTURE0 + t);
10398
10398
  }
10399
- function ie(e, t) {
10399
+ function re(e, t) {
10400
10400
  let n = l.get(e);
10401
10401
  if (e.isRenderTargetTexture === !1 && e.version > 0 && n.__version !== e.version) {
10402
- z(n, e, t);
10402
+ le(n, e, t);
10403
10403
  return;
10404
10404
  }
10405
10405
  c.bindTexture(o.TEXTURE_3D, n.__webglTexture, o.TEXTURE0 + t);
10406
10406
  }
10407
- function ae(e, t) {
10407
+ function R(e, t) {
10408
10408
  let n = l.get(e);
10409
10409
  if (e.version > 0 && n.__version !== e.version) {
10410
- B(n, e, t);
10410
+ ue(n, e, t);
10411
10411
  return;
10412
10412
  }
10413
10413
  c.bindTexture(o.TEXTURE_CUBE_MAP, n.__webglTexture, o.TEXTURE0 + t);
10414
10414
  }
10415
- let L = {
10415
+ let z = {
10416
10416
  [e]: o.REPEAT,
10417
10417
  [t]: o.CLAMP_TO_EDGE,
10418
10418
  [n]: o.MIRRORED_REPEAT
10419
- }, R = {
10419
+ }, B = {
10420
10420
  [r]: o.NEAREST,
10421
10421
  1004: o.NEAREST_MIPMAP_NEAREST,
10422
10422
  1005: o.NEAREST_MIPMAP_LINEAR,
10423
10423
  [i]: o.LINEAR,
10424
10424
  1007: o.LINEAR_MIPMAP_NEAREST,
10425
10425
  [a]: o.LINEAR_MIPMAP_LINEAR
10426
- }, oe = {
10426
+ }, ie = {
10427
10427
  512: o.NEVER,
10428
10428
  519: o.ALWAYS,
10429
10429
  513: o.LESS,
@@ -10433,8 +10433,8 @@ function Vc(o, s, c, l, u, d, p) {
10433
10433
  516: o.GREATER,
10434
10434
  517: o.NOTEQUAL
10435
10435
  };
10436
- function se(e, t) {
10437
- if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S, L[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, L[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, L[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, R[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, R[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, oe[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
10436
+ function ae(e, t) {
10437
+ if (t.type === 1015 && s.has("OES_texture_float_linear") === !1 && (t.magFilter === 1006 || t.magFilter === 1007 || t.magFilter === 1005 || t.magFilter === 1008 || t.minFilter === 1006 || t.minFilter === 1007 || t.minFilter === 1005 || t.minFilter === 1008) && console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), o.texParameteri(e, o.TEXTURE_WRAP_S, z[t.wrapS]), o.texParameteri(e, o.TEXTURE_WRAP_T, z[t.wrapT]), (e === o.TEXTURE_3D || e === o.TEXTURE_2D_ARRAY) && o.texParameteri(e, o.TEXTURE_WRAP_R, z[t.wrapR]), o.texParameteri(e, o.TEXTURE_MAG_FILTER, B[t.magFilter]), o.texParameteri(e, o.TEXTURE_MIN_FILTER, B[t.minFilter]), t.compareFunction && (o.texParameteri(e, o.TEXTURE_COMPARE_MODE, o.COMPARE_REF_TO_TEXTURE), o.texParameteri(e, o.TEXTURE_COMPARE_FUNC, ie[t.compareFunction])), s.has("EXT_texture_filter_anisotropic") === !0) {
10438
10438
  if (t.magFilter === 1003 || t.minFilter !== 1005 && t.minFilter !== 1008 || t.type === 1015 && s.has("OES_texture_float_linear") === !1) return;
10439
10439
  if (t.anisotropy > 1 || l.get(t).__currentAnisotropy) {
10440
10440
  let n = s.get("EXT_texture_filter_anisotropic");
@@ -10442,12 +10442,12 @@ function Vc(o, s, c, l, u, d, p) {
10442
10442
  }
10443
10443
  }
10444
10444
  }
10445
- function ce(e, t) {
10445
+ function oe(e, t) {
10446
10446
  let n = !1;
10447
10447
  e.__webglInit === void 0 && (e.__webglInit = !0, t.addEventListener("dispose", A));
10448
10448
  let r = t.source, i = y.get(r);
10449
10449
  i === void 0 && (i = {}, y.set(r, i));
10450
- let a = ne(t);
10450
+ let a = te(t);
10451
10451
  if (a !== e.__cacheKey) {
10452
10452
  i[a] === void 0 && (i[a] = {
10453
10453
  texture: o.createTexture(),
@@ -10458,18 +10458,18 @@ function Vc(o, s, c, l, u, d, p) {
10458
10458
  }
10459
10459
  return n;
10460
10460
  }
10461
- function le(e, t, n) {
10461
+ function se(e, t, n) {
10462
10462
  return Math.floor(Math.floor(e / n) / t);
10463
10463
  }
10464
- function ue(e, t, n, r) {
10464
+ function ce(e, t, n, r) {
10465
10465
  let i = e.updateRanges;
10466
10466
  if (i.length === 0) c.texSubImage2D(o.TEXTURE_2D, 0, 0, 0, t.width, t.height, n, r, t.data);
10467
10467
  else {
10468
10468
  i.sort((e, t) => e.start - t.start);
10469
10469
  let a = 0;
10470
10470
  for (let e = 1; e < i.length; e++) {
10471
- let n = i[a], r = i[e], o = n.start + n.count, s = le(r.start, t.width, 4), c = le(n.start, t.width, 4);
10472
- r.start <= o + 1 && s === c && le(r.start + r.count - 1, t.width, 4) === s ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++a, i[a] = r);
10471
+ let n = i[a], r = i[e], o = n.start + n.count, s = se(r.start, t.width, 4), c = se(n.start, t.width, 4);
10472
+ r.start <= o + 1 && s === c && se(r.start + r.count - 1, t.width, 4) === s ? n.count = Math.max(n.count, r.start + r.count - n.start) : (++a, i[a] = r);
10473
10473
  }
10474
10474
  i.length = a + 1;
10475
10475
  let s = o.getParameter(o.UNPACK_ROW_LENGTH), l = o.getParameter(o.UNPACK_SKIP_PIXELS), u = o.getParameter(o.UNPACK_SKIP_ROWS);
@@ -10481,10 +10481,10 @@ function Vc(o, s, c, l, u, d, p) {
10481
10481
  e.clearUpdateRanges(), o.pixelStorei(o.UNPACK_ROW_LENGTH, s), o.pixelStorei(o.UNPACK_SKIP_PIXELS, l), o.pixelStorei(o.UNPACK_SKIP_ROWS, u);
10482
10482
  }
10483
10483
  }
10484
- function z(e, t, n) {
10484
+ function le(e, t, n) {
10485
10485
  let r = o.TEXTURE_2D;
10486
10486
  (t.isDataArrayTexture || t.isCompressedArrayTexture) && (r = o.TEXTURE_2D_ARRAY), t.isData3DTexture && (r = o.TEXTURE_3D);
10487
- let i = ce(e, t), a = t.source;
10487
+ let i = oe(e, t), a = t.source;
10488
10488
  c.bindTexture(r, e.__webglTexture, o.TEXTURE0 + n);
10489
10489
  let s = l.get(a);
10490
10490
  if (a.version !== s.__version || i === !0) {
@@ -10494,7 +10494,7 @@ function Vc(o, s, c, l, u, d, p) {
10494
10494
  let m = C(t.image, !1, u.maxTextureSize);
10495
10495
  m = ve(t, m);
10496
10496
  let h = d.convert(t.format, t.colorSpace), g = d.convert(t.type), _ = D(t.internalFormat, h, g, t.colorSpace, t.isVideoTexture);
10497
- se(r, t);
10497
+ ae(r, t);
10498
10498
  let v, y = t.mipmaps, b = t.isVideoTexture !== !0, x = s.__version === void 0 || i === !0, S = a.dataReady, E = k(t, m);
10499
10499
  if (t.isDepthTexture) _ = O(t.format === f, t.type), x && (b ? c.texStorage2D(o.TEXTURE_2D, 1, _, m.width, m.height) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, null));
10500
10500
  else if (t.isDataTexture) {
@@ -10502,7 +10502,7 @@ function Vc(o, s, c, l, u, d, p) {
10502
10502
  b && x && c.texStorage2D(o.TEXTURE_2D, E, _, y[0].width, y[0].height);
10503
10503
  for (let e = 0, t = y.length; e < t; e++) v = y[e], b ? S && c.texSubImage2D(o.TEXTURE_2D, e, 0, 0, v.width, v.height, h, g, v.data) : c.texImage2D(o.TEXTURE_2D, e, _, v.width, v.height, 0, h, g, v.data);
10504
10504
  t.generateMipmaps = !1;
10505
- } else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && ue(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
10505
+ } else b ? (x && c.texStorage2D(o.TEXTURE_2D, E, _, m.width, m.height), S && ce(t, m, h, g)) : c.texImage2D(o.TEXTURE_2D, 0, _, m.width, m.height, 0, h, g, m.data);
10506
10506
  } else if (t.isCompressedTexture) {
10507
10507
  if (t.isCompressedArrayTexture) {
10508
10508
  b && x && c.texStorage3D(o.TEXTURE_2D_ARRAY, E, _, y[0].width, y[0].height, m.depth);
@@ -10566,9 +10566,9 @@ function Vc(o, s, c, l, u, d, p) {
10566
10566
  }
10567
10567
  e.__version = t.version;
10568
10568
  }
10569
- function B(e, t, n) {
10569
+ function ue(e, t, n) {
10570
10570
  if (t.image.length !== 6) return;
10571
- let r = ce(e, t), i = t.source;
10571
+ let r = oe(e, t), i = t.source;
10572
10572
  c.bindTexture(o.TEXTURE_CUBE_MAP, e.__webglTexture, o.TEXTURE0 + n);
10573
10573
  let a = l.get(i);
10574
10574
  if (i.version !== a.__version || r === !0) {
@@ -10578,7 +10578,7 @@ function Vc(o, s, c, l, u, d, p) {
10578
10578
  let f = t.isCompressedTexture || t.image[0].isCompressedTexture, p = t.image[0] && t.image[0].isDataTexture, m = [];
10579
10579
  for (let e = 0; e < 6; e++) !f && !p ? m[e] = C(t.image[e], !0, u.maxCubemapSize) : m[e] = p ? t.image[e].image : t.image[e], m[e] = ve(t, m[e]);
10580
10580
  let h = m[0], g = d.convert(t.format, t.colorSpace), _ = d.convert(t.type), v = D(t.internalFormat, g, _, t.colorSpace), y = t.isVideoTexture !== !0, b = a.__version === void 0 || r === !0, x = i.dataReady, S = k(t, h);
10581
- se(o.TEXTURE_CUBE_MAP, t);
10581
+ ae(o.TEXTURE_CUBE_MAP, t);
10582
10582
  let E;
10583
10583
  if (f) {
10584
10584
  y && b && c.texStorage2D(o.TEXTURE_CUBE_MAP, S, v, h.width, h.height);
@@ -10638,7 +10638,7 @@ function Vc(o, s, c, l, u, d, p) {
10638
10638
  if (t && t.isWebGLCubeRenderTarget) throw Error("Depth Texture with cube render targets is not supported");
10639
10639
  if (c.bindFramebuffer(o.FRAMEBUFFER, e), !(t.depthTexture && t.depthTexture.isDepthTexture)) throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
10640
10640
  let n = l.get(t.depthTexture);
10641
- n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0), I(t.depthTexture, 0);
10641
+ n.__renderTarget = t, (!n.__webglTexture || t.depthTexture.image.width !== t.width || t.depthTexture.image.height !== t.height) && (t.depthTexture.image.width = t.width, t.depthTexture.image.height = t.height, t.depthTexture.needsUpdate = !0), L(t.depthTexture, 0);
10642
10642
  let r = n.__webglTexture, i = he(t);
10643
10643
  if (t.depthTexture.format === 1026) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_ATTACHMENT, o.TEXTURE_2D, r, 0);
10644
10644
  else if (t.depthTexture.format === 1027) ge(t) ? m.framebufferTexture2DMultisampleEXT(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0, i) : o.framebufferTexture2D(o.FRAMEBUFFER, o.DEPTH_STENCIL_ATTACHMENT, o.TEXTURE_2D, r, 0);
@@ -10712,19 +10712,19 @@ function Vc(o, s, c, l, u, d, p) {
10712
10712
  }
10713
10713
  }
10714
10714
  if (a) {
10715
- c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), se(o.TEXTURE_CUBE_MAP, t);
10715
+ c.bindTexture(o.TEXTURE_CUBE_MAP, r.__webglTexture), ae(o.TEXTURE_CUBE_MAP, t);
10716
10716
  for (let r = 0; r < 6; r++) if (t.mipmaps && t.mipmaps.length > 0) for (let i = 0; i < t.mipmaps.length; i++) de(n.__webglFramebuffer[r][i], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, i);
10717
10717
  else de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, o.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0);
10718
10718
  w(t) && T(o.TEXTURE_CUBE_MAP), c.unbindTexture();
10719
10719
  } else if (s) {
10720
10720
  for (let t = 0, r = i.length; t < r; t++) {
10721
10721
  let r = i[t], a = l.get(r), s = o.TEXTURE_2D;
10722
- (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), se(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
10722
+ (e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (s = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(s, a.__webglTexture), ae(s, r), de(n.__webglFramebuffer, e, r, o.COLOR_ATTACHMENT0 + t, s, 0), w(r) && T(s);
10723
10723
  }
10724
10724
  c.unbindTexture();
10725
10725
  } else {
10726
10726
  let i = o.TEXTURE_2D;
10727
- if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), se(i, t), t.mipmaps && t.mipmaps.length > 0) for (let r = 0; r < t.mipmaps.length; r++) de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, i, r);
10727
+ if ((e.isWebGL3DRenderTarget || e.isWebGLArrayRenderTarget) && (i = e.isWebGL3DRenderTarget ? o.TEXTURE_3D : o.TEXTURE_2D_ARRAY), c.bindTexture(i, r.__webglTexture), ae(i, t), t.mipmaps && t.mipmaps.length > 0) for (let r = 0; r < t.mipmaps.length; r++) de(n.__webglFramebuffer[r], e, t, o.COLOR_ATTACHMENT0, i, r);
10728
10728
  else de(n.__webglFramebuffer, e, t, o.COLOR_ATTACHMENT0, i, 0);
10729
10729
  w(t) && T(i), c.unbindTexture();
10730
10730
  }
@@ -10787,7 +10787,7 @@ function Vc(o, s, c, l, u, d, p) {
10787
10787
  function ye(e) {
10788
10788
  return typeof HTMLImageElement < "u" && e instanceof HTMLImageElement ? (g.width = e.naturalWidth || e.width, g.height = e.naturalHeight || e.height) : typeof VideoFrame < "u" && e instanceof VideoFrame ? (g.width = e.displayWidth, g.height = e.displayHeight) : (g.width = e.width, g.height = e.height), g;
10789
10789
  }
10790
- this.allocateTextureUnit = te, this.resetTextureUnits = F, this.setTexture2D = I, this.setTexture2DArray = re, this.setTexture3D = ie, this.setTextureCube = ae, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
10790
+ this.allocateTextureUnit = ee, this.resetTextureUnits = I, this.setTexture2D = L, this.setTexture2DArray = ne, this.setTexture3D = re, this.setTextureCube = R, this.rebindTextures = W, this.setupRenderTarget = G, this.updateRenderTargetMipmap = K, this.updateMultisampleRenderTarget = J, this.setupDepthRenderbuffer = fe, this.setupFrameBufferTexture = de, this.useMultisampledRTT = ge;
10791
10791
  }
10792
10792
  function Hc(e, t) {
10793
10793
  function n(n, r = "") {
@@ -10918,7 +10918,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10918
10918
  A.viewport = new Ae();
10919
10919
  let j = new Kn();
10920
10920
  j.viewport = new Ae();
10921
- let M = [A, j], N = new Aa(), ee = null, P = null;
10921
+ let M = [A, j], N = new Aa(), P = null, F = null;
10922
10922
  this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(e) {
10923
10923
  let t = T[e];
10924
10924
  return t === void 0 && (t = new er(), T[e] = t), t.getTargetRaySpace();
@@ -10929,7 +10929,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10929
10929
  let t = T[e];
10930
10930
  return t === void 0 && (t = new er(), T[e] = t), t.getHandSpace();
10931
10931
  };
10932
- function F(e) {
10932
+ function I(e) {
10933
10933
  let t = E.indexOf(e.inputSource);
10934
10934
  if (t === -1) return;
10935
10935
  let n = T[t];
@@ -10938,15 +10938,15 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10938
10938
  data: e.inputSource
10939
10939
  }));
10940
10940
  }
10941
- function te() {
10942
- r.removeEventListener("select", F), r.removeEventListener("selectstart", F), r.removeEventListener("selectend", F), r.removeEventListener("squeeze", F), r.removeEventListener("squeezestart", F), r.removeEventListener("squeezeend", F), r.removeEventListener("end", te), r.removeEventListener("inputsourceschange", ne);
10941
+ function ee() {
10942
+ r.removeEventListener("select", I), r.removeEventListener("selectstart", I), r.removeEventListener("selectend", I), r.removeEventListener("squeeze", I), r.removeEventListener("squeezestart", I), r.removeEventListener("squeezeend", I), r.removeEventListener("end", ee), r.removeEventListener("inputsourceschange", te);
10943
10943
  for (let e = 0; e < T.length; e++) {
10944
10944
  let t = E[e];
10945
10945
  t !== null && (E[e] = null, T[e].disconnect(t));
10946
10946
  }
10947
- ee = null, P = null, b.reset();
10947
+ P = null, F = null, b.reset();
10948
10948
  for (let e in x) delete x[e];
10949
- e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, se.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
10949
+ e.setRenderTarget(C), _ = null, g = null, h = null, r = null, w = null, ae.stop(), n.isPresenting = !1, e.setPixelRatio(O), e.setSize(D.width, D.height, !1), n.dispatchEvent({ type: "sessionend" });
10950
10950
  }
10951
10951
  this.setFramebufferScaleFactor = function(e) {
10952
10952
  i = e, n.isPresenting === !0 && console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.");
@@ -10966,7 +10966,7 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
10966
10966
  return r;
10967
10967
  }, this.setSession = async function(m) {
10968
10968
  if (r = m, r !== null) {
10969
- if (C = e.getRenderTarget(), r.addEventListener("select", F), r.addEventListener("selectstart", F), r.addEventListener("selectend", F), r.addEventListener("squeeze", F), r.addEventListener("squeezestart", F), r.addEventListener("squeezeend", F), r.addEventListener("end", te), r.addEventListener("inputsourceschange", ne), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
10969
+ if (C = e.getRenderTarget(), r.addEventListener("select", I), r.addEventListener("selectstart", I), r.addEventListener("selectend", I), r.addEventListener("squeeze", I), r.addEventListener("squeezestart", I), r.addEventListener("squeezeend", I), r.addEventListener("end", ee), r.addEventListener("inputsourceschange", te), S.xrCompatible !== !0 && await t.makeXRCompatible(), O = e.getPixelRatio(), e.getSize(D), y && "createProjectionLayer" in XRWebGLBinding.prototype) {
10970
10970
  let n = null, a = null, c = null;
10971
10971
  S.depth && (c = S.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, n = S.stencil ? f : d, a = S.stencil ? 1020 : s);
10972
10972
  let l = {
@@ -11001,14 +11001,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11001
11001
  resolveStencilBuffer: _.ignoreDepthValues === !1
11002
11002
  });
11003
11003
  }
11004
- w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), se.setContext(r), se.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
11004
+ w.isXRRenderTarget = !0, this.setFoveation(l), p = null, a = await r.requestReferenceSpace(c), ae.setContext(r), ae.start(), n.isPresenting = !0, n.dispatchEvent({ type: "sessionstart" });
11005
11005
  }
11006
11006
  }, this.getEnvironmentBlendMode = function() {
11007
11007
  if (r !== null) return r.environmentBlendMode;
11008
11008
  }, this.getDepthTexture = function() {
11009
11009
  return b.getDepthTexture();
11010
11010
  };
11011
- function ne(e) {
11011
+ function te(e) {
11012
11012
  for (let t = 0; t < e.removed.length; t++) {
11013
11013
  let n = e.removed[t], r = E.indexOf(n);
11014
11014
  r >= 0 && (E[r] = null, T[r].disconnect(n));
@@ -11029,32 +11029,32 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11029
11029
  i && i.connect(n);
11030
11030
  }
11031
11031
  }
11032
- let I = new U(), re = new U();
11033
- function ie(e, t, n) {
11034
- I.setFromMatrixPosition(t.matrixWorld), re.setFromMatrixPosition(n.matrixWorld);
11035
- let r = I.distanceTo(re), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
11032
+ let L = new U(), ne = new U();
11033
+ function re(e, t, n) {
11034
+ L.setFromMatrixPosition(t.matrixWorld), ne.setFromMatrixPosition(n.matrixWorld);
11035
+ let r = L.distanceTo(ne), i = t.projectionMatrix.elements, a = n.projectionMatrix.elements, o = i[14] / (i[10] - 1), s = i[14] / (i[10] + 1), c = (i[9] + 1) / i[5], l = (i[9] - 1) / i[5], u = (i[8] - 1) / i[0], d = (a[8] + 1) / a[0], f = o * u, p = o * d, m = r / (-u + d), h = m * -u;
11036
11036
  if (t.matrixWorld.decompose(e.position, e.quaternion, e.scale), e.translateX(h), e.translateZ(m), e.matrixWorld.compose(e.position, e.quaternion, e.scale), e.matrixWorldInverse.copy(e.matrixWorld).invert(), i[10] === -1) e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse);
11037
11037
  else {
11038
11038
  let t = o + m, n = s + m, i = f - h, a = p + (r - h), u = c * s / n * t, d = l * s / n * t;
11039
11039
  e.projectionMatrix.makePerspective(i, a, u, d, t, n), e.projectionMatrixInverse.copy(e.projectionMatrix).invert();
11040
11040
  }
11041
11041
  }
11042
- function ae(e, t) {
11042
+ function R(e, t) {
11043
11043
  t === null ? e.matrixWorld.copy(e.matrix) : e.matrixWorld.multiplyMatrices(t.matrixWorld, e.matrix), e.matrixWorldInverse.copy(e.matrixWorld).invert();
11044
11044
  }
11045
11045
  this.updateCamera = function(e) {
11046
11046
  if (r === null) return;
11047
11047
  let t = e.near, n = e.far;
11048
- b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (ee !== N.near || P !== N.far) && (r.updateRenderState({
11048
+ b.texture !== null && (b.depthNear > 0 && (t = b.depthNear), b.depthFar > 0 && (n = b.depthFar)), N.near = j.near = A.near = t, N.far = j.far = A.far = n, (P !== N.near || F !== N.far) && (r.updateRenderState({
11049
11049
  depthNear: N.near,
11050
11050
  depthFar: N.far
11051
- }), ee = N.near, P = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
11051
+ }), P = N.near, F = N.far), N.layers.mask = e.layers.mask | 6, A.layers.mask = N.layers.mask & 3, j.layers.mask = N.layers.mask & 5;
11052
11052
  let i = e.parent, a = N.cameras;
11053
- ae(N, i);
11054
- for (let e = 0; e < a.length; e++) ae(a[e], i);
11055
- a.length === 2 ? ie(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), L(e, N, i);
11053
+ R(N, i);
11054
+ for (let e = 0; e < a.length; e++) R(a[e], i);
11055
+ a.length === 2 ? re(N, A, j) : N.projectionMatrix.copy(A.projectionMatrix), z(e, N, i);
11056
11056
  };
11057
- function L(e, t, n) {
11057
+ function z(e, t, n) {
11058
11058
  n === null ? e.matrix.copy(t.matrixWorld) : (e.matrix.copy(n.matrixWorld), e.matrix.invert(), e.matrix.multiply(t.matrixWorld)), e.matrix.decompose(e.position, e.quaternion, e.scale), e.updateMatrixWorld(!0), e.projectionMatrix.copy(t.projectionMatrix), e.projectionMatrixInverse.copy(t.projectionMatrixInverse), e.isPerspectiveCamera && (e.fov = k * 2 * Math.atan(1 / e.projectionMatrix.elements[5]), e.zoom = 1);
11059
11059
  }
11060
11060
  this.getCamera = function() {
@@ -11070,8 +11070,8 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11070
11070
  }, this.getCameraTexture = function(e) {
11071
11071
  return x[e];
11072
11072
  };
11073
- let R = null;
11074
- function oe(t, i) {
11073
+ let B = null;
11074
+ function ie(t, i) {
11075
11075
  if (m = i.getViewerPose(p || a), v = i, m !== null) {
11076
11076
  let t = m.views;
11077
11077
  _ !== null && (e.setRenderTargetFramebuffer(w, _.framebuffer), e.setRenderTarget(w));
@@ -11110,14 +11110,14 @@ var Uc = "\nvoid main() {\n\n gl_Position = vec4( position, 1.0 );\n\n}", Wc = "
11110
11110
  let t = E[e], n = T[e];
11111
11111
  t !== null && n !== void 0 && n.update(t, i, p || a);
11112
11112
  }
11113
- R && R(t, i), i.detectedPlanes && n.dispatchEvent({
11113
+ B && B(t, i), i.detectedPlanes && n.dispatchEvent({
11114
11114
  type: "planesdetected",
11115
11115
  data: i
11116
11116
  }), v = null;
11117
11117
  }
11118
- let se = new Ya();
11119
- se.setAnimationLoop(oe), this.setAnimationLoop = function(e) {
11120
- R = e;
11118
+ let ae = new Ya();
11119
+ ae.setAnimationLoop(ie), this.setAnimationLoop = function(e) {
11120
+ B = e;
11121
11121
  }, this.dispose = function() {};
11122
11122
  }
11123
11123
  }, qc = /*@__PURE__*/ new vt(), Jc = /*@__PURE__*/ new ct();
@@ -11280,7 +11280,7 @@ var Zc = class {
11280
11280
  }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = 0, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
11281
11281
  let T = this, E = !1;
11282
11282
  this._outputColorSpace = y;
11283
- let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), ee = null, P = new X(0), F = 0, te = t.width, ne = t.height, I = 1, re = null, ie = null, ae = new Ae(0, 0, te, ne), L = new Ae(0, 0, te, ne), R = !1, oe = new lr(), se = !1, ce = !1, le = new ct(), ue = new U(), z = new Ae(), B = {
11283
+ let D = 0, O = 0, k = null, A = -1, j = null, M = new Ae(), N = new Ae(), P = null, F = new X(0), I = 0, ee = t.width, te = t.height, L = 1, ne = null, re = null, R = new Ae(0, 0, ee, te), z = new Ae(0, 0, ee, te), B = !1, ie = new lr(), ae = !1, oe = !1, se = new ct(), ce = new U(), le = new Ae(), ue = {
11284
11284
  background: null,
11285
11285
  fog: null,
11286
11286
  environment: null,
@@ -11288,7 +11288,7 @@ var Zc = class {
11288
11288
  isScene: !0
11289
11289
  }, de = !1;
11290
11290
  function V() {
11291
- return k === null ? I : 1;
11291
+ return k === null ? L : 1;
11292
11292
  }
11293
11293
  let H = n;
11294
11294
  function fe(e, n) {
@@ -11329,39 +11329,39 @@ var Zc = class {
11329
11329
  let e = W.get("WEBGL_lose_context");
11330
11330
  e && e.restoreContext();
11331
11331
  }, this.getPixelRatio = function() {
11332
- return I;
11332
+ return L;
11333
11333
  }, this.setPixelRatio = function(e) {
11334
- e !== void 0 && (I = e, this.setSize(te, ne, !1));
11334
+ e !== void 0 && (L = e, this.setSize(ee, te, !1));
11335
11335
  }, this.getSize = function(e) {
11336
- return e.set(te, ne);
11336
+ return e.set(ee, te);
11337
11337
  }, this.setSize = function(e, n, r = !0) {
11338
11338
  if (Re.isPresenting) {
11339
11339
  console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");
11340
11340
  return;
11341
11341
  }
11342
- te = e, ne = n, t.width = Math.floor(e * I), t.height = Math.floor(n * I), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
11342
+ ee = e, te = n, t.width = Math.floor(e * L), t.height = Math.floor(n * L), r === !0 && (t.style.width = e + "px", t.style.height = n + "px"), this.setViewport(0, 0, e, n);
11343
11343
  }, this.getDrawingBufferSize = function(e) {
11344
- return e.set(te * I, ne * I).floor();
11344
+ return e.set(ee * L, te * L).floor();
11345
11345
  }, this.setDrawingBufferSize = function(e, n, r) {
11346
- te = e, ne = n, I = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
11346
+ ee = e, te = n, L = r, t.width = Math.floor(e * r), t.height = Math.floor(n * r), this.setViewport(0, 0, e, n);
11347
11347
  }, this.getCurrentViewport = function(e) {
11348
11348
  return e.copy(M);
11349
11349
  }, this.getViewport = function(e) {
11350
- return e.copy(ae);
11350
+ return e.copy(R);
11351
11351
  }, this.setViewport = function(e, t, n, r) {
11352
- e.isVector4 ? ae.set(e.x, e.y, e.z, e.w) : ae.set(e, t, n, r), K.viewport(M.copy(ae).multiplyScalar(I).round());
11352
+ e.isVector4 ? R.set(e.x, e.y, e.z, e.w) : R.set(e, t, n, r), K.viewport(M.copy(R).multiplyScalar(L).round());
11353
11353
  }, this.getScissor = function(e) {
11354
- return e.copy(L);
11354
+ return e.copy(z);
11355
11355
  }, this.setScissor = function(e, t, n, r) {
11356
- e.isVector4 ? L.set(e.x, e.y, e.z, e.w) : L.set(e, t, n, r), K.scissor(N.copy(L).multiplyScalar(I).round());
11356
+ e.isVector4 ? z.set(e.x, e.y, e.z, e.w) : z.set(e, t, n, r), K.scissor(N.copy(z).multiplyScalar(L).round());
11357
11357
  }, this.getScissorTest = function() {
11358
- return R;
11358
+ return B;
11359
11359
  }, this.setScissorTest = function(e) {
11360
- K.setScissorTest(R = e);
11360
+ K.setScissorTest(B = e);
11361
11361
  }, this.setOpaqueSort = function(e) {
11362
- re = e;
11362
+ ne = e;
11363
11363
  }, this.setTransparentSort = function(e) {
11364
- ie = e;
11364
+ re = e;
11365
11365
  }, this.getClearColor = function(e) {
11366
11366
  return e.copy(Oe.getClearColor());
11367
11367
  }, this.setClearColor = function() {
@@ -11418,7 +11418,7 @@ var Zc = class {
11418
11418
  }), e.isShaderMaterial && Se.releaseShaderCache(e));
11419
11419
  }
11420
11420
  this.renderBufferDirect = function(e, t, n, r, i, a) {
11421
- t === null && (t = B);
11421
+ t === null && (t = ue);
11422
11422
  let o = i.isMesh && i.matrixWorld.determinant() < 0, s = at(e, t, n, r, i);
11423
11423
  K.setMaterial(r, o);
11424
11424
  let c = n.index, l = 1;
@@ -11505,13 +11505,13 @@ var Zc = class {
11505
11505
  return;
11506
11506
  }
11507
11507
  if (E === !0) return;
11508
- if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x), le.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), oe.setFromProjectionMatrix(le, w, t.reversedDepth), ce = this.localClippingEnabled, se = Ee.init(this.clippingPlanes, ce), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
11508
+ if (e.matrixWorldAutoUpdate === !0 && e.updateMatrixWorld(), t.parent === null && t.matrixWorldAutoUpdate === !0 && t.updateMatrixWorld(), Re.enabled === !0 && Re.isPresenting === !0 && (Re.cameraAutoUpdate === !0 && Re.updateCamera(t), t = Re.getCamera()), e.isScene === !0 && e.onBeforeRender(T, e, t, k), x = Te.get(e, C.length), x.init(t), C.push(x), se.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse), ie.setFromProjectionMatrix(se, w, t.reversedDepth), oe = this.localClippingEnabled, ae = Ee.init(this.clippingPlanes, oe), v = we.get(e, S.length), v.init(), S.push(v), Re.enabled === !0 && Re.isPresenting === !0) {
11509
11509
  let e = T.xr.getDepthSensingMesh();
11510
11510
  e !== null && Ze(e, t, -Infinity, T.sortObjects);
11511
11511
  }
11512
- Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(re, ie), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, se === !0 && Ee.beginShadows();
11512
+ Ze(e, t, 0, T.sortObjects), v.finish(), T.sortObjects === !0 && v.sort(ne, re), de = Re.enabled === !1 || Re.isPresenting === !1 || Re.hasDepthSensing() === !1, de && Oe.addToRenderList(v, e), this.info.render.frame++, ae === !0 && Ee.beginShadows();
11513
11513
  let n = x.state.shadowsArray;
11514
- De.render(n, e, t), se === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
11514
+ De.render(n, e, t), ae === !0 && Ee.endShadows(), this.info.autoReset === !0 && this.info.reset();
11515
11515
  let r = v.opaque, i = v.transmissive;
11516
11516
  if (x.setupLights(), t.isArrayCamera) {
11517
11517
  let n = t.cameras;
@@ -11525,7 +11525,7 @@ var Zc = class {
11525
11525
  Qe(v, e, r, r.viewport);
11526
11526
  }
11527
11527
  } else i.length > 0 && $e(r, i, e, t), de && Oe.render(e), Qe(v, e, t);
11528
- k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], se === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
11528
+ k !== null && O === 0 && (J.updateMultisampleRenderTarget(k), J.updateRenderTargetMipmap(k)), e.isScene === !0 && e.onAfterRender(T, e, t), Fe.resetDefaultState(), A = -1, j = null, C.pop(), C.length > 0 ? (x = C[C.length - 1], ae === !0 && Ee.setGlobalState(T.clippingPlanes, x.state.camera)) : x = null, S.pop(), v = S.length > 0 ? S[S.length - 1] : null;
11529
11529
  };
11530
11530
  function Ze(e, t, n, r) {
11531
11531
  if (e.visible === !1) return;
@@ -11534,20 +11534,20 @@ var Zc = class {
11534
11534
  else if (e.isLOD) e.autoUpdate === !0 && e.update(t);
11535
11535
  else if (e.isLight) x.pushLight(e), e.castShadow && x.pushShadow(e);
11536
11536
  else if (e.isSprite) {
11537
- if (!e.frustumCulled || oe.intersectsSprite(e)) {
11538
- r && z.setFromMatrixPosition(e.matrixWorld).applyMatrix4(le);
11537
+ if (!e.frustumCulled || ie.intersectsSprite(e)) {
11538
+ r && le.setFromMatrixPosition(e.matrixWorld).applyMatrix4(se);
11539
11539
  let t = xe.update(e), i = e.material;
11540
- i.visible && v.push(e, t, i, n, z.z, null);
11540
+ i.visible && v.push(e, t, i, n, le.z, null);
11541
11541
  }
11542
- } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || oe.intersectsObject(e))) {
11542
+ } else if ((e.isMesh || e.isLine || e.isPoints) && (!e.frustumCulled || ie.intersectsObject(e))) {
11543
11543
  let t = xe.update(e), i = e.material;
11544
- if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), z.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), z.copy(e.boundingSphere.center)), z.applyMatrix4(e.matrixWorld).applyMatrix4(le)), Array.isArray(i)) {
11544
+ if (r && (e.boundingSphere === void 0 ? (t.boundingSphere === null && t.computeBoundingSphere(), le.copy(t.boundingSphere.center)) : (e.boundingSphere === null && e.computeBoundingSphere(), le.copy(e.boundingSphere.center)), le.applyMatrix4(e.matrixWorld).applyMatrix4(se)), Array.isArray(i)) {
11545
11545
  let r = t.groups;
11546
11546
  for (let a = 0, o = r.length; a < o; a++) {
11547
11547
  let o = r[a], s = i[o.materialIndex];
11548
- s && s.visible && v.push(e, t, s, n, z.z, o);
11548
+ s && s.visible && v.push(e, t, s, n, le.z, o);
11549
11549
  }
11550
- } else i.visible && v.push(e, t, i, n, z.z, null);
11550
+ } else i.visible && v.push(e, t, i, n, le.z, null);
11551
11551
  }
11552
11552
  }
11553
11553
  let i = e.children;
@@ -11555,7 +11555,7 @@ var Zc = class {
11555
11555
  }
11556
11556
  function Qe(e, t, n, r) {
11557
11557
  let i = e.opaque, a = e.transmissive, o = e.transparent;
11558
- x.setupLightsView(n), se === !0 && Ee.setGlobalState(T.clippingPlanes, n), r && K.viewport(M.copy(r)), i.length > 0 && et(i, t, n), a.length > 0 && et(a, t, n), o.length > 0 && et(o, t, n), K.buffers.depth.setTest(!0), K.buffers.depth.setMask(!0), K.buffers.color.setMask(!0), K.setPolygonOffset(!1);
11558
+ x.setupLightsView(n), ae === !0 && Ee.setGlobalState(T.clippingPlanes, n), r && K.viewport(M.copy(r)), i.length > 0 && et(i, t, n), a.length > 0 && et(a, t, n), o.length > 0 && et(o, t, n), K.buffers.depth.setTest(!0), K.buffers.depth.setMask(!0), K.buffers.color.setMask(!0), K.setPolygonOffset(!1);
11559
11559
  }
11560
11560
  function $e(e, t, n, r) {
11561
11561
  if ((n.isScene === !0 ? n.overrideMaterial : null) !== null) return;
@@ -11572,11 +11572,11 @@ var Zc = class {
11572
11572
  let s = x.state.transmissionRenderTarget[r.id], c = r.viewport || M;
11573
11573
  s.setSize(c.z * T.transmissionResolutionScale, c.w * T.transmissionResolutionScale);
11574
11574
  let u = T.getRenderTarget(), d = T.getActiveCubeFace(), f = T.getActiveMipmapLevel();
11575
- T.setRenderTarget(s), T.getClearColor(P), F = T.getClearAlpha(), F < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
11575
+ T.setRenderTarget(s), T.getClearColor(F), I = T.getClearAlpha(), I < 1 && T.setClearColor(16777215, .5), T.clear(), de && Oe.render(n);
11576
11576
  let p = T.toneMapping;
11577
11577
  T.toneMapping = 0;
11578
11578
  let m = r.viewport;
11579
- if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), se === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
11579
+ if (r.viewport !== void 0 && (r.viewport = void 0), x.setupLightsView(r), ae === !0 && Ee.setGlobalState(T.clippingPlanes, r), et(e, n, r), J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s), W.has("WEBGL_multisampled_render_to_texture") === !1) {
11580
11580
  let e = !1;
11581
11581
  for (let i = 0, a = t.length; i < a; i++) {
11582
11582
  let a = t[i], o = a.object, s = a.geometry, c = a.material, l = a.group;
@@ -11587,7 +11587,7 @@ var Zc = class {
11587
11587
  }
11588
11588
  e === !0 && (J.updateMultisampleRenderTarget(s), J.updateRenderTargetMipmap(s));
11589
11589
  }
11590
- T.setRenderTarget(u, d, f), T.setClearColor(P, F), m !== void 0 && (r.viewport = m), T.toneMapping = p;
11590
+ T.setRenderTarget(u, d, f), T.setClearColor(F, I), m !== void 0 && (r.viewport = m), T.toneMapping = p;
11591
11591
  }
11592
11592
  function et(e, t, n) {
11593
11593
  let r = t.isScene === !0 ? t.overrideMaterial : null;
@@ -11600,7 +11600,7 @@ var Zc = class {
11600
11600
  e.onBeforeRender(T, t, n, r, i, a), e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse, e.matrixWorld), e.normalMatrix.getNormalMatrix(e.modelViewMatrix), i.onBeforeRender(T, t, n, r, e, a), i.transparent === !0 && i.side === 2 && i.forceSinglePass === !1 ? (i.side = 1, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 0, i.needsUpdate = !0, T.renderBufferDirect(n, t, r, i, e, a), i.side = 2) : T.renderBufferDirect(n, t, r, i, e, a), e.onAfterRender(T, t, n, r, i, a);
11601
11601
  }
11602
11602
  function nt(e, t, n) {
11603
- t.isScene !== !0 && (t = B);
11603
+ t.isScene !== !0 && (t = ue);
11604
11604
  let r = q.get(e), i = x.state.lights, a = x.state.shadowsArray, o = i.state.version, s = Se.getParameters(e, i.state, a, t, n), c = Se.getProgramCacheKey(s), l = r.programs;
11605
11605
  r.environment = e.isMeshStandardMaterial ? t.environment : null, r.fog = t.fog, r.envMap = (e.isMeshStandardMaterial ? ve : _e).get(e.envMap || r.environment), r.envMapRotation = r.environment !== null && e.envMap === null ? t.environmentRotation : e.envMapRotation, l === void 0 && (e.addEventListener("dispose", He), l = /* @__PURE__ */ new Map(), r.programs = l);
11606
11606
  let u = l.get(c);
@@ -11622,11 +11622,11 @@ var Zc = class {
11622
11622
  n.outputColorSpace = t.outputColorSpace, n.batching = t.batching, n.batchingColor = t.batchingColor, n.instancing = t.instancing, n.instancingColor = t.instancingColor, n.instancingMorph = t.instancingMorph, n.skinning = t.skinning, n.morphTargets = t.morphTargets, n.morphNormals = t.morphNormals, n.morphColors = t.morphColors, n.morphTargetsCount = t.morphTargetsCount, n.numClippingPlanes = t.numClippingPlanes, n.numIntersection = t.numClipIntersection, n.vertexAlphas = t.vertexAlphas, n.vertexTangents = t.vertexTangents, n.toneMapping = t.toneMapping;
11623
11623
  }
11624
11624
  function at(e, t, n, r, i) {
11625
- t.isScene !== !0 && (t = B), J.resetTextureUnits();
11625
+ t.isScene !== !0 && (t = ue), J.resetTextureUnits();
11626
11626
  let a = t.fog, o = r.isMeshStandardMaterial ? t.environment : null, s = k === null ? T.outputColorSpace : k.isXRRenderTarget === !0 ? k.texture.colorSpace : b, c = (r.isMeshStandardMaterial ? ve : _e).get(r.envMap || o), l = r.vertexColors === !0 && !!n.attributes.color && n.attributes.color.itemSize === 4, u = !!n.attributes.tangent && (!!r.normalMap || r.anisotropy > 0), d = !!n.morphAttributes.position, f = !!n.morphAttributes.normal, p = !!n.morphAttributes.color, m = 0;
11627
11627
  r.toneMapped && (k === null || k.isXRRenderTarget === !0) && (m = T.toneMapping);
11628
11628
  let h = n.morphAttributes.position || n.morphAttributes.normal || n.morphAttributes.color, g = h === void 0 ? 0 : h.length, _ = q.get(r), v = x.state.lights;
11629
- if (se === !0 && (ce === !0 || e !== j)) {
11629
+ if (ae === !0 && (oe === !0 || e !== j)) {
11630
11630
  let t = e === j && r.id === A;
11631
11631
  Ee.setState(r, e, t);
11632
11632
  }
@@ -11638,7 +11638,7 @@ var Zc = class {
11638
11638
  if (K.useProgram(S.program) && (C = !0, w = !0, E = !0), r.id !== A && (A = r.id, w = !0), C || j !== e) {
11639
11639
  K.buffers.depth.getReversed() && e.reversedDepth !== !0 && (e._reversedDepth = !0, e.updateProjectionMatrix()), D.setValue(H, "projectionMatrix", e.projectionMatrix), D.setValue(H, "viewMatrix", e.matrixWorldInverse);
11640
11640
  let t = D.map.cameraPosition;
11641
- t !== void 0 && t.setValue(H, ue.setFromMatrixPosition(e.matrixWorld)), G.logarithmicDepthBuffer && D.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && D.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), j !== e && (j = e, w = !0, E = !0);
11641
+ t !== void 0 && t.setValue(H, ce.setFromMatrixPosition(e.matrixWorld)), G.logarithmicDepthBuffer && D.setValue(H, "logDepthBufFC", 2 / (Math.log(e.far + 1) / Math.LN2)), (r.isMeshPhongMaterial || r.isMeshToonMaterial || r.isMeshLambertMaterial || r.isMeshBasicMaterial || r.isMeshStandardMaterial || r.isShaderMaterial) && D.setValue(H, "isOrthographic", e.isOrthographicCamera === !0), j !== e && (j = e, w = !0, E = !0);
11642
11642
  }
11643
11643
  if (i.isSkinnedMesh) {
11644
11644
  D.setOptional(H, i, "bindMatrix"), D.setOptional(H, i, "bindMatrixInverse");
@@ -11647,7 +11647,7 @@ var Zc = class {
11647
11647
  }
11648
11648
  i.isBatchedMesh && (D.setOptional(H, i, "batchingTexture"), D.setValue(H, "batchingTexture", i._matricesTexture, J), D.setOptional(H, i, "batchingIdTexture"), D.setValue(H, "batchingIdTexture", i._indirectTexture, J), D.setOptional(H, i, "batchingColorTexture"), i._colorsTexture !== null && D.setValue(H, "batchingColorTexture", i._colorsTexture, J));
11649
11649
  let M = n.morphAttributes;
11650
- if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, I, ne, x.state.transmissionRenderTarget[e.id]), Hs.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Hs.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
11650
+ if ((M.position !== void 0 || M.normal !== void 0 || M.color !== void 0) && ke.update(i, n, S), (w || _.receiveShadow !== i.receiveShadow) && (_.receiveShadow = i.receiveShadow, D.setValue(H, "receiveShadow", i.receiveShadow)), r.isMeshGouraudMaterial && r.envMap !== null && (O.envMap.value = c, O.flipEnvMap.value = c.isCubeTexture && c.isRenderTargetTexture === !1 ? -1 : 1), r.isMeshStandardMaterial && r.envMap === null && t.environment !== null && (O.envMapIntensity.value = t.environmentIntensity), w && (D.setValue(H, "toneMappingExposure", T.toneMappingExposure), _.needsLights && ot(O, E), a && r.fog === !0 && Ce.refreshFogUniforms(O, a), Ce.refreshMaterialUniforms(O, r, L, te, x.state.transmissionRenderTarget[e.id]), Hs.upload(H, rt(_), O, J)), r.isShaderMaterial && r.uniformsNeedUpdate === !0 && (Hs.upload(H, rt(_), O, J), r.uniformsNeedUpdate = !1), r.isSpriteMaterial && D.setValue(H, "center", i.center), D.setValue(H, "modelViewMatrix", i.modelViewMatrix), D.setValue(H, "normalMatrix", i.normalMatrix), D.setValue(H, "modelMatrix", i.matrixWorld), r.isShaderMaterial || r.isRawShaderMaterial) {
11651
11651
  let e = r.uniformsGroups;
11652
11652
  for (let t = 0, n = e.length; t < n; t++) {
11653
11653
  let n = e[t];
@@ -11694,9 +11694,9 @@ var Zc = class {
11694
11694
  let c = e.texture;
11695
11695
  (c.isData3DTexture || c.isDataArrayTexture || c.isCompressedArrayTexture) && (o = !0);
11696
11696
  let l = q.get(e).__webglFramebuffer;
11697
- e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), ee = e.scissorTest;
11698
- } else M.copy(ae).multiplyScalar(I).floor(), N.copy(L).multiplyScalar(I).floor(), ee = R;
11699
- if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(ee), a) {
11697
+ e.isWebGLCubeRenderTarget ? (i = Array.isArray(l[t]) ? l[t][n] : l[t], a = !0) : i = e.samples > 0 && J.useMultisampledRTT(e) === !1 ? q.get(e).__webglMultisampledFramebuffer : Array.isArray(l) ? l[n] : l, M.copy(e.viewport), N.copy(e.scissor), P = e.scissorTest;
11698
+ } else M.copy(R).multiplyScalar(L).floor(), N.copy(z).multiplyScalar(L).floor(), P = B;
11699
+ if (n !== 0 && (i = lt), K.bindFramebuffer(H.FRAMEBUFFER, i) && r && K.drawBuffers(e, i), K.viewport(M), K.scissor(N), K.setScissorTest(P), a) {
11700
11700
  let r = q.get(e.texture);
11701
11701
  H.framebufferTexture2D(H.FRAMEBUFFER, H.COLOR_ATTACHMENT0, H.TEXTURE_CUBE_MAP_POSITIVE_X + t, r.__webglTexture, n);
11702
11702
  } else if (o) {
@@ -11884,7 +11884,17 @@ function ll(e = {}) {
11884
11884
  opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
11885
11885
  };
11886
11886
  }
11887
- function ul(e, t) {
11887
+ function ul(e) {
11888
+ return [
11889
+ "preserve",
11890
+ "center",
11891
+ "fit"
11892
+ ].includes(e) ? e : "preserve";
11893
+ }
11894
+ function dl(e) {
11895
+ return e === "model" ? "model" : "camera";
11896
+ }
11897
+ function fl(e, t) {
11888
11898
  e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
11889
11899
  }
11890
11900
  il({
@@ -11934,7 +11944,7 @@ il({
11934
11944
  } } : {}
11935
11945
  }))
11936
11946
  });
11937
- var dl = {
11947
+ var pl = {
11938
11948
  background: {
11939
11949
  color: "#0a111a",
11940
11950
  glow: "#1c2b39",
@@ -11979,17 +11989,17 @@ var dl = {
11979
11989
  hint: !0
11980
11990
  }
11981
11991
  };
11982
- function fl(e, t) {
11992
+ function ml(e, t) {
11983
11993
  let n = { ...e };
11984
11994
  if (!t || typeof t != "object") return n;
11985
- for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? fl(e?.[r] || {}, i) : i;
11995
+ for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? ml(e?.[r] || {}, i) : i;
11986
11996
  return n;
11987
11997
  }
11988
- function pl(e) {
11998
+ function hl(e) {
11989
11999
  let t = e && typeof e == "object" ? { ...e } : {};
11990
- return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), fl(dl, t);
12000
+ return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), ml(pl, t);
11991
12001
  }
11992
- function ml(e) {
12002
+ function gl(e) {
11993
12003
  if (!e || typeof e != "object") return "directed";
11994
12004
  let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
11995
12005
  return e.bidirectional === !0 || [
@@ -12004,7 +12014,7 @@ function ml(e) {
12004
12014
  "failed"
12005
12015
  ].includes(t) ? "broken" : "directed";
12006
12016
  }
12007
- var hl = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), gl = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", _l = [
12017
+ var _l = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), vl = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", yl = [
12008
12018
  ".viewport>.atlas-print-snapshot{display:none!important}",
12009
12019
  "@media print{",
12010
12020
  ":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
@@ -12013,17 +12023,17 @@ var hl = [":host{display:block;position:relative;height:var(--lc-height,680px);m
12013
12023
  ":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
12014
12024
  ":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
12015
12025
  "}"
12016
- ].join(""), vl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, yl = {
12017
- minus: vl("<path d=\"M6 12h12\"/>"),
12018
- plus: vl("<path d=\"M12 6v12M6 12h12\"/>"),
12019
- fit: vl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12020
- front: vl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12021
- view: vl("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12022
- relations: vl("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
12023
- focus: vl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12024
- chevron: vl("<path d=\"m8 10 4 4 4-4\"/>")
12025
- }, bl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, xl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${yl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Sl = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${yl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${yl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${yl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${yl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${xl("view", yl.view, "Vista", "Vista", bl("labels", "Etiquetas", !0) + bl("panel", "Información", !0) + "<div class=\"toolbar-option-separator\"></div>" + bl("open-all", "Abrir todos") + bl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${xl("relations", yl.relations, "Relaciones", "Selección", bl("relations-all", "Todas") + bl("relations-selected", "Selección", !0) + bl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${xl("focus", yl.focus, "Foco", "Todo", bl("focus-all", "Todo", !0) + bl("focus-dim", "Conectados") + bl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + bl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
12026
- function Cl(e) {
12026
+ ].join(""), bl = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, xl = {
12027
+ minus: bl("<path d=\"M6 12h12\"/>"),
12028
+ plus: bl("<path d=\"M12 6v12M6 12h12\"/>"),
12029
+ fit: bl("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12030
+ front: bl("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
12031
+ view: bl("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
12032
+ relations: bl("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
12033
+ focus: bl("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
12034
+ chevron: bl("<path d=\"m8 10 4 4 4-4\"/>")
12035
+ }, Sl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, Cl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${xl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, wl = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${xl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${xl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${xl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${xl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Cl("view", xl.view, "Vista", "Vista", Sl("labels", "Etiquetas", !0) + Sl("panel", "Información", !0) + Sl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + Sl("open-all", "Abrir todos") + Sl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Cl("relations", xl.relations, "Relaciones", "Selección", Sl("relations-all", "Todas") + Sl("relations-selected", "Selección", !0) + Sl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Cl("focus", xl.focus, "Foco", "Todo", Sl("focus-all", "Todo", !0) + Sl("focus-dim", "Conectados") + Sl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + Sl("focus-selection", "Enfocar selección") + Sl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: botón derecho / ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic · Enfoca: doble clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
12036
+ function Tl(e) {
12027
12037
  return String(e ?? "").replace(/[&<>"']/g, (e) => ({
12028
12038
  "&": "&amp;",
12029
12039
  "<": "&lt;",
@@ -12032,17 +12042,17 @@ function Cl(e) {
12032
12042
  "'": "&#39;"
12033
12043
  })[e]);
12034
12044
  }
12035
- function wl(e) {
12045
+ function El(e) {
12036
12046
  let t = String(e ?? "").trim();
12037
12047
  if (!t) return "";
12038
12048
  try {
12039
12049
  let e = new URL(t, globalThis.location?.href);
12040
- return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Cl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12050
+ return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Tl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
12041
12051
  } catch {
12042
12052
  return "";
12043
12053
  }
12044
12054
  }
12045
- function Tl(e) {
12055
+ function Dl(e) {
12046
12056
  let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
12047
12057
  ...e,
12048
12058
  p: Array.isArray(e.p) ? e.p : [
@@ -12059,14 +12069,14 @@ function Tl(e) {
12059
12069
  from: e[0],
12060
12070
  to: e[1],
12061
12071
  label: e[2] || "",
12062
- mode: ml({ mode: e[3] }),
12072
+ mode: gl({ mode: e[3] }),
12063
12073
  index: t
12064
12074
  } : {
12065
12075
  ...e,
12066
12076
  from: e.from,
12067
12077
  to: e.to,
12068
12078
  label: e.label || "",
12069
- mode: ml(e),
12079
+ mode: gl(e),
12070
12080
  index: t
12071
12081
  }) : [];
12072
12082
  return {
@@ -12075,12 +12085,12 @@ function Tl(e) {
12075
12085
  ...Qc,
12076
12086
  ...t.palette || {}
12077
12087
  },
12078
- theme: pl(t.theme || t.styles),
12088
+ theme: hl(t.theme || t.styles),
12079
12089
  entities: n,
12080
12090
  relations: r
12081
12091
  };
12082
12092
  }
12083
- function El(e, t, n = [
12093
+ function Ol(e, t, n = [
12084
12094
  1,
12085
12095
  1,
12086
12096
  1
@@ -12099,7 +12109,7 @@ function El(e, t, n = [
12099
12109
  });
12100
12110
  return s.center(), s;
12101
12111
  }
12102
- function Dl(e, t, n) {
12112
+ function kl(e, t, n) {
12103
12113
  let r = new ui();
12104
12114
  for (let t = 0; t < e; t++) {
12105
12115
  let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
@@ -12116,7 +12126,7 @@ function Dl(e, t, n) {
12116
12126
  });
12117
12127
  return i.rotateX(Math.PI / 2), i.center(), i;
12118
12128
  }
12119
- function Ol(e, t, n, r) {
12129
+ function Al(e, t, n, r) {
12120
12130
  let i = Math.min(.22, Math.max(0, Number(n) || 0));
12121
12131
  if (!i) return new Er(t, e, 1, 32);
12122
12132
  let a = [new V(0, -.5)];
@@ -12133,7 +12143,7 @@ function Ol(e, t, n, r) {
12133
12143
  }
12134
12144
  return a.push(new V(0, .5)), new Qi(a, 32);
12135
12145
  }
12136
- function kl(e, t) {
12146
+ function jl(e, t) {
12137
12147
  if (!t) return e;
12138
12148
  let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
12139
12149
  for (let e = 0; e < r.count; e++) {
@@ -12142,36 +12152,36 @@ function kl(e, t) {
12142
12152
  }
12143
12153
  return r.needsUpdate = !0, e.computeVertexNormals(), e;
12144
12154
  }
12145
- function Al(e, t = 0, n = 4, r = [
12155
+ function Ml(e, t = 0, n = 4, r = [
12146
12156
  1,
12147
12157
  1,
12148
12158
  1
12149
12159
  ]) {
12150
12160
  let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
12151
12161
  switch (e) {
12152
- case "cylinder": return i ? Ol(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12153
- case "cone": return i ? Ol(0, .5, i, a) : new Dr(.5, 1, 32);
12162
+ case "cylinder": return i ? Al(.5, .5, i, a) : new Er(.5, .5, 1, 32);
12163
+ case "cone": return i ? Al(0, .5, i, a) : new Dr(.5, 1, 32);
12154
12164
  case "frustum-cone":
12155
- case "truncated-cone": return i ? Ol(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12165
+ case "truncated-cone": return i ? Al(.28, .5, i, a) : new Er(.28, .5, 1, 32);
12156
12166
  case "frustum-pyramid":
12157
12167
  case "truncated-pyramid": return new Er(.28, .5, 1, 4);
12158
12168
  case "frustum-triangle": return new Er(.28, .5, 1, 3);
12159
- case "prism": return i ? Dl(6, i, a) : new Er(.5, .5, 1, 6);
12160
- case "pyramid-square": return i ? kl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12161
- case "pyramid-triangle": return i ? kl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12169
+ case "prism": return i ? kl(6, i, a) : new Er(.5, .5, 1, 6);
12170
+ case "pyramid-square": return i ? jl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
12171
+ case "pyramid-triangle": return i ? jl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
12162
12172
  case "sphere": return new ta(.5, 24, 16);
12163
- case "octahedron": return kl(new $i(.5), i);
12164
- case "dodecahedron": return kl(new kr(.5), i);
12165
- case "icosahedron": return kl(new Zi(.5), i);
12166
- default: return i ? El(i, a, r) : new Nn(1, 1, 1);
12173
+ case "octahedron": return jl(new $i(.5), i);
12174
+ case "dodecahedron": return jl(new kr(.5), i);
12175
+ case "icosahedron": return jl(new Zi(.5), i);
12176
+ default: return i ? Ol(i, a, r) : new Nn(1, 1, 1);
12167
12177
  }
12168
12178
  }
12169
- function jl(e) {
12179
+ function Nl(e) {
12170
12180
  e.computeBoundingBox();
12171
12181
  let t = e.boundingBox?.getSize(new U());
12172
12182
  return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
12173
12183
  }
12174
- function Ml(e, t) {
12184
+ function Pl(e, t) {
12175
12185
  let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
12176
12186
  for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
12177
12187
  return {
@@ -12179,10 +12189,10 @@ function Ml(e, t) {
12179
12189
  ...n && typeof n == "object" ? n : {}
12180
12190
  };
12181
12191
  }
12182
- function Nl(e, t, n) {
12192
+ function Fl(e, t, n) {
12183
12193
  return typeof e != "string" || !e ? n : t[e] || e;
12184
12194
  }
12185
- function Pl(e, t = "#ffffff", n = "transparent") {
12195
+ function Il(e, t = "#ffffff", n = "transparent") {
12186
12196
  let r = document.createElement("canvas");
12187
12197
  r.width = 256, r.height = 256;
12188
12198
  let i = r.getContext("2d");
@@ -12190,11 +12200,11 @@ function Pl(e, t = "#ffffff", n = "transparent") {
12190
12200
  let a = new Cr(r);
12191
12201
  return a.colorSpace = y, a;
12192
12202
  }
12193
- function Fl(e) {
12194
- return e.shape === "plane" ? new ea(1, 1) : Al(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12203
+ function Ll(e) {
12204
+ return e.shape === "plane" ? new ea(1, 1) : Ml(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
12195
12205
  }
12196
- function Il(e, t, n, r, i) {
12197
- let a = Ml(t, e), o = {
12206
+ function Rl(e, t, n, r, i) {
12207
+ let a = Pl(t, e), o = {
12198
12208
  ...n,
12199
12209
  ...e.palette || {},
12200
12210
  ...t.geometryPalette || t.geometry_palette || {}
@@ -12208,9 +12218,9 @@ function Il(e, t, n, r, i) {
12208
12218
  if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
12209
12219
  let l = new Qn(), u = [], d = [];
12210
12220
  for (let a of c) {
12211
- let s = Fl(a);
12212
- jl(s);
12213
- let c = a.color || "component", f = Nl(c, o, n.component || Qc.component), p = new ia({
12221
+ let s = Ll(a);
12222
+ Nl(s);
12223
+ let c = a.color || "component", f = Fl(c, o, n.component || Qc.component), p = new ia({
12214
12224
  color: f,
12215
12225
  roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
12216
12226
  metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
@@ -12281,7 +12291,7 @@ function Il(e, t, n, r, i) {
12281
12291
  n.src = g;
12282
12292
  }
12283
12293
  })(), p.map.colorSpace = y, p.needsUpdate = !0;
12284
- } else h != null && h !== "" && (p.map = Pl(h, Nl(a.iconColor || "#ffffff", o, "#ffffff"), Nl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
12294
+ } else h != null && h !== "" && (p.map = Il(h, Fl(a.iconColor || "#ffffff", o, "#ffffff"), Fl(a.iconBackground || "transparent", o, "transparent")), p.transparent = !0, p.needsUpdate = !0);
12285
12295
  if (m = new An(s, p), m.position.fromArray(Array.isArray(a.position) ? a.position : [
12286
12296
  0,
12287
12297
  0,
@@ -12317,7 +12327,7 @@ function Il(e, t, n, r, i) {
12317
12327
  descriptor: s
12318
12328
  };
12319
12329
  }
12320
- function Ll(e, t, n, r = "", i = !0) {
12330
+ function zl(e, t, n, r = "", i = !0) {
12321
12331
  let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
12322
12332
  a.width = Math.ceil(s * 320), a.height = Math.ceil(c * 320), o.imageSmoothingEnabled = !0, o.imageSmoothingQuality = "high", o.clearRect(0, 0, a.width, a.height);
12323
12333
  let l = a.height * .62;
@@ -12362,7 +12372,7 @@ function Ll(e, t, n, r = "", i = !0) {
12362
12372
  ]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
12363
12373
  return x.renderOrder = 20, x.frustumCulled = !1, x.userData.front = S, x.userData.back = C, x.userData.top = w, x.userData.height = c, x.userData.width = s, x.userData.textOffsetX = h, x.userData.textOffsetY = g, x.userData.nodeLabel = !0, x;
12364
12374
  }
12365
- function Rl(e, t, n, r = globalThis.document) {
12375
+ function Bl(e, t, n, r = globalThis.document) {
12366
12376
  if (!e || !t || !n || !r?.createElement) return null;
12367
12377
  try {
12368
12378
  e.render(t, n);
@@ -12384,12 +12394,14 @@ function Rl(e, t, n, r = globalThis.document) {
12384
12394
  return null;
12385
12395
  }
12386
12396
  }
12387
- var zl = class extends HTMLElement {
12397
+ var Vl = class extends HTMLElement {
12388
12398
  static get observedAttributes() {
12389
12399
  return [
12390
12400
  "height",
12391
12401
  "relation-mode",
12392
12402
  "selection-mode",
12403
+ "selection-navigation",
12404
+ "item-facing",
12393
12405
  "shell-labels",
12394
12406
  "toolbar",
12395
12407
  "panel",
@@ -12408,13 +12420,13 @@ var zl = class extends HTMLElement {
12408
12420
  return ol();
12409
12421
  }
12410
12422
  constructor() {
12411
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + hl + gl + _l + "</style>" + Sl, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this.theme = pl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = ll({
12423
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + _l + vl + yl + "</style>" + wl, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this._theme = hl(), this.relationMode = this.getAttribute("relation-mode") || "selected", this.focusFilter = ll({
12412
12424
  mode: this.getAttribute("focus-mode"),
12413
12425
  effect: this.getAttribute("focus-effect"),
12414
12426
  layout: this.getAttribute("focus-layout")
12415
- }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
12427
+ }), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = ul(this.getAttribute("selection-navigation")), this.itemFacing = dl(this.getAttribute("item-facing")), this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
12416
12428
  this.ready && this.modelData && this._build();
12417
- }, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
12429
+ }, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
12418
12430
  }
12419
12431
  connectedCallback() {
12420
12432
  globalThis.addEventListener?.("lc-geometry-registry-change", this._geometryRegistryListener), globalThis.addEventListener?.("beforeprint", this._beforePrintListener), globalThis.addEventListener?.("afterprint", this._afterPrintListener), typeof this._printMedia?.addEventListener == "function" ? this._printMedia.addEventListener("change", this._printMediaListener) : this._printMedia?.addListener?.(this._printMediaListener), this.resizeObserver.observe(this.canvas), this.hasAttribute("height") && this.style.setProperty("--lc-height", this.getAttribute("height")), this._loadInitial();
@@ -12424,7 +12436,7 @@ var zl = class extends HTMLElement {
12424
12436
  }
12425
12437
  attributeChangedCallback(e, t, n) {
12426
12438
  if (t !== n) {
12427
- if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
12439
+ if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && dl(n) !== this.itemFacing && this.setItemFacing(n, { source: "attribute" }), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
12428
12440
  let e = n !== "false";
12429
12441
  e !== this.showShellLabels && (this.showShellLabels = e, this._build({
12430
12442
  preserveSelection: this.selected?.id,
@@ -12467,7 +12479,7 @@ var zl = class extends HTMLElement {
12467
12479
  this.setPalette(e);
12468
12480
  }
12469
12481
  captureFrame() {
12470
- return Rl(this.renderer, this.scene, this.camera, this.ownerDocument);
12482
+ return Bl(this.renderer, this.scene, this.camera, this.ownerDocument);
12471
12483
  }
12472
12484
  prepareForPrint() {
12473
12485
  if (this._printState) return this;
@@ -12614,8 +12626,10 @@ var zl = class extends HTMLElement {
12614
12626
  let e = this.focusFilter.layout === "reflow";
12615
12627
  t.classList.toggle("active", e), t.setAttribute("aria-pressed", String(e)), t.disabled = this.focusFilter.mode === "all";
12616
12628
  }
12617
- let n = this.shadowRoot.querySelector("[data-toolbar-status=\"focus\"]");
12618
- n && (n.textContent = e === "all" ? "Todo" : e === "dim" ? "Conectados" : "Aislar");
12629
+ let n = this.shadowRoot.querySelector("[data-action=\"focus-selection\"]");
12630
+ n && (n.disabled = !this.selected && this.selectedRelationIndex === null);
12631
+ let r = this.shadowRoot.querySelector("[data-toolbar-status=\"focus\"]");
12632
+ r && (r.textContent = e === "all" ? "Todo" : e === "dim" ? "Conectados" : "Aislar");
12619
12633
  }
12620
12634
  _syncRelationToolbar() {
12621
12635
  for (let e of [
@@ -12641,6 +12655,12 @@ var zl = class extends HTMLElement {
12641
12655
  let e = this.shadowRoot?.querySelector("[data-action=\"labels\"]");
12642
12656
  e && (e.classList.toggle("active", this.showShellLabels), e.setAttribute("aria-pressed", String(this.showShellLabels)));
12643
12657
  }
12658
+ _syncItemFacingToolbar() {
12659
+ let e = this.shadowRoot?.querySelector("[data-action=\"item-facing\"]");
12660
+ if (!e) return;
12661
+ let t = this.itemFacing === "camera";
12662
+ e.classList.toggle("active", t), e.setAttribute("aria-pressed", String(t));
12663
+ }
12644
12664
  _closeToolbarMenus(e = null) {
12645
12665
  this.toolbar?.querySelectorAll(".toolbar-menu[open]").forEach((t) => {
12646
12666
  t !== e && t.removeAttribute("open");
@@ -12658,11 +12678,17 @@ var zl = class extends HTMLElement {
12658
12678
  }
12659
12679
  _applyModelRenderOptions() {
12660
12680
  let e = this.modelData?.render;
12661
- return !e || typeof e != "object" ? this : ([
12681
+ if (!e || typeof e != "object") return this;
12682
+ [
12662
12683
  "all",
12663
12684
  "selected",
12664
12685
  "none"
12665
- ].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this);
12686
+ ].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
12687
+ let t = e.navigation?.onSelect ?? e.selectionNavigation;
12688
+ return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && dl(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
12689
+ emit: !1,
12690
+ source: "model"
12691
+ }), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
12666
12692
  }
12667
12693
  _emit(e, t = {}) {
12668
12694
  this.dispatchEvent(new CustomEvent(e, {
@@ -12733,7 +12759,7 @@ var zl = class extends HTMLElement {
12733
12759
  }
12734
12760
  _commitModelChange(e, t = {}, n = {}) {
12735
12761
  let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
12736
- this.modelData = Tl(this.modelData);
12762
+ this.modelData = Dl(this.modelData);
12737
12763
  let o = this._syncInitialContainerState({
12738
12764
  refresh: !1,
12739
12765
  emit: !1,
@@ -12750,7 +12776,7 @@ var zl = class extends HTMLElement {
12750
12776
  }
12751
12777
  updateModel(e = {}, t = {}) {
12752
12778
  if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
12753
- let n = this.modelData || Tl({}), r = JSON.stringify(n.render?.camera || null), i = {
12779
+ let n = this.modelData || Dl({}), r = JSON.stringify(n.render?.camera || null), i = {
12754
12780
  ...n,
12755
12781
  ...e,
12756
12782
  palette: e.palette ? {
@@ -12761,11 +12787,11 @@ var zl = class extends HTMLElement {
12761
12787
  entities: Array.isArray(e.entities) ? e.entities : n.entities,
12762
12788
  relations: Array.isArray(e.relations) ? e.relations : n.relations
12763
12789
  };
12764
- return this.modelData = Tl(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
12790
+ return this.modelData = Dl(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
12765
12791
  }
12766
12792
  addEntity(e, t = {}) {
12767
12793
  if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
12768
- if (this.modelData ||= Tl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
12794
+ if (this.modelData ||= Dl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
12769
12795
  if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
12770
12796
  return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
12771
12797
  }
@@ -12844,6 +12870,25 @@ var zl = class extends HTMLElement {
12844
12870
  zoomOut() {
12845
12871
  return this.targetZoom = Math.max($c, this.targetZoom / 1.18), this.invalidate(), this;
12846
12872
  }
12873
+ setSelectionNavigation(e) {
12874
+ let t = ul(e);
12875
+ return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
12876
+ }
12877
+ focusSelection(e = {}) {
12878
+ let t = null, n = 1.22;
12879
+ if (this.selected) t = this._worldPosition(this.selected), n = this.selected.parent ? 1.35 : 1.1;
12880
+ else if (this.selectedRelationIndex !== null) {
12881
+ let e = this.relations[this.selectedRelationIndex], n = e && this.nodes.get(e.from), r = e && this.nodes.get(e.to);
12882
+ n && r && (t = this._worldPosition(n).add(this._worldPosition(r)).multiplyScalar(.5));
12883
+ }
12884
+ return t ? (this.targetFocus.copy(t), this.targetZoom = n, e.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this) : this;
12885
+ }
12886
+ _applySelectionNavigation(e = this.selectionNavigation) {
12887
+ let t = ul(e);
12888
+ if (t === "preserve") return this;
12889
+ let n = this.targetZoom;
12890
+ return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
12891
+ }
12847
12892
  panBy(e = 0, t = 0) {
12848
12893
  let n = this.camera.getWorldDirection(new U()), r = new U().crossVectors(n, this.camera.up).normalize(), i = new U().crossVectors(r, n).normalize();
12849
12894
  return this.targetFocus.addScaledVector(r, Number(e) || 0), this.targetFocus.addScaledVector(i, Number(t) || 0), this.invalidate(), this;
@@ -12910,6 +12955,19 @@ var zl = class extends HTMLElement {
12910
12955
  toggleShellLabels() {
12911
12956
  return this.setShellLabels(!this.showShellLabels);
12912
12957
  }
12958
+ setItemFacing(e = "camera", t = {}) {
12959
+ let n = dl(e), r = n !== this.itemFacing;
12960
+ return this.itemFacing = n, this.getAttribute("item-facing") !== n && this.setAttribute("item-facing", n), this._syncItemFacingToolbar(), this._applyItemFacing(), this.invalidate(), r && t.emit !== !1 && this._emit("lc-item-facing-change", {
12961
+ mode: n,
12962
+ source: t.source || "api"
12963
+ }), this;
12964
+ }
12965
+ toggleItemFacing(e = {}) {
12966
+ return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
12967
+ }
12968
+ _applyItemFacing() {
12969
+ if (this.camera) for (let e of this.nodes.values()) e.group && !cl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
12970
+ }
12913
12971
  isContainerOpen(e) {
12914
12972
  return this._containerEntityIds().includes(e) && this.open.has(e);
12915
12973
  }
@@ -12967,13 +13025,13 @@ var zl = class extends HTMLElement {
12967
13025
  this.setTheme(e);
12968
13026
  }
12969
13027
  get theme() {
12970
- return this._theme || pl();
13028
+ return this._theme || hl();
12971
13029
  }
12972
13030
  set theme(e) {
12973
- this._theme = pl(e), this.shadowRoot && this._applyTheme();
13031
+ this._theme = hl(e), this.shadowRoot && this._applyTheme();
12974
13032
  }
12975
13033
  setTheme(e = {}) {
12976
- return this.theme = fl(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
13034
+ return this.theme = ml(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
12977
13035
  }
12978
13036
  _applyTheme() {
12979
13037
  let e = this.theme, t = this.style;
@@ -13004,7 +13062,7 @@ var zl = class extends HTMLElement {
13004
13062
  this._loading = !0, this._pendingSelection = null;
13005
13063
  try {
13006
13064
  let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
13007
- this.modelData = Tl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
13065
+ this.modelData = Dl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
13008
13066
  ...this.modelData.palette,
13009
13067
  ...this._pendingPalette
13010
13068
  }, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
@@ -13035,9 +13093,9 @@ var zl = class extends HTMLElement {
13035
13093
  }
13036
13094
  _applyLighting() {
13037
13095
  if (!this.ambientLight || !this.directionalLight) return;
13038
- let e = this.theme?.lighting || dl.lighting;
13096
+ let e = this.theme?.lighting || pl.lighting;
13039
13097
  this.ambientLight.color.set(e.ambientSky), this.ambientLight.groundColor.set(e.ambientGround), this.ambientLight.intensity = Number(e.ambient) || 0, this.directionalLight.color.set(e.directionalColor), this.directionalLight.intensity = Number(e.directional) || 0;
13040
- let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : dl.lighting.directionalPosition;
13098
+ let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : pl.lighting.directionalPosition;
13041
13099
  this.directionalLight.position.fromArray(t);
13042
13100
  }
13043
13101
  _worldPosition(e, t = /* @__PURE__ */ new Set()) {
@@ -13074,7 +13132,7 @@ var zl = class extends HTMLElement {
13074
13132
  ...e.geometryPalette || {},
13075
13133
  ...e.geometryPaletteOverrides || {}
13076
13134
  };
13077
- n.material.color.set(Nl(n.value, r, t));
13135
+ n.material.color.set(Fl(n.value, r, t));
13078
13136
  }
13079
13137
  }
13080
13138
  }
@@ -13099,7 +13157,7 @@ var zl = class extends HTMLElement {
13099
13157
  ...e.ports || {}
13100
13158
  }, s) {
13101
13159
  try {
13102
- let n = Il(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
13160
+ let n = Rl(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
13103
13161
  n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
13104
13162
  if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
13105
13163
  e.userData.node = t;
@@ -13120,7 +13178,7 @@ var zl = class extends HTMLElement {
13120
13178
  entityId: e.id,
13121
13179
  error: r
13122
13180
  } }));
13123
- let i = jl(Al("box"));
13181
+ let i = Nl(Ml("box"));
13124
13182
  t.material = new ia({
13125
13183
  color: "#ed8f98",
13126
13184
  roughness: .72,
@@ -13129,8 +13187,8 @@ var zl = class extends HTMLElement {
13129
13187
  }
13130
13188
  t.labelSize = new U().fromArray(e.s);
13131
13189
  } else {
13132
- let n = o === "box" && Number(e.radius) > 0, r = Al(o, e.radius, e.segments, e.s);
13133
- n || jl(r), t.material = new ia({
13190
+ let n = o === "box" && Number(e.radius) > 0, r = Ml(o, e.radius, e.segments, e.s);
13191
+ n || Nl(r), t.material = new ia({
13134
13192
  color: a,
13135
13193
  roughness: .72,
13136
13194
  metalness: .06,
@@ -13150,7 +13208,7 @@ var zl = class extends HTMLElement {
13150
13208
  1
13151
13209
  ] : e.s), t.group.add(t.edge);
13152
13210
  }
13153
- t.label = Ll(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13211
+ t.label = zl(e.name, a, t.labelSize, e.type, this.showShellLabels), t.label.userData.node = t, t.label.traverse((e) => {
13154
13212
  e.userData.node = t;
13155
13213
  }), t.group.add(t.label), this.scene.add(t.group);
13156
13214
  }
@@ -13170,7 +13228,7 @@ var zl = class extends HTMLElement {
13170
13228
  return !t || t.has(e.id) ? 1 : this.focusFilter.effect === "hide" ? 0 : this.focusFilter.opacity;
13171
13229
  }
13172
13230
  _endpoint(e, t, n = !1, r = null) {
13173
- let i = this._worldPosition(e), a = e.anchor || "center", o = r?.[n ? "fromAnchor" : "toAnchor"] || r?.[n ? "from_anchor" : "to_anchor"];
13231
+ let i = this._worldPosition(e), a = e.anchor || "surface", o = r?.[n ? "fromAnchor" : "toAnchor"] || r?.[n ? "from_anchor" : "to_anchor"];
13174
13232
  if (a === "port" || o) {
13175
13233
  let t = e.ports || {}, r = t[o] || t[n ? "output" : "input"] || t.default;
13176
13234
  if (Array.isArray(r) && r.length >= 3) {
@@ -13197,7 +13255,7 @@ var zl = class extends HTMLElement {
13197
13255
  if (!o && this.focusFilter.effect === "hide") continue;
13198
13256
  let s = o ? 1 : this.focusFilter.opacity, c = this._endpoint(i, a, !0, e), l = this._endpoint(a, i, !1, e), u = l.clone().sub(c);
13199
13257
  if (u.lengthSq() < .01) continue;
13200
- let d = ml(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
13258
+ let d = gl(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
13201
13259
  let r = new rn({
13202
13260
  color: e,
13203
13261
  transparent: !0,
@@ -13247,8 +13305,8 @@ var zl = class extends HTMLElement {
13247
13305
  if (!this.modelData) return;
13248
13306
  let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
13249
13307
  if (e) {
13250
- let t = ml(e), n = e.text ? "<p>" + Cl(e.text) + "</p>" : "", r = wl(e.url);
13251
- this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Cl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Cl(e.from) + " → " + Cl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Cl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this._applyTheme();
13308
+ let t = gl(e), n = e.text ? "<p>" + Tl(e.text) + "</p>" : "", r = El(e.url);
13309
+ this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Tl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Tl(e.from) + " → " + Tl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Tl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this._applyTheme();
13252
13310
  return;
13253
13311
  }
13254
13312
  let t = this.selected;
@@ -13258,11 +13316,11 @@ var zl = class extends HTMLElement {
13258
13316
  }
13259
13317
  let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
13260
13318
  for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
13261
- let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Cl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Cl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13262
- let n = this.relations.indexOf(e), r = e.text ? "<small>" + Cl(e.text) + "</small>" : "";
13263
- return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Cl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Cl(e.from) + " → " + Cl(e.to) + "</small>" + r + "</button>";
13319
+ let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Tl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Tl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
13320
+ let n = this.relations.indexOf(e), r = e.text ? "<small>" + Tl(e.text) + "</small>" : "";
13321
+ return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Tl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Tl(e.from) + " → " + Tl(e.to) + "</small>" + r + "</button>";
13264
13322
  }).join("");
13265
- this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<div class=\"eyebrow\">" + Cl(cl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Cl(t.name) + "</h2><div class=\"sub\">" + Cl(t.sub || "") + "</div><p>" + Cl(t.text || "") + "</p>" + wl(t.url) + (cl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
13323
+ this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Tl(cl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Tl(t.name) + "</h2><div class=\"sub\">" + Tl(t.sub || "") + "</div><p>" + Tl(t.text || "") + "</p>" + El(t.url) + (cl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
13266
13324
  this.toggleContainer(t.id, { source: "panel" });
13267
13325
  }), this._applyTheme();
13268
13326
  }
@@ -13274,7 +13332,7 @@ var zl = class extends HTMLElement {
13274
13332
  return this.selected = n, this.selectedRelationIndex = null, cl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
13275
13333
  refresh: !1,
13276
13334
  source: t.source || "api"
13277
- }), this.targetFocus.copy(this._worldPosition(n)), this.targetZoom = n.parent ? 1.35 : 1.1, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13335
+ }), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13278
13336
  kind: "entity",
13279
13337
  id: e,
13280
13338
  index: null,
@@ -13292,12 +13350,10 @@ var zl = class extends HTMLElement {
13292
13350
  let t = this.nodes.get(e)?.parent ? this.nodes.get(this.nodes.get(e).parent) : null;
13293
13351
  for (; t;) i.add(t.id), t = t.parent ? this.nodes.get(t.parent) : null;
13294
13352
  }
13295
- this._replaceOpenContainers(i, {
13353
+ return this._replaceOpenContainers(i, {
13296
13354
  refresh: !1,
13297
13355
  source: t.source || "api"
13298
- });
13299
- let a = this.nodes.get(r.from), o = this.nodes.get(r.to);
13300
- return a && o && this.targetFocus.copy(this._worldPosition(a).add(this._worldPosition(o)).multiplyScalar(.5)), this.targetZoom = 1.22, this._renderPanel(), this._rebuildRelations(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13356
+ }), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
13301
13357
  kind: "relation",
13302
13358
  id: r.id || null,
13303
13359
  index: n,
@@ -13311,7 +13367,7 @@ var zl = class extends HTMLElement {
13311
13367
  "all",
13312
13368
  "selected",
13313
13369
  "none"
13314
- ].includes(e) ? e : "selected", this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
13370
+ ].includes(e) ? e : "selected", this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._syncFocusToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
13315
13371
  }
13316
13372
  reset() {
13317
13373
  this.selected = null, this.selectedRelationIndex = null, this.restoreInitialContainerState({
@@ -13332,15 +13388,15 @@ var zl = class extends HTMLElement {
13332
13388
  let t = Math.abs(this.targetZoom - this.zoom), n = this.targetFocus.distanceTo(this.focus);
13333
13389
  this.zoom += (this.targetZoom - this.zoom) * .12, this.focus.lerp(this.targetFocus, .12);
13334
13390
  let r = this._baseCameraDistance() / this.zoom;
13335
- this.cameraTarget.set(this.focus.x, this.focus.y, this.focus.z), this.cameraPosition.set(Math.sin(this.yaw) * Math.cos(this.pitch), Math.sin(this.pitch), Math.cos(this.yaw) * Math.cos(this.pitch)).multiplyScalar(r).add(this.cameraTarget), this.camera.position.copy(this.cameraPosition), this.camera.lookAt(this.cameraTarget);
13391
+ this.cameraTarget.set(this.focus.x, this.focus.y, this.focus.z), this.cameraPosition.set(Math.sin(this.yaw) * Math.cos(this.pitch), Math.sin(this.pitch), Math.cos(this.yaw) * Math.cos(this.pitch)).multiplyScalar(r).add(this.cameraTarget), this.camera.position.copy(this.cameraPosition), this.camera.lookAt(this.cameraTarget), this._applyItemFacing();
13336
13392
  let i = this._focusedEntityIds();
13337
13393
  for (let e of this.nodes.values()) {
13338
13394
  let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
13339
13395
  e.group.visible = n;
13340
13396
  let r = cl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
13341
- if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) ul(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
13397
+ if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) fl(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
13342
13398
  else {
13343
- for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), ul(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
13399
+ for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), fl(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
13344
13400
  e._appearanceSelected = e === this.selected;
13345
13401
  }
13346
13402
  e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
@@ -13348,7 +13404,7 @@ var zl = class extends HTMLElement {
13348
13404
  e.label.userData.textOffsetY;
13349
13405
  let m = e.labelSize || new U().fromArray(e.s);
13350
13406
  e.label.visible = n;
13351
- let h = this._worldPosition(e), g = this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
13407
+ let h = this._worldPosition(e), g = this.itemFacing === "camera" && !cl(e.type) || this.camera.position.z >= h.z, _ = this.camera.position.y > h.y + .25;
13352
13408
  if (cl(e.type)) {
13353
13409
  c.visible = g && (!o || s), l.visible = !g && (!o || s), u.visible = s && _;
13354
13410
  let e = s ? .52 : 1;
@@ -13397,13 +13453,13 @@ var zl = class extends HTMLElement {
13397
13453
  e.key === "Escape" && (this._closeToolbarMenus(), this.canvas.focus({ preventScroll: !0 }));
13398
13454
  }), this.shadowRoot.addEventListener("click", (e) => {
13399
13455
  let t = e.target.closest?.("[data-action]"), n = t?.dataset.action;
13400
- e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
13456
+ e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
13401
13457
  mode: "connected",
13402
13458
  effect: "dim"
13403
13459
  }, { source: "toolbar" }), n === "focus-hide" && this.setFocusFilter({
13404
13460
  mode: "connected",
13405
13461
  effect: "hide"
13406
- }, { source: "toolbar" }), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && this._closeToolbarMenus(), n && this.invalidate();
13462
+ }, { source: "toolbar" }), n === "focus-selection" && this.focusSelection(), n === "focus-layout" && this.setFocusFilter({ layout: this.focusFilter.layout === "reflow" ? "preserve" : "reflow" }, { source: "toolbar" }), t?.closest?.(".toolbar-popover") && this._closeToolbarMenus(), n && this.invalidate();
13407
13463
  }), this.canvas.addEventListener("contextmenu", (e) => e.preventDefault()), this.canvas.addEventListener("pointerdown", (e) => {
13408
13464
  if (e.pointerType !== "touch" && ![
13409
13465
  0,
@@ -13501,17 +13557,27 @@ var zl = class extends HTMLElement {
13501
13557
  }
13502
13558
  this.invalidate();
13503
13559
  };
13504
- this.canvas.addEventListener("pointerup", (t) => e(t)), this.canvas.addEventListener("pointercancel", (t) => e(t, !0)), this.canvas.addEventListener("wheel", (e) => {
13560
+ this.canvas.addEventListener("pointerup", (t) => e(t)), this.canvas.addEventListener("pointercancel", (t) => e(t, !0)), this.canvas.addEventListener("dblclick", (e) => {
13561
+ if (this.selectionMode !== "internal") return;
13562
+ let t = this._pick(e);
13563
+ t?.kind === "entity" && this.select(t.node.id, {
13564
+ source: "double-click",
13565
+ navigation: "fit"
13566
+ }), t?.kind === "relation" && this.selectRelation(t.index, {
13567
+ source: "double-click",
13568
+ navigation: "fit"
13569
+ });
13570
+ }), this.canvas.addEventListener("wheel", (e) => {
13505
13571
  e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max($c, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
13506
13572
  }, { passive: !1 });
13507
13573
  }
13508
13574
  _showError(e) {
13509
13575
  let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
13510
- n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Cl(e) + "</div>");
13576
+ n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Tl(e) + "</div>");
13511
13577
  }
13512
13578
  };
13513
- customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", zl);
13579
+ customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", Vl);
13514
13580
  //#endregion
13515
- export { zl as LiquidCarsAtlas, Rl as captureRendererFrame, ol as getGeometryCatalog, Tl as normalizeModel, il as registerGeometryPack, al as unregisterGeometryPack };
13581
+ export { Vl as LiquidCarsAtlas, Bl as captureRendererFrame, ol as getGeometryCatalog, Dl as normalizeModel, il as registerGeometryPack, al as unregisterGeometryPack };
13516
13582
 
13517
13583
  //# sourceMappingURL=liquidcars-atlas.js.map