@w0nna_dev/lina-widget 1.2.6 → 1.2.7

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.
@@ -29,7 +29,7 @@ const Ug = (n) => new Qf(typeof n == "string" ? n : n + "", void 0, Rd), Po = (n
29
29
  throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
30
30
  })(s) + n[r + 1], n[0]);
31
31
  return new Qf(t, n, Rd);
32
- }, Lg = (n, e) => {
32
+ }, Dg = (n, e) => {
33
33
  if (Ad) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
34
34
  else for (const t of e) {
35
35
  const i = document.createElement("style"), s = Ka.litNonce;
@@ -45,7 +45,7 @@ const Ug = (n) => new Qf(typeof n == "string" ? n : n + "", void 0, Rd), Po = (n
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: Dg, defineProperty: Vg, getOwnPropertyDescriptor: Ng, getOwnPropertyNames: Og, getOwnPropertySymbols: qg, getPrototypeOf: Fg } = Object, $n = globalThis, Pu = $n.trustedTypes, Bg = Pu ? Pu.emptyScript : "", tc = $n.reactiveElementPolyfillSupport, Wr = (n, e) => n, fo = { toAttribute(n, e) {
48
+ const { is: Lg, defineProperty: Vg, getOwnPropertyDescriptor: Ng, getOwnPropertyNames: Og, getOwnPropertySymbols: qg, getPrototypeOf: Fg } = Object, $n = globalThis, Pu = $n.trustedTypes, Bg = Pu ? Pu.emptyScript : "", tc = $n.reactiveElementPolyfillSupport, Wr = (n, e) => n, fo = { toAttribute(n, e) {
49
49
  switch (e) {
50
50
  case Boolean:
51
51
  n = n ? Bg : null;
@@ -73,7 +73,7 @@ const { is: Dg, defineProperty: Vg, getOwnPropertyDescriptor: Ng, getOwnProperty
73
73
  }
74
74
  }
75
75
  return t;
76
- } }, kd = (n, e) => !Dg(n, e), Uu = { attribute: !0, type: String, converter: fo, reflect: !1, useDefault: !1, hasChanged: kd };
76
+ } }, kd = (n, e) => !Lg(n, e), Uu = { attribute: !0, type: String, converter: fo, reflect: !1, useDefault: !1, hasChanged: kd };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), $n.litPropertyMetadata ?? ($n.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
78
  let js = class extends HTMLElement {
79
79
  static addInitializer(e) {
@@ -159,7 +159,7 @@ let js = class extends HTMLElement {
159
159
  }
160
160
  createRenderRoot() {
161
161
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
162
- return Lg(e, this.constructor.elementStyles), e;
162
+ return Dg(e, this.constructor.elementStyles), e;
163
163
  }
164
164
  connectedCallback() {
165
165
  var e;
@@ -284,12 +284,12 @@ js.elementStyles = [], js.shadowRootOptions = { mode: "open" }, js[Wr("elementPr
284
284
  * Copyright 2017 Google LLC
285
285
  * SPDX-License-Identifier: BSD-3-Clause
286
286
  */
287
- const Jr = globalThis, Lu = (n) => n, po = Jr.trustedTypes, Du = po ? po.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Yf = "$lit$", Hn = `lit$${Math.random().toFixed(9).slice(2)}$`, jf = "?" + Hn, Gg = `<${jf}>`, Rs = document, Zr = () => Rs.createComment(""), Xr = (n) => n === null || typeof n != "object" && typeof n != "function", wd = Array.isArray, zg = (n) => wd(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ic = `[
287
+ const Jr = globalThis, Du = (n) => n, po = Jr.trustedTypes, Lu = po ? po.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Yf = "$lit$", Hn = `lit$${Math.random().toFixed(9).slice(2)}$`, jf = "?" + Hn, Gg = `<${jf}>`, Rs = document, Zr = () => Rs.createComment(""), Xr = (n) => n === null || typeof n != "object" && typeof n != "function", wd = Array.isArray, zg = (n) => wd(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", ic = `[
288
288
  \f\r]`, Mr = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Vu = /-->/g, Nu = />/g, ds = RegExp(`>|${ic}(?:([^\\s"'>=/]+)(${ic}*=${ic}*(?:[^
289
289
  \f\r"'\`<>=]|("|')|))|$)`, "g"), Ou = /'/g, qu = /"/g, Zf = /^(?:script|style|textarea|title)$/i, Wg = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), _t = Wg(1), ur = Symbol.for("lit-noChange"), Kt = Symbol.for("lit-nothing"), Fu = /* @__PURE__ */ new WeakMap(), Es = Rs.createTreeWalker(Rs, 129);
290
290
  function Xf(n, e) {
291
291
  if (!wd(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
292
- return Du !== void 0 ? Du.createHTML(e) : e;
292
+ return Lu !== void 0 ? Lu.createHTML(e) : e;
293
293
  }
294
294
  const Jg = (n, e) => {
295
295
  const t = n.length - 1, i = [];
@@ -429,8 +429,8 @@ class ua {
429
429
  _$AR(e = this._$AA.nextSibling, t) {
430
430
  var i;
431
431
  for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
432
- const s = Lu(e).nextSibling;
433
- Lu(e).remove(), e = s;
432
+ const s = Du(e).nextSibling;
433
+ Du(e).remove(), e = s;
434
434
  }
435
435
  }
436
436
  setConnected(e) {
@@ -556,7 +556,7 @@ sc == null || sc({ LitElement: es });
556
556
  * Copyright 2017 Google LLC
557
557
  * SPDX-License-Identifier: BSD-3-Clause
558
558
  */
559
- const Lo = (n) => (e, t) => {
559
+ const Do = (n) => (e, t) => {
560
560
  t !== void 0 ? t.addInitializer(() => {
561
561
  customElements.define(n, e);
562
562
  }) : customElements.define(n, e);
@@ -694,7 +694,7 @@ class o0 extends n0 {
694
694
  * Copyright 2020 Google LLC
695
695
  * SPDX-License-Identifier: BSD-3-Clause
696
696
  */
697
- const Do = () => new c0();
697
+ const Lo = () => new c0();
698
698
  let c0 = class {
699
699
  };
700
700
  const rc = /* @__PURE__ */ new WeakMap(), Vo = i0(class extends o0 {
@@ -1710,7 +1710,7 @@ function U0(n) {
1710
1710
  return n ? Object.assign(Object.assign({}, Hu), n) : Hu;
1711
1711
  }
1712
1712
  const go = Symbol(), Ya = Symbol();
1713
- function L0() {
1713
+ function D0() {
1714
1714
  return {
1715
1715
  makeReadOptions: P0,
1716
1716
  makeWriteOptions: U0,
@@ -1838,7 +1838,7 @@ function Qu(n, e, t, i, s) {
1838
1838
  throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: map value null"));
1839
1839
  let l;
1840
1840
  try {
1841
- l = D0(t.K, a);
1841
+ l = L0(t.K, a);
1842
1842
  } catch (d) {
1843
1843
  let u = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(nn(e));
1844
1844
  throw d instanceof Error && d.message.length > 0 && (u += ": ".concat(d.message)), new Error(u);
@@ -1903,7 +1903,7 @@ function Qu(n, e, t, i, s) {
1903
1903
  break;
1904
1904
  }
1905
1905
  }
1906
- function D0(n, e) {
1906
+ function L0(n, e) {
1907
1907
  if (n === X.BOOL)
1908
1908
  switch (e) {
1909
1909
  case "true":
@@ -2089,7 +2089,7 @@ function ja(n, e) {
2089
2089
  return Nt(e instanceof Uint8Array), lp.enc(e);
2090
2090
  }
2091
2091
  }
2092
- const Ls = Symbol("@bufbuild/protobuf/unknown-fields"), ju = {
2092
+ const Ds = Symbol("@bufbuild/protobuf/unknown-fields"), ju = {
2093
2093
  readUnknownFields: !0,
2094
2094
  readerFactory: (n) => new A0(n)
2095
2095
  }, Zu = {
@@ -2108,20 +2108,20 @@ function q0() {
2108
2108
  makeWriteOptions: O0,
2109
2109
  listUnknownFields(n) {
2110
2110
  var e;
2111
- return (e = n[Ls]) !== null && e !== void 0 ? e : [];
2111
+ return (e = n[Ds]) !== null && e !== void 0 ? e : [];
2112
2112
  },
2113
2113
  discardUnknownFields(n) {
2114
- delete n[Ls];
2114
+ delete n[Ds];
2115
2115
  },
2116
2116
  writeUnknownFields(n, e) {
2117
- const i = n[Ls];
2117
+ const i = n[Ds];
2118
2118
  if (i)
2119
2119
  for (const s of i)
2120
2120
  e.tag(s.no, s.wireType).raw(s.data);
2121
2121
  },
2122
2122
  onUnknownField(n, e, t, i) {
2123
2123
  const s = n;
2124
- Array.isArray(s[Ls]) || (s[Ls] = []), s[Ls].push({
2124
+ Array.isArray(s[Ds]) || (s[Ds] = []), s[Ds].push({
2125
2125
  no: e,
2126
2126
  wireType: t,
2127
2127
  data: i
@@ -2535,7 +2535,7 @@ function Ar(n) {
2535
2535
  function J0(n, e, t) {
2536
2536
  return {
2537
2537
  syntax: n,
2538
- json: L0(),
2538
+ json: D0(),
2539
2539
  bin: q0(),
2540
2540
  util: Object.assign(Object.assign({}, W0()), {
2541
2541
  newFieldList: e,
@@ -3618,13 +3618,13 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
3618
3618
  no: 10,
3619
3619
  name: "rpc_request",
3620
3620
  kind: "message",
3621
- T: Ld,
3621
+ T: Dd,
3622
3622
  oneof: "value"
3623
3623
  }, {
3624
3624
  no: 11,
3625
3625
  name: "rpc_ack",
3626
3626
  kind: "message",
3627
- T: Dd,
3627
+ T: Ld,
3628
3628
  oneof: "value"
3629
3629
  }, {
3630
3630
  no: 12,
@@ -3713,13 +3713,13 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
3713
3713
  no: 4,
3714
3714
  name: "rpc_request",
3715
3715
  kind: "message",
3716
- T: Ld,
3716
+ T: Dd,
3717
3717
  oneof: "value"
3718
3718
  }, {
3719
3719
  no: 5,
3720
3720
  name: "rpc_ack",
3721
3721
  kind: "message",
3722
- T: Dd,
3722
+ T: Ld,
3723
3723
  oneof: "value"
3724
3724
  }, {
3725
3725
  no: 6,
@@ -3931,7 +3931,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
3931
3931
  kind: "scalar",
3932
3932
  T: 8
3933
3933
  /* ScalarType.BOOL */
3934
- }]), Ld = /* @__PURE__ */ F.makeMessageType("livekit.RpcRequest", () => [{
3934
+ }]), Dd = /* @__PURE__ */ F.makeMessageType("livekit.RpcRequest", () => [{
3935
3935
  no: 1,
3936
3936
  name: "id",
3937
3937
  kind: "scalar",
@@ -3961,7 +3961,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
3961
3961
  kind: "scalar",
3962
3962
  T: 13
3963
3963
  /* ScalarType.UINT32 */
3964
- }]), Dd = /* @__PURE__ */ F.makeMessageType("livekit.RpcAck", () => [{
3964
+ }]), Ld = /* @__PURE__ */ F.makeMessageType("livekit.RpcAck", () => [{
3965
3965
  no: 1,
3966
3966
  name: "request_id",
3967
3967
  kind: "scalar",
@@ -4465,7 +4465,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
4465
4465
  no: 7,
4466
4466
  name: "track_setting",
4467
4467
  kind: "message",
4468
- T: Lp,
4468
+ T: Dp,
4469
4469
  oneof: "message"
4470
4470
  }, {
4471
4471
  no: 8,
@@ -4525,7 +4525,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
4525
4525
  no: 18,
4526
4526
  name: "update_video_track",
4527
4527
  kind: "message",
4528
- T: Dp,
4528
+ T: Lp,
4529
4529
  oneof: "message"
4530
4530
  }]), ih = /* @__PURE__ */ F.makeMessageType("livekit.SignalResponse", () => [{
4531
4531
  no: 1,
@@ -4645,13 +4645,13 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
4645
4645
  no: 21,
4646
4646
  name: "subscription_response",
4647
4647
  kind: "message",
4648
- T: Lv,
4648
+ T: Dv,
4649
4649
  oneof: "message"
4650
4650
  }, {
4651
4651
  no: 22,
4652
4652
  name: "request_response",
4653
4653
  kind: "message",
4654
- T: Dv,
4654
+ T: Lv,
4655
4655
  oneof: "message"
4656
4656
  }, {
4657
4657
  no: 23,
@@ -5004,7 +5004,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
5004
5004
  kind: "message",
5005
5005
  T: Mp,
5006
5006
  repeated: !0
5007
- }]), Lp = /* @__PURE__ */ F.makeMessageType("livekit.UpdateTrackSettings", () => [{
5007
+ }]), Dp = /* @__PURE__ */ F.makeMessageType("livekit.UpdateTrackSettings", () => [{
5008
5008
  no: 1,
5009
5009
  name: "track_sids",
5010
5010
  kind: "scalar",
@@ -5057,7 +5057,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
5057
5057
  kind: "enum",
5058
5058
  T: F.getEnumType(Xt),
5059
5059
  repeated: !0
5060
- }]), Dp = /* @__PURE__ */ F.makeMessageType("livekit.UpdateLocalVideoTrack", () => [{
5060
+ }]), Lp = /* @__PURE__ */ F.makeMessageType("livekit.UpdateLocalVideoTrack", () => [{
5061
5061
  no: 1,
5062
5062
  name: "track_sid",
5063
5063
  kind: "scalar",
@@ -5519,7 +5519,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
5519
5519
  kind: "scalar",
5520
5520
  T: 3
5521
5521
  /* ScalarType.INT64 */
5522
- }]), Lv = /* @__PURE__ */ F.makeMessageType("livekit.SubscriptionResponse", () => [{
5522
+ }]), Dv = /* @__PURE__ */ F.makeMessageType("livekit.SubscriptionResponse", () => [{
5523
5523
  no: 1,
5524
5524
  name: "track_sid",
5525
5525
  kind: "scalar",
@@ -5530,7 +5530,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
5530
5530
  name: "err",
5531
5531
  kind: "enum",
5532
5532
  T: F.getEnumType(rv)
5533
- }]), Dv = /* @__PURE__ */ F.makeMessageType("livekit.RequestResponse", () => [{
5533
+ }]), Lv = /* @__PURE__ */ F.makeMessageType("livekit.RequestResponse", () => [{
5534
5534
  no: 1,
5535
5535
  name: "request_id",
5536
5536
  kind: "scalar",
@@ -5581,7 +5581,7 @@ const tv = /* @__PURE__ */ F.makeMessageType("livekit.MetricsBatch", () => [{
5581
5581
  no: 9,
5582
5582
  name: "update_video_track",
5583
5583
  kind: "message",
5584
- T: Dp,
5584
+ T: Lp,
5585
5585
  oneof: "request"
5586
5586
  }]), Gd = /* @__PURE__ */ F.makeEnum("livekit.RequestResponse.Reason", [{
5587
5587
  no: 0,
@@ -7719,33 +7719,33 @@ var Et;
7719
7719
  (function(n) {
7720
7720
  n[n.NotAllowed = 0] = "NotAllowed", n[n.ServerUnreachable = 1] = "ServerUnreachable", n[n.InternalError = 2] = "InternalError", n[n.Cancelled = 3] = "Cancelled", n[n.LeaveRequest = 4] = "LeaveRequest", n[n.Timeout = 5] = "Timeout", n[n.WebSocket = 6] = "WebSocket", n[n.ServiceNotFound = 7] = "ServiceNotFound";
7721
7721
  })(Et || (Et = {}));
7722
- class Le extends pn {
7722
+ class De extends pn {
7723
7723
  constructor(e, t, i, s) {
7724
7724
  super(1, e), this.name = "ConnectionError", this.status = i, this.reason = t, this.context = s, this.reasonName = Et[t];
7725
7725
  }
7726
7726
  static notAllowed(e, t, i) {
7727
- return new Le(e, Et.NotAllowed, t, i);
7727
+ return new De(e, Et.NotAllowed, t, i);
7728
7728
  }
7729
7729
  static timeout(e) {
7730
- return new Le(e, Et.Timeout);
7730
+ return new De(e, Et.Timeout);
7731
7731
  }
7732
7732
  static leaveRequest(e, t) {
7733
- return new Le(e, Et.LeaveRequest, void 0, t);
7733
+ return new De(e, Et.LeaveRequest, void 0, t);
7734
7734
  }
7735
7735
  static internal(e, t) {
7736
- return new Le(e, Et.InternalError, void 0, t);
7736
+ return new De(e, Et.InternalError, void 0, t);
7737
7737
  }
7738
7738
  static cancelled(e) {
7739
- return new Le(e, Et.Cancelled);
7739
+ return new De(e, Et.Cancelled);
7740
7740
  }
7741
7741
  static serverUnreachable(e, t) {
7742
- return new Le(e, Et.ServerUnreachable, t);
7742
+ return new De(e, Et.ServerUnreachable, t);
7743
7743
  }
7744
7744
  static websocket(e, t, i) {
7745
- return new Le(e, Et.WebSocket, t, i);
7745
+ return new De(e, Et.WebSocket, t, i);
7746
7746
  }
7747
7747
  static serviceNotFound(e, t) {
7748
- return new Le(e, Et.ServiceNotFound, void 0, t);
7748
+ return new De(e, Et.ServiceNotFound, void 0, t);
7749
7749
  }
7750
7750
  }
7751
7751
  class Wd extends pn {
@@ -7792,7 +7792,7 @@ class Oi extends pn {
7792
7792
  super(16, e), this.name = "DataStreamError", this.reason = t, this.reasonName = hi[t];
7793
7793
  }
7794
7794
  }
7795
- class Ds extends pn {
7795
+ class Ls extends pn {
7796
7796
  constructor(e) {
7797
7797
  super(18, e), this.name = "SignalReconnectError";
7798
7798
  }
@@ -8137,10 +8137,10 @@ function bS(n, e) {
8137
8137
  return (t = n.layers) === null || t === void 0 ? void 0 : t.find((i) => i.quality === e);
8138
8138
  }
8139
8139
  const TS = 5e3, kr = [];
8140
- var Li;
8140
+ var Di;
8141
8141
  (function(n) {
8142
8142
  n[n.LOW = 0] = "LOW", n[n.MEDIUM = 1] = "MEDIUM", n[n.HIGH = 2] = "HIGH";
8143
- })(Li || (Li = {}));
8143
+ })(Di || (Di = {}));
8144
8144
  class Z extends fn.EventEmitter {
8145
8145
  /**
8146
8146
  * indicates current state of stream, it'll indicate `paused` if the track
@@ -8547,13 +8547,13 @@ function is(n) {
8547
8547
  return Array.isArray(n.ideal) ? n.ideal[0] : n.ideal;
8548
8548
  throw Error("could not unwrap constraint");
8549
8549
  }
8550
- function LS(n) {
8550
+ function DS(n) {
8551
8551
  return n.startsWith("http") ? n.replace(/^(http)/, "ws") : n;
8552
8552
  }
8553
8553
  function ra(n) {
8554
8554
  return n.startsWith("ws") ? n.replace(/^(ws)/, "http") : n;
8555
8555
  }
8556
- function DS(n, e) {
8556
+ function LS(n, e) {
8557
8557
  return n.segments.map((t) => {
8558
8558
  let {
8559
8559
  id: i,
@@ -8668,7 +8668,7 @@ function BS(n, e) {
8668
8668
  return t ? i : Hd(i, "v1");
8669
8669
  }
8670
8670
  function GS(n, e) {
8671
- const t = new URL(LS(n));
8671
+ const t = new URL(DS(n));
8672
8672
  return e.forEach((i, s) => {
8673
8673
  t.searchParams.set(s, i);
8674
8674
  }), Hd(t, "rtc");
@@ -9297,7 +9297,7 @@ class ty {
9297
9297
  };
9298
9298
  this.opened = new Ei((a, c) => {
9299
9299
  const l = () => {
9300
- c(Le.websocket("Encountered websocket error during connection establishment"));
9300
+ c(De.websocket("Encountered websocket error during connection establishment"));
9301
9301
  };
9302
9302
  r.onopen = () => {
9303
9303
  a({
@@ -9334,7 +9334,7 @@ class ty {
9334
9334
  once: !0
9335
9335
  });
9336
9336
  }), u = yield Ei.race([ni(250), d]);
9337
- u ? a(u) : c(Le.websocket("Encountered unspecified websocket error without a timely close event"));
9337
+ u ? a(u) : c(De.websocket("Encountered unspecified websocket error without a timely close event"));
9338
9338
  });
9339
9339
  r.onclose = (d) => {
9340
9340
  let {
@@ -9427,13 +9427,13 @@ class Qd {
9427
9427
  const w = x instanceof Event ? x.currentTarget : x, V = WS(w, "Abort handler called");
9428
9428
  this.streamWriter && !this.isDisconnected ? this.sendLeave().then(() => this.close(V)).catch((O) => {
9429
9429
  this.log.error(O), this.close();
9430
- }) : this.close(), C(), p(Le.cancelled(V));
9430
+ }) : this.close(), C(), p(De.cancelled(V));
9431
9431
  });
9432
9432
  c == null || c.addEventListener("abort", T);
9433
9433
  const C = () => {
9434
9434
  clearTimeout(R), c == null || c.removeEventListener("abort", T);
9435
9435
  }, R = setTimeout(() => {
9436
- T(Le.timeout("room connection has timed out (signal)"));
9436
+ T(De.timeout("room connection has timed out (signal)"));
9437
9437
  }, a.websocketTimeout), _ = (x, w) => {
9438
9438
  this.handleSignalConnected(x, R, w);
9439
9439
  }, b = new URL(g);
@@ -9444,14 +9444,14 @@ class Qd {
9444
9444
  try {
9445
9445
  this.ws.closed.then((G) => {
9446
9446
  var W;
9447
- this.isEstablishingConnection && p(Le.internal("Websocket got closed during a (re)connection attempt: ".concat(G.reason))), G.closeCode !== 1e3 && (this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
9447
+ this.isEstablishingConnection && p(De.internal("Websocket got closed during a (re)connection attempt: ".concat(G.reason))), G.closeCode !== 1e3 && (this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
9448
9448
  reason: G.reason,
9449
9449
  code: G.closeCode,
9450
9450
  wasClean: G.closeCode === 1e3,
9451
9451
  state: this.state
9452
9452
  })), this.state === xt.CONNECTED && this.handleOnClose((W = G.reason) !== null && W !== void 0 ? W : "Unexpected WS error"));
9453
9453
  }).catch((G) => {
9454
- this.isEstablishingConnection && p(Le.internal("Websocket error during a (re)connection attempt: ".concat(G)));
9454
+ this.isEstablishingConnection && p(De.internal("Websocket error during a (re)connection attempt: ".concat(G)));
9455
9455
  });
9456
9456
  const x = yield this.ws.opened.catch((G) => I(this, void 0, void 0, function* () {
9457
9457
  if (this.state !== xt.CONNECTED) {
@@ -9468,7 +9468,7 @@ class Qd {
9468
9468
  this.streamWriter = x.writable.getWriter();
9469
9469
  const V = yield w.read();
9470
9470
  if (w.releaseLock(), !V.value)
9471
- throw Le.internal("no message received as first message");
9471
+ throw De.internal("no message received as first message");
9472
9472
  const O = Ch(V.value), J = this.validateFirstMessage(O, (E = a.reconnect) !== null && E !== void 0 ? E : !1);
9473
9473
  if (!J.isValid) {
9474
9474
  p(J.error);
@@ -9807,13 +9807,13 @@ class Qd {
9807
9807
  shouldProcessFirstMessage: !0
9808
9808
  }) : this.isEstablishingConnection && ((o = e.message) === null || o === void 0 ? void 0 : o.case) === "leave" ? {
9809
9809
  isValid: !1,
9810
- error: Le.leaveRequest("Received leave request while trying to (re)connect", e.message.value.reason)
9810
+ error: De.leaveRequest("Received leave request while trying to (re)connect", e.message.value.reason)
9811
9811
  } : t ? {
9812
9812
  isValid: !1,
9813
- error: Le.internal("Unexpected first message")
9813
+ error: De.internal("Unexpected first message")
9814
9814
  } : {
9815
9815
  isValid: !1,
9816
- error: Le.internal("did not receive join response, got ".concat((a = e.message) === null || a === void 0 ? void 0 : a.case, " instead"))
9816
+ error: De.internal("did not receive join response, got ".concat((a = e.message) === null || a === void 0 ? void 0 : a.case, " instead"))
9817
9817
  };
9818
9818
  }
9819
9819
  /**
@@ -9829,20 +9829,20 @@ class Qd {
9829
9829
  const i = yield fetch(t);
9830
9830
  switch (i.status) {
9831
9831
  case 404:
9832
- return Le.serviceNotFound("v1 RTC path not found. Consider upgrading your LiveKit server version", "v0-rtc");
9832
+ return De.serviceNotFound("v1 RTC path not found. Consider upgrading your LiveKit server version", "v0-rtc");
9833
9833
  case 401:
9834
9834
  case 403:
9835
9835
  const s = yield i.text();
9836
- return Le.notAllowed(s, i.status);
9836
+ return De.notAllowed(s, i.status);
9837
9837
  default:
9838
9838
  break;
9839
9839
  }
9840
- return e instanceof Le ? e : Le.internal("Encountered unknown websocket error during connection: ".concat(e), {
9840
+ return e instanceof De ? e : De.internal("Encountered unknown websocket error during connection: ".concat(e), {
9841
9841
  status: i.status,
9842
9842
  statusText: i.statusText
9843
9843
  });
9844
9844
  } catch (i) {
9845
- return i instanceof Le ? i : Le.serverUnreachable(i instanceof Error ? i.message : "server was not reachable");
9845
+ return i instanceof De ? i : De.serverUnreachable(i instanceof Error ? i.message : "server was not reachable");
9846
9846
  }
9847
9847
  });
9848
9848
  }
@@ -10620,7 +10620,7 @@ const uy = 0.7, hy = 20, or = {
10620
10620
  NegotiationComplete: "negotiationComplete",
10621
10621
  RTPVideoPayloadTypes: "rtpVideoPayloadTypes"
10622
10622
  };
10623
- class Lh extends fn.EventEmitter {
10623
+ class Dh extends fn.EventEmitter {
10624
10624
  get pc() {
10625
10625
  return this._pc || (this._pc = this.createPC()), this._pc;
10626
10626
  }
@@ -10753,7 +10753,7 @@ class Lh extends fn.EventEmitter {
10753
10753
  }, this.logContext));
10754
10754
  const o = Kn.parse((t = r.sdp) !== null && t !== void 0 ? t : "");
10755
10755
  if (o.media.forEach((a) => {
10756
- Vh(a), a.type === "audio" ? Dh(a, ["all"], []) : a.type === "video" && this.trackBitrates.some((c) => {
10756
+ Vh(a), a.type === "audio" ? Lh(a, ["all"], []) : a.type === "video" && this.trackBitrates.some((c) => {
10757
10757
  if (!a.msid || !c.cid || !a.msid.includes(c.cid))
10758
10758
  return !1;
10759
10759
  let l = 0;
@@ -10785,7 +10785,7 @@ class Lh extends fn.EventEmitter {
10785
10785
  var e;
10786
10786
  const t = yield this.pc.createAnswer(), i = Kn.parse((e = t.sdp) !== null && e !== void 0 ? e : "");
10787
10787
  return i.media.forEach((s) => {
10788
- Vh(s), s.type === "audio" && Dh(s, this.remoteStereoMids, this.remoteNackMids);
10788
+ Vh(s), s.type === "audio" && Lh(s, this.remoteStereoMids, this.remoteNackMids);
10789
10789
  }), yield this.setMungedSDP(t, Kn.write(i)), t;
10790
10790
  });
10791
10791
  }
@@ -10926,7 +10926,7 @@ class Lh extends fn.EventEmitter {
10926
10926
  }
10927
10927
  }
10928
10928
  }
10929
- function Dh(n, e, t) {
10929
+ function Lh(n, e, t) {
10930
10930
  const i = Zd(n.mid);
10931
10931
  let s = 0;
10932
10932
  n.rtp.some((r) => r.codec === "opus" ? (s = r.payload, !0) : !1), s > 0 && (n.rtcpFb || (n.rtcpFb = []), t.includes(i) && !n.rtcpFb.some((r) => r.payload === s && r.type === "nack") && n.rtcpFb.push({
@@ -11017,7 +11017,7 @@ class gy {
11017
11017
  var r, o;
11018
11018
  const a = this.state, c = this.requiredTransports.map((l) => l.getConnectionState());
11019
11019
  c.every((l) => l === "connected") ? this.state = Vt.CONNECTED : c.some((l) => l === "failed") ? this.state = Vt.FAILED : c.some((l) => l === "connecting") ? this.state = Vt.CONNECTING : c.every((l) => l === "closed") ? this.state = Vt.CLOSED : c.some((l) => l === "closed") ? this.state = Vt.CLOSING : c.every((l) => l === "new") && (this.state = Vt.NEW), a !== this.state && (this.log.debug("pc state change: from ".concat(Vt[a], " to ").concat(Vt[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), (o = this.subscriber) === null || o === void 0 ? void 0 : o.getConnectionState()));
11020
- }, this.log = Un((s = i.loggerName) !== null && s !== void 0 ? s : Xi.PCManager), this.loggerOptions = i, this.isPublisherConnectionRequired = t !== "subscriber-primary", this.isSubscriberConnectionRequired = t === "subscriber-primary", this.publisher = new Lh(e, i), this._mode = t, t !== "publisher-only" && (this.subscriber = new Lh(e, i), this.subscriber.onConnectionStateChange = this.updateState, this.subscriber.onIceConnectionStateChange = this.updateState, this.subscriber.onSignalingStatechange = this.updateState, this.subscriber.onIceCandidate = (r) => {
11020
+ }, this.log = Un((s = i.loggerName) !== null && s !== void 0 ? s : Xi.PCManager), this.loggerOptions = i, this.isPublisherConnectionRequired = t !== "subscriber-primary", this.isSubscriberConnectionRequired = t === "subscriber-primary", this.publisher = new Dh(e, i), this._mode = t, t !== "publisher-only" && (this.subscriber = new Dh(e, i), this.subscriber.onConnectionStateChange = this.updateState, this.subscriber.onIceConnectionStateChange = this.updateState, this.subscriber.onSignalingStatechange = this.updateState, this.subscriber.onIceCandidate = (r) => {
11021
11021
  var o;
11022
11022
  (o = this.onIceCandidate) === null || o === void 0 || o.call(this, r, Hi.SUBSCRIBER);
11023
11023
  }, this.subscriber.onDataChannel = (r) => {
@@ -11167,15 +11167,15 @@ class gy {
11167
11167
  if (i.getConnectionState() !== "connected")
11168
11168
  return new Promise((c, l) => I(r, void 0, void 0, function* () {
11169
11169
  const d = () => {
11170
- this.log.warn("abort transport connection", this.logContext), ii.clearTimeout(u), l(Le.cancelled("room connection has been cancelled"));
11170
+ this.log.warn("abort transport connection", this.logContext), ii.clearTimeout(u), l(De.cancelled("room connection has been cancelled"));
11171
11171
  };
11172
11172
  s != null && s.signal.aborted && d(), s == null || s.signal.addEventListener("abort", d);
11173
11173
  const u = ii.setTimeout(() => {
11174
- s == null || s.signal.removeEventListener("abort", d), l(Le.internal("could not establish pc connection"));
11174
+ s == null || s.signal.removeEventListener("abort", d), l(De.internal("could not establish pc connection"));
11175
11175
  }, o);
11176
11176
  for (; this.state !== Vt.CONNECTED; )
11177
11177
  if (yield ni(50), s != null && s.signal.aborted) {
11178
- l(Le.cancelled("room connection has been cancelled"));
11178
+ l(De.cancelled("room connection has been cancelled"));
11179
11179
  return;
11180
11180
  }
11181
11181
  ii.clearTimeout(u), s == null || s.signal.removeEventListener("abort", d), c();
@@ -11204,9 +11204,9 @@ class tt {
11204
11204
  maxAgeInMs: a
11205
11205
  };
11206
11206
  } else
11207
- throw r.status === 401 ? Le.notAllowed("Could not fetch region settings: ".concat(r.statusText), r.status) : Le.internal("Could not fetch region settings: ".concat(r.statusText));
11207
+ throw r.status === 401 ? De.notAllowed("Could not fetch region settings: ".concat(r.statusText), r.status) : De.internal("Could not fetch region settings: ".concat(r.statusText));
11208
11208
  } catch (r) {
11209
- throw r instanceof Le ? r : i != null && i.aborted ? Le.cancelled("Region fetching was aborted") : Le.serverUnreachable("Could not fetch region settings, ".concat(r instanceof Error ? "".concat(r.name, ": ").concat(r.message) : r));
11209
+ throw r instanceof De ? r : i != null && i.aborted ? De.cancelled("Region fetching was aborted") : De.serverUnreachable("Could not fetch region settings, ".concat(r instanceof Error ? "".concat(r.name, ": ").concat(r.message) : r));
11210
11210
  } finally {
11211
11211
  s();
11212
11212
  }
@@ -11220,7 +11220,7 @@ class tt {
11220
11220
  const r = yield tt.fetchRegionSettings(e, t);
11221
11221
  tt.updateCachedRegionSettings(e, t, r);
11222
11222
  } catch (r) {
11223
- if (r instanceof Le && r.reason === Et.NotAllowed) {
11223
+ if (r instanceof De && r.reason === Et.NotAllowed) {
11224
11224
  We.debug("token is not valid, cancelling auto region refresh");
11225
11225
  return;
11226
11226
  }
@@ -11436,7 +11436,7 @@ function xy() {
11436
11436
  return tu;
11437
11437
  }
11438
11438
  const Ey = 1e3, Cy = 1e4;
11439
- class Lm extends Z {
11439
+ class Dm extends Z {
11440
11440
  /** @internal */
11441
11441
  get sender() {
11442
11442
  return this._sender;
@@ -11827,7 +11827,7 @@ class Lm extends Z {
11827
11827
  return (e = this.localTrackRecorder) === null || e === void 0 ? void 0 : e.mimeType;
11828
11828
  }
11829
11829
  }
11830
- class Co extends Lm {
11830
+ class Co extends Dm {
11831
11831
  /**
11832
11832
  * boolean indicating whether enhanced noise cancellation is currently being used on this track
11833
11833
  */
@@ -12007,7 +12007,7 @@ function kl(n, e, t, i) {
12007
12007
  o || (o = Uy(n, e, t, l), We.debug("using video encoding", o));
12008
12008
  const d = o.maxFramerate, u = new vt(e, t, o.maxBitrate, o.maxFramerate, o.priority);
12009
12009
  if (c && Qi(l)) {
12010
- const g = new Dm(c), v = [];
12010
+ const g = new Lm(c), v = [];
12011
12011
  if (g.spatial > 3)
12012
12012
  throw new Error("unsupported scalabilityMode: ".concat(c));
12013
12013
  const m = Ai();
@@ -12063,7 +12063,7 @@ function Py(n, e, t) {
12063
12063
  return n.source === Z.Source.ScreenShare && t.simulcast && (t.simulcast = !1), kl(n.source === Z.Source.ScreenShare, c, l, t);
12064
12064
  }
12065
12065
  function Uy(n, e, t, i) {
12066
- const s = Ly(n, e, t);
12066
+ const s = Dy(n, e, t);
12067
12067
  let {
12068
12068
  encoding: r
12069
12069
  } = s[0];
@@ -12085,7 +12085,7 @@ function Uy(n, e, t, i) {
12085
12085
  }
12086
12086
  return r;
12087
12087
  }
12088
- function Ly(n, e, t) {
12088
+ function Dy(n, e, t) {
12089
12089
  if (n)
12090
12090
  return ky;
12091
12091
  const i = e > t ? e / t : t / e;
@@ -12137,7 +12137,7 @@ function qh(n) {
12137
12137
  return i.maxBitrate > s.maxBitrate ? 1 : i.maxBitrate < s.maxBitrate ? -1 : i.maxBitrate === s.maxBitrate && i.maxFramerate && s.maxFramerate ? i.maxFramerate > s.maxFramerate ? 1 : -1 : 0;
12138
12138
  });
12139
12139
  }
12140
- class Dm {
12140
+ class Lm {
12141
12141
  constructor(e) {
12142
12142
  const t = e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);
12143
12143
  if (!t)
@@ -12155,11 +12155,11 @@ class Dm {
12155
12155
  return "L".concat(this.spatial, "T").concat(this.temporal).concat((e = this.suffix) !== null && e !== void 0 ? e : "");
12156
12156
  }
12157
12157
  }
12158
- function Dy(n) {
12158
+ function Ly(n) {
12159
12159
  return n.source === Z.Source.ScreenShare || n.constraints.height && is(n.constraints.height) >= 1080 ? "maintain-resolution" : "balanced";
12160
12160
  }
12161
12161
  const Vy = 5e3;
12162
- class Mo extends Lm {
12162
+ class Mo extends Dm {
12163
12163
  get sender() {
12164
12164
  return this._sender;
12165
12165
  }
@@ -12345,7 +12345,7 @@ class Mo extends Lm {
12345
12345
  }
12346
12346
  setPublishingQuality(e) {
12347
12347
  const t = [];
12348
- for (let i = Li.LOW; i <= Li.HIGH; i += 1)
12348
+ for (let i = Di.LOW; i <= Di.HIGH; i += 1)
12349
12349
  t.push(new Fd({
12350
12350
  quality: i,
12351
12351
  enabled: i <= e
@@ -12592,29 +12592,29 @@ function Fh(n, e, t, i, s, r, o) {
12592
12592
  function Vm(n) {
12593
12593
  switch (n) {
12594
12594
  case "f":
12595
- return Li.HIGH;
12595
+ return Di.HIGH;
12596
12596
  case "h":
12597
- return Li.MEDIUM;
12597
+ return Di.MEDIUM;
12598
12598
  case "q":
12599
- return Li.LOW;
12599
+ return Di.LOW;
12600
12600
  default:
12601
- return Li.HIGH;
12601
+ return Di.HIGH;
12602
12602
  }
12603
12603
  }
12604
12604
  function Bh(n, e, t, i) {
12605
12605
  if (!t)
12606
12606
  return [new ts({
12607
- quality: Li.HIGH,
12607
+ quality: Di.HIGH,
12608
12608
  width: n,
12609
12609
  height: e,
12610
12610
  bitrate: 0,
12611
12611
  ssrc: 0
12612
12612
  })];
12613
12613
  if (i) {
12614
- const s = t[0].scalabilityMode, r = new Dm(s), o = [], a = r.suffix == "h" ? 1.5 : 2, c = r.suffix == "h" ? 2 : 3;
12614
+ const s = t[0].scalabilityMode, r = new Lm(s), o = [], a = r.suffix == "h" ? 1.5 : 2, c = r.suffix == "h" ? 2 : 3;
12615
12615
  for (let l = 0; l < r.spatial; l += 1)
12616
12616
  o.push(new ts({
12617
- quality: Math.min(Li.HIGH, r.spatial - 1) - l,
12617
+ quality: Math.min(Di.HIGH, r.spatial - 1) - l,
12618
12618
  width: Math.ceil(n / Math.pow(a, l)),
12619
12619
  height: Math.ceil(e / Math.pow(a, l)),
12620
12620
  bitrate: t[0].maxBitrate ? Math.ceil(t[0].maxBitrate / Math.pow(c, l)) : 0,
@@ -12803,7 +12803,7 @@ class By extends fn.EventEmitter {
12803
12803
  We.error(h, l.logContext);
12804
12804
  }), l.registerOnLineListener(), l.clientConfiguration = u.clientConfiguration, l.emit(ce.SignalConnected, u), u;
12805
12805
  } catch (u) {
12806
- if (u instanceof Le) {
12806
+ if (u instanceof De) {
12807
12807
  if (u.reason === Et.ServerUnreachable) {
12808
12808
  if (l.log.warn("Couldn't connect to server, attempt ".concat(l.joinAttempts, " of ").concat(l.maxJoinAttempts), l.logContext), l.joinAttempts < l.maxJoinAttempts)
12809
12809
  return l.join(r, o, a, c, d);
@@ -12852,7 +12852,7 @@ class By extends fn.EventEmitter {
12852
12852
  throw new kn("a track with the same ID has already been published");
12853
12853
  return new Promise((t, i) => {
12854
12854
  const s = setTimeout(() => {
12855
- delete this.pendingTrackResolvers[e.cid], i(Le.timeout("publication of local track timed out, no response from server"));
12855
+ delete this.pendingTrackResolvers[e.cid], i(De.timeout("publication of local track timed out, no response from server"));
12856
12856
  }, 1e4);
12857
12857
  this.pendingTrackResolvers[e.cid] = {
12858
12858
  resolve: (r) => {
@@ -13102,7 +13102,7 @@ class By extends fn.EventEmitter {
13102
13102
  let o = !0;
13103
13103
  r instanceof Ft ? (this.log.debug("received unrecoverable error", Object.assign(Object.assign({}, this.logContext), {
13104
13104
  error: r
13105
- })), o = !1) : r instanceof Ds || (this.fullReconnectOnNext = !0), o ? this.handleDisconnect("reconnect", vs.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(ce.Disconnected), yield this.close());
13105
+ })), o = !1) : r instanceof Ls || (this.fullReconnectOnNext = !0), o ? this.handleDisconnect("reconnect", vs.RR_UNKNOWN) : (this.log.info("could not recover connection after ".concat(this.reconnectAttempts, " attempts, ").concat(Date.now() - this.reconnectStart, "ms. giving up"), this.logContext), this.emit(ce.Disconnected), yield this.close());
13106
13106
  } finally {
13107
13107
  this.attemptingReconnect = !1;
13108
13108
  }
@@ -13129,15 +13129,15 @@ class By extends fn.EventEmitter {
13129
13129
  let r;
13130
13130
  try {
13131
13131
  if (!this.signalOpts)
13132
- throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Ds();
13132
+ throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Ls();
13133
13133
  r = yield this.join(e ?? this.url, this.token, this.signalOpts, void 0, !this.options.singlePeerConnection);
13134
13134
  } catch (o) {
13135
- throw o instanceof Le && o.reason === Et.NotAllowed ? new Ft("could not reconnect, token might be expired") : new Ds();
13135
+ throw o instanceof De && o.reason === Et.NotAllowed ? new Ft("could not reconnect, token might be expired") : new Ls();
13136
13136
  }
13137
13137
  if (this.shouldFailNext)
13138
13138
  throw this.shouldFailNext = !1, new Error("simulated failure");
13139
13139
  if (this.client.setReconnected(), this.emit(ce.SignalRestarted, r), yield this.waitForPCReconnected(), this.client.currentState !== xt.CONNECTED)
13140
- throw new Ds("Signal connection got severed during reconnect");
13140
+ throw new Ls("Signal connection got severed during reconnect");
13141
13141
  (t = this.regionUrlProvider) === null || t === void 0 || t.resetAttempts(), this.emit(ce.Restarted);
13142
13142
  } catch (r) {
13143
13143
  const o = yield (i = this.regionUrlProvider) === null || i === void 0 ? void 0 : i.getNextBestRegionUrl();
@@ -13164,7 +13164,7 @@ class By extends fn.EventEmitter {
13164
13164
  let r = "";
13165
13165
  throw s instanceof Error && (r = s.message, this.log.error(s.message, Object.assign(Object.assign({}, this.logContext), {
13166
13166
  error: s
13167
- }))), s instanceof Le && s.reason === Et.NotAllowed ? new Ft("could not reconnect, token might be expired") : s instanceof Le && s.reason === Et.LeaveRequest ? s : new Ds(r);
13167
+ }))), s instanceof De && s.reason === Et.NotAllowed ? new Ft("could not reconnect, token might be expired") : s instanceof De && s.reason === Et.LeaveRequest ? s : new Ls(r);
13168
13168
  }
13169
13169
  if (this.emit(ce.SignalResumed), i) {
13170
13170
  const s = this.makeRTCConfiguration(i);
@@ -13174,7 +13174,7 @@ class By extends fn.EventEmitter {
13174
13174
  if (this.shouldFailNext)
13175
13175
  throw this.shouldFailNext = !1, new Error("simulated failure");
13176
13176
  if (yield this.pcManager.triggerIceRestart(), yield this.waitForPCReconnected(), this.client.currentState !== xt.CONNECTED)
13177
- throw new Ds("Signal connection got severed during reconnect");
13177
+ throw new Ls("Signal connection got severed during reconnect");
13178
13178
  this.client.setReconnected(), ((t = this.reliableDC) === null || t === void 0 ? void 0 : t.readyState) === "open" && this.reliableDC.id === null && this.createDataChannels(), i != null && i.lastMessageSeq && this.resendReliableMessagesForResume(i.lastMessageSeq), this.emit(ce.Resumed);
13179
13179
  });
13180
13180
  }
@@ -13193,7 +13193,7 @@ class By extends fn.EventEmitter {
13193
13193
  throw new Ft("PC manager is closed");
13194
13194
  yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Ni.Connected;
13195
13195
  } catch (e) {
13196
- throw this.pcState = Ni.Disconnected, Le.internal("could not establish PC connection, ".concat(e.message));
13196
+ throw this.pcState = Ni.Disconnected, De.internal("could not establish PC connection, ".concat(e.message));
13197
13197
  }
13198
13198
  });
13199
13199
  }
@@ -13228,7 +13228,7 @@ class By extends fn.EventEmitter {
13228
13228
  kind: Ye.RELIABLE,
13229
13229
  value: {
13230
13230
  case: "rpcAck",
13231
- value: new Dd({
13231
+ value: new Ld({
13232
13232
  requestId: t
13233
13233
  })
13234
13234
  }
@@ -13309,7 +13309,7 @@ class By extends fn.EventEmitter {
13309
13309
  throw new Ft("PC manager is closed");
13310
13310
  const o = s ? i.pcManager.subscriber : i.pcManager.publisher, a = s ? "Subscriber" : "Publisher";
13311
13311
  if (!o)
13312
- throw Le.internal("".concat(a, " connection not set"));
13312
+ throw De.internal("".concat(a, " connection not set"));
13313
13313
  let c = !1;
13314
13314
  !s && !i.dataChannelForKind(t, s) && (i.createDataChannels(), c = !0), !c && !s && !i.pcManager.publisher.isICEConnected && i.pcManager.publisher.getICEConnectionState() !== "checking" && (c = !0), c && i.negotiate().catch((u) => {
13315
13315
  We.error(u, i.logContext);
@@ -13323,7 +13323,7 @@ class By extends fn.EventEmitter {
13323
13323
  return;
13324
13324
  yield ni(50);
13325
13325
  }
13326
- throw Le.internal("could not establish ".concat(a, " connection, state: ").concat(o.getICEConnectionState()));
13326
+ throw De.internal("could not establish ".concat(a, " connection, state: ").concat(o.getICEConnectionState()));
13327
13327
  })();
13328
13328
  });
13329
13329
  }
@@ -15478,7 +15478,7 @@ class ib extends Fm {
15478
15478
  var b, x, w;
15479
15479
  if (!this.engine.pcManager)
15480
15480
  throw new Ft("pcManager is not ready");
15481
- if (e.sender = yield this.engine.createSender(e, t, S), this.emit(ue.LocalSenderCreated, e.sender, e), qn(e) && ((b = t.degradationPreference) !== null && b !== void 0 || (t.degradationPreference = Dy(e)), e.setDegradationPreference(t.degradationPreference)), S)
15481
+ if (e.sender = yield this.engine.createSender(e, t, S), this.emit(ue.LocalSenderCreated, e.sender, e), qn(e) && ((b = t.degradationPreference) !== null && b !== void 0 || (t.degradationPreference = Ly(e)), e.setDegradationPreference(t.degradationPreference)), S)
15482
15482
  if (ws() && e.kind === Z.Kind.Audio) {
15483
15483
  let V;
15484
15484
  for (const O of this.engine.pcManager.publisher.getTransceivers())
@@ -15942,7 +15942,7 @@ class ib extends Fm {
15942
15942
  kind: Ye.RELIABLE,
15943
15943
  value: {
15944
15944
  case: "rpcRequest",
15945
- value: new Ld({
15945
+ value: new Dd({
15946
15946
  id: t,
15947
15947
  method: i,
15948
15948
  payload: s,
@@ -16099,7 +16099,7 @@ class nb extends Cn {
16099
16099
  }
16100
16100
  get videoQuality() {
16101
16101
  var e;
16102
- return (e = this.requestedMaxQuality) !== null && e !== void 0 ? e : Li.HIGH;
16102
+ return (e = this.requestedMaxQuality) !== null && e !== void 0 ? e : Di.HIGH;
16103
16103
  }
16104
16104
  /** @internal */
16105
16105
  setTrack(e) {
@@ -16136,7 +16136,7 @@ class nb extends Cn {
16136
16136
  }
16137
16137
  /* @internal */
16138
16138
  emitTrackUpdate() {
16139
- const e = new Lp({
16139
+ const e = new Dp({
16140
16140
  trackSids: [this.trackSid],
16141
16141
  disabled: !this.isEnabled,
16142
16142
  fps: this.fps
@@ -16154,8 +16154,8 @@ class nb extends Cn {
16154
16154
  t ? (e.width = Math.ceil(t.width), e.height = Math.ceil(t.height)) : this.requestedMaxQuality !== void 0 ? (this.log.debug("using requested max quality", Object.assign(Object.assign({}, this.logContext), {
16155
16155
  quality: this.requestedMaxQuality
16156
16156
  })), e.quality = this.requestedMaxQuality) : (this.log.debug("using default quality", Object.assign(Object.assign({}, this.logContext), {
16157
- quality: Li.HIGH
16158
- })), e.quality = Li.HIGH);
16157
+ quality: Di.HIGH
16158
+ })), e.quality = Di.HIGH);
16159
16159
  }
16160
16160
  this.emit(ae.UpdateSettings, e);
16161
16161
  }
@@ -16373,15 +16373,15 @@ class mr extends fn.EventEmitter {
16373
16373
  this.abortController = M, u == null || u();
16374
16374
  try {
16375
16375
  if (yield ar.getInstance().getBackOffPromise(a), M.signal.aborted)
16376
- throw Le.cancelled("Connection attempt aborted");
16376
+ throw De.cancelled("Connection attempt aborted");
16377
16377
  yield this.attemptConnection(m ?? a, c, l, M), this.abortController = void 0, g();
16378
16378
  } catch (S) {
16379
- if (this.regionUrlProvider && S instanceof Le && S.reason !== Et.Cancelled && S.reason !== Et.NotAllowed) {
16379
+ if (this.regionUrlProvider && S instanceof De && S.reason !== Et.Cancelled && S.reason !== Et.NotAllowed) {
16380
16380
  let T = null;
16381
16381
  try {
16382
16382
  this.log.debug("Fetching next region"), T = yield this.regionUrlProvider.getNextBestRegionUrl((p = this.abortController) === null || p === void 0 ? void 0 : p.signal);
16383
16383
  } catch (C) {
16384
- if (C instanceof Le && (C.status === 401 || C.reason === Et.Cancelled)) {
16384
+ if (C instanceof De && (C.status === 401 || C.reason === Et.Cancelled)) {
16385
16385
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), v(C);
16386
16386
  return;
16387
16387
  }
@@ -16390,7 +16390,7 @@ class mr extends fn.EventEmitter {
16390
16390
  [Et.InternalError, Et.ServerUnreachable, Et.Timeout].includes(S.reason) && (this.log.debug("Adding failed connection attempt to back off"), ar.getInstance().addFailedConnectionAttempt(a)), T && !(!((E = this.abortController) === null || E === void 0) && E.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(S.message, ". Retrying with another region: ").concat(T), this.logContext), this.recreateEngine(), yield h(g, v, T)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Eh(S)), v(S));
16391
16391
  } else {
16392
16392
  let T = ji.UNKNOWN_REASON;
16393
- S instanceof Le && (T = Eh(S)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, T), v(S);
16393
+ S instanceof De && (T = Eh(S)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, T), v(S);
16394
16394
  }
16395
16395
  }
16396
16396
  }), f = this.regionUrl;
@@ -16441,13 +16441,13 @@ class mr extends fn.EventEmitter {
16441
16441
  this.applyJoinResponse(f), this.setupLocalParticipantEvents(), this.emit(te.SignalConnected);
16442
16442
  } catch (f) {
16443
16443
  yield this.engine.close(), this.recreateEngine();
16444
- const g = d.signal.aborted ? Le.cancelled("Signal connection aborted") : Le.serverUnreachable("could not establish signal connection");
16445
- throw f instanceof Error && (g.message = "".concat(g.message, ": ").concat(f.message)), f instanceof Le && (g.reason = f.reason, g.status = f.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
16444
+ const g = d.signal.aborted ? De.cancelled("Signal connection aborted") : De.serverUnreachable("could not establish signal connection");
16445
+ throw f instanceof Error && (g.message = "".concat(g.message, ": ").concat(f.message)), f instanceof De && (g.reason = f.reason, g.status = f.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
16446
16446
  error: f
16447
16447
  })), g;
16448
16448
  }
16449
16449
  if (d.signal.aborted)
16450
- throw yield this.engine.close(), this.recreateEngine(), Le.cancelled("Connection attempt aborted");
16450
+ throw yield this.engine.close(), this.recreateEngine(), De.cancelled("Connection attempt aborted");
16451
16451
  try {
16452
16452
  yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, d);
16453
16453
  } catch (f) {
@@ -16470,7 +16470,7 @@ class mr extends fn.EventEmitter {
16470
16470
  }
16471
16471
  if (d.log.info("disconnect from room", Object.assign({}, d.logContext)), d.state === ot.Connecting || d.state === ot.Reconnecting || d.isResuming) {
16472
16472
  const m = "Abort connection attempt due to user initiated disconnect";
16473
- d.log.warn(m, d.logContext), (h = d.abortController) === null || h === void 0 || h.abort(m), (g = (f = d.connectFuture) === null || f === void 0 ? void 0 : f.reject) === null || g === void 0 || g.call(f, Le.cancelled("Client initiated disconnect")), d.connectFuture = void 0;
16473
+ d.log.warn(m, d.logContext), (h = d.abortController) === null || h === void 0 || h.abort(m), (g = (f = d.connectFuture) === null || f === void 0 ? void 0 : f.reject) === null || g === void 0 || g.call(f, De.cancelled("Client initiated disconnect")), d.connectFuture = void 0;
16474
16474
  }
16475
16475
  d.engine && (d.engine.client.isDisconnected || (yield d.engine.client.sendLeave()), yield d.engine.close()), d.handleDisconnect(u, ji.CLIENT_INITIATED), d.engine = void 0;
16476
16476
  } finally {
@@ -16628,7 +16628,7 @@ class mr extends fn.EventEmitter {
16628
16628
  }, this.handleSipDtmf = (a, c) => {
16629
16629
  this.emit(te.SipDTMFReceived, c, a), a == null || a.emit(ue.SipDTMFReceived, c);
16630
16630
  }, this.handleTranscription = (a, c) => {
16631
- const l = c.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(c.transcribedParticipantIdentity), d = l == null ? void 0 : l.trackPublications.get(c.trackId), u = DS(c, this.transcriptionReceivedTimes);
16631
+ const l = c.transcribedParticipantIdentity === this.localParticipant.identity ? this.localParticipant : this.getParticipantByIdentity(c.transcribedParticipantIdentity), d = l == null ? void 0 : l.trackPublications.get(c.trackId), u = LS(c, this.transcriptionReceivedTimes);
16632
16632
  d == null || d.emit(ae.TranscriptionReceived, u), l == null || l.emit(ue.TranscriptionReceived, u, d), this.emit(te.TranscriptionReceived, u, l, d);
16633
16633
  }, this.handleChatMessage = (a, c) => {
16634
16634
  const l = VS(c);
@@ -18363,7 +18363,7 @@ class Ko extends EventTarget {
18363
18363
  * Copyright 2010-2025 Three.js Authors
18364
18364
  * SPDX-License-Identifier: MIT
18365
18365
  */
18366
- const iu = "182", Ib = 0, Kh = 1, _b = 2, ao = 1, Pb = 2, Gr = 3, Ln = 0, ci = 1, wn = 2, _n = 0, cr = 1, Yn = 2, Hh = 3, Qh = 4, Ub = 5, Ts = 100, Lb = 101, Db = 102, Vb = 103, Nb = 104, Ob = 200, qb = 201, Fb = 202, Bb = 203, _l = 204, Pl = 205, Gb = 206, zb = 207, Wb = 208, Jb = 209, Kb = 210, Hb = 211, Qb = 212, Yb = 213, jb = 214, Ul = 0, Ll = 1, Dl = 2, gr = 3, Vl = 4, Nl = 5, Ol = 6, ql = 7, Gm = 0, Zb = 1, Xb = 2, cn = 0, zm = 1, Wm = 2, Jm = 3, Km = 4, Hm = 5, Qm = 6, Ym = 7, jm = 300, _s = 301, vr = 302, Fl = 303, Bl = 304, Ho = 306, Gl = 1e3, In = 1001, zl = 1002, si = 1003, $b = 1004, Ta = 1005, oi = 1006, Mc = 1007, Cs = 1008, Ui = 1009, Zm = 1010, Xm = 1011, aa = 1012, nu = 1013, hn = 1014, rn = 1015, Dn = 1016, su = 1017, ru = 1018, oa = 1020, $m = 35902, eg = 35899, tg = 1021, ig = 1022, Zi = 1023, Vn = 1026, Ms = 1027, ng = 1028, au = 1029, Sr = 1030, ou = 1031, cu = 1033, oo = 33776, co = 33777, lo = 33778, uo = 33779, Wl = 35840, Jl = 35841, Kl = 35842, Hl = 35843, Ql = 36196, Yl = 37492, jl = 37496, Zl = 37488, Xl = 37489, $l = 37490, ed = 37491, td = 37808, id = 37809, nd = 37810, sd = 37811, rd = 37812, ad = 37813, od = 37814, cd = 37815, ld = 37816, dd = 37817, ud = 37818, hd = 37819, fd = 37820, pd = 37821, md = 36492, gd = 36494, vd = 36495, Sd = 36283, yd = 36284, bd = 36285, Td = 36286, eT = 3200, tT = 0, iT = 1, jn = "", qi = "srgb", yr = "srgb-linear", Ro = "linear", ft = "srgb", Vs = 7680, Yh = 519, nT = 512, sT = 513, rT = 514, lu = 515, aT = 516, oT = 517, du = 518, cT = 519, jh = 35044, Zh = "300 es", an = 2e3, ko = 2001;
18366
+ const iu = "182", Ib = 0, Kh = 1, _b = 2, ao = 1, Pb = 2, Gr = 3, Dn = 0, ci = 1, wn = 2, _n = 0, cr = 1, Yn = 2, Hh = 3, Qh = 4, Ub = 5, Ts = 100, Db = 101, Lb = 102, Vb = 103, Nb = 104, Ob = 200, qb = 201, Fb = 202, Bb = 203, _l = 204, Pl = 205, Gb = 206, zb = 207, Wb = 208, Jb = 209, Kb = 210, Hb = 211, Qb = 212, Yb = 213, jb = 214, Ul = 0, Dl = 1, Ll = 2, gr = 3, Vl = 4, Nl = 5, Ol = 6, ql = 7, Gm = 0, Zb = 1, Xb = 2, cn = 0, zm = 1, Wm = 2, Jm = 3, Km = 4, Hm = 5, Qm = 6, Ym = 7, jm = 300, _s = 301, vr = 302, Fl = 303, Bl = 304, Ho = 306, Gl = 1e3, In = 1001, zl = 1002, si = 1003, $b = 1004, Ta = 1005, oi = 1006, Mc = 1007, Cs = 1008, Ui = 1009, Zm = 1010, Xm = 1011, aa = 1012, nu = 1013, hn = 1014, rn = 1015, Ln = 1016, su = 1017, ru = 1018, oa = 1020, $m = 35902, eg = 35899, tg = 1021, ig = 1022, Zi = 1023, Vn = 1026, Ms = 1027, ng = 1028, au = 1029, Sr = 1030, ou = 1031, cu = 1033, oo = 33776, co = 33777, lo = 33778, uo = 33779, Wl = 35840, Jl = 35841, Kl = 35842, Hl = 35843, Ql = 36196, Yl = 37492, jl = 37496, Zl = 37488, Xl = 37489, $l = 37490, ed = 37491, td = 37808, id = 37809, nd = 37810, sd = 37811, rd = 37812, ad = 37813, od = 37814, cd = 37815, ld = 37816, dd = 37817, ud = 37818, hd = 37819, fd = 37820, pd = 37821, md = 36492, gd = 36494, vd = 36495, Sd = 36283, yd = 36284, bd = 36285, Td = 36286, eT = 3200, tT = 0, iT = 1, jn = "", qi = "srgb", yr = "srgb-linear", Ro = "linear", ft = "srgb", Vs = 7680, Yh = 519, nT = 512, sT = 513, rT = 514, lu = 515, aT = 516, oT = 517, du = 518, cT = 519, jh = 35044, Zh = "300 es", an = 2e3, ko = 2001;
18367
18367
  function sg(n) {
18368
18368
  for (let e = n.length - 1; e >= 0; --e)
18369
18369
  if (n[e] >= 65535) return !0;
@@ -22248,7 +22248,7 @@ function Pc(n, e, t, i, s) {
22248
22248
  }
22249
22249
  return !0;
22250
22250
  }
22251
- const ST = /* @__PURE__ */ new pa(), Lr = /* @__PURE__ */ new N(), Uc = /* @__PURE__ */ new N();
22251
+ const ST = /* @__PURE__ */ new pa(), Dr = /* @__PURE__ */ new N(), Uc = /* @__PURE__ */ new N();
22252
22252
  class ma {
22253
22253
  /**
22254
22254
  * Constructs a new sphere.
@@ -22413,11 +22413,11 @@ class ma {
22413
22413
  expandByPoint(e) {
22414
22414
  if (this.isEmpty())
22415
22415
  return this.center.copy(e), this.radius = 0, this;
22416
- Lr.subVectors(e, this.center);
22417
- const t = Lr.lengthSq();
22416
+ Dr.subVectors(e, this.center);
22417
+ const t = Dr.lengthSq();
22418
22418
  if (t > this.radius * this.radius) {
22419
22419
  const i = Math.sqrt(t), s = (i - this.radius) * 0.5;
22420
- this.center.addScaledVector(Lr, s / i), this.radius += s;
22420
+ this.center.addScaledVector(Dr, s / i), this.radius += s;
22421
22421
  }
22422
22422
  return this;
22423
22423
  }
@@ -22428,7 +22428,7 @@ class ma {
22428
22428
  * @return {Sphere} A reference to this sphere.
22429
22429
  */
22430
22430
  union(e) {
22431
- return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (Uc.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Lr.copy(e.center).add(Uc)), this.expandByPoint(Lr.copy(e.center).sub(Uc))), this);
22431
+ return e.isEmpty() ? this : this.isEmpty() ? (this.copy(e), this) : (this.center.equals(e.center) === !0 ? this.radius = Math.max(this.radius, e.radius) : (Uc.subVectors(e.center, this.center).setLength(e.radius), this.expandByPoint(Dr.copy(e.center).add(Uc)), this.expandByPoint(Dr.copy(e.center).sub(Uc))), this);
22432
22432
  }
22433
22433
  /**
22434
22434
  * Returns `true` if this sphere is equal with the given one.
@@ -22468,7 +22468,7 @@ class ma {
22468
22468
  return this.radius = e.radius, this.center.fromArray(e.center), this;
22469
22469
  }
22470
22470
  }
22471
- const vn = /* @__PURE__ */ new N(), Lc = /* @__PURE__ */ new N(), Ma = /* @__PURE__ */ new N(), Gn = /* @__PURE__ */ new N(), Dc = /* @__PURE__ */ new N(), Aa = /* @__PURE__ */ new N(), Vc = /* @__PURE__ */ new N();
22471
+ const vn = /* @__PURE__ */ new N(), Dc = /* @__PURE__ */ new N(), Ma = /* @__PURE__ */ new N(), Gn = /* @__PURE__ */ new N(), Lc = /* @__PURE__ */ new N(), Aa = /* @__PURE__ */ new N(), Vc = /* @__PURE__ */ new N();
22472
22472
  class hu {
22473
22473
  /**
22474
22474
  * Constructs a new ray.
@@ -22567,7 +22567,7 @@ class hu {
22567
22567
  * @return {number} The squared distance.
22568
22568
  */
22569
22569
  distanceSqToSegment(e, t, i, s) {
22570
- Lc.copy(e).add(t).multiplyScalar(0.5), Ma.copy(t).sub(e).normalize(), Gn.copy(this.origin).sub(Lc);
22570
+ Dc.copy(e).add(t).multiplyScalar(0.5), Ma.copy(t).sub(e).normalize(), Gn.copy(this.origin).sub(Dc);
22571
22571
  const r = e.distanceTo(t) * 0.5, o = -this.direction.dot(Ma), a = Gn.dot(this.direction), c = -Gn.dot(Ma), l = Gn.lengthSq(), d = Math.abs(1 - o * o);
22572
22572
  let u, h, f, g;
22573
22573
  if (d > 0)
@@ -22584,7 +22584,7 @@ class hu {
22584
22584
  h <= -g ? (u = Math.max(0, -(-o * r + a)), h = u > 0 ? -r : Math.min(Math.max(-r, -c), r), f = -u * u + h * (h + 2 * c) + l) : h <= g ? (u = 0, h = Math.min(Math.max(-r, -c), r), f = h * (h + 2 * c) + l) : (u = Math.max(0, -(o * r + a)), h = u > 0 ? r : Math.min(Math.max(-r, -c), r), f = -u * u + h * (h + 2 * c) + l);
22585
22585
  else
22586
22586
  h = o > 0 ? -r : r, u = Math.max(0, -(o * h + a)), f = -u * u + h * (h + 2 * c) + l;
22587
- return i && i.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(Lc).addScaledVector(Ma, h), f;
22587
+ return i && i.copy(this.origin).addScaledVector(this.direction, u), s && s.copy(Dc).addScaledVector(Ma, h), f;
22588
22588
  }
22589
22589
  /**
22590
22590
  * Intersects this ray with the given sphere, returning the intersection
@@ -22680,7 +22680,7 @@ class hu {
22680
22680
  * @return {?Vector3} The intersection point.
22681
22681
  */
22682
22682
  intersectTriangle(e, t, i, s, r) {
22683
- Dc.subVectors(t, e), Aa.subVectors(i, e), Vc.crossVectors(Dc, Aa);
22683
+ Lc.subVectors(t, e), Aa.subVectors(i, e), Vc.crossVectors(Lc, Aa);
22684
22684
  let o = this.direction.dot(Vc), a;
22685
22685
  if (o > 0) {
22686
22686
  if (s) return null;
@@ -22693,7 +22693,7 @@ class hu {
22693
22693
  const c = a * this.direction.dot(Aa.crossVectors(Gn, Aa));
22694
22694
  if (c < 0)
22695
22695
  return null;
22696
- const l = a * this.direction.dot(Dc.cross(Gn));
22696
+ const l = a * this.direction.dot(Lc.cross(Gn));
22697
22697
  if (l < 0 || c + l > o)
22698
22698
  return null;
22699
22699
  const d = -a * Gn.dot(Vc);
@@ -23712,7 +23712,7 @@ class ag {
23712
23712
  }
23713
23713
  }
23714
23714
  let TT = 0;
23715
- const af = /* @__PURE__ */ new N(), Gs = /* @__PURE__ */ new fa(), Sn = /* @__PURE__ */ new Ut(), ka = /* @__PURE__ */ new N(), Dr = /* @__PURE__ */ new N(), xT = /* @__PURE__ */ new N(), ET = /* @__PURE__ */ new fa(), of = /* @__PURE__ */ new N(1, 0, 0), cf = /* @__PURE__ */ new N(0, 1, 0), lf = /* @__PURE__ */ new N(0, 0, 1), df = { type: "added" }, CT = { type: "removed" }, zs = { type: "childadded", child: null }, Nc = { type: "childremoved", child: null };
23715
+ const af = /* @__PURE__ */ new N(), Gs = /* @__PURE__ */ new fa(), Sn = /* @__PURE__ */ new Ut(), ka = /* @__PURE__ */ new N(), Lr = /* @__PURE__ */ new N(), xT = /* @__PURE__ */ new N(), ET = /* @__PURE__ */ new fa(), of = /* @__PURE__ */ new N(1, 0, 0), cf = /* @__PURE__ */ new N(0, 1, 0), lf = /* @__PURE__ */ new N(0, 0, 1), df = { type: "added" }, CT = { type: "removed" }, zs = { type: "childadded", child: null }, Nc = { type: "childremoved", child: null };
23716
23716
  class ei extends Tr {
23717
23717
  /**
23718
23718
  * Constructs a new 3D object.
@@ -24010,7 +24010,7 @@ class ei extends Tr {
24010
24010
  lookAt(e, t, i) {
24011
24011
  e.isVector3 ? ka.copy(e) : ka.set(e, t, i);
24012
24012
  const s = this.parent;
24013
- this.updateWorldMatrix(!0, !1), Dr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Sn.lookAt(Dr, ka, this.up) : Sn.lookAt(ka, Dr, this.up), this.quaternion.setFromRotationMatrix(Sn), s && (Sn.extractRotation(s.matrixWorld), Gs.setFromRotationMatrix(Sn), this.quaternion.premultiply(Gs.invert()));
24013
+ this.updateWorldMatrix(!0, !1), Lr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Sn.lookAt(Lr, ka, this.up) : Sn.lookAt(ka, Lr, this.up), this.quaternion.setFromRotationMatrix(Sn), s && (Sn.extractRotation(s.matrixWorld), Gs.setFromRotationMatrix(Sn), this.quaternion.premultiply(Gs.invert()));
24014
24014
  }
24015
24015
  /**
24016
24016
  * Adds the given 3D object as a child to this 3D object. An arbitrary number of
@@ -24149,7 +24149,7 @@ class ei extends Tr {
24149
24149
  * @return {Quaternion} The 3D object's rotation in world space.
24150
24150
  */
24151
24151
  getWorldQuaternion(e) {
24152
- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Dr, e, xT), e;
24152
+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Lr, e, xT), e;
24153
24153
  }
24154
24154
  /**
24155
24155
  * Returns a vector representing the scale of the 3D object in world space.
@@ -24158,7 +24158,7 @@ class ei extends Tr {
24158
24158
  * @return {Vector3} The 3D object's scale in world space.
24159
24159
  */
24160
24160
  getWorldScale(e) {
24161
- return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Dr, ET, e), e;
24161
+ return this.updateWorldMatrix(!0, !1), this.matrixWorld.decompose(Lr, ET, e), e;
24162
24162
  }
24163
24163
  /**
24164
24164
  * Returns a vector representing the ("look") direction of the 3D object in world space.
@@ -25286,7 +25286,7 @@ class xr extends Tr {
25286
25286
  * Constructs a new material.
25287
25287
  */
25288
25288
  constructor() {
25289
- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: MT++ }), this.uuid = ha(), this.name = "", this.type = "Material", this.blending = cr, this.side = Ln, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = _l, this.blendDst = Pl, this.blendEquation = Ts, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Ne(0, 0, 0), this.blendAlpha = 0, this.depthFunc = gr, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = Yh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Vs, this.stencilZFail = Vs, this.stencilZPass = Vs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
25289
+ super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: MT++ }), this.uuid = ha(), this.name = "", this.type = "Material", this.blending = cr, this.side = Dn, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = _l, this.blendDst = Pl, this.blendEquation = Ts, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Ne(0, 0, 0), this.blendAlpha = 0, this.depthFunc = gr, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = Yh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Vs, this.stencilZFail = Vs, this.stencilZPass = Vs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
25290
25290
  }
25291
25291
  /**
25292
25292
  * Sets the alpha value to be used when running an alpha test. The material
@@ -25385,7 +25385,7 @@ class xr extends Tr {
25385
25385
  generator: "Material.toJSON"
25386
25386
  }
25387
25387
  };
25388
- i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen !== void 0 && (i.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (i.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (i.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (i.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (i.dispersion = this.dispersion), this.iridescence !== void 0 && (i.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (i.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (i.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (i.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (i.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (i.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== cr && (i.blending = this.blending), this.side !== Ln && (i.side = this.side), this.vertexColors === !0 && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = !0), this.blendSrc !== _l && (i.blendSrc = this.blendSrc), this.blendDst !== Pl && (i.blendDst = this.blendDst), this.blendEquation !== Ts && (i.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha), this.depthFunc !== gr && (i.depthFunc = this.depthFunc), this.depthTest === !1 && (i.depthTest = this.depthTest), this.depthWrite === !1 && (i.depthWrite = this.depthWrite), this.colorWrite === !1 && (i.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== Yh && (i.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (i.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Vs && (i.stencilFail = this.stencilFail), this.stencilZFail !== Vs && (i.stencilZFail = this.stencilZFail), this.stencilZPass !== Vs && (i.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaHash === !0 && (i.alphaHash = !0), this.alphaToCoverage === !0 && (i.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0), this.forceSinglePass === !0 && (i.forceSinglePass = !0), this.allowOverride === !1 && (i.allowOverride = !1), this.wireframe === !0 && (i.wireframe = !0), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (i.flatShading = !0), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), this.fog === !1 && (i.fog = !1), Object.keys(this.userData).length > 0 && (i.userData = this.userData);
25388
+ i.uuid = this.uuid, i.type = this.type, this.name !== "" && (i.name = this.name), this.color && this.color.isColor && (i.color = this.color.getHex()), this.roughness !== void 0 && (i.roughness = this.roughness), this.metalness !== void 0 && (i.metalness = this.metalness), this.sheen !== void 0 && (i.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (i.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (i.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (i.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (i.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (i.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (i.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (i.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (i.shininess = this.shininess), this.clearcoat !== void 0 && (i.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (i.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (i.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (i.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (i.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, i.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (i.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (i.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (i.dispersion = this.dispersion), this.iridescence !== void 0 && (i.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (i.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (i.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (i.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (i.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (i.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (i.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (i.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (i.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (i.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (i.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (i.lightMap = this.lightMap.toJSON(e).uuid, i.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (i.aoMap = this.aoMap.toJSON(e).uuid, i.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (i.bumpMap = this.bumpMap.toJSON(e).uuid, i.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (i.normalMap = this.normalMap.toJSON(e).uuid, i.normalMapType = this.normalMapType, i.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (i.displacementMap = this.displacementMap.toJSON(e).uuid, i.displacementScale = this.displacementScale, i.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (i.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (i.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (i.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (i.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (i.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (i.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (i.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (i.combine = this.combine)), this.envMapRotation !== void 0 && (i.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (i.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (i.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (i.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (i.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (i.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (i.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (i.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (i.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (i.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (i.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (i.size = this.size), this.shadowSide !== null && (i.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (i.sizeAttenuation = this.sizeAttenuation), this.blending !== cr && (i.blending = this.blending), this.side !== Dn && (i.side = this.side), this.vertexColors === !0 && (i.vertexColors = !0), this.opacity < 1 && (i.opacity = this.opacity), this.transparent === !0 && (i.transparent = !0), this.blendSrc !== _l && (i.blendSrc = this.blendSrc), this.blendDst !== Pl && (i.blendDst = this.blendDst), this.blendEquation !== Ts && (i.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (i.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (i.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (i.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (i.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (i.blendAlpha = this.blendAlpha), this.depthFunc !== gr && (i.depthFunc = this.depthFunc), this.depthTest === !1 && (i.depthTest = this.depthTest), this.depthWrite === !1 && (i.depthWrite = this.depthWrite), this.colorWrite === !1 && (i.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (i.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== Yh && (i.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (i.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (i.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Vs && (i.stencilFail = this.stencilFail), this.stencilZFail !== Vs && (i.stencilZFail = this.stencilZFail), this.stencilZPass !== Vs && (i.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (i.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (i.rotation = this.rotation), this.polygonOffset === !0 && (i.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (i.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (i.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (i.linewidth = this.linewidth), this.dashSize !== void 0 && (i.dashSize = this.dashSize), this.gapSize !== void 0 && (i.gapSize = this.gapSize), this.scale !== void 0 && (i.scale = this.scale), this.dithering === !0 && (i.dithering = !0), this.alphaTest > 0 && (i.alphaTest = this.alphaTest), this.alphaHash === !0 && (i.alphaHash = !0), this.alphaToCoverage === !0 && (i.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (i.premultipliedAlpha = !0), this.forceSinglePass === !0 && (i.forceSinglePass = !0), this.allowOverride === !1 && (i.allowOverride = !1), this.wireframe === !0 && (i.wireframe = !0), this.wireframeLinewidth > 1 && (i.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (i.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (i.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (i.flatShading = !0), this.visible === !1 && (i.visible = !1), this.toneMapped === !1 && (i.toneMapped = !1), this.fog === !1 && (i.fog = !1), Object.keys(this.userData).length > 0 && (i.userData = this.userData);
25389
25389
  function s(r) {
25390
25390
  const o = [];
25391
25391
  for (const a in r) {
@@ -26356,7 +26356,7 @@ class gi extends Tr {
26356
26356
  this.dispatchEvent({ type: "dispose" });
26357
26357
  }
26358
26358
  }
26359
- const hf = /* @__PURE__ */ new Ut(), fs = /* @__PURE__ */ new hu(), _a = /* @__PURE__ */ new ma(), ff = /* @__PURE__ */ new N(), Pa = /* @__PURE__ */ new N(), Ua = /* @__PURE__ */ new N(), La = /* @__PURE__ */ new N(), Hc = /* @__PURE__ */ new N(), Da = /* @__PURE__ */ new N(), pf = /* @__PURE__ */ new N(), Va = /* @__PURE__ */ new N();
26359
+ const hf = /* @__PURE__ */ new Ut(), fs = /* @__PURE__ */ new hu(), _a = /* @__PURE__ */ new ma(), ff = /* @__PURE__ */ new N(), Pa = /* @__PURE__ */ new N(), Ua = /* @__PURE__ */ new N(), Da = /* @__PURE__ */ new N(), Hc = /* @__PURE__ */ new N(), La = /* @__PURE__ */ new N(), pf = /* @__PURE__ */ new N(), Va = /* @__PURE__ */ new N();
26360
26360
  class Ri extends ei {
26361
26361
  /**
26362
26362
  * Constructs a new mesh.
@@ -26400,12 +26400,12 @@ class Ri extends ei {
26400
26400
  t.fromBufferAttribute(s, e);
26401
26401
  const a = this.morphTargetInfluences;
26402
26402
  if (r && a) {
26403
- Da.set(0, 0, 0);
26403
+ La.set(0, 0, 0);
26404
26404
  for (let c = 0, l = r.length; c < l; c++) {
26405
26405
  const d = a[c], u = r[c];
26406
- d !== 0 && (Hc.fromBufferAttribute(u, e), o ? Da.addScaledVector(Hc, d) : Da.addScaledVector(Hc.sub(t), d));
26406
+ d !== 0 && (Hc.fromBufferAttribute(u, e), o ? La.addScaledVector(Hc, d) : La.addScaledVector(Hc.sub(t), d));
26407
26407
  }
26408
- t.add(Da);
26408
+ t.add(La);
26409
26409
  }
26410
26410
  return t;
26411
26411
  }
@@ -26458,7 +26458,7 @@ class Ri extends ei {
26458
26458
  }
26459
26459
  function kT(n, e, t, i, s, r, o, a) {
26460
26460
  let c;
26461
- if (e.side === ci ? c = i.intersectTriangle(o, r, s, !0, a) : c = i.intersectTriangle(s, r, o, e.side === Ln, a), c === null) return null;
26461
+ if (e.side === ci ? c = i.intersectTriangle(o, r, s, !0, a) : c = i.intersectTriangle(s, r, o, e.side === Dn, a), c === null) return null;
26462
26462
  Va.copy(a), Va.applyMatrix4(n.matrixWorld);
26463
26463
  const l = t.ray.origin.distanceTo(Va);
26464
26464
  return l < t.near || l > t.far ? null : {
@@ -26468,11 +26468,11 @@ function kT(n, e, t, i, s, r, o, a) {
26468
26468
  };
26469
26469
  }
26470
26470
  function Na(n, e, t, i, s, r, o, a, c, l) {
26471
- n.getVertexPosition(a, Pa), n.getVertexPosition(c, Ua), n.getVertexPosition(l, La);
26472
- const d = kT(n, e, t, i, Pa, Ua, La, pf);
26471
+ n.getVertexPosition(a, Pa), n.getVertexPosition(c, Ua), n.getVertexPosition(l, Da);
26472
+ const d = kT(n, e, t, i, Pa, Ua, Da, pf);
26473
26473
  if (d) {
26474
26474
  const u = new N();
26475
- Yi.getBarycoord(pf, Pa, Ua, La, u), s && (d.uv = Yi.getInterpolatedAttribute(s, a, c, l, u, new nt())), r && (d.uv1 = Yi.getInterpolatedAttribute(r, a, c, l, u, new nt())), o && (d.normal = Yi.getInterpolatedAttribute(o, a, c, l, u, new N()), d.normal.dot(i.direction) > 0 && d.normal.multiplyScalar(-1));
26475
+ Yi.getBarycoord(pf, Pa, Ua, Da, u), s && (d.uv = Yi.getInterpolatedAttribute(s, a, c, l, u, new nt())), r && (d.uv1 = Yi.getInterpolatedAttribute(r, a, c, l, u, new nt())), o && (d.normal = Yi.getInterpolatedAttribute(o, a, c, l, u, new N()), d.normal.dot(i.direction) > 0 && d.normal.multiplyScalar(-1));
26476
26476
  const h = {
26477
26477
  a,
26478
26478
  b: c,
@@ -26480,7 +26480,7 @@ function Na(n, e, t, i, s, r, o, a, c, l) {
26480
26480
  normal: new N(),
26481
26481
  materialIndex: 0
26482
26482
  };
26483
- Yi.getNormal(Pa, Ua, La, h.normal), d.face = h, d.barycoord = u;
26483
+ Yi.getNormal(Pa, Ua, Da, h.normal), d.face = h, d.barycoord = u;
26484
26484
  }
26485
26485
  return d;
26486
26486
  }
@@ -27034,7 +27034,7 @@ class Oa extends ei {
27034
27034
  super(), this.isGroup = !0, this.type = "Group";
27035
27035
  }
27036
27036
  }
27037
- const LT = { type: "move" };
27037
+ const DT = { type: "move" };
27038
27038
  class Qc {
27039
27039
  /**
27040
27040
  * Constructs a new XR controller.
@@ -27132,7 +27132,7 @@ class Qc {
27132
27132
  }));
27133
27133
  } else
27134
27134
  c !== null && e.gripSpace && (r = t.getPose(e.gripSpace, i), r !== null && (c.matrix.fromArray(r.transform.matrix), c.matrix.decompose(c.position, c.rotation, c.scale), c.matrixWorldNeedsUpdate = !0, r.linearVelocity ? (c.hasLinearVelocity = !0, c.linearVelocity.copy(r.linearVelocity)) : c.hasLinearVelocity = !1, r.angularVelocity ? (c.hasAngularVelocity = !0, c.angularVelocity.copy(r.angularVelocity)) : c.hasAngularVelocity = !1));
27135
- a !== null && (s = t.getPose(e.targetRaySpace, i), s === null && r !== null && (s = r), s !== null && (a.matrix.fromArray(s.transform.matrix), a.matrix.decompose(a.position, a.rotation, a.scale), a.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (a.hasLinearVelocity = !0, a.linearVelocity.copy(s.linearVelocity)) : a.hasLinearVelocity = !1, s.angularVelocity ? (a.hasAngularVelocity = !0, a.angularVelocity.copy(s.angularVelocity)) : a.hasAngularVelocity = !1, this.dispatchEvent(LT)));
27135
+ a !== null && (s = t.getPose(e.targetRaySpace, i), s === null && r !== null && (s = r), s !== null && (a.matrix.fromArray(s.transform.matrix), a.matrix.decompose(a.position, a.rotation, a.scale), a.matrixWorldNeedsUpdate = !0, s.linearVelocity ? (a.hasLinearVelocity = !0, a.linearVelocity.copy(s.linearVelocity)) : a.hasLinearVelocity = !1, s.angularVelocity ? (a.hasAngularVelocity = !0, a.angularVelocity.copy(s.angularVelocity)) : a.hasAngularVelocity = !1, this.dispatchEvent(DT)));
27136
27136
  }
27137
27137
  return a !== null && (a.visible = s !== null), c !== null && (c.visible = r !== null), l !== null && (l.visible = o !== null), this;
27138
27138
  }
@@ -27167,7 +27167,7 @@ class mg extends ei {
27167
27167
  return this.fog !== null && (t.object.fog = this.fog.toJSON()), this.backgroundBlurriness > 0 && (t.object.backgroundBlurriness = this.backgroundBlurriness), this.backgroundIntensity !== 1 && (t.object.backgroundIntensity = this.backgroundIntensity), t.object.backgroundRotation = this.backgroundRotation.toArray(), this.environmentIntensity !== 1 && (t.object.environmentIntensity = this.environmentIntensity), t.object.environmentRotation = this.environmentRotation.toArray(), t;
27168
27168
  }
27169
27169
  }
27170
- class DT extends mi {
27170
+ class LT extends mi {
27171
27171
  /**
27172
27172
  * Constructs a new data texture.
27173
27173
  *
@@ -28639,7 +28639,7 @@ function XT(n) {
28639
28639
  return { byteLength: 1, components: 1 };
28640
28640
  case aa:
28641
28641
  case Xm:
28642
- case Dn:
28642
+ case Ln:
28643
28643
  return { byteLength: 2, components: 1 };
28644
28644
  case su:
28645
28645
  case ru:
@@ -29314,7 +29314,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
29314
29314
  #else
29315
29315
  uniform sampler2D envMap;
29316
29316
  #endif
29317
- #endif`, Lx = `#ifdef USE_ENVMAP
29317
+ #endif`, Dx = `#ifdef USE_ENVMAP
29318
29318
  uniform float reflectivity;
29319
29319
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
29320
29320
  #define ENV_WORLDPOS
@@ -29325,7 +29325,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
29325
29325
  #else
29326
29326
  varying vec3 vReflect;
29327
29327
  #endif
29328
- #endif`, Dx = `#ifdef USE_ENVMAP
29328
+ #endif`, Lx = `#ifdef USE_ENVMAP
29329
29329
  #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
29330
29330
  #define ENV_WORLDPOS
29331
29331
  #endif
@@ -30469,9 +30469,9 @@ gl_Position = projectionMatrix * mvPosition;`, _E = `#ifdef DITHERING
30469
30469
  #ifdef USE_ROUGHNESSMAP
30470
30470
  vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
30471
30471
  roughnessFactor *= texelRoughness.g;
30472
- #endif`, LE = `#ifdef USE_ROUGHNESSMAP
30472
+ #endif`, DE = `#ifdef USE_ROUGHNESSMAP
30473
30473
  uniform sampler2D roughnessMap;
30474
- #endif`, DE = `#if NUM_SPOT_LIGHT_COORDS > 0
30474
+ #endif`, LE = `#if NUM_SPOT_LIGHT_COORDS > 0
30475
30475
  varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
30476
30476
  #endif
30477
30477
  #if NUM_SPOT_LIGHT_MAPS > 0
@@ -32381,8 +32381,8 @@ void main() {
32381
32381
  colorspace_pars_fragment: _x,
32382
32382
  envmap_fragment: Px,
32383
32383
  envmap_common_pars_fragment: Ux,
32384
- envmap_pars_fragment: Lx,
32385
- envmap_pars_vertex: Dx,
32384
+ envmap_pars_fragment: Dx,
32385
+ envmap_pars_vertex: Lx,
32386
32386
  envmap_physical_pars_fragment: Kx,
32387
32387
  envmap_vertex: Vx,
32388
32388
  fog_vertex: Nx,
@@ -32435,8 +32435,8 @@ void main() {
32435
32435
  dithering_fragment: _E,
32436
32436
  dithering_pars_fragment: PE,
32437
32437
  roughnessmap_fragment: UE,
32438
- roughnessmap_pars_fragment: LE,
32439
- shadowmap_pars_fragment: DE,
32438
+ roughnessmap_pars_fragment: DE,
32439
+ shadowmap_pars_fragment: LE,
32440
32440
  shadowmap_pars_vertex: VE,
32441
32441
  shadowmap_vertex: NE,
32442
32442
  shadowmask_pars_fragment: OE,
@@ -32929,7 +32929,7 @@ sn.physical = {
32929
32929
  fragmentShader: Je.meshphysical_frag
32930
32930
  };
32931
32931
  const Wa = { r: 0, b: 0, g: 0 }, ms = /* @__PURE__ */ new Nn(), UC = /* @__PURE__ */ new Ut();
32932
- function LC(n, e, t, i, s, r, o) {
32932
+ function DC(n, e, t, i, s, r, o) {
32933
32933
  const a = new Ne(0);
32934
32934
  let c = r === !0 ? 0 : 1, l, d, u = null, h = 0, f = null;
32935
32935
  function g(M) {
@@ -32971,7 +32971,7 @@ function LC(n, e, t, i, s, r, o) {
32971
32971
  uniforms: br(sn.background.uniforms),
32972
32972
  vertexShader: sn.background.vertexShader,
32973
32973
  fragmentShader: sn.background.fragmentShader,
32974
- side: Ln,
32974
+ side: Dn,
32975
32975
  depthTest: !1,
32976
32976
  depthWrite: !1,
32977
32977
  fog: !1,
@@ -33007,7 +33007,7 @@ function LC(n, e, t, i, s, r, o) {
33007
33007
  dispose: E
33008
33008
  };
33009
33009
  }
33010
- function DC(n, e) {
33010
+ function LC(n, e) {
33011
33011
  const t = n.getParameter(n.MAX_VERTEX_ATTRIBS), i = {}, s = h(null);
33012
33012
  let r = s, o = !1;
33013
33013
  function a(x, w, V, O, J) {
@@ -33270,7 +33270,7 @@ function NC(n, e, t, i) {
33270
33270
  return !(R !== Zi && i.convert(R) !== n.getParameter(n.IMPLEMENTATION_COLOR_READ_FORMAT));
33271
33271
  }
33272
33272
  function a(R) {
33273
- const _ = R === Dn && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
33273
+ const _ = R === Ln && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
33274
33274
  return !(R !== Ui && i.convert(R) !== n.getParameter(n.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)
33275
33275
  R !== rn && !_);
33276
33276
  }
@@ -33495,7 +33495,7 @@ class Af {
33495
33495
  magFilter: oi,
33496
33496
  minFilter: oi,
33497
33497
  generateMipmaps: !1,
33498
- type: Dn,
33498
+ type: Ln,
33499
33499
  format: Zi,
33500
33500
  colorSpace: yr,
33501
33501
  depthBuffer: !1
@@ -34313,7 +34313,7 @@ function $C(n, e, t, i, s) {
34313
34313
  depthBuffer: i,
34314
34314
  stencilBuffer: s
34315
34315
  }), o = new ln(e, t, {
34316
- type: Dn,
34316
+ type: Ln,
34317
34317
  depthBuffer: !1,
34318
34318
  stencilBuffer: !1
34319
34319
  }), a = new gi();
@@ -34424,7 +34424,7 @@ function $C(n, e, t, i, s) {
34424
34424
  r.dispose(), o.dispose(), a.dispose(), c.dispose();
34425
34425
  };
34426
34426
  }
34427
- const bg = /* @__PURE__ */ new mi(), Cd = /* @__PURE__ */ new la(1, 1), Tg = /* @__PURE__ */ new rg(), xg = /* @__PURE__ */ new vT(), Eg = /* @__PURE__ */ new fg(), If = [], _f = [], Pf = new Float32Array(16), Uf = new Float32Array(9), Lf = new Float32Array(4);
34427
+ const bg = /* @__PURE__ */ new mi(), Cd = /* @__PURE__ */ new la(1, 1), Tg = /* @__PURE__ */ new rg(), xg = /* @__PURE__ */ new vT(), Eg = /* @__PURE__ */ new fg(), If = [], _f = [], Pf = new Float32Array(16), Uf = new Float32Array(9), Df = new Float32Array(4);
34428
34428
  function Er(n, e, t) {
34429
34429
  const i = n[0];
34430
34430
  if (i <= 0 || i > 0) return n;
@@ -34494,7 +34494,7 @@ function sM(n, e) {
34494
34494
  n.uniformMatrix2fv(this.addr, !1, e), Yt(t, e);
34495
34495
  } else {
34496
34496
  if (Qt(t, i)) return;
34497
- Lf.set(i), n.uniformMatrix2fv(this.addr, !1, Lf), Yt(t, i);
34497
+ Df.set(i), n.uniformMatrix2fv(this.addr, !1, Df), Yt(t, i);
34498
34498
  }
34499
34499
  }
34500
34500
  function rM(n, e) {
@@ -34730,10 +34730,10 @@ function PM(n, e) {
34730
34730
  function UM(n, e) {
34731
34731
  n.uniform3uiv(this.addr, e);
34732
34732
  }
34733
- function LM(n, e) {
34733
+ function DM(n, e) {
34734
34734
  n.uniform4uiv(this.addr, e);
34735
34735
  }
34736
- function DM(n, e, t) {
34736
+ function LM(n, e, t) {
34737
34737
  const i = this.cache, s = e.length, r = jo(t, s);
34738
34738
  Qt(i, r) || (n.uniform1iv(this.addr, r), Yt(i, r));
34739
34739
  let o;
@@ -34808,7 +34808,7 @@ function qM(n) {
34808
34808
  return UM;
34809
34809
  // _VEC3
34810
34810
  case 36296:
34811
- return LM;
34811
+ return DM;
34812
34812
  // _VEC4
34813
34813
  case 35678:
34814
34814
  // SAMPLER_2D
@@ -34819,7 +34819,7 @@ function qM(n) {
34819
34819
  case 36306:
34820
34820
  // UNSIGNED_INT_SAMPLER_2D
34821
34821
  case 35682:
34822
- return DM;
34822
+ return LM;
34823
34823
  case 35679:
34824
34824
  // SAMPLER_3D
34825
34825
  case 36299:
@@ -34867,7 +34867,7 @@ class GM {
34867
34867
  }
34868
34868
  }
34869
34869
  const nl = /(\w+)(\])?(\[|\.)?/g;
34870
- function Df(n, e) {
34870
+ function Lf(n, e) {
34871
34871
  n.seq.push(e), n.map[e.id] = e;
34872
34872
  }
34873
34873
  function zM(n, e, t) {
@@ -34877,11 +34877,11 @@ function zM(n, e, t) {
34877
34877
  let a = r[1];
34878
34878
  const c = r[2] === "]", l = r[3];
34879
34879
  if (c && (a = a | 0), l === void 0 || l === "[" && o + 2 === s) {
34880
- Df(t, l === void 0 ? new FM(a, n, e) : new BM(a, n, e));
34880
+ Lf(t, l === void 0 ? new FM(a, n, e) : new BM(a, n, e));
34881
34881
  break;
34882
34882
  } else {
34883
34883
  let u = t.map[a];
34884
- u === void 0 && (u = new GM(a), Df(t, u)), t = u;
34884
+ u === void 0 && (u = new GM(a), Lf(t, u)), t = u;
34885
34885
  }
34886
34886
  }
34887
34887
  }
@@ -35510,7 +35510,7 @@ function yA(n, e, t, i, s, r, o) {
35510
35510
  Fe = ut.vertexShader, It = ut.fragmentShader;
35511
35511
  } else
35512
35512
  Fe = b.vertexShader, It = b.fragmentShader, c.update(b), mt = c.getVertexShaderID(b), Y = c.getFragmentShaderID(b);
35513
- const ie = n.getRenderTarget(), Ee = n.state.buffers.depth.getReversed(), Ge = O.isInstancedMesh === !0, Ae = O.isBatchedMesh === !0, st = !!b.map, jt = !!b.matcap, et = !!W, dt = !!b.aoMap, bt = !!b.lightMap, Ke = !!b.bumpMap, Gt = !!b.normalMap, P = !!b.displacementMap, zt = !!b.emissiveMap, ct = !!b.metalnessMap, Mt = !!b.roughnessMap, ke = b.anisotropy > 0, k = b.clearcoat > 0, y = b.dispersion > 0, L = b.iridescence > 0, H = b.sheen > 0, $ = b.transmission > 0, K = ke && !!b.anisotropyMap, Ie = k && !!b.clearcoatMap, he = k && !!b.clearcoatNormalMap, Re = k && !!b.clearcoatRoughnessMap, Ve = L && !!b.iridescenceMap, se = L && !!b.iridescenceThicknessMap, pe = H && !!b.sheenColorMap, Me = H && !!b.sheenRoughnessMap, we = !!b.specularMap, fe = !!b.specularColorMap, He = !!b.specularIntensityMap, U = $ && !!b.transmissionMap, be = $ && !!b.thicknessMap, oe = !!b.gradientMap, Te = !!b.alphaMap, ne = b.alphaTest > 0, j = !!b.alphaHash, de = !!b.extensions;
35513
+ const ie = n.getRenderTarget(), Ee = n.state.buffers.depth.getReversed(), Ge = O.isInstancedMesh === !0, Ae = O.isBatchedMesh === !0, st = !!b.map, jt = !!b.matcap, et = !!W, dt = !!b.aoMap, bt = !!b.lightMap, Ke = !!b.bumpMap, Gt = !!b.normalMap, P = !!b.displacementMap, zt = !!b.emissiveMap, ct = !!b.metalnessMap, Mt = !!b.roughnessMap, ke = b.anisotropy > 0, k = b.clearcoat > 0, y = b.dispersion > 0, D = b.iridescence > 0, H = b.sheen > 0, $ = b.transmission > 0, K = ke && !!b.anisotropyMap, Ie = k && !!b.clearcoatMap, he = k && !!b.clearcoatNormalMap, Re = k && !!b.clearcoatRoughnessMap, Ve = D && !!b.iridescenceMap, se = D && !!b.iridescenceThicknessMap, pe = H && !!b.sheenColorMap, Me = H && !!b.sheenRoughnessMap, we = !!b.specularMap, fe = !!b.specularColorMap, He = !!b.specularIntensityMap, U = $ && !!b.transmissionMap, be = $ && !!b.thicknessMap, oe = !!b.gradientMap, Te = !!b.alphaMap, ne = b.alphaTest > 0, j = !!b.alphaHash, de = !!b.extensions;
35514
35514
  let qe = cn;
35515
35515
  b.toneMapped && (ie === null || ie.isXRRenderTarget === !0) && (qe = n.toneMapping);
35516
35516
  const At = {
@@ -35554,7 +35554,7 @@ function yA(n, e, t, i, s, r, o) {
35554
35554
  clearcoatNormalMap: he,
35555
35555
  clearcoatRoughnessMap: Re,
35556
35556
  dispersion: y,
35557
- iridescence: L,
35557
+ iridescence: D,
35558
35558
  iridescenceMap: Ve,
35559
35559
  iridescenceThicknessMap: se,
35560
35560
  sheen: H,
@@ -36101,7 +36101,7 @@ void main() {
36101
36101
  ], Kf = /* @__PURE__ */ new Ut(), qr = /* @__PURE__ */ new N(), sl = /* @__PURE__ */ new N();
36102
36102
  function UA(n, e, t) {
36103
36103
  let i = new fu();
36104
- const s = new nt(), r = new nt(), o = new qt(), a = new JT(), c = new KT(), l = {}, d = t.maxTextureSize, u = { [Ln]: ci, [ci]: Ln, [wn]: wn }, h = new ti({
36104
+ const s = new nt(), r = new nt(), o = new qt(), a = new JT(), c = new KT(), l = {}, d = t.maxTextureSize, u = { [Dn]: ci, [ci]: Dn, [wn]: wn }, h = new ti({
36105
36105
  defines: {
36106
36106
  VSM_SAMPLES: 8
36107
36107
  },
@@ -36151,7 +36151,7 @@ function UA(n, e, t) {
36151
36151
  }
36152
36152
  W.map = new ln(s.x, s.y, {
36153
36153
  format: Sr,
36154
- type: Dn,
36154
+ type: Ln,
36155
36155
  minFilter: oi,
36156
36156
  magFilter: oi,
36157
36157
  generateMipmaps: !1
@@ -36192,7 +36192,7 @@ function UA(n, e, t) {
36192
36192
  const _ = e.update(v);
36193
36193
  h.defines.VSM_SAMPLES !== C.blurSamples && (h.defines.VSM_SAMPLES = C.blurSamples, f.defines.VSM_SAMPLES = C.blurSamples, h.needsUpdate = !0, f.needsUpdate = !0), C.mapPass === null && (C.mapPass = new ln(s.x, s.y, {
36194
36194
  format: Sr,
36195
- type: Dn
36195
+ type: Ln
36196
36196
  })), h.uniforms.shadow_pass.value = C.map.depthTexture, h.uniforms.resolution.value = C.mapSize, h.uniforms.radius.value = C.radius, n.setRenderTarget(C.mapPass), n.clear(), n.renderBufferDirect(R, null, _, h, v, null), f.uniforms.shadow_pass.value = C.mapPass.texture, f.uniforms.resolution.value = C.mapSize, f.uniforms.radius.value = C.radius, n.setRenderTarget(C.map), n.clear(), n.renderBufferDirect(R, null, _, f, v, null);
36197
36197
  }
36198
36198
  function M(C, R, _, b) {
@@ -36244,17 +36244,17 @@ function UA(n, e, t) {
36244
36244
  }
36245
36245
  }
36246
36246
  }
36247
- const LA = {
36248
- [Ul]: Ll,
36249
- [Dl]: Ol,
36247
+ const DA = {
36248
+ [Ul]: Dl,
36249
+ [Ll]: Ol,
36250
36250
  [Vl]: ql,
36251
36251
  [gr]: Nl,
36252
- [Ll]: Ul,
36253
- [Ol]: Dl,
36252
+ [Dl]: Ul,
36253
+ [Ol]: Ll,
36254
36254
  [ql]: Vl,
36255
36255
  [Nl]: gr
36256
36256
  };
36257
- function DA(n, e) {
36257
+ function LA(n, e) {
36258
36258
  function t() {
36259
36259
  let U = !1;
36260
36260
  const be = new qt();
@@ -36296,15 +36296,15 @@ function DA(n, e) {
36296
36296
  oe !== j && !U && (n.depthMask(j), oe = j);
36297
36297
  },
36298
36298
  setFunc: function(j) {
36299
- if (be && (j = LA[j]), Te !== j) {
36299
+ if (be && (j = DA[j]), Te !== j) {
36300
36300
  switch (j) {
36301
36301
  case Ul:
36302
36302
  n.depthFunc(n.NEVER);
36303
36303
  break;
36304
- case Ll:
36304
+ case Dl:
36305
36305
  n.depthFunc(n.ALWAYS);
36306
36306
  break;
36307
- case Dl:
36307
+ case Ll:
36308
36308
  n.depthFunc(n.LESS);
36309
36309
  break;
36310
36310
  case gr:
@@ -36410,8 +36410,8 @@ function DA(n, e) {
36410
36410
  }
36411
36411
  const jt = {
36412
36412
  [Ts]: n.FUNC_ADD,
36413
- [Lb]: n.FUNC_SUBTRACT,
36414
- [Db]: n.FUNC_REVERSE_SUBTRACT
36413
+ [Db]: n.FUNC_SUBTRACT,
36414
+ [Lb]: n.FUNC_REVERSE_SUBTRACT
36415
36415
  };
36416
36416
  jt[Vb] = n.MIN, jt[Nb] = n.MAX;
36417
36417
  const et = {
@@ -36521,7 +36521,7 @@ function DA(n, e) {
36521
36521
  at("WebGLState:", U);
36522
36522
  }
36523
36523
  }
36524
- function L() {
36524
+ function D() {
36525
36525
  try {
36526
36526
  n.compressedTexImage3D(...arguments);
36527
36527
  } catch (U) {
@@ -36625,7 +36625,7 @@ function DA(n, e) {
36625
36625
  bindTexture: ke,
36626
36626
  unbindTexture: k,
36627
36627
  compressedTexImage2D: y,
36628
- compressedTexImage3D: L,
36628
+ compressedTexImage3D: D,
36629
36629
  texImage2D: Ve,
36630
36630
  texImage3D: se,
36631
36631
  updateUBOMapping: we,
@@ -36653,10 +36653,10 @@ function VA(n, e, t, i, s, r, o) {
36653
36653
  function g(k, y) {
36654
36654
  return f ? new OffscreenCanvas(k, y) : wo("canvas");
36655
36655
  }
36656
- function v(k, y, L) {
36656
+ function v(k, y, D) {
36657
36657
  let H = 1;
36658
36658
  const $ = ke(k);
36659
- if (($.width > L || $.height > L) && (H = L / Math.max($.width, $.height)), H < 1)
36659
+ if (($.width > D || $.height > D) && (H = D / Math.max($.width, $.height)), H < 1)
36660
36660
  if (typeof HTMLImageElement < "u" && k instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && k instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && k instanceof ImageBitmap || typeof VideoFrame < "u" && k instanceof VideoFrame) {
36661
36661
  const K = Math.floor(H * $.width), Ie = Math.floor(H * $.height);
36662
36662
  u === void 0 && (u = g(K, Ie));
@@ -36675,21 +36675,21 @@ function VA(n, e, t, i, s, r, o) {
36675
36675
  function E(k) {
36676
36676
  return k.isWebGLCubeRenderTarget ? n.TEXTURE_CUBE_MAP : k.isWebGL3DRenderTarget ? n.TEXTURE_3D : k.isWebGLArrayRenderTarget || k.isCompressedArrayTexture ? n.TEXTURE_2D_ARRAY : n.TEXTURE_2D;
36677
36677
  }
36678
- function M(k, y, L, H, $ = !1) {
36678
+ function M(k, y, D, H, $ = !1) {
36679
36679
  if (k !== null) {
36680
36680
  if (n[k] !== void 0) return n[k];
36681
36681
  Oe("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + k + "'");
36682
36682
  }
36683
36683
  let K = y;
36684
- if (y === n.RED && (L === n.FLOAT && (K = n.R32F), L === n.HALF_FLOAT && (K = n.R16F), L === n.UNSIGNED_BYTE && (K = n.R8)), y === n.RED_INTEGER && (L === n.UNSIGNED_BYTE && (K = n.R8UI), L === n.UNSIGNED_SHORT && (K = n.R16UI), L === n.UNSIGNED_INT && (K = n.R32UI), L === n.BYTE && (K = n.R8I), L === n.SHORT && (K = n.R16I), L === n.INT && (K = n.R32I)), y === n.RG && (L === n.FLOAT && (K = n.RG32F), L === n.HALF_FLOAT && (K = n.RG16F), L === n.UNSIGNED_BYTE && (K = n.RG8)), y === n.RG_INTEGER && (L === n.UNSIGNED_BYTE && (K = n.RG8UI), L === n.UNSIGNED_SHORT && (K = n.RG16UI), L === n.UNSIGNED_INT && (K = n.RG32UI), L === n.BYTE && (K = n.RG8I), L === n.SHORT && (K = n.RG16I), L === n.INT && (K = n.RG32I)), y === n.RGB_INTEGER && (L === n.UNSIGNED_BYTE && (K = n.RGB8UI), L === n.UNSIGNED_SHORT && (K = n.RGB16UI), L === n.UNSIGNED_INT && (K = n.RGB32UI), L === n.BYTE && (K = n.RGB8I), L === n.SHORT && (K = n.RGB16I), L === n.INT && (K = n.RGB32I)), y === n.RGBA_INTEGER && (L === n.UNSIGNED_BYTE && (K = n.RGBA8UI), L === n.UNSIGNED_SHORT && (K = n.RGBA16UI), L === n.UNSIGNED_INT && (K = n.RGBA32UI), L === n.BYTE && (K = n.RGBA8I), L === n.SHORT && (K = n.RGBA16I), L === n.INT && (K = n.RGBA32I)), y === n.RGB && (L === n.UNSIGNED_INT_5_9_9_9_REV && (K = n.RGB9_E5), L === n.UNSIGNED_INT_10F_11F_11F_REV && (K = n.R11F_G11F_B10F)), y === n.RGBA) {
36684
+ if (y === n.RED && (D === n.FLOAT && (K = n.R32F), D === n.HALF_FLOAT && (K = n.R16F), D === n.UNSIGNED_BYTE && (K = n.R8)), y === n.RED_INTEGER && (D === n.UNSIGNED_BYTE && (K = n.R8UI), D === n.UNSIGNED_SHORT && (K = n.R16UI), D === n.UNSIGNED_INT && (K = n.R32UI), D === n.BYTE && (K = n.R8I), D === n.SHORT && (K = n.R16I), D === n.INT && (K = n.R32I)), y === n.RG && (D === n.FLOAT && (K = n.RG32F), D === n.HALF_FLOAT && (K = n.RG16F), D === n.UNSIGNED_BYTE && (K = n.RG8)), y === n.RG_INTEGER && (D === n.UNSIGNED_BYTE && (K = n.RG8UI), D === n.UNSIGNED_SHORT && (K = n.RG16UI), D === n.UNSIGNED_INT && (K = n.RG32UI), D === n.BYTE && (K = n.RG8I), D === n.SHORT && (K = n.RG16I), D === n.INT && (K = n.RG32I)), y === n.RGB_INTEGER && (D === n.UNSIGNED_BYTE && (K = n.RGB8UI), D === n.UNSIGNED_SHORT && (K = n.RGB16UI), D === n.UNSIGNED_INT && (K = n.RGB32UI), D === n.BYTE && (K = n.RGB8I), D === n.SHORT && (K = n.RGB16I), D === n.INT && (K = n.RGB32I)), y === n.RGBA_INTEGER && (D === n.UNSIGNED_BYTE && (K = n.RGBA8UI), D === n.UNSIGNED_SHORT && (K = n.RGBA16UI), D === n.UNSIGNED_INT && (K = n.RGBA32UI), D === n.BYTE && (K = n.RGBA8I), D === n.SHORT && (K = n.RGBA16I), D === n.INT && (K = n.RGBA32I)), y === n.RGB && (D === n.UNSIGNED_INT_5_9_9_9_REV && (K = n.RGB9_E5), D === n.UNSIGNED_INT_10F_11F_11F_REV && (K = n.R11F_G11F_B10F)), y === n.RGBA) {
36685
36685
  const Ie = $ ? Ro : it.getTransfer(H);
36686
- L === n.FLOAT && (K = n.RGBA32F), L === n.HALF_FLOAT && (K = n.RGBA16F), L === n.UNSIGNED_BYTE && (K = Ie === ft ? n.SRGB8_ALPHA8 : n.RGBA8), L === n.UNSIGNED_SHORT_4_4_4_4 && (K = n.RGBA4), L === n.UNSIGNED_SHORT_5_5_5_1 && (K = n.RGB5_A1);
36686
+ D === n.FLOAT && (K = n.RGBA32F), D === n.HALF_FLOAT && (K = n.RGBA16F), D === n.UNSIGNED_BYTE && (K = Ie === ft ? n.SRGB8_ALPHA8 : n.RGBA8), D === n.UNSIGNED_SHORT_4_4_4_4 && (K = n.RGBA4), D === n.UNSIGNED_SHORT_5_5_5_1 && (K = n.RGB5_A1);
36687
36687
  }
36688
36688
  return (K === n.R16F || K === n.R32F || K === n.RG16F || K === n.RG32F || K === n.RGBA16F || K === n.RGBA32F) && e.get("EXT_color_buffer_float"), K;
36689
36689
  }
36690
36690
  function S(k, y) {
36691
- let L;
36692
- return k ? y === null || y === hn || y === oa ? L = n.DEPTH24_STENCIL8 : y === rn ? L = n.DEPTH32F_STENCIL8 : y === aa && (L = n.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : y === null || y === hn || y === oa ? L = n.DEPTH_COMPONENT24 : y === rn ? L = n.DEPTH_COMPONENT32F : y === aa && (L = n.DEPTH_COMPONENT16), L;
36691
+ let D;
36692
+ return k ? y === null || y === hn || y === oa ? D = n.DEPTH24_STENCIL8 : y === rn ? D = n.DEPTH32F_STENCIL8 : y === aa && (D = n.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : y === null || y === hn || y === oa ? D = n.DEPTH_COMPONENT24 : y === rn ? D = n.DEPTH_COMPONENT32F : y === aa && (D = n.DEPTH_COMPONENT16), D;
36693
36693
  }
36694
36694
  function T(k, y) {
36695
36695
  return m(k) === !0 || k.isFramebufferTexture && k.minFilter !== si && k.minFilter !== oi ? Math.log2(Math.max(y.width, y.height)) + 1 : k.mipmaps !== void 0 && k.mipmaps.length > 0 ? k.mipmaps.length : k.isCompressedTexture && Array.isArray(k.image) ? y.mipmaps.length : 1;
@@ -36705,17 +36705,17 @@ function VA(n, e, t, i, s, r, o) {
36705
36705
  function _(k) {
36706
36706
  const y = i.get(k);
36707
36707
  if (y.__webglInit === void 0) return;
36708
- const L = k.source, H = h.get(L);
36708
+ const D = k.source, H = h.get(D);
36709
36709
  if (H) {
36710
36710
  const $ = H[y.__cacheKey];
36711
- $.usedTimes--, $.usedTimes === 0 && b(k), Object.keys(H).length === 0 && h.delete(L);
36711
+ $.usedTimes--, $.usedTimes === 0 && b(k), Object.keys(H).length === 0 && h.delete(D);
36712
36712
  }
36713
36713
  i.remove(k);
36714
36714
  }
36715
36715
  function b(k) {
36716
36716
  const y = i.get(k);
36717
36717
  n.deleteTexture(y.__webglTexture);
36718
- const L = k.source, H = h.get(L);
36718
+ const D = k.source, H = h.get(D);
36719
36719
  delete H[y.__cacheKey], o.memory.textures--;
36720
36720
  }
36721
36721
  function x(k) {
@@ -36738,10 +36738,10 @@ function VA(n, e, t, i, s, r, o) {
36738
36738
  y.__webglColorRenderbuffer[H] && n.deleteRenderbuffer(y.__webglColorRenderbuffer[H]);
36739
36739
  y.__webglDepthRenderbuffer && n.deleteRenderbuffer(y.__webglDepthRenderbuffer);
36740
36740
  }
36741
- const L = k.textures;
36742
- for (let H = 0, $ = L.length; H < $; H++) {
36743
- const K = i.get(L[H]);
36744
- K.__webglTexture && (n.deleteTexture(K.__webglTexture), o.memory.textures--), i.remove(L[H]);
36741
+ const D = k.textures;
36742
+ for (let H = 0, $ = D.length; H < $; H++) {
36743
+ const K = i.get(D[H]);
36744
+ K.__webglTexture && (n.deleteTexture(K.__webglTexture), o.memory.textures--), i.remove(D[H]);
36745
36745
  }
36746
36746
  i.remove(k);
36747
36747
  }
@@ -36758,43 +36758,43 @@ function VA(n, e, t, i, s, r, o) {
36758
36758
  return y.push(k.wrapS), y.push(k.wrapT), y.push(k.wrapR || 0), y.push(k.magFilter), y.push(k.minFilter), y.push(k.anisotropy), y.push(k.internalFormat), y.push(k.format), y.push(k.type), y.push(k.generateMipmaps), y.push(k.premultiplyAlpha), y.push(k.flipY), y.push(k.unpackAlignment), y.push(k.colorSpace), y.join();
36759
36759
  }
36760
36760
  function Q(k, y) {
36761
- const L = i.get(k);
36762
- if (k.isVideoTexture && ct(k), k.isRenderTargetTexture === !1 && k.isExternalTexture !== !0 && k.version > 0 && L.__version !== k.version) {
36761
+ const D = i.get(k);
36762
+ if (k.isVideoTexture && ct(k), k.isRenderTargetTexture === !1 && k.isExternalTexture !== !0 && k.version > 0 && D.__version !== k.version) {
36763
36763
  const H = k.image;
36764
36764
  if (H === null)
36765
36765
  Oe("WebGLRenderer: Texture marked for update but no image data found.");
36766
36766
  else if (H.complete === !1)
36767
36767
  Oe("WebGLRenderer: Texture marked for update but image is incomplete");
36768
36768
  else {
36769
- Y(L, k, y);
36769
+ Y(D, k, y);
36770
36770
  return;
36771
36771
  }
36772
- } else k.isExternalTexture && (L.__webglTexture = k.sourceTexture ? k.sourceTexture : null);
36773
- t.bindTexture(n.TEXTURE_2D, L.__webglTexture, n.TEXTURE0 + y);
36772
+ } else k.isExternalTexture && (D.__webglTexture = k.sourceTexture ? k.sourceTexture : null);
36773
+ t.bindTexture(n.TEXTURE_2D, D.__webglTexture, n.TEXTURE0 + y);
36774
36774
  }
36775
36775
  function G(k, y) {
36776
- const L = i.get(k);
36777
- if (k.isRenderTargetTexture === !1 && k.version > 0 && L.__version !== k.version) {
36778
- Y(L, k, y);
36776
+ const D = i.get(k);
36777
+ if (k.isRenderTargetTexture === !1 && k.version > 0 && D.__version !== k.version) {
36778
+ Y(D, k, y);
36779
36779
  return;
36780
- } else k.isExternalTexture && (L.__webglTexture = k.sourceTexture ? k.sourceTexture : null);
36781
- t.bindTexture(n.TEXTURE_2D_ARRAY, L.__webglTexture, n.TEXTURE0 + y);
36780
+ } else k.isExternalTexture && (D.__webglTexture = k.sourceTexture ? k.sourceTexture : null);
36781
+ t.bindTexture(n.TEXTURE_2D_ARRAY, D.__webglTexture, n.TEXTURE0 + y);
36782
36782
  }
36783
36783
  function W(k, y) {
36784
- const L = i.get(k);
36785
- if (k.isRenderTargetTexture === !1 && k.version > 0 && L.__version !== k.version) {
36786
- Y(L, k, y);
36784
+ const D = i.get(k);
36785
+ if (k.isRenderTargetTexture === !1 && k.version > 0 && D.__version !== k.version) {
36786
+ Y(D, k, y);
36787
36787
  return;
36788
36788
  }
36789
- t.bindTexture(n.TEXTURE_3D, L.__webglTexture, n.TEXTURE0 + y);
36789
+ t.bindTexture(n.TEXTURE_3D, D.__webglTexture, n.TEXTURE0 + y);
36790
36790
  }
36791
36791
  function ee(k, y) {
36792
- const L = i.get(k);
36793
- if (k.isCubeDepthTexture !== !0 && k.version > 0 && L.__version !== k.version) {
36794
- ie(L, k, y);
36792
+ const D = i.get(k);
36793
+ if (k.isCubeDepthTexture !== !0 && k.version > 0 && D.__version !== k.version) {
36794
+ ie(D, k, y);
36795
36795
  return;
36796
36796
  }
36797
- t.bindTexture(n.TEXTURE_CUBE_MAP, L.__webglTexture, n.TEXTURE0 + y);
36797
+ t.bindTexture(n.TEXTURE_CUBE_MAP, D.__webglTexture, n.TEXTURE0 + y);
36798
36798
  }
36799
36799
  const ve = {
36800
36800
  [Gl]: n.REPEAT,
@@ -36821,13 +36821,13 @@ function VA(n, e, t, i, s, r, o) {
36821
36821
  if (y.type === rn && e.has("OES_texture_float_linear") === !1 && (y.magFilter === oi || y.magFilter === Mc || y.magFilter === Ta || y.magFilter === Cs || y.minFilter === oi || y.minFilter === Mc || y.minFilter === Ta || y.minFilter === Cs) && Oe("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), n.texParameteri(k, n.TEXTURE_WRAP_S, ve[y.wrapS]), n.texParameteri(k, n.TEXTURE_WRAP_T, ve[y.wrapT]), (k === n.TEXTURE_3D || k === n.TEXTURE_2D_ARRAY) && n.texParameteri(k, n.TEXTURE_WRAP_R, ve[y.wrapR]), n.texParameteri(k, n.TEXTURE_MAG_FILTER, le[y.magFilter]), n.texParameteri(k, n.TEXTURE_MIN_FILTER, le[y.minFilter]), y.compareFunction && (n.texParameteri(k, n.TEXTURE_COMPARE_MODE, n.COMPARE_REF_TO_TEXTURE), n.texParameteri(k, n.TEXTURE_COMPARE_FUNC, ye[y.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
36822
36822
  if (y.magFilter === si || y.minFilter !== Ta && y.minFilter !== Cs || y.type === rn && e.has("OES_texture_float_linear") === !1) return;
36823
36823
  if (y.anisotropy > 1 || i.get(y).__currentAnisotropy) {
36824
- const L = e.get("EXT_texture_filter_anisotropic");
36825
- n.texParameterf(k, L.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(y.anisotropy, s.getMaxAnisotropy())), i.get(y).__currentAnisotropy = y.anisotropy;
36824
+ const D = e.get("EXT_texture_filter_anisotropic");
36825
+ n.texParameterf(k, D.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(y.anisotropy, s.getMaxAnisotropy())), i.get(y).__currentAnisotropy = y.anisotropy;
36826
36826
  }
36827
36827
  }
36828
36828
  }
36829
36829
  function Fe(k, y) {
36830
- let L = !1;
36830
+ let D = !1;
36831
36831
  k.__webglInit === void 0 && (k.__webglInit = !0, y.addEventListener("dispose", C));
36832
36832
  const H = y.source;
36833
36833
  let $ = h.get(H);
@@ -36837,19 +36837,19 @@ function VA(n, e, t, i, s, r, o) {
36837
36837
  $[K] === void 0 && ($[K] = {
36838
36838
  texture: n.createTexture(),
36839
36839
  usedTimes: 0
36840
- }, o.memory.textures++, L = !0), $[K].usedTimes++;
36840
+ }, o.memory.textures++, D = !0), $[K].usedTimes++;
36841
36841
  const Ie = $[k.__cacheKey];
36842
36842
  Ie !== void 0 && ($[k.__cacheKey].usedTimes--, Ie.usedTimes === 0 && b(y)), k.__cacheKey = K, k.__webglTexture = $[K].texture;
36843
36843
  }
36844
- return L;
36844
+ return D;
36845
36845
  }
36846
- function It(k, y, L) {
36847
- return Math.floor(Math.floor(k / L) / y);
36846
+ function It(k, y, D) {
36847
+ return Math.floor(Math.floor(k / D) / y);
36848
36848
  }
36849
- function mt(k, y, L, H) {
36849
+ function mt(k, y, D, H) {
36850
36850
  const K = k.updateRanges;
36851
36851
  if (K.length === 0)
36852
- t.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, y.width, y.height, L, H, y.data);
36852
+ t.texSubImage2D(n.TEXTURE_2D, 0, 0, 0, y.width, y.height, D, H, y.data);
36853
36853
  else {
36854
36854
  K.sort((se, pe) => se.start - pe.start);
36855
36855
  let Ie = 0;
@@ -36865,19 +36865,19 @@ function VA(n, e, t, i, s, r, o) {
36865
36865
  n.pixelStorei(n.UNPACK_ROW_LENGTH, y.width);
36866
36866
  for (let se = 0, pe = K.length; se < pe; se++) {
36867
36867
  const Me = K[se], we = Math.floor(Me.start / 4), fe = Math.ceil(Me.count / 4), He = we % y.width, U = Math.floor(we / y.width), be = fe, oe = 1;
36868
- n.pixelStorei(n.UNPACK_SKIP_PIXELS, He), n.pixelStorei(n.UNPACK_SKIP_ROWS, U), t.texSubImage2D(n.TEXTURE_2D, 0, He, U, be, oe, L, H, y.data);
36868
+ n.pixelStorei(n.UNPACK_SKIP_PIXELS, He), n.pixelStorei(n.UNPACK_SKIP_ROWS, U), t.texSubImage2D(n.TEXTURE_2D, 0, He, U, be, oe, D, H, y.data);
36869
36869
  }
36870
36870
  k.clearUpdateRanges(), n.pixelStorei(n.UNPACK_ROW_LENGTH, he), n.pixelStorei(n.UNPACK_SKIP_PIXELS, Re), n.pixelStorei(n.UNPACK_SKIP_ROWS, Ve);
36871
36871
  }
36872
36872
  }
36873
- function Y(k, y, L) {
36873
+ function Y(k, y, D) {
36874
36874
  let H = n.TEXTURE_2D;
36875
36875
  (y.isDataArrayTexture || y.isCompressedArrayTexture) && (H = n.TEXTURE_2D_ARRAY), y.isData3DTexture && (H = n.TEXTURE_3D);
36876
36876
  const $ = Fe(k, y), K = y.source;
36877
- t.bindTexture(H, k.__webglTexture, n.TEXTURE0 + L);
36877
+ t.bindTexture(H, k.__webglTexture, n.TEXTURE0 + D);
36878
36878
  const Ie = i.get(K);
36879
36879
  if (K.version !== Ie.__version || $ === !0) {
36880
- t.activeTexture(n.TEXTURE0 + L);
36880
+ t.activeTexture(n.TEXTURE0 + D);
36881
36881
  const he = it.getPrimaries(it.workingColorSpace), Re = y.colorSpace === jn ? null : it.getPrimaries(y.colorSpace), Ve = y.colorSpace === jn || he === Re ? n.NONE : n.BROWSER_DEFAULT_WEBGL;
36882
36882
  n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, y.flipY), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, y.premultiplyAlpha), n.pixelStorei(n.UNPACK_ALIGNMENT, y.unpackAlignment), n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL, Ve);
36883
36883
  let se = v(y.image, !1, s.maxTextureSize);
@@ -36976,13 +36976,13 @@ function VA(n, e, t, i, s, r, o) {
36976
36976
  }
36977
36977
  k.__version = y.version;
36978
36978
  }
36979
- function ie(k, y, L) {
36979
+ function ie(k, y, D) {
36980
36980
  if (y.image.length !== 6) return;
36981
36981
  const H = Fe(k, y), $ = y.source;
36982
- t.bindTexture(n.TEXTURE_CUBE_MAP, k.__webglTexture, n.TEXTURE0 + L);
36982
+ t.bindTexture(n.TEXTURE_CUBE_MAP, k.__webglTexture, n.TEXTURE0 + D);
36983
36983
  const K = i.get($);
36984
36984
  if ($.version !== K.__version || H === !0) {
36985
- t.activeTexture(n.TEXTURE0 + L);
36985
+ t.activeTexture(n.TEXTURE0 + D);
36986
36986
  const Ie = it.getPrimaries(it.workingColorSpace), he = y.colorSpace === jn ? null : it.getPrimaries(y.colorSpace), Re = y.colorSpace === jn || Ie === he ? n.NONE : n.BROWSER_DEFAULT_WEBGL;
36987
36987
  n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, y.flipY), n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL, y.premultiplyAlpha), n.pixelStorei(n.UNPACK_ALIGNMENT, y.unpackAlignment), n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL, Re);
36988
36988
  const Ve = y.isCompressedTexture || y.image[0].isCompressedTexture, se = y.image[0] && y.image[0].isDataTexture, pe = [];
@@ -37026,28 +37026,28 @@ function VA(n, e, t, i, s, r, o) {
37026
37026
  }
37027
37027
  k.__version = y.version;
37028
37028
  }
37029
- function Ee(k, y, L, H, $, K) {
37030
- const Ie = r.convert(L.format, L.colorSpace), he = r.convert(L.type), Re = M(L.internalFormat, Ie, he, L.colorSpace), Ve = i.get(y), se = i.get(L);
37029
+ function Ee(k, y, D, H, $, K) {
37030
+ const Ie = r.convert(D.format, D.colorSpace), he = r.convert(D.type), Re = M(D.internalFormat, Ie, he, D.colorSpace), Ve = i.get(y), se = i.get(D);
37031
37031
  if (se.__renderTarget = y, !Ve.__hasExternalTextures) {
37032
37032
  const pe = Math.max(1, y.width >> K), Me = Math.max(1, y.height >> K);
37033
37033
  $ === n.TEXTURE_3D || $ === n.TEXTURE_2D_ARRAY ? t.texImage3D($, K, Re, pe, Me, y.depth, 0, Ie, he, null) : t.texImage2D($, K, Re, pe, Me, 0, Ie, he, null);
37034
37034
  }
37035
37035
  t.bindFramebuffer(n.FRAMEBUFFER, k), zt(y) ? a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER, H, $, se.__webglTexture, 0, P(y)) : ($ === n.TEXTURE_2D || $ >= n.TEXTURE_CUBE_MAP_POSITIVE_X && $ <= n.TEXTURE_CUBE_MAP_NEGATIVE_Z) && n.framebufferTexture2D(n.FRAMEBUFFER, H, $, se.__webglTexture, K), t.bindFramebuffer(n.FRAMEBUFFER, null);
37036
37036
  }
37037
- function Ge(k, y, L) {
37037
+ function Ge(k, y, D) {
37038
37038
  if (n.bindRenderbuffer(n.RENDERBUFFER, k), y.depthBuffer) {
37039
37039
  const H = y.depthTexture, $ = H && H.isDepthTexture ? H.type : null, K = S(y.stencilBuffer, $), Ie = y.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT;
37040
- zt(y) ? a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, P(y), K, y.width, y.height) : L ? n.renderbufferStorageMultisample(n.RENDERBUFFER, P(y), K, y.width, y.height) : n.renderbufferStorage(n.RENDERBUFFER, K, y.width, y.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, Ie, n.RENDERBUFFER, k);
37040
+ zt(y) ? a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, P(y), K, y.width, y.height) : D ? n.renderbufferStorageMultisample(n.RENDERBUFFER, P(y), K, y.width, y.height) : n.renderbufferStorage(n.RENDERBUFFER, K, y.width, y.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, Ie, n.RENDERBUFFER, k);
37041
37041
  } else {
37042
37042
  const H = y.textures;
37043
37043
  for (let $ = 0; $ < H.length; $++) {
37044
37044
  const K = H[$], Ie = r.convert(K.format, K.colorSpace), he = r.convert(K.type), Re = M(K.internalFormat, Ie, he, K.colorSpace);
37045
- zt(y) ? a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, P(y), Re, y.width, y.height) : L ? n.renderbufferStorageMultisample(n.RENDERBUFFER, P(y), Re, y.width, y.height) : n.renderbufferStorage(n.RENDERBUFFER, Re, y.width, y.height);
37045
+ zt(y) ? a.renderbufferStorageMultisampleEXT(n.RENDERBUFFER, P(y), Re, y.width, y.height) : D ? n.renderbufferStorageMultisample(n.RENDERBUFFER, P(y), Re, y.width, y.height) : n.renderbufferStorage(n.RENDERBUFFER, Re, y.width, y.height);
37046
37046
  }
37047
37047
  }
37048
37048
  n.bindRenderbuffer(n.RENDERBUFFER, null);
37049
37049
  }
37050
- function Ae(k, y, L) {
37050
+ function Ae(k, y, D) {
37051
37051
  const H = y.isWebGLCubeRenderTarget === !0;
37052
37052
  if (t.bindFramebuffer(n.FRAMEBUFFER, k), !(y.depthTexture && y.depthTexture.isDepthTexture))
37053
37053
  throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
@@ -37063,7 +37063,7 @@ function VA(n, e, t, i, s, r, o) {
37063
37063
  }
37064
37064
  } else
37065
37065
  Q(y.depthTexture, 0);
37066
- const K = $.__webglTexture, Ie = P(y), he = H ? n.TEXTURE_CUBE_MAP_POSITIVE_X + L : n.TEXTURE_2D, Re = y.depthTexture.format === Ms ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT;
37066
+ const K = $.__webglTexture, Ie = P(y), he = H ? n.TEXTURE_CUBE_MAP_POSITIVE_X + D : n.TEXTURE_2D, Re = y.depthTexture.format === Ms ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT;
37067
37067
  if (y.depthTexture.format === Vn)
37068
37068
  zt(y) ? a.framebufferTexture2DMultisampleEXT(n.FRAMEBUFFER, Re, he, K, 0, Ie) : n.framebufferTexture2D(n.FRAMEBUFFER, Re, he, K, 0);
37069
37069
  else if (y.depthTexture.format === Ms)
@@ -37072,7 +37072,7 @@ function VA(n, e, t, i, s, r, o) {
37072
37072
  throw new Error("Unknown depthTexture format");
37073
37073
  }
37074
37074
  function st(k) {
37075
- const y = i.get(k), L = k.isWebGLCubeRenderTarget === !0;
37075
+ const y = i.get(k), D = k.isWebGLCubeRenderTarget === !0;
37076
37076
  if (y.__boundDepthTexture !== k.depthTexture) {
37077
37077
  const H = k.depthTexture;
37078
37078
  if (y.__depthDisposeCallback && y.__depthDisposeCallback(), H) {
@@ -37084,14 +37084,14 @@ function VA(n, e, t, i, s, r, o) {
37084
37084
  y.__boundDepthTexture = H;
37085
37085
  }
37086
37086
  if (k.depthTexture && !y.__autoAllocateDepthBuffer)
37087
- if (L)
37087
+ if (D)
37088
37088
  for (let H = 0; H < 6; H++)
37089
37089
  Ae(y.__webglFramebuffer[H], k, H);
37090
37090
  else {
37091
37091
  const H = k.texture.mipmaps;
37092
37092
  H && H.length > 0 ? Ae(y.__webglFramebuffer[0], k, 0) : Ae(y.__webglFramebuffer, k, 0);
37093
37093
  }
37094
- else if (L) {
37094
+ else if (D) {
37095
37095
  y.__webglDepthbuffer = [];
37096
37096
  for (let H = 0; H < 6; H++)
37097
37097
  if (t.bindFramebuffer(n.FRAMEBUFFER, y.__webglFramebuffer[H]), y.__webglDepthbuffer[H] === void 0)
@@ -37111,44 +37111,44 @@ function VA(n, e, t, i, s, r, o) {
37111
37111
  }
37112
37112
  t.bindFramebuffer(n.FRAMEBUFFER, null);
37113
37113
  }
37114
- function jt(k, y, L) {
37114
+ function jt(k, y, D) {
37115
37115
  const H = i.get(k);
37116
- y !== void 0 && Ee(H.__webglFramebuffer, k, k.texture, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, 0), L !== void 0 && st(k);
37116
+ y !== void 0 && Ee(H.__webglFramebuffer, k, k.texture, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, 0), D !== void 0 && st(k);
37117
37117
  }
37118
37118
  function et(k) {
37119
- const y = k.texture, L = i.get(k), H = i.get(y);
37119
+ const y = k.texture, D = i.get(k), H = i.get(y);
37120
37120
  k.addEventListener("dispose", R);
37121
37121
  const $ = k.textures, K = k.isWebGLCubeRenderTarget === !0, Ie = $.length > 1;
37122
37122
  if (Ie || (H.__webglTexture === void 0 && (H.__webglTexture = n.createTexture()), H.__version = y.version, o.memory.textures++), K) {
37123
- L.__webglFramebuffer = [];
37123
+ D.__webglFramebuffer = [];
37124
37124
  for (let he = 0; he < 6; he++)
37125
37125
  if (y.mipmaps && y.mipmaps.length > 0) {
37126
- L.__webglFramebuffer[he] = [];
37126
+ D.__webglFramebuffer[he] = [];
37127
37127
  for (let Re = 0; Re < y.mipmaps.length; Re++)
37128
- L.__webglFramebuffer[he][Re] = n.createFramebuffer();
37128
+ D.__webglFramebuffer[he][Re] = n.createFramebuffer();
37129
37129
  } else
37130
- L.__webglFramebuffer[he] = n.createFramebuffer();
37130
+ D.__webglFramebuffer[he] = n.createFramebuffer();
37131
37131
  } else {
37132
37132
  if (y.mipmaps && y.mipmaps.length > 0) {
37133
- L.__webglFramebuffer = [];
37133
+ D.__webglFramebuffer = [];
37134
37134
  for (let he = 0; he < y.mipmaps.length; he++)
37135
- L.__webglFramebuffer[he] = n.createFramebuffer();
37135
+ D.__webglFramebuffer[he] = n.createFramebuffer();
37136
37136
  } else
37137
- L.__webglFramebuffer = n.createFramebuffer();
37137
+ D.__webglFramebuffer = n.createFramebuffer();
37138
37138
  if (Ie)
37139
37139
  for (let he = 0, Re = $.length; he < Re; he++) {
37140
37140
  const Ve = i.get($[he]);
37141
37141
  Ve.__webglTexture === void 0 && (Ve.__webglTexture = n.createTexture(), o.memory.textures++);
37142
37142
  }
37143
37143
  if (k.samples > 0 && zt(k) === !1) {
37144
- L.__webglMultisampledFramebuffer = n.createFramebuffer(), L.__webglColorRenderbuffer = [], t.bindFramebuffer(n.FRAMEBUFFER, L.__webglMultisampledFramebuffer);
37144
+ D.__webglMultisampledFramebuffer = n.createFramebuffer(), D.__webglColorRenderbuffer = [], t.bindFramebuffer(n.FRAMEBUFFER, D.__webglMultisampledFramebuffer);
37145
37145
  for (let he = 0; he < $.length; he++) {
37146
37146
  const Re = $[he];
37147
- L.__webglColorRenderbuffer[he] = n.createRenderbuffer(), n.bindRenderbuffer(n.RENDERBUFFER, L.__webglColorRenderbuffer[he]);
37147
+ D.__webglColorRenderbuffer[he] = n.createRenderbuffer(), n.bindRenderbuffer(n.RENDERBUFFER, D.__webglColorRenderbuffer[he]);
37148
37148
  const Ve = r.convert(Re.format, Re.colorSpace), se = r.convert(Re.type), pe = M(Re.internalFormat, Ve, se, Re.colorSpace, k.isXRRenderTarget === !0), Me = P(k);
37149
- n.renderbufferStorageMultisample(n.RENDERBUFFER, Me, pe, k.width, k.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0 + he, n.RENDERBUFFER, L.__webglColorRenderbuffer[he]);
37149
+ n.renderbufferStorageMultisample(n.RENDERBUFFER, Me, pe, k.width, k.height), n.framebufferRenderbuffer(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0 + he, n.RENDERBUFFER, D.__webglColorRenderbuffer[he]);
37150
37150
  }
37151
- n.bindRenderbuffer(n.RENDERBUFFER, null), k.depthBuffer && (L.__webglDepthRenderbuffer = n.createRenderbuffer(), Ge(L.__webglDepthRenderbuffer, k, !0)), t.bindFramebuffer(n.FRAMEBUFFER, null);
37151
+ n.bindRenderbuffer(n.RENDERBUFFER, null), k.depthBuffer && (D.__webglDepthRenderbuffer = n.createRenderbuffer(), Ge(D.__webglDepthRenderbuffer, k, !0)), t.bindFramebuffer(n.FRAMEBUFFER, null);
37152
37152
  }
37153
37153
  }
37154
37154
  if (K) {
@@ -37156,32 +37156,32 @@ function VA(n, e, t, i, s, r, o) {
37156
37156
  for (let he = 0; he < 6; he++)
37157
37157
  if (y.mipmaps && y.mipmaps.length > 0)
37158
37158
  for (let Re = 0; Re < y.mipmaps.length; Re++)
37159
- Ee(L.__webglFramebuffer[he][Re], k, y, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + he, Re);
37159
+ Ee(D.__webglFramebuffer[he][Re], k, y, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + he, Re);
37160
37160
  else
37161
- Ee(L.__webglFramebuffer[he], k, y, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + he, 0);
37161
+ Ee(D.__webglFramebuffer[he], k, y, n.COLOR_ATTACHMENT0, n.TEXTURE_CUBE_MAP_POSITIVE_X + he, 0);
37162
37162
  m(y) && p(n.TEXTURE_CUBE_MAP), t.unbindTexture();
37163
37163
  } else if (Ie) {
37164
37164
  for (let he = 0, Re = $.length; he < Re; he++) {
37165
37165
  const Ve = $[he], se = i.get(Ve);
37166
37166
  let pe = n.TEXTURE_2D;
37167
- (k.isWebGL3DRenderTarget || k.isWebGLArrayRenderTarget) && (pe = k.isWebGL3DRenderTarget ? n.TEXTURE_3D : n.TEXTURE_2D_ARRAY), t.bindTexture(pe, se.__webglTexture), Be(pe, Ve), Ee(L.__webglFramebuffer, k, Ve, n.COLOR_ATTACHMENT0 + he, pe, 0), m(Ve) && p(pe);
37167
+ (k.isWebGL3DRenderTarget || k.isWebGLArrayRenderTarget) && (pe = k.isWebGL3DRenderTarget ? n.TEXTURE_3D : n.TEXTURE_2D_ARRAY), t.bindTexture(pe, se.__webglTexture), Be(pe, Ve), Ee(D.__webglFramebuffer, k, Ve, n.COLOR_ATTACHMENT0 + he, pe, 0), m(Ve) && p(pe);
37168
37168
  }
37169
37169
  t.unbindTexture();
37170
37170
  } else {
37171
37171
  let he = n.TEXTURE_2D;
37172
37172
  if ((k.isWebGL3DRenderTarget || k.isWebGLArrayRenderTarget) && (he = k.isWebGL3DRenderTarget ? n.TEXTURE_3D : n.TEXTURE_2D_ARRAY), t.bindTexture(he, H.__webglTexture), Be(he, y), y.mipmaps && y.mipmaps.length > 0)
37173
37173
  for (let Re = 0; Re < y.mipmaps.length; Re++)
37174
- Ee(L.__webglFramebuffer[Re], k, y, n.COLOR_ATTACHMENT0, he, Re);
37174
+ Ee(D.__webglFramebuffer[Re], k, y, n.COLOR_ATTACHMENT0, he, Re);
37175
37175
  else
37176
- Ee(L.__webglFramebuffer, k, y, n.COLOR_ATTACHMENT0, he, 0);
37176
+ Ee(D.__webglFramebuffer, k, y, n.COLOR_ATTACHMENT0, he, 0);
37177
37177
  m(y) && p(he), t.unbindTexture();
37178
37178
  }
37179
37179
  k.depthBuffer && st(k);
37180
37180
  }
37181
37181
  function dt(k) {
37182
37182
  const y = k.textures;
37183
- for (let L = 0, H = y.length; L < H; L++) {
37184
- const $ = y[L];
37183
+ for (let D = 0, H = y.length; D < H; D++) {
37184
+ const $ = y[D];
37185
37185
  if (m($)) {
37186
37186
  const K = E(k), Ie = i.get($).__webglTexture;
37187
37187
  t.bindTexture(K, Ie), p(K), t.unbindTexture();
@@ -37192,7 +37192,7 @@ function VA(n, e, t, i, s, r, o) {
37192
37192
  function Gt(k) {
37193
37193
  if (k.samples > 0) {
37194
37194
  if (zt(k) === !1) {
37195
- const y = k.textures, L = k.width, H = k.height;
37195
+ const y = k.textures, D = k.width, H = k.height;
37196
37196
  let $ = n.COLOR_BUFFER_BIT;
37197
37197
  const K = k.stencilBuffer ? n.DEPTH_STENCIL_ATTACHMENT : n.DEPTH_ATTACHMENT, Ie = i.get(k), he = y.length > 1;
37198
37198
  if (he)
@@ -37207,7 +37207,7 @@ function VA(n, e, t, i, s, r, o) {
37207
37207
  const se = i.get(y[Ve]).__webglTexture;
37208
37208
  n.framebufferTexture2D(n.DRAW_FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, se, 0);
37209
37209
  }
37210
- n.blitFramebuffer(0, 0, L, H, 0, 0, L, H, $, n.NEAREST), c === !0 && (bt.length = 0, Ke.length = 0, bt.push(n.COLOR_ATTACHMENT0 + Ve), k.depthBuffer && k.resolveDepthBuffer === !1 && (bt.push(K), Ke.push(K), n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER, Ke)), n.invalidateFramebuffer(n.READ_FRAMEBUFFER, bt));
37210
+ n.blitFramebuffer(0, 0, D, H, 0, 0, D, H, $, n.NEAREST), c === !0 && (bt.length = 0, Ke.length = 0, bt.push(n.COLOR_ATTACHMENT0 + Ve), k.depthBuffer && k.resolveDepthBuffer === !1 && (bt.push(K), Ke.push(K), n.invalidateFramebuffer(n.DRAW_FRAMEBUFFER, Ke)), n.invalidateFramebuffer(n.READ_FRAMEBUFFER, bt));
37211
37211
  }
37212
37212
  if (t.bindFramebuffer(n.READ_FRAMEBUFFER, null), t.bindFramebuffer(n.DRAW_FRAMEBUFFER, null), he)
37213
37213
  for (let Ve = 0; Ve < y.length; Ve++) {
@@ -37234,8 +37234,8 @@ function VA(n, e, t, i, s, r, o) {
37234
37234
  d.get(k) !== y && (d.set(k, y), k.update());
37235
37235
  }
37236
37236
  function Mt(k, y) {
37237
- const L = k.colorSpace, H = k.format, $ = k.type;
37238
- return k.isCompressedTexture === !0 || k.isVideoTexture === !0 || L !== yr && L !== jn && (it.getTransfer(L) === ft ? (H !== Zi || $ !== Ui) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : at("WebGLTextures: Unsupported texture color space:", L)), y;
37237
+ const D = k.colorSpace, H = k.format, $ = k.type;
37238
+ return k.isCompressedTexture === !0 || k.isVideoTexture === !0 || D !== yr && D !== jn && (it.getTransfer(D) === ft ? (H !== Zi || $ !== Ui) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : at("WebGLTextures: Unsupported texture color space:", D)), y;
37239
37239
  }
37240
37240
  function ke(k) {
37241
37241
  return typeof HTMLImageElement < "u" && k instanceof HTMLImageElement ? (l.width = k.naturalWidth || k.width, l.height = k.naturalHeight || k.height) : typeof VideoFrame < "u" && k instanceof VideoFrame ? (l.width = k.displayWidth, l.height = k.displayHeight) : (l.width = k.width, l.height = k.height), l;
@@ -37259,7 +37259,7 @@ function NA(n, e) {
37259
37259
  if (i === nu) return n.INT;
37260
37260
  if (i === hn) return n.UNSIGNED_INT;
37261
37261
  if (i === rn) return n.FLOAT;
37262
- if (i === Dn) return n.HALF_FLOAT;
37262
+ if (i === Ln) return n.HALF_FLOAT;
37263
37263
  if (i === tg) return n.ALPHA;
37264
37264
  if (i === ig) return n.RGB;
37265
37265
  if (i === Zi) return n.RGBA;
@@ -37569,8 +37569,8 @@ class BA extends Tr {
37569
37569
  if (ie.matrixWorld.decompose(Y.position, Y.quaternion, Y.scale), Y.translateX(Mt), Y.translateZ(ct), Y.matrixWorld.compose(Y.position, Y.quaternion, Y.scale), Y.matrixWorldInverse.copy(Y.matrixWorld).invert(), Ae[10] === -1)
37570
37570
  Y.projectionMatrix.copy(ie.projectionMatrix), Y.projectionMatrixInverse.copy(ie.projectionMatrixInverse);
37571
37571
  else {
37572
- const ke = jt + ct, k = et + ct, y = P - Mt, L = zt + (Ge - Mt), H = dt * et / k * ke, $ = bt * et / k * ke;
37573
- Y.projectionMatrix.makePerspective(y, L, H, $, ke, k), Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert();
37572
+ const ke = jt + ct, k = et + ct, y = P - Mt, D = zt + (Ge - Mt), H = dt * et / k * ke, $ = bt * et / k * ke;
37573
+ Y.projectionMatrix.makePerspective(y, D, H, $, ke, k), Y.projectionMatrixInverse.copy(Y.projectionMatrix).invert();
37574
37574
  }
37575
37575
  }
37576
37576
  function ye(Y, ie) {
@@ -38333,7 +38333,7 @@ const JA = new Uint16Array([
38333
38333
  ]);
38334
38334
  let en = null;
38335
38335
  function KA() {
38336
- return en === null && (en = new DT(JA, 16, 16, Sr, Dn), en.name = "DFG_LUT", en.minFilter = oi, en.magFilter = oi, en.wrapS = In, en.wrapT = In, en.generateMipmaps = !1, en.needsUpdate = !0), en;
38336
+ return en === null && (en = new LT(JA, 16, 16, Sr, Ln), en.name = "DFG_LUT", en.minFilter = oi, en.magFilter = oi, en.wrapS = In, en.wrapT = In, en.generateMipmaps = !1, en.needsUpdate = !0), en;
38337
38337
  }
38338
38338
  class Cg {
38339
38339
  /**
@@ -38409,8 +38409,8 @@ class Cg {
38409
38409
  return O === null ? Fe : 1;
38410
38410
  }
38411
38411
  let P = i;
38412
- function zt(A, D) {
38413
- return t.getContext(A, D);
38412
+ function zt(A, L) {
38413
+ return t.getContext(A, L);
38414
38414
  }
38415
38415
  try {
38416
38416
  const A = {
@@ -38424,16 +38424,16 @@ class Cg {
38424
38424
  failIfMajorPerformanceCaveat: u
38425
38425
  };
38426
38426
  if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${iu}`), t.addEventListener("webglcontextlost", qe, !1), t.addEventListener("webglcontextrestored", At, !1), t.addEventListener("webglcontextcreationerror", ut, !1), P === null) {
38427
- const D = "webgl2";
38428
- if (P = zt(D, A), P === null)
38429
- throw zt(D) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
38427
+ const L = "webgl2";
38428
+ if (P = zt(L, A), P === null)
38429
+ throw zt(L) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
38430
38430
  }
38431
38431
  } catch (A) {
38432
38432
  throw at("WebGLRenderer: " + A.message), A;
38433
38433
  }
38434
- let ct, Mt, ke, k, y, L, H, $, K, Ie, he, Re, Ve, se, pe, Me, we, fe, He, U, be, oe, Te, ne;
38434
+ let ct, Mt, ke, k, y, D, H, $, K, Ie, he, Re, Ve, se, pe, Me, we, fe, He, U, be, oe, Te, ne;
38435
38435
  function j() {
38436
- ct = new KC(P), ct.init(), oe = new NA(P, ct), Mt = new NC(P, ct, e, oe), ke = new DA(P, ct), Mt.reversedDepthBuffer && h && ke.buffers.depth.setReversed(!0), k = new YC(P), y = new bA(), L = new VA(P, ct, ke, y, Mt, oe, k), H = new qC(b), $ = new JC(b), K = new $T(P), Te = new DC(P, K), Ie = new HC(P, K, k, Te), he = new ZC(P, Ie, K, k), He = new jC(P, Mt, L), Me = new OC(y), Re = new yA(b, H, $, ct, Mt, Te, Me), Ve = new zA(b, y), se = new xA(), pe = new kA(ct), fe = new LC(b, H, $, ke, he, g, c), we = new UA(b, he, Mt), ne = new WA(P, k, Mt, ke), U = new VC(P, ct, k), be = new QC(P, ct, k), k.programs = Re.programs, b.capabilities = Mt, b.extensions = ct, b.properties = y, b.renderLists = se, b.shadowMap = we, b.state = ke, b.info = k;
38436
+ ct = new KC(P), ct.init(), oe = new NA(P, ct), Mt = new NC(P, ct, e, oe), ke = new LA(P, ct), Mt.reversedDepthBuffer && h && ke.buffers.depth.setReversed(!0), k = new YC(P), y = new bA(), D = new VA(P, ct, ke, y, Mt, oe, k), H = new qC(b), $ = new JC(b), K = new $T(P), Te = new LC(P, K), Ie = new HC(P, K, k, Te), he = new ZC(P, Ie, K, k), He = new jC(P, Mt, D), Me = new OC(y), Re = new yA(b, H, $, ct, Mt, Te, Me), Ve = new zA(b, y), se = new xA(), pe = new kA(ct), fe = new DC(b, H, $, ke, he, g, c), we = new UA(b, he, Mt), ne = new WA(P, k, Mt, ke), U = new VC(P, ct, k), be = new QC(P, ct, k), k.programs = Re.programs, b.capabilities = Mt, b.extensions = ct, b.properties = y, b.renderLists = se, b.shadowMap = we, b.state = ke, b.info = k;
38437
38437
  }
38438
38438
  j(), v !== Ui && (_ = new $C(v, t.width, t.height, s, r));
38439
38439
  const de = new BA(b, P);
@@ -38453,24 +38453,24 @@ class Cg {
38453
38453
  A !== void 0 && (Fe = A, this.setSize(ye, Be, !1));
38454
38454
  }, this.getSize = function(A) {
38455
38455
  return A.set(ye, Be);
38456
- }, this.setSize = function(A, D, z = !0) {
38456
+ }, this.setSize = function(A, L, z = !0) {
38457
38457
  if (de.isPresenting) {
38458
38458
  Oe("WebGLRenderer: Can't change size while VR device is presenting.");
38459
38459
  return;
38460
38460
  }
38461
- ye = A, Be = D, t.width = Math.floor(A * Fe), t.height = Math.floor(D * Fe), z === !0 && (t.style.width = A + "px", t.style.height = D + "px"), _ !== null && _.setSize(t.width, t.height), this.setViewport(0, 0, A, D);
38461
+ ye = A, Be = L, t.width = Math.floor(A * Fe), t.height = Math.floor(L * Fe), z === !0 && (t.style.width = A + "px", t.style.height = L + "px"), _ !== null && _.setSize(t.width, t.height), this.setViewport(0, 0, A, L);
38462
38462
  }, this.getDrawingBufferSize = function(A) {
38463
38463
  return A.set(ye * Fe, Be * Fe).floor();
38464
- }, this.setDrawingBufferSize = function(A, D, z) {
38465
- ye = A, Be = D, Fe = z, t.width = Math.floor(A * z), t.height = Math.floor(D * z), this.setViewport(0, 0, A, D);
38464
+ }, this.setDrawingBufferSize = function(A, L, z) {
38465
+ ye = A, Be = L, Fe = z, t.width = Math.floor(A * z), t.height = Math.floor(L * z), this.setViewport(0, 0, A, L);
38466
38466
  }, this.setEffects = function(A) {
38467
38467
  if (v === Ui) {
38468
38468
  console.error("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");
38469
38469
  return;
38470
38470
  }
38471
38471
  if (A) {
38472
- for (let D = 0; D < A.length; D++)
38473
- if (A[D].isOutputPass === !0) {
38472
+ for (let L = 0; L < A.length; L++)
38473
+ if (A[L].isOutputPass === !0) {
38474
38474
  console.warn("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");
38475
38475
  break;
38476
38476
  }
@@ -38480,12 +38480,12 @@ class Cg {
38480
38480
  return A.copy(G);
38481
38481
  }, this.getViewport = function(A) {
38482
38482
  return A.copy(Y);
38483
- }, this.setViewport = function(A, D, z, B) {
38484
- A.isVector4 ? Y.set(A.x, A.y, A.z, A.w) : Y.set(A, D, z, B), ke.viewport(G.copy(Y).multiplyScalar(Fe).round());
38483
+ }, this.setViewport = function(A, L, z, B) {
38484
+ A.isVector4 ? Y.set(A.x, A.y, A.z, A.w) : Y.set(A, L, z, B), ke.viewport(G.copy(Y).multiplyScalar(Fe).round());
38485
38485
  }, this.getScissor = function(A) {
38486
38486
  return A.copy(ie);
38487
- }, this.setScissor = function(A, D, z, B) {
38488
- A.isVector4 ? ie.set(A.x, A.y, A.z, A.w) : ie.set(A, D, z, B), ke.scissor(W.copy(ie).multiplyScalar(Fe).round());
38487
+ }, this.setScissor = function(A, L, z, B) {
38488
+ A.isVector4 ? ie.set(A.x, A.y, A.z, A.w) : ie.set(A, L, z, B), ke.scissor(W.copy(ie).multiplyScalar(Fe).round());
38489
38489
  }, this.getScissorTest = function() {
38490
38490
  return Ee;
38491
38491
  }, this.setScissorTest = function(A) {
@@ -38502,7 +38502,7 @@ class Cg {
38502
38502
  return fe.getClearAlpha();
38503
38503
  }, this.setClearAlpha = function() {
38504
38504
  fe.setClearAlpha(...arguments);
38505
- }, this.clear = function(A = !0, D = !0, z = !0) {
38505
+ }, this.clear = function(A = !0, L = !0, z = !0) {
38506
38506
  let B = 0;
38507
38507
  if (A) {
38508
38508
  let q = !1;
@@ -38511,12 +38511,12 @@ class Cg {
38511
38511
  q = m.has(me);
38512
38512
  }
38513
38513
  if (q) {
38514
- const me = O.texture.type, xe = p.has(me), Se = fe.getClearColor(), Ce = fe.getClearAlpha(), _e = Se.r, De = Se.g, Pe = Se.b;
38515
- xe ? (E[0] = _e, E[1] = De, E[2] = Pe, E[3] = Ce, P.clearBufferuiv(P.COLOR, 0, E)) : (M[0] = _e, M[1] = De, M[2] = Pe, M[3] = Ce, P.clearBufferiv(P.COLOR, 0, M));
38514
+ const me = O.texture.type, xe = p.has(me), Se = fe.getClearColor(), Ce = fe.getClearAlpha(), _e = Se.r, Le = Se.g, Pe = Se.b;
38515
+ xe ? (E[0] = _e, E[1] = Le, E[2] = Pe, E[3] = Ce, P.clearBufferuiv(P.COLOR, 0, E)) : (M[0] = _e, M[1] = Le, M[2] = Pe, M[3] = Ce, P.clearBufferiv(P.COLOR, 0, M));
38516
38516
  } else
38517
38517
  B |= P.COLOR_BUFFER_BIT;
38518
38518
  }
38519
- D && (B |= P.DEPTH_BUFFER_BIT), z && (B |= P.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), P.clear(B);
38519
+ L && (B |= P.DEPTH_BUFFER_BIT), z && (B |= P.STENCIL_BUFFER_BIT, this.state.buffers.stencil.setMask(4294967295)), P.clear(B);
38520
38520
  }, this.clearColor = function() {
38521
38521
  this.clear(!0, !1, !1);
38522
38522
  }, this.clearDepth = function() {
@@ -38531,42 +38531,42 @@ class Cg {
38531
38531
  }
38532
38532
  function At() {
38533
38533
  $h("WebGLRenderer: Context Restored."), x = !1;
38534
- const A = k.autoReset, D = we.enabled, z = we.autoUpdate, B = we.needsUpdate, q = we.type;
38535
- j(), k.autoReset = A, we.enabled = D, we.autoUpdate = z, we.needsUpdate = B, we.type = q;
38534
+ const A = k.autoReset, L = we.enabled, z = we.autoUpdate, B = we.needsUpdate, q = we.type;
38535
+ j(), k.autoReset = A, we.enabled = L, we.autoUpdate = z, we.needsUpdate = B, we.type = q;
38536
38536
  }
38537
38537
  function ut(A) {
38538
38538
  at("WebGLRenderer: A WebGL context could not be created. Reason: ", A.statusMessage);
38539
38539
  }
38540
38540
  function $i(A) {
38541
- const D = A.target;
38542
- D.removeEventListener("dispose", $i), mn(D);
38541
+ const L = A.target;
38542
+ L.removeEventListener("dispose", $i), mn(L);
38543
38543
  }
38544
38544
  function mn(A) {
38545
38545
  Mg(A), y.remove(A);
38546
38546
  }
38547
38547
  function Mg(A) {
38548
- const D = y.get(A).programs;
38549
- D !== void 0 && (D.forEach(function(z) {
38548
+ const L = y.get(A).programs;
38549
+ L !== void 0 && (L.forEach(function(z) {
38550
38550
  Re.releaseProgram(z);
38551
38551
  }), A.isShaderMaterial && Re.releaseShaderCache(A));
38552
38552
  }
38553
- this.renderBufferDirect = function(A, D, z, B, q, me) {
38554
- D === null && (D = bt);
38555
- const xe = q.isMesh && q.matrixWorld.determinant() < 0, Se = Rg(A, D, z, B, q);
38553
+ this.renderBufferDirect = function(A, L, z, B, q, me) {
38554
+ L === null && (L = bt);
38555
+ const xe = q.isMesh && q.matrixWorld.determinant() < 0, Se = Rg(A, L, z, B, q);
38556
38556
  ke.setMaterial(B, xe);
38557
38557
  let Ce = z.index, _e = 1;
38558
38558
  if (B.wireframe === !0) {
38559
38559
  if (Ce = Ie.getWireframeAttribute(z), Ce === void 0) return;
38560
38560
  _e = 2;
38561
38561
  }
38562
- const De = z.drawRange, Pe = z.attributes.position;
38563
- let Qe = De.start * _e, gt = (De.start + De.count) * _e;
38562
+ const Le = z.drawRange, Pe = z.attributes.position;
38563
+ let Qe = Le.start * _e, gt = (Le.start + Le.count) * _e;
38564
38564
  me !== null && (Qe = Math.max(Qe, me.start * _e), gt = Math.min(gt, (me.start + me.count) * _e)), Ce !== null ? (Qe = Math.max(Qe, 0), gt = Math.min(gt, Ce.count)) : Pe != null && (Qe = Math.max(Qe, 0), gt = Math.min(gt, Pe.count));
38565
- const Lt = gt - Qe;
38566
- if (Lt < 0 || Lt === 1 / 0) return;
38565
+ const Dt = gt - Qe;
38566
+ if (Dt < 0 || Dt === 1 / 0) return;
38567
38567
  Te.setup(q, B, Se, z, Ce);
38568
- let Dt, Tt = U;
38569
- if (Ce !== null && (Dt = K.get(Ce), Tt = be, Tt.setIndex(Dt)), q.isMesh)
38568
+ let Lt, Tt = U;
38569
+ if (Ce !== null && (Lt = K.get(Ce), Tt = be, Tt.setIndex(Lt)), q.isMesh)
38570
38570
  B.wireframe === !0 ? (ke.setLineWidth(B.wireframeLinewidth * Gt()), Tt.setMode(P.LINES)) : Tt.setMode(P.TRIANGLES);
38571
38571
  else if (q.isLine) {
38572
38572
  let Ue = B.linewidth;
@@ -38583,21 +38583,21 @@ class Cg {
38583
38583
  Us.setValue(P, "_gl_DrawID", Ii), Tt.render(Ue[Ii] / wi, ht[Ii]);
38584
38584
  }
38585
38585
  else if (q.isInstancedMesh)
38586
- Tt.renderInstances(Qe, Lt, q.count);
38586
+ Tt.renderInstances(Qe, Dt, q.count);
38587
38587
  else if (z.isInstancedBufferGeometry) {
38588
38588
  const Ue = z._maxInstanceCount !== void 0 ? z._maxInstanceCount : 1 / 0, ht = Math.min(z.instanceCount, Ue);
38589
- Tt.renderInstances(Qe, Lt, ht);
38589
+ Tt.renderInstances(Qe, Dt, ht);
38590
38590
  } else
38591
- Tt.render(Qe, Lt);
38591
+ Tt.render(Qe, Dt);
38592
38592
  };
38593
- function xu(A, D, z) {
38594
- A.transparent === !0 && A.side === wn && A.forceSinglePass === !1 ? (A.side = ci, A.needsUpdate = !0, Sa(A, D, z), A.side = Ln, A.needsUpdate = !0, Sa(A, D, z), A.side = wn) : Sa(A, D, z);
38593
+ function xu(A, L, z) {
38594
+ A.transparent === !0 && A.side === wn && A.forceSinglePass === !1 ? (A.side = ci, A.needsUpdate = !0, Sa(A, L, z), A.side = Dn, A.needsUpdate = !0, Sa(A, L, z), A.side = wn) : Sa(A, L, z);
38595
38595
  }
38596
- this.compile = function(A, D, z = null) {
38597
- z === null && (z = A), T = pe.get(z), T.init(D), R.push(T), z.traverseVisible(function(q) {
38598
- q.isLight && q.layers.test(D.layers) && (T.pushLight(q), q.castShadow && T.pushShadow(q));
38596
+ this.compile = function(A, L, z = null) {
38597
+ z === null && (z = A), T = pe.get(z), T.init(L), R.push(T), z.traverseVisible(function(q) {
38598
+ q.isLight && q.layers.test(L.layers) && (T.pushLight(q), q.castShadow && T.pushShadow(q));
38599
38599
  }), A !== z && A.traverseVisible(function(q) {
38600
- q.isLight && q.layers.test(D.layers) && (T.pushLight(q), q.castShadow && T.pushShadow(q));
38600
+ q.isLight && q.layers.test(L.layers) && (T.pushLight(q), q.castShadow && T.pushShadow(q));
38601
38601
  }), T.setupLights();
38602
38602
  const B = /* @__PURE__ */ new Set();
38603
38603
  return A.traverse(function(q) {
@@ -38613,8 +38613,8 @@ class Cg {
38613
38613
  else
38614
38614
  xu(me, z, q), B.add(me);
38615
38615
  }), T = R.pop(), B;
38616
- }, this.compileAsync = function(A, D, z = null) {
38617
- const B = this.compile(A, D, z);
38616
+ }, this.compileAsync = function(A, L, z = null) {
38617
+ const B = this.compile(A, L, z);
38618
38618
  return new Promise((q) => {
38619
38619
  function me() {
38620
38620
  if (B.forEach(function(xe) {
@@ -38641,45 +38641,45 @@ class Cg {
38641
38641
  const cs = new yg();
38642
38642
  cs.setAnimationLoop(Ag), typeof self < "u" && cs.setContext(self), this.setAnimationLoop = function(A) {
38643
38643
  Xo = A, de.setAnimationLoop(A), A === null ? cs.stop() : cs.start();
38644
- }, de.addEventListener("sessionstart", Eu), de.addEventListener("sessionend", Cu), this.render = function(A, D) {
38645
- if (D !== void 0 && D.isCamera !== !0) {
38644
+ }, de.addEventListener("sessionstart", Eu), de.addEventListener("sessionend", Cu), this.render = function(A, L) {
38645
+ if (L !== void 0 && L.isCamera !== !0) {
38646
38646
  at("WebGLRenderer.render: camera is not an instance of THREE.Camera.");
38647
38647
  return;
38648
38648
  }
38649
38649
  if (x === !0) return;
38650
38650
  const z = de.enabled === !0 && de.isPresenting === !0, B = _ !== null && (O === null || z) && _.begin(b, O);
38651
- if (A.matrixWorldAutoUpdate === !0 && A.updateMatrixWorld(), D.parent === null && D.matrixWorldAutoUpdate === !0 && D.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (_ === null || _.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(D), D = de.getCamera()), A.isScene === !0 && A.onBeforeRender(b, A, D, O), T = pe.get(A, R.length), T.init(D), R.push(T), jt.multiplyMatrices(D.projectionMatrix, D.matrixWorldInverse), Ge.setFromProjectionMatrix(jt, an, D.reversedDepth), st = this.localClippingEnabled, Ae = Me.init(this.clippingPlanes, st), S = se.get(A, C.length), S.init(), C.push(S), de.enabled === !0 && de.isPresenting === !0) {
38651
+ if (A.matrixWorldAutoUpdate === !0 && A.updateMatrixWorld(), L.parent === null && L.matrixWorldAutoUpdate === !0 && L.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (_ === null || _.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(L), L = de.getCamera()), A.isScene === !0 && A.onBeforeRender(b, A, L, O), T = pe.get(A, R.length), T.init(L), R.push(T), jt.multiplyMatrices(L.projectionMatrix, L.matrixWorldInverse), Ge.setFromProjectionMatrix(jt, an, L.reversedDepth), st = this.localClippingEnabled, Ae = Me.init(this.clippingPlanes, st), S = se.get(A, C.length), S.init(), C.push(S), de.enabled === !0 && de.isPresenting === !0) {
38652
38652
  const xe = b.xr.getDepthSensingMesh();
38653
- xe !== null && $o(xe, D, -1 / 0, b.sortObjects);
38653
+ xe !== null && $o(xe, L, -1 / 0, b.sortObjects);
38654
38654
  }
38655
- $o(A, D, 0, b.sortObjects), S.finish(), b.sortObjects === !0 && S.sort(It, mt), Ke = de.enabled === !1 || de.isPresenting === !1 || de.hasDepthSensing() === !1, Ke && fe.addToRenderList(S, A), this.info.render.frame++, Ae === !0 && Me.beginShadows();
38655
+ $o(A, L, 0, b.sortObjects), S.finish(), b.sortObjects === !0 && S.sort(It, mt), Ke = de.enabled === !1 || de.isPresenting === !1 || de.hasDepthSensing() === !1, Ke && fe.addToRenderList(S, A), this.info.render.frame++, Ae === !0 && Me.beginShadows();
38656
38656
  const q = T.state.shadowsArray;
38657
- if (we.render(q, A, D), Ae === !0 && Me.endShadows(), this.info.autoReset === !0 && this.info.reset(), (B && _.hasRenderPass()) === !1) {
38657
+ if (we.render(q, A, L), Ae === !0 && Me.endShadows(), this.info.autoReset === !0 && this.info.reset(), (B && _.hasRenderPass()) === !1) {
38658
38658
  const xe = S.opaque, Se = S.transmissive;
38659
- if (T.setupLights(), D.isArrayCamera) {
38660
- const Ce = D.cameras;
38659
+ if (T.setupLights(), L.isArrayCamera) {
38660
+ const Ce = L.cameras;
38661
38661
  if (Se.length > 0)
38662
- for (let _e = 0, De = Ce.length; _e < De; _e++) {
38662
+ for (let _e = 0, Le = Ce.length; _e < Le; _e++) {
38663
38663
  const Pe = Ce[_e];
38664
38664
  Au(xe, Se, A, Pe);
38665
38665
  }
38666
38666
  Ke && fe.render(A);
38667
- for (let _e = 0, De = Ce.length; _e < De; _e++) {
38667
+ for (let _e = 0, Le = Ce.length; _e < Le; _e++) {
38668
38668
  const Pe = Ce[_e];
38669
38669
  Mu(S, A, Pe, Pe.viewport);
38670
38670
  }
38671
38671
  } else
38672
- Se.length > 0 && Au(xe, Se, A, D), Ke && fe.render(A), Mu(S, A, D);
38672
+ Se.length > 0 && Au(xe, Se, A, L), Ke && fe.render(A), Mu(S, A, L);
38673
38673
  }
38674
- O !== null && V === 0 && (L.updateMultisampleRenderTarget(O), L.updateRenderTargetMipmap(O)), B && _.end(b), A.isScene === !0 && A.onAfterRender(b, A, D), Te.resetDefaultState(), J = -1, Q = null, R.pop(), R.length > 0 ? (T = R[R.length - 1], Ae === !0 && Me.setGlobalState(b.clippingPlanes, T.state.camera)) : T = null, C.pop(), C.length > 0 ? S = C[C.length - 1] : S = null;
38674
+ O !== null && V === 0 && (D.updateMultisampleRenderTarget(O), D.updateRenderTargetMipmap(O)), B && _.end(b), A.isScene === !0 && A.onAfterRender(b, A, L), Te.resetDefaultState(), J = -1, Q = null, R.pop(), R.length > 0 ? (T = R[R.length - 1], Ae === !0 && Me.setGlobalState(b.clippingPlanes, T.state.camera)) : T = null, C.pop(), C.length > 0 ? S = C[C.length - 1] : S = null;
38675
38675
  };
38676
- function $o(A, D, z, B) {
38676
+ function $o(A, L, z, B) {
38677
38677
  if (A.visible === !1) return;
38678
- if (A.layers.test(D.layers)) {
38678
+ if (A.layers.test(L.layers)) {
38679
38679
  if (A.isGroup)
38680
38680
  z = A.renderOrder;
38681
38681
  else if (A.isLOD)
38682
- A.autoUpdate === !0 && A.update(D);
38682
+ A.autoUpdate === !0 && A.update(L);
38683
38683
  else if (A.isLight)
38684
38684
  T.pushLight(A), A.castShadow && T.pushShadow(A);
38685
38685
  else if (A.isSprite) {
@@ -38692,7 +38692,7 @@ class Cg {
38692
38692
  const xe = he.update(A), Se = A.material;
38693
38693
  if (B && (A.boundingSphere !== void 0 ? (A.boundingSphere === null && A.computeBoundingSphere(), dt.copy(A.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), dt.copy(xe.boundingSphere.center)), dt.applyMatrix4(A.matrixWorld).applyMatrix4(jt)), Array.isArray(Se)) {
38694
38694
  const Ce = xe.groups;
38695
- for (let _e = 0, De = Ce.length; _e < De; _e++) {
38695
+ for (let _e = 0, Le = Ce.length; _e < Le; _e++) {
38696
38696
  const Pe = Ce[_e], Qe = Se[Pe.materialIndex];
38697
38697
  Qe && Qe.visible && S.push(A, xe, Qe, z, dt.z, Pe);
38698
38698
  }
@@ -38701,20 +38701,20 @@ class Cg {
38701
38701
  }
38702
38702
  const me = A.children;
38703
38703
  for (let xe = 0, Se = me.length; xe < Se; xe++)
38704
- $o(me[xe], D, z, B);
38704
+ $o(me[xe], L, z, B);
38705
38705
  }
38706
- function Mu(A, D, z, B) {
38706
+ function Mu(A, L, z, B) {
38707
38707
  const { opaque: q, transmissive: me, transparent: xe } = A;
38708
- T.setupLightsView(z), Ae === !0 && Me.setGlobalState(b.clippingPlanes, z), B && ke.viewport(G.copy(B)), q.length > 0 && va(q, D, z), me.length > 0 && va(me, D, z), xe.length > 0 && va(xe, D, z), ke.buffers.depth.setTest(!0), ke.buffers.depth.setMask(!0), ke.buffers.color.setMask(!0), ke.setPolygonOffset(!1);
38708
+ T.setupLightsView(z), Ae === !0 && Me.setGlobalState(b.clippingPlanes, z), B && ke.viewport(G.copy(B)), q.length > 0 && va(q, L, z), me.length > 0 && va(me, L, z), xe.length > 0 && va(xe, L, z), ke.buffers.depth.setTest(!0), ke.buffers.depth.setMask(!0), ke.buffers.color.setMask(!0), ke.setPolygonOffset(!1);
38709
38709
  }
38710
- function Au(A, D, z, B) {
38710
+ function Au(A, L, z, B) {
38711
38711
  if ((z.isScene === !0 ? z.overrideMaterial : null) !== null)
38712
38712
  return;
38713
38713
  if (T.state.transmissionRenderTarget[B.id] === void 0) {
38714
38714
  const Qe = ct.has("EXT_color_buffer_half_float") || ct.has("EXT_color_buffer_float");
38715
38715
  T.state.transmissionRenderTarget[B.id] = new ln(1, 1, {
38716
38716
  generateMipmaps: !0,
38717
- type: Qe ? Dn : Ui,
38717
+ type: Qe ? Ln : Ui,
38718
38718
  minFilter: Cs,
38719
38719
  samples: Mt.samples,
38720
38720
  stencilBuffer: r,
@@ -38727,72 +38727,72 @@ class Cg {
38727
38727
  me.setSize(xe.z * b.transmissionResolutionScale, xe.w * b.transmissionResolutionScale);
38728
38728
  const Se = b.getRenderTarget(), Ce = b.getActiveCubeFace(), _e = b.getActiveMipmapLevel();
38729
38729
  b.setRenderTarget(me), b.getClearColor(ve), le = b.getClearAlpha(), le < 1 && b.setClearColor(16777215, 0.5), b.clear(), Ke && fe.render(z);
38730
- const De = b.toneMapping;
38730
+ const Le = b.toneMapping;
38731
38731
  b.toneMapping = cn;
38732
38732
  const Pe = B.viewport;
38733
- if (B.viewport !== void 0 && (B.viewport = void 0), T.setupLightsView(B), Ae === !0 && Me.setGlobalState(b.clippingPlanes, B), va(A, z, B), L.updateMultisampleRenderTarget(me), L.updateRenderTargetMipmap(me), ct.has("WEBGL_multisampled_render_to_texture") === !1) {
38733
+ if (B.viewport !== void 0 && (B.viewport = void 0), T.setupLightsView(B), Ae === !0 && Me.setGlobalState(b.clippingPlanes, B), va(A, z, B), D.updateMultisampleRenderTarget(me), D.updateRenderTargetMipmap(me), ct.has("WEBGL_multisampled_render_to_texture") === !1) {
38734
38734
  let Qe = !1;
38735
- for (let gt = 0, Lt = D.length; gt < Lt; gt++) {
38736
- const Dt = D[gt], { object: Tt, geometry: Ue, material: ht, group: rt } = Dt;
38735
+ for (let gt = 0, Dt = L.length; gt < Dt; gt++) {
38736
+ const Lt = L[gt], { object: Tt, geometry: Ue, material: ht, group: rt } = Lt;
38737
38737
  if (ht.side === wn && Tt.layers.test(B.layers)) {
38738
38738
  const wi = ht.side;
38739
38739
  ht.side = ci, ht.needsUpdate = !0, Ru(Tt, z, B, Ue, ht, rt), ht.side = wi, ht.needsUpdate = !0, Qe = !0;
38740
38740
  }
38741
38741
  }
38742
- Qe === !0 && (L.updateMultisampleRenderTarget(me), L.updateRenderTargetMipmap(me));
38742
+ Qe === !0 && (D.updateMultisampleRenderTarget(me), D.updateRenderTargetMipmap(me));
38743
38743
  }
38744
- b.setRenderTarget(Se, Ce, _e), b.setClearColor(ve, le), Pe !== void 0 && (B.viewport = Pe), b.toneMapping = De;
38744
+ b.setRenderTarget(Se, Ce, _e), b.setClearColor(ve, le), Pe !== void 0 && (B.viewport = Pe), b.toneMapping = Le;
38745
38745
  }
38746
- function va(A, D, z) {
38747
- const B = D.isScene === !0 ? D.overrideMaterial : null;
38746
+ function va(A, L, z) {
38747
+ const B = L.isScene === !0 ? L.overrideMaterial : null;
38748
38748
  for (let q = 0, me = A.length; q < me; q++) {
38749
38749
  const xe = A[q], { object: Se, geometry: Ce, group: _e } = xe;
38750
- let De = xe.material;
38751
- De.allowOverride === !0 && B !== null && (De = B), Se.layers.test(z.layers) && Ru(Se, D, z, Ce, De, _e);
38750
+ let Le = xe.material;
38751
+ Le.allowOverride === !0 && B !== null && (Le = B), Se.layers.test(z.layers) && Ru(Se, L, z, Ce, Le, _e);
38752
38752
  }
38753
38753
  }
38754
- function Ru(A, D, z, B, q, me) {
38755
- A.onBeforeRender(b, D, z, B, q, me), A.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse, A.matrixWorld), A.normalMatrix.getNormalMatrix(A.modelViewMatrix), q.onBeforeRender(b, D, z, B, A, me), q.transparent === !0 && q.side === wn && q.forceSinglePass === !1 ? (q.side = ci, q.needsUpdate = !0, b.renderBufferDirect(z, D, B, q, A, me), q.side = Ln, q.needsUpdate = !0, b.renderBufferDirect(z, D, B, q, A, me), q.side = wn) : b.renderBufferDirect(z, D, B, q, A, me), A.onAfterRender(b, D, z, B, q, me);
38754
+ function Ru(A, L, z, B, q, me) {
38755
+ A.onBeforeRender(b, L, z, B, q, me), A.modelViewMatrix.multiplyMatrices(z.matrixWorldInverse, A.matrixWorld), A.normalMatrix.getNormalMatrix(A.modelViewMatrix), q.onBeforeRender(b, L, z, B, A, me), q.transparent === !0 && q.side === wn && q.forceSinglePass === !1 ? (q.side = ci, q.needsUpdate = !0, b.renderBufferDirect(z, L, B, q, A, me), q.side = Dn, q.needsUpdate = !0, b.renderBufferDirect(z, L, B, q, A, me), q.side = wn) : b.renderBufferDirect(z, L, B, q, A, me), A.onAfterRender(b, L, z, B, q, me);
38756
38756
  }
38757
- function Sa(A, D, z) {
38758
- D.isScene !== !0 && (D = bt);
38759
- const B = y.get(A), q = T.state.lights, me = T.state.shadowsArray, xe = q.state.version, Se = Re.getParameters(A, q.state, me, D, z), Ce = Re.getProgramCacheKey(Se);
38757
+ function Sa(A, L, z) {
38758
+ L.isScene !== !0 && (L = bt);
38759
+ const B = y.get(A), q = T.state.lights, me = T.state.shadowsArray, xe = q.state.version, Se = Re.getParameters(A, q.state, me, L, z), Ce = Re.getProgramCacheKey(Se);
38760
38760
  let _e = B.programs;
38761
- B.environment = A.isMeshStandardMaterial ? D.environment : null, B.fog = D.fog, B.envMap = (A.isMeshStandardMaterial ? $ : H).get(A.envMap || B.environment), B.envMapRotation = B.environment !== null && A.envMap === null ? D.environmentRotation : A.envMapRotation, _e === void 0 && (A.addEventListener("dispose", $i), _e = /* @__PURE__ */ new Map(), B.programs = _e);
38762
- let De = _e.get(Ce);
38763
- if (De !== void 0) {
38764
- if (B.currentProgram === De && B.lightsStateVersion === xe)
38765
- return wu(A, Se), De;
38761
+ B.environment = A.isMeshStandardMaterial ? L.environment : null, B.fog = L.fog, B.envMap = (A.isMeshStandardMaterial ? $ : H).get(A.envMap || B.environment), B.envMapRotation = B.environment !== null && A.envMap === null ? L.environmentRotation : A.envMapRotation, _e === void 0 && (A.addEventListener("dispose", $i), _e = /* @__PURE__ */ new Map(), B.programs = _e);
38762
+ let Le = _e.get(Ce);
38763
+ if (Le !== void 0) {
38764
+ if (B.currentProgram === Le && B.lightsStateVersion === xe)
38765
+ return wu(A, Se), Le;
38766
38766
  } else
38767
- Se.uniforms = Re.getUniforms(A), A.onBeforeCompile(Se, b), De = Re.acquireProgram(Se, Ce), _e.set(Ce, De), B.uniforms = Se.uniforms;
38767
+ Se.uniforms = Re.getUniforms(A), A.onBeforeCompile(Se, b), Le = Re.acquireProgram(Se, Ce), _e.set(Ce, Le), B.uniforms = Se.uniforms;
38768
38768
  const Pe = B.uniforms;
38769
- return (!A.isShaderMaterial && !A.isRawShaderMaterial || A.clipping === !0) && (Pe.clippingPlanes = Me.uniform), wu(A, Se), B.needsLights = wg(A), B.lightsStateVersion = xe, B.needsLights && (Pe.ambientLightColor.value = q.state.ambient, Pe.lightProbe.value = q.state.probe, Pe.directionalLights.value = q.state.directional, Pe.directionalLightShadows.value = q.state.directionalShadow, Pe.spotLights.value = q.state.spot, Pe.spotLightShadows.value = q.state.spotShadow, Pe.rectAreaLights.value = q.state.rectArea, Pe.ltc_1.value = q.state.rectAreaLTC1, Pe.ltc_2.value = q.state.rectAreaLTC2, Pe.pointLights.value = q.state.point, Pe.pointLightShadows.value = q.state.pointShadow, Pe.hemisphereLights.value = q.state.hemi, Pe.directionalShadowMap.value = q.state.directionalShadowMap, Pe.directionalShadowMatrix.value = q.state.directionalShadowMatrix, Pe.spotShadowMap.value = q.state.spotShadowMap, Pe.spotLightMatrix.value = q.state.spotLightMatrix, Pe.spotLightMap.value = q.state.spotLightMap, Pe.pointShadowMap.value = q.state.pointShadowMap, Pe.pointShadowMatrix.value = q.state.pointShadowMatrix), B.currentProgram = De, B.uniformsList = null, De;
38769
+ return (!A.isShaderMaterial && !A.isRawShaderMaterial || A.clipping === !0) && (Pe.clippingPlanes = Me.uniform), wu(A, Se), B.needsLights = wg(A), B.lightsStateVersion = xe, B.needsLights && (Pe.ambientLightColor.value = q.state.ambient, Pe.lightProbe.value = q.state.probe, Pe.directionalLights.value = q.state.directional, Pe.directionalLightShadows.value = q.state.directionalShadow, Pe.spotLights.value = q.state.spot, Pe.spotLightShadows.value = q.state.spotShadow, Pe.rectAreaLights.value = q.state.rectArea, Pe.ltc_1.value = q.state.rectAreaLTC1, Pe.ltc_2.value = q.state.rectAreaLTC2, Pe.pointLights.value = q.state.point, Pe.pointLightShadows.value = q.state.pointShadow, Pe.hemisphereLights.value = q.state.hemi, Pe.directionalShadowMap.value = q.state.directionalShadowMap, Pe.directionalShadowMatrix.value = q.state.directionalShadowMatrix, Pe.spotShadowMap.value = q.state.spotShadowMap, Pe.spotLightMatrix.value = q.state.spotLightMatrix, Pe.spotLightMap.value = q.state.spotLightMap, Pe.pointShadowMap.value = q.state.pointShadowMap, Pe.pointShadowMatrix.value = q.state.pointShadowMatrix), B.currentProgram = Le, B.uniformsList = null, Le;
38770
38770
  }
38771
38771
  function ku(A) {
38772
38772
  if (A.uniformsList === null) {
38773
- const D = A.currentProgram.getUniforms();
38774
- A.uniformsList = ho.seqWithValue(D.seq, A.uniforms);
38773
+ const L = A.currentProgram.getUniforms();
38774
+ A.uniformsList = ho.seqWithValue(L.seq, A.uniforms);
38775
38775
  }
38776
38776
  return A.uniformsList;
38777
38777
  }
38778
- function wu(A, D) {
38778
+ function wu(A, L) {
38779
38779
  const z = y.get(A);
38780
- z.outputColorSpace = D.outputColorSpace, z.batching = D.batching, z.batchingColor = D.batchingColor, z.instancing = D.instancing, z.instancingColor = D.instancingColor, z.instancingMorph = D.instancingMorph, z.skinning = D.skinning, z.morphTargets = D.morphTargets, z.morphNormals = D.morphNormals, z.morphColors = D.morphColors, z.morphTargetsCount = D.morphTargetsCount, z.numClippingPlanes = D.numClippingPlanes, z.numIntersection = D.numClipIntersection, z.vertexAlphas = D.vertexAlphas, z.vertexTangents = D.vertexTangents, z.toneMapping = D.toneMapping;
38781
- }
38782
- function Rg(A, D, z, B, q) {
38783
- D.isScene !== !0 && (D = bt), L.resetTextureUnits();
38784
- const me = D.fog, xe = B.isMeshStandardMaterial ? D.environment : null, Se = O === null ? b.outputColorSpace : O.isXRRenderTarget === !0 ? O.texture.colorSpace : yr, Ce = (B.isMeshStandardMaterial ? $ : H).get(B.envMap || xe), _e = B.vertexColors === !0 && !!z.attributes.color && z.attributes.color.itemSize === 4, De = !!z.attributes.tangent && (!!B.normalMap || B.anisotropy > 0), Pe = !!z.morphAttributes.position, Qe = !!z.morphAttributes.normal, gt = !!z.morphAttributes.color;
38785
- let Lt = cn;
38786
- B.toneMapped && (O === null || O.isXRRenderTarget === !0) && (Lt = b.toneMapping);
38787
- const Dt = z.morphAttributes.position || z.morphAttributes.normal || z.morphAttributes.color, Tt = Dt !== void 0 ? Dt.length : 0, Ue = y.get(B), ht = T.state.lights;
38780
+ z.outputColorSpace = L.outputColorSpace, z.batching = L.batching, z.batchingColor = L.batchingColor, z.instancing = L.instancing, z.instancingColor = L.instancingColor, z.instancingMorph = L.instancingMorph, z.skinning = L.skinning, z.morphTargets = L.morphTargets, z.morphNormals = L.morphNormals, z.morphColors = L.morphColors, z.morphTargetsCount = L.morphTargetsCount, z.numClippingPlanes = L.numClippingPlanes, z.numIntersection = L.numClipIntersection, z.vertexAlphas = L.vertexAlphas, z.vertexTangents = L.vertexTangents, z.toneMapping = L.toneMapping;
38781
+ }
38782
+ function Rg(A, L, z, B, q) {
38783
+ L.isScene !== !0 && (L = bt), D.resetTextureUnits();
38784
+ const me = L.fog, xe = B.isMeshStandardMaterial ? L.environment : null, Se = O === null ? b.outputColorSpace : O.isXRRenderTarget === !0 ? O.texture.colorSpace : yr, Ce = (B.isMeshStandardMaterial ? $ : H).get(B.envMap || xe), _e = B.vertexColors === !0 && !!z.attributes.color && z.attributes.color.itemSize === 4, Le = !!z.attributes.tangent && (!!B.normalMap || B.anisotropy > 0), Pe = !!z.morphAttributes.position, Qe = !!z.morphAttributes.normal, gt = !!z.morphAttributes.color;
38785
+ let Dt = cn;
38786
+ B.toneMapped && (O === null || O.isXRRenderTarget === !0) && (Dt = b.toneMapping);
38787
+ const Lt = z.morphAttributes.position || z.morphAttributes.normal || z.morphAttributes.color, Tt = Lt !== void 0 ? Lt.length : 0, Ue = y.get(B), ht = T.state.lights;
38788
38788
  if (Ae === !0 && (st === !0 || A !== Q)) {
38789
38789
  const di = A === Q && B.id === J;
38790
38790
  Me.setState(B, A, di);
38791
38791
  }
38792
38792
  let rt = !1;
38793
- B.version === Ue.__version ? (Ue.needsLights && Ue.lightsStateVersion !== ht.state.version || Ue.outputColorSpace !== Se || q.isBatchedMesh && Ue.batching === !1 || !q.isBatchedMesh && Ue.batching === !0 || q.isBatchedMesh && Ue.batchingColor === !0 && q.colorTexture === null || q.isBatchedMesh && Ue.batchingColor === !1 && q.colorTexture !== null || q.isInstancedMesh && Ue.instancing === !1 || !q.isInstancedMesh && Ue.instancing === !0 || q.isSkinnedMesh && Ue.skinning === !1 || !q.isSkinnedMesh && Ue.skinning === !0 || q.isInstancedMesh && Ue.instancingColor === !0 && q.instanceColor === null || q.isInstancedMesh && Ue.instancingColor === !1 && q.instanceColor !== null || q.isInstancedMesh && Ue.instancingMorph === !0 && q.morphTexture === null || q.isInstancedMesh && Ue.instancingMorph === !1 && q.morphTexture !== null || Ue.envMap !== Ce || B.fog === !0 && Ue.fog !== me || Ue.numClippingPlanes !== void 0 && (Ue.numClippingPlanes !== Me.numPlanes || Ue.numIntersection !== Me.numIntersection) || Ue.vertexAlphas !== _e || Ue.vertexTangents !== De || Ue.morphTargets !== Pe || Ue.morphNormals !== Qe || Ue.morphColors !== gt || Ue.toneMapping !== Lt || Ue.morphTargetsCount !== Tt) && (rt = !0) : (rt = !0, Ue.__version = B.version);
38793
+ B.version === Ue.__version ? (Ue.needsLights && Ue.lightsStateVersion !== ht.state.version || Ue.outputColorSpace !== Se || q.isBatchedMesh && Ue.batching === !1 || !q.isBatchedMesh && Ue.batching === !0 || q.isBatchedMesh && Ue.batchingColor === !0 && q.colorTexture === null || q.isBatchedMesh && Ue.batchingColor === !1 && q.colorTexture !== null || q.isInstancedMesh && Ue.instancing === !1 || !q.isInstancedMesh && Ue.instancing === !0 || q.isSkinnedMesh && Ue.skinning === !1 || !q.isSkinnedMesh && Ue.skinning === !0 || q.isInstancedMesh && Ue.instancingColor === !0 && q.instanceColor === null || q.isInstancedMesh && Ue.instancingColor === !1 && q.instanceColor !== null || q.isInstancedMesh && Ue.instancingMorph === !0 && q.morphTexture === null || q.isInstancedMesh && Ue.instancingMorph === !1 && q.morphTexture !== null || Ue.envMap !== Ce || B.fog === !0 && Ue.fog !== me || Ue.numClippingPlanes !== void 0 && (Ue.numClippingPlanes !== Me.numPlanes || Ue.numIntersection !== Me.numIntersection) || Ue.vertexAlphas !== _e || Ue.vertexTangents !== Le || Ue.morphTargets !== Pe || Ue.morphNormals !== Qe || Ue.morphColors !== gt || Ue.toneMapping !== Dt || Ue.morphTargetsCount !== Tt) && (rt = !0) : (rt = !0, Ue.__version = B.version);
38794
38794
  let wi = Ue.currentProgram;
38795
- rt === !0 && (wi = Sa(B, D, q));
38795
+ rt === !0 && (wi = Sa(B, L, q));
38796
38796
  let Us = !1, Ii = !1, Cr = !1;
38797
38797
  const Rt = wi.getUniforms(), Si = Ue.uniforms;
38798
38798
  if (ke.useProgram(wi.program) && (Us = !0, Ii = !0, Cr = !0), B.id !== J && (J = B.id, Ii = !0), Us || Q !== A) {
@@ -38804,14 +38804,14 @@ class Cg {
38804
38804
  2 / (Math.log(A.far + 1) / Math.LN2)
38805
38805
  ), (B.isMeshPhongMaterial || B.isMeshToonMaterial || B.isMeshLambertMaterial || B.isMeshBasicMaterial || B.isMeshStandardMaterial || B.isShaderMaterial) && Rt.setValue(P, "isOrthographic", A.isOrthographicCamera === !0), Q !== A && (Q = A, Ii = !0, Cr = !0);
38806
38806
  }
38807
- if (Ue.needsLights && (ht.state.directionalShadowMap.length > 0 && Rt.setValue(P, "directionalShadowMap", ht.state.directionalShadowMap, L), ht.state.spotShadowMap.length > 0 && Rt.setValue(P, "spotShadowMap", ht.state.spotShadowMap, L), ht.state.pointShadowMap.length > 0 && Rt.setValue(P, "pointShadowMap", ht.state.pointShadowMap, L)), q.isSkinnedMesh) {
38807
+ if (Ue.needsLights && (ht.state.directionalShadowMap.length > 0 && Rt.setValue(P, "directionalShadowMap", ht.state.directionalShadowMap, D), ht.state.spotShadowMap.length > 0 && Rt.setValue(P, "spotShadowMap", ht.state.spotShadowMap, D), ht.state.pointShadowMap.length > 0 && Rt.setValue(P, "pointShadowMap", ht.state.pointShadowMap, D)), q.isSkinnedMesh) {
38808
38808
  Rt.setOptional(P, q, "bindMatrix"), Rt.setOptional(P, q, "bindMatrixInverse");
38809
38809
  const di = q.skeleton;
38810
- di && (di.boneTexture === null && di.computeBoneTexture(), Rt.setValue(P, "boneTexture", di.boneTexture, L));
38810
+ di && (di.boneTexture === null && di.computeBoneTexture(), Rt.setValue(P, "boneTexture", di.boneTexture, D));
38811
38811
  }
38812
- q.isBatchedMesh && (Rt.setOptional(P, q, "batchingTexture"), Rt.setValue(P, "batchingTexture", q._matricesTexture, L), Rt.setOptional(P, q, "batchingIdTexture"), Rt.setValue(P, "batchingIdTexture", q._indirectTexture, L), Rt.setOptional(P, q, "batchingColorTexture"), q._colorsTexture !== null && Rt.setValue(P, "batchingColorTexture", q._colorsTexture, L));
38813
- const Di = z.morphAttributes;
38814
- if ((Di.position !== void 0 || Di.normal !== void 0 || Di.color !== void 0) && He.update(q, z, wi), (Ii || Ue.receiveShadow !== q.receiveShadow) && (Ue.receiveShadow = q.receiveShadow, Rt.setValue(P, "receiveShadow", q.receiveShadow)), B.isMeshGouraudMaterial && B.envMap !== null && (Si.envMap.value = Ce, Si.flipEnvMap.value = Ce.isCubeTexture && Ce.isRenderTargetTexture === !1 ? -1 : 1), B.isMeshStandardMaterial && B.envMap === null && D.environment !== null && (Si.envMapIntensity.value = D.environmentIntensity), Si.dfgLUT !== void 0 && (Si.dfgLUT.value = KA()), Ii && (Rt.setValue(P, "toneMappingExposure", b.toneMappingExposure), Ue.needsLights && kg(Si, Cr), me && B.fog === !0 && Ve.refreshFogUniforms(Si, me), Ve.refreshMaterialUniforms(Si, B, Fe, Be, T.state.transmissionRenderTarget[A.id]), ho.upload(P, ku(Ue), Si, L)), B.isShaderMaterial && B.uniformsNeedUpdate === !0 && (ho.upload(P, ku(Ue), Si, L), B.uniformsNeedUpdate = !1), B.isSpriteMaterial && Rt.setValue(P, "center", q.center), Rt.setValue(P, "modelViewMatrix", q.modelViewMatrix), Rt.setValue(P, "normalMatrix", q.normalMatrix), Rt.setValue(P, "modelMatrix", q.matrixWorld), B.isShaderMaterial || B.isRawShaderMaterial) {
38812
+ q.isBatchedMesh && (Rt.setOptional(P, q, "batchingTexture"), Rt.setValue(P, "batchingTexture", q._matricesTexture, D), Rt.setOptional(P, q, "batchingIdTexture"), Rt.setValue(P, "batchingIdTexture", q._indirectTexture, D), Rt.setOptional(P, q, "batchingColorTexture"), q._colorsTexture !== null && Rt.setValue(P, "batchingColorTexture", q._colorsTexture, D));
38813
+ const Li = z.morphAttributes;
38814
+ if ((Li.position !== void 0 || Li.normal !== void 0 || Li.color !== void 0) && He.update(q, z, wi), (Ii || Ue.receiveShadow !== q.receiveShadow) && (Ue.receiveShadow = q.receiveShadow, Rt.setValue(P, "receiveShadow", q.receiveShadow)), B.isMeshGouraudMaterial && B.envMap !== null && (Si.envMap.value = Ce, Si.flipEnvMap.value = Ce.isCubeTexture && Ce.isRenderTargetTexture === !1 ? -1 : 1), B.isMeshStandardMaterial && B.envMap === null && L.environment !== null && (Si.envMapIntensity.value = L.environmentIntensity), Si.dfgLUT !== void 0 && (Si.dfgLUT.value = KA()), Ii && (Rt.setValue(P, "toneMappingExposure", b.toneMappingExposure), Ue.needsLights && kg(Si, Cr), me && B.fog === !0 && Ve.refreshFogUniforms(Si, me), Ve.refreshMaterialUniforms(Si, B, Fe, Be, T.state.transmissionRenderTarget[A.id]), ho.upload(P, ku(Ue), Si, D)), B.isShaderMaterial && B.uniformsNeedUpdate === !0 && (ho.upload(P, ku(Ue), Si, D), B.uniformsNeedUpdate = !1), B.isSpriteMaterial && Rt.setValue(P, "center", q.center), Rt.setValue(P, "modelViewMatrix", q.modelViewMatrix), Rt.setValue(P, "normalMatrix", q.normalMatrix), Rt.setValue(P, "modelMatrix", q.matrixWorld), B.isShaderMaterial || B.isRawShaderMaterial) {
38815
38815
  const di = B.uniformsGroups;
38816
38816
  for (let yi = 0, ec = di.length; yi < ec; yi++) {
38817
38817
  const ls = di[yi];
@@ -38820,8 +38820,8 @@ class Cg {
38820
38820
  }
38821
38821
  return wi;
38822
38822
  }
38823
- function kg(A, D) {
38824
- A.ambientLightColor.needsUpdate = D, A.lightProbe.needsUpdate = D, A.directionalLights.needsUpdate = D, A.directionalLightShadows.needsUpdate = D, A.pointLights.needsUpdate = D, A.pointLightShadows.needsUpdate = D, A.spotLights.needsUpdate = D, A.spotLightShadows.needsUpdate = D, A.rectAreaLights.needsUpdate = D, A.hemisphereLights.needsUpdate = D;
38823
+ function kg(A, L) {
38824
+ A.ambientLightColor.needsUpdate = L, A.lightProbe.needsUpdate = L, A.directionalLights.needsUpdate = L, A.directionalLightShadows.needsUpdate = L, A.pointLights.needsUpdate = L, A.pointLightShadows.needsUpdate = L, A.spotLights.needsUpdate = L, A.spotLightShadows.needsUpdate = L, A.rectAreaLights.needsUpdate = L, A.hemisphereLights.needsUpdate = L;
38825
38825
  }
38826
38826
  function wg(A) {
38827
38827
  return A.isMeshLambertMaterial || A.isMeshToonMaterial || A.isMeshPhongMaterial || A.isMeshStandardMaterial || A.isShadowMaterial || A.isShaderMaterial && A.lights === !0;
@@ -38832,16 +38832,16 @@ class Cg {
38832
38832
  return V;
38833
38833
  }, this.getRenderTarget = function() {
38834
38834
  return O;
38835
- }, this.setRenderTargetTextures = function(A, D, z) {
38835
+ }, this.setRenderTargetTextures = function(A, L, z) {
38836
38836
  const B = y.get(A);
38837
- B.__autoAllocateDepthBuffer = A.resolveDepthBuffer === !1, B.__autoAllocateDepthBuffer === !1 && (B.__useRenderToTexture = !1), y.get(A.texture).__webglTexture = D, y.get(A.depthTexture).__webglTexture = B.__autoAllocateDepthBuffer ? void 0 : z, B.__hasExternalTextures = !0;
38838
- }, this.setRenderTargetFramebuffer = function(A, D) {
38837
+ B.__autoAllocateDepthBuffer = A.resolveDepthBuffer === !1, B.__autoAllocateDepthBuffer === !1 && (B.__useRenderToTexture = !1), y.get(A.texture).__webglTexture = L, y.get(A.depthTexture).__webglTexture = B.__autoAllocateDepthBuffer ? void 0 : z, B.__hasExternalTextures = !0;
38838
+ }, this.setRenderTargetFramebuffer = function(A, L) {
38839
38839
  const z = y.get(A);
38840
- z.__webglFramebuffer = D, z.__useDefaultFramebuffer = D === void 0;
38840
+ z.__webglFramebuffer = L, z.__useDefaultFramebuffer = L === void 0;
38841
38841
  };
38842
38842
  const Ig = P.createFramebuffer();
38843
- this.setRenderTarget = function(A, D = 0, z = 0) {
38844
- O = A, w = D, V = z;
38843
+ this.setRenderTarget = function(A, L = 0, z = 0) {
38844
+ O = A, w = L, V = z;
38845
38845
  let B = null, q = !1, me = !1;
38846
38846
  if (A) {
38847
38847
  const Se = y.get(A);
@@ -38849,28 +38849,28 @@ class Cg {
38849
38849
  ke.bindFramebuffer(P.FRAMEBUFFER, Se.__webglFramebuffer), G.copy(A.viewport), W.copy(A.scissor), ee = A.scissorTest, ke.viewport(G), ke.scissor(W), ke.setScissorTest(ee), J = -1;
38850
38850
  return;
38851
38851
  } else if (Se.__webglFramebuffer === void 0)
38852
- L.setupRenderTarget(A);
38852
+ D.setupRenderTarget(A);
38853
38853
  else if (Se.__hasExternalTextures)
38854
- L.rebindTextures(A, y.get(A.texture).__webglTexture, y.get(A.depthTexture).__webglTexture);
38854
+ D.rebindTextures(A, y.get(A.texture).__webglTexture, y.get(A.depthTexture).__webglTexture);
38855
38855
  else if (A.depthBuffer) {
38856
- const De = A.depthTexture;
38857
- if (Se.__boundDepthTexture !== De) {
38858
- if (De !== null && y.has(De) && (A.width !== De.image.width || A.height !== De.image.height))
38856
+ const Le = A.depthTexture;
38857
+ if (Se.__boundDepthTexture !== Le) {
38858
+ if (Le !== null && y.has(Le) && (A.width !== Le.image.width || A.height !== Le.image.height))
38859
38859
  throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");
38860
- L.setupDepthRenderbuffer(A);
38860
+ D.setupDepthRenderbuffer(A);
38861
38861
  }
38862
38862
  }
38863
38863
  const Ce = A.texture;
38864
38864
  (Ce.isData3DTexture || Ce.isDataArrayTexture || Ce.isCompressedArrayTexture) && (me = !0);
38865
38865
  const _e = y.get(A).__webglFramebuffer;
38866
- A.isWebGLCubeRenderTarget ? (Array.isArray(_e[D]) ? B = _e[D][z] : B = _e[D], q = !0) : A.samples > 0 && L.useMultisampledRTT(A) === !1 ? B = y.get(A).__webglMultisampledFramebuffer : Array.isArray(_e) ? B = _e[z] : B = _e, G.copy(A.viewport), W.copy(A.scissor), ee = A.scissorTest;
38866
+ A.isWebGLCubeRenderTarget ? (Array.isArray(_e[L]) ? B = _e[L][z] : B = _e[L], q = !0) : A.samples > 0 && D.useMultisampledRTT(A) === !1 ? B = y.get(A).__webglMultisampledFramebuffer : Array.isArray(_e) ? B = _e[z] : B = _e, G.copy(A.viewport), W.copy(A.scissor), ee = A.scissorTest;
38867
38867
  } else
38868
38868
  G.copy(Y).multiplyScalar(Fe).floor(), W.copy(ie).multiplyScalar(Fe).floor(), ee = Ee;
38869
38869
  if (z !== 0 && (B = Ig), ke.bindFramebuffer(P.FRAMEBUFFER, B) && ke.drawBuffers(A, B), ke.viewport(G), ke.scissor(W), ke.setScissorTest(ee), q) {
38870
38870
  const Se = y.get(A.texture);
38871
- P.framebufferTexture2D(P.FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_CUBE_MAP_POSITIVE_X + D, Se.__webglTexture, z);
38871
+ P.framebufferTexture2D(P.FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_CUBE_MAP_POSITIVE_X + L, Se.__webglTexture, z);
38872
38872
  } else if (me) {
38873
- const Se = D;
38873
+ const Se = L;
38874
38874
  for (let Ce = 0; Ce < A.textures.length; Ce++) {
38875
38875
  const _e = y.get(A.textures[Ce]);
38876
38876
  P.framebufferTextureLayer(P.FRAMEBUFFER, P.COLOR_ATTACHMENT0 + Ce, _e.__webglTexture, z, Se);
@@ -38880,7 +38880,7 @@ class Cg {
38880
38880
  P.framebufferTexture2D(P.FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, Se.__webglTexture, z);
38881
38881
  }
38882
38882
  J = -1;
38883
- }, this.readRenderTargetPixels = function(A, D, z, B, q, me, xe, Se = 0) {
38883
+ }, this.readRenderTargetPixels = function(A, L, z, B, q, me, xe, Se = 0) {
38884
38884
  if (!(A && A.isWebGLRenderTarget)) {
38885
38885
  at("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
38886
38886
  return;
@@ -38889,8 +38889,8 @@ class Cg {
38889
38889
  if (A.isWebGLCubeRenderTarget && xe !== void 0 && (Ce = Ce[xe]), Ce) {
38890
38890
  ke.bindFramebuffer(P.FRAMEBUFFER, Ce);
38891
38891
  try {
38892
- const _e = A.textures[Se], De = _e.format, Pe = _e.type;
38893
- if (!Mt.textureFormatReadable(De)) {
38892
+ const _e = A.textures[Se], Le = _e.format, Pe = _e.type;
38893
+ if (!Mt.textureFormatReadable(Le)) {
38894
38894
  at("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
38895
38895
  return;
38896
38896
  }
@@ -38898,73 +38898,73 @@ class Cg {
38898
38898
  at("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
38899
38899
  return;
38900
38900
  }
38901
- D >= 0 && D <= A.width - B && z >= 0 && z <= A.height - q && (A.textures.length > 1 && P.readBuffer(P.COLOR_ATTACHMENT0 + Se), P.readPixels(D, z, B, q, oe.convert(De), oe.convert(Pe), me));
38901
+ L >= 0 && L <= A.width - B && z >= 0 && z <= A.height - q && (A.textures.length > 1 && P.readBuffer(P.COLOR_ATTACHMENT0 + Se), P.readPixels(L, z, B, q, oe.convert(Le), oe.convert(Pe), me));
38902
38902
  } finally {
38903
38903
  const _e = O !== null ? y.get(O).__webglFramebuffer : null;
38904
38904
  ke.bindFramebuffer(P.FRAMEBUFFER, _e);
38905
38905
  }
38906
38906
  }
38907
- }, this.readRenderTargetPixelsAsync = async function(A, D, z, B, q, me, xe, Se = 0) {
38907
+ }, this.readRenderTargetPixelsAsync = async function(A, L, z, B, q, me, xe, Se = 0) {
38908
38908
  if (!(A && A.isWebGLRenderTarget))
38909
38909
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
38910
38910
  let Ce = y.get(A).__webglFramebuffer;
38911
38911
  if (A.isWebGLCubeRenderTarget && xe !== void 0 && (Ce = Ce[xe]), Ce)
38912
- if (D >= 0 && D <= A.width - B && z >= 0 && z <= A.height - q) {
38912
+ if (L >= 0 && L <= A.width - B && z >= 0 && z <= A.height - q) {
38913
38913
  ke.bindFramebuffer(P.FRAMEBUFFER, Ce);
38914
- const _e = A.textures[Se], De = _e.format, Pe = _e.type;
38915
- if (!Mt.textureFormatReadable(De))
38914
+ const _e = A.textures[Se], Le = _e.format, Pe = _e.type;
38915
+ if (!Mt.textureFormatReadable(Le))
38916
38916
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
38917
38917
  if (!Mt.textureTypeReadable(Pe))
38918
38918
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
38919
38919
  const Qe = P.createBuffer();
38920
- P.bindBuffer(P.PIXEL_PACK_BUFFER, Qe), P.bufferData(P.PIXEL_PACK_BUFFER, me.byteLength, P.STREAM_READ), A.textures.length > 1 && P.readBuffer(P.COLOR_ATTACHMENT0 + Se), P.readPixels(D, z, B, q, oe.convert(De), oe.convert(Pe), 0);
38920
+ P.bindBuffer(P.PIXEL_PACK_BUFFER, Qe), P.bufferData(P.PIXEL_PACK_BUFFER, me.byteLength, P.STREAM_READ), A.textures.length > 1 && P.readBuffer(P.COLOR_ATTACHMENT0 + Se), P.readPixels(L, z, B, q, oe.convert(Le), oe.convert(Pe), 0);
38921
38921
  const gt = O !== null ? y.get(O).__webglFramebuffer : null;
38922
38922
  ke.bindFramebuffer(P.FRAMEBUFFER, gt);
38923
- const Lt = P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE, 0);
38924
- return P.flush(), await dT(P, Lt, 4), P.bindBuffer(P.PIXEL_PACK_BUFFER, Qe), P.getBufferSubData(P.PIXEL_PACK_BUFFER, 0, me), P.deleteBuffer(Qe), P.deleteSync(Lt), me;
38923
+ const Dt = P.fenceSync(P.SYNC_GPU_COMMANDS_COMPLETE, 0);
38924
+ return P.flush(), await dT(P, Dt, 4), P.bindBuffer(P.PIXEL_PACK_BUFFER, Qe), P.getBufferSubData(P.PIXEL_PACK_BUFFER, 0, me), P.deleteBuffer(Qe), P.deleteSync(Dt), me;
38925
38925
  } else
38926
38926
  throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
38927
- }, this.copyFramebufferToTexture = function(A, D = null, z = 0) {
38928
- const B = Math.pow(2, -z), q = Math.floor(A.image.width * B), me = Math.floor(A.image.height * B), xe = D !== null ? D.x : 0, Se = D !== null ? D.y : 0;
38929
- L.setTexture2D(A, 0), P.copyTexSubImage2D(P.TEXTURE_2D, z, 0, 0, xe, Se, q, me), ke.unbindTexture();
38927
+ }, this.copyFramebufferToTexture = function(A, L = null, z = 0) {
38928
+ const B = Math.pow(2, -z), q = Math.floor(A.image.width * B), me = Math.floor(A.image.height * B), xe = L !== null ? L.x : 0, Se = L !== null ? L.y : 0;
38929
+ D.setTexture2D(A, 0), P.copyTexSubImage2D(P.TEXTURE_2D, z, 0, 0, xe, Se, q, me), ke.unbindTexture();
38930
38930
  };
38931
38931
  const _g = P.createFramebuffer(), Pg = P.createFramebuffer();
38932
- this.copyTextureToTexture = function(A, D, z = null, B = null, q = 0, me = null) {
38932
+ this.copyTextureToTexture = function(A, L, z = null, B = null, q = 0, me = null) {
38933
38933
  me === null && (q !== 0 ? (ca("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), me = q, q = 0) : me = 0);
38934
- let xe, Se, Ce, _e, De, Pe, Qe, gt, Lt;
38935
- const Dt = A.isCompressedTexture ? A.mipmaps[me] : A.image;
38934
+ let xe, Se, Ce, _e, Le, Pe, Qe, gt, Dt;
38935
+ const Lt = A.isCompressedTexture ? A.mipmaps[me] : A.image;
38936
38936
  if (z !== null)
38937
- xe = z.max.x - z.min.x, Se = z.max.y - z.min.y, Ce = z.isBox3 ? z.max.z - z.min.z : 1, _e = z.min.x, De = z.min.y, Pe = z.isBox3 ? z.min.z : 0;
38937
+ xe = z.max.x - z.min.x, Se = z.max.y - z.min.y, Ce = z.isBox3 ? z.max.z - z.min.z : 1, _e = z.min.x, Le = z.min.y, Pe = z.isBox3 ? z.min.z : 0;
38938
38938
  else {
38939
- const Di = Math.pow(2, -q);
38940
- xe = Math.floor(Dt.width * Di), Se = Math.floor(Dt.height * Di), A.isDataArrayTexture ? Ce = Dt.depth : A.isData3DTexture ? Ce = Math.floor(Dt.depth * Di) : Ce = 1, _e = 0, De = 0, Pe = 0;
38939
+ const Li = Math.pow(2, -q);
38940
+ xe = Math.floor(Lt.width * Li), Se = Math.floor(Lt.height * Li), A.isDataArrayTexture ? Ce = Lt.depth : A.isData3DTexture ? Ce = Math.floor(Lt.depth * Li) : Ce = 1, _e = 0, Le = 0, Pe = 0;
38941
38941
  }
38942
- B !== null ? (Qe = B.x, gt = B.y, Lt = B.z) : (Qe = 0, gt = 0, Lt = 0);
38943
- const Tt = oe.convert(D.format), Ue = oe.convert(D.type);
38942
+ B !== null ? (Qe = B.x, gt = B.y, Dt = B.z) : (Qe = 0, gt = 0, Dt = 0);
38943
+ const Tt = oe.convert(L.format), Ue = oe.convert(L.type);
38944
38944
  let ht;
38945
- D.isData3DTexture ? (L.setTexture3D(D, 0), ht = P.TEXTURE_3D) : D.isDataArrayTexture || D.isCompressedArrayTexture ? (L.setTexture2DArray(D, 0), ht = P.TEXTURE_2D_ARRAY) : (L.setTexture2D(D, 0), ht = P.TEXTURE_2D), P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL, D.flipY), P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL, D.premultiplyAlpha), P.pixelStorei(P.UNPACK_ALIGNMENT, D.unpackAlignment);
38945
+ L.isData3DTexture ? (D.setTexture3D(L, 0), ht = P.TEXTURE_3D) : L.isDataArrayTexture || L.isCompressedArrayTexture ? (D.setTexture2DArray(L, 0), ht = P.TEXTURE_2D_ARRAY) : (D.setTexture2D(L, 0), ht = P.TEXTURE_2D), P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL, L.flipY), P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL, L.premultiplyAlpha), P.pixelStorei(P.UNPACK_ALIGNMENT, L.unpackAlignment);
38946
38946
  const rt = P.getParameter(P.UNPACK_ROW_LENGTH), wi = P.getParameter(P.UNPACK_IMAGE_HEIGHT), Us = P.getParameter(P.UNPACK_SKIP_PIXELS), Ii = P.getParameter(P.UNPACK_SKIP_ROWS), Cr = P.getParameter(P.UNPACK_SKIP_IMAGES);
38947
- P.pixelStorei(P.UNPACK_ROW_LENGTH, Dt.width), P.pixelStorei(P.UNPACK_IMAGE_HEIGHT, Dt.height), P.pixelStorei(P.UNPACK_SKIP_PIXELS, _e), P.pixelStorei(P.UNPACK_SKIP_ROWS, De), P.pixelStorei(P.UNPACK_SKIP_IMAGES, Pe);
38948
- const Rt = A.isDataArrayTexture || A.isData3DTexture, Si = D.isDataArrayTexture || D.isData3DTexture;
38947
+ P.pixelStorei(P.UNPACK_ROW_LENGTH, Lt.width), P.pixelStorei(P.UNPACK_IMAGE_HEIGHT, Lt.height), P.pixelStorei(P.UNPACK_SKIP_PIXELS, _e), P.pixelStorei(P.UNPACK_SKIP_ROWS, Le), P.pixelStorei(P.UNPACK_SKIP_IMAGES, Pe);
38948
+ const Rt = A.isDataArrayTexture || A.isData3DTexture, Si = L.isDataArrayTexture || L.isData3DTexture;
38949
38949
  if (A.isDepthTexture) {
38950
- const Di = y.get(A), di = y.get(D), yi = y.get(Di.__renderTarget), ec = y.get(di.__renderTarget);
38950
+ const Li = y.get(A), di = y.get(L), yi = y.get(Li.__renderTarget), ec = y.get(di.__renderTarget);
38951
38951
  ke.bindFramebuffer(P.READ_FRAMEBUFFER, yi.__webglFramebuffer), ke.bindFramebuffer(P.DRAW_FRAMEBUFFER, ec.__webglFramebuffer);
38952
38952
  for (let ls = 0; ls < Ce; ls++)
38953
- Rt && (P.framebufferTextureLayer(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, y.get(A).__webglTexture, q, Pe + ls), P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, y.get(D).__webglTexture, me, Lt + ls)), P.blitFramebuffer(_e, De, xe, Se, Qe, gt, xe, Se, P.DEPTH_BUFFER_BIT, P.NEAREST);
38953
+ Rt && (P.framebufferTextureLayer(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, y.get(A).__webglTexture, q, Pe + ls), P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, y.get(L).__webglTexture, me, Dt + ls)), P.blitFramebuffer(_e, Le, xe, Se, Qe, gt, xe, Se, P.DEPTH_BUFFER_BIT, P.NEAREST);
38954
38954
  ke.bindFramebuffer(P.READ_FRAMEBUFFER, null), ke.bindFramebuffer(P.DRAW_FRAMEBUFFER, null);
38955
38955
  } else if (q !== 0 || A.isRenderTargetTexture || y.has(A)) {
38956
- const Di = y.get(A), di = y.get(D);
38956
+ const Li = y.get(A), di = y.get(L);
38957
38957
  ke.bindFramebuffer(P.READ_FRAMEBUFFER, _g), ke.bindFramebuffer(P.DRAW_FRAMEBUFFER, Pg);
38958
38958
  for (let yi = 0; yi < Ce; yi++)
38959
- Rt ? P.framebufferTextureLayer(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, Di.__webglTexture, q, Pe + yi) : P.framebufferTexture2D(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, Di.__webglTexture, q), Si ? P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, di.__webglTexture, me, Lt + yi) : P.framebufferTexture2D(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, di.__webglTexture, me), q !== 0 ? P.blitFramebuffer(_e, De, xe, Se, Qe, gt, xe, Se, P.COLOR_BUFFER_BIT, P.NEAREST) : Si ? P.copyTexSubImage3D(ht, me, Qe, gt, Lt + yi, _e, De, xe, Se) : P.copyTexSubImage2D(ht, me, Qe, gt, _e, De, xe, Se);
38959
+ Rt ? P.framebufferTextureLayer(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, Li.__webglTexture, q, Pe + yi) : P.framebufferTexture2D(P.READ_FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, Li.__webglTexture, q), Si ? P.framebufferTextureLayer(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, di.__webglTexture, me, Dt + yi) : P.framebufferTexture2D(P.DRAW_FRAMEBUFFER, P.COLOR_ATTACHMENT0, P.TEXTURE_2D, di.__webglTexture, me), q !== 0 ? P.blitFramebuffer(_e, Le, xe, Se, Qe, gt, xe, Se, P.COLOR_BUFFER_BIT, P.NEAREST) : Si ? P.copyTexSubImage3D(ht, me, Qe, gt, Dt + yi, _e, Le, xe, Se) : P.copyTexSubImage2D(ht, me, Qe, gt, _e, Le, xe, Se);
38960
38960
  ke.bindFramebuffer(P.READ_FRAMEBUFFER, null), ke.bindFramebuffer(P.DRAW_FRAMEBUFFER, null);
38961
38961
  } else
38962
- Si ? A.isDataTexture || A.isData3DTexture ? P.texSubImage3D(ht, me, Qe, gt, Lt, xe, Se, Ce, Tt, Ue, Dt.data) : D.isCompressedArrayTexture ? P.compressedTexSubImage3D(ht, me, Qe, gt, Lt, xe, Se, Ce, Tt, Dt.data) : P.texSubImage3D(ht, me, Qe, gt, Lt, xe, Se, Ce, Tt, Ue, Dt) : A.isDataTexture ? P.texSubImage2D(P.TEXTURE_2D, me, Qe, gt, xe, Se, Tt, Ue, Dt.data) : A.isCompressedTexture ? P.compressedTexSubImage2D(P.TEXTURE_2D, me, Qe, gt, Dt.width, Dt.height, Tt, Dt.data) : P.texSubImage2D(P.TEXTURE_2D, me, Qe, gt, xe, Se, Tt, Ue, Dt);
38963
- P.pixelStorei(P.UNPACK_ROW_LENGTH, rt), P.pixelStorei(P.UNPACK_IMAGE_HEIGHT, wi), P.pixelStorei(P.UNPACK_SKIP_PIXELS, Us), P.pixelStorei(P.UNPACK_SKIP_ROWS, Ii), P.pixelStorei(P.UNPACK_SKIP_IMAGES, Cr), me === 0 && D.generateMipmaps && P.generateMipmap(ht), ke.unbindTexture();
38962
+ Si ? A.isDataTexture || A.isData3DTexture ? P.texSubImage3D(ht, me, Qe, gt, Dt, xe, Se, Ce, Tt, Ue, Lt.data) : L.isCompressedArrayTexture ? P.compressedTexSubImage3D(ht, me, Qe, gt, Dt, xe, Se, Ce, Tt, Lt.data) : P.texSubImage3D(ht, me, Qe, gt, Dt, xe, Se, Ce, Tt, Ue, Lt) : A.isDataTexture ? P.texSubImage2D(P.TEXTURE_2D, me, Qe, gt, xe, Se, Tt, Ue, Lt.data) : A.isCompressedTexture ? P.compressedTexSubImage2D(P.TEXTURE_2D, me, Qe, gt, Lt.width, Lt.height, Tt, Lt.data) : P.texSubImage2D(P.TEXTURE_2D, me, Qe, gt, xe, Se, Tt, Ue, Lt);
38963
+ P.pixelStorei(P.UNPACK_ROW_LENGTH, rt), P.pixelStorei(P.UNPACK_IMAGE_HEIGHT, wi), P.pixelStorei(P.UNPACK_SKIP_PIXELS, Us), P.pixelStorei(P.UNPACK_SKIP_ROWS, Ii), P.pixelStorei(P.UNPACK_SKIP_IMAGES, Cr), me === 0 && L.generateMipmaps && P.generateMipmap(ht), ke.unbindTexture();
38964
38964
  }, this.initRenderTarget = function(A) {
38965
- y.get(A).__webglFramebuffer === void 0 && L.setupRenderTarget(A);
38965
+ y.get(A).__webglFramebuffer === void 0 && D.setupRenderTarget(A);
38966
38966
  }, this.initTexture = function(A) {
38967
- A.isCubeTexture ? L.setTextureCube(A, 0) : A.isData3DTexture ? L.setTexture3D(A, 0) : A.isDataArrayTexture || A.isCompressedArrayTexture ? L.setTexture2DArray(A, 0) : L.setTexture2D(A, 0), ke.unbindTexture();
38967
+ A.isCubeTexture ? D.setTextureCube(A, 0) : A.isData3DTexture ? D.setTexture3D(A, 0) : A.isDataArrayTexture || A.isCompressedArrayTexture ? D.setTexture2DArray(A, 0) : D.setTexture2D(A, 0), ke.unbindTexture();
38968
38968
  }, this.resetState = function() {
38969
38969
  w = 0, V = 0, O = null, ke.reset(), Te.reset();
38970
38970
  }, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
@@ -39488,7 +39488,7 @@ class Su {
39488
39488
  uColorContrast: { value: this.config.colorContrast }
39489
39489
  },
39490
39490
  transparent: !0,
39491
- side: Ln
39491
+ side: Dn
39492
39492
  }), this.orb = new Ri(t, this.orbMaterial), this.scene.add(this.orb);
39493
39493
  const i = new dr(
39494
39494
  this.config.size,
@@ -40194,7 +40194,7 @@ var sR = Object.defineProperty, rR = Object.getOwnPropertyDescriptor, kt = (n, e
40194
40194
  };
40195
40195
  let St = class extends es {
40196
40196
  constructor() {
40197
- super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Do(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
40197
+ super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Lo(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
40198
40198
  const t = n.detail;
40199
40199
  if (!(!t || !this.audioAnalyzer))
40200
40200
  try {
@@ -40734,7 +40734,7 @@ kt([
40734
40734
  re({ type: Number, attribute: "sound-volume" })
40735
40735
  ], St.prototype, "soundVolume", 2);
40736
40736
  St = kt([
40737
- Lo("hanc-ai-inline-call")
40737
+ Do("hanc-ai-inline-call")
40738
40738
  ], St);
40739
40739
  var aR = Object.defineProperty, oR = Object.getOwnPropertyDescriptor, Ct = (n, e, t, i) => {
40740
40740
  for (var s = i > 1 ? void 0 : i ? oR(e, t) : e, r = n.length - 1, o; r >= 0; r--)
@@ -40751,7 +40751,7 @@ const cR = {
40751
40751
  };
40752
40752
  let pt = class extends es {
40753
40753
  constructor() {
40754
- super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Do(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.agentState = "", this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
40754
+ super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Lo(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.agentState = "", this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
40755
40755
  const t = n.detail;
40756
40756
  if (!(!t || !this.audioAnalyzer))
40757
40757
  try {
@@ -41306,7 +41306,7 @@ Ct([
41306
41306
  re({ type: Number, attribute: "sound-volume" })
41307
41307
  ], pt.prototype, "soundVolume", 2);
41308
41308
  pt = Ct([
41309
- Lo("hanc-ai-floating-call")
41309
+ Do("hanc-ai-floating-call")
41310
41310
  ], pt);
41311
41311
  var lR = Object.defineProperty, dR = Object.getOwnPropertyDescriptor, wt = (n, e, t, i) => {
41312
41312
  for (var s = i > 1 ? void 0 : i ? dR(e, t) : e, r = n.length - 1, o; r >= 0; r--)
@@ -41315,7 +41315,7 @@ var lR = Object.defineProperty, dR = Object.getOwnPropertyDescriptor, wt = (n, e
41315
41315
  };
41316
41316
  let yt = class extends es {
41317
41317
  constructor() {
41318
- super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Do(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
41318
+ super(...arguments), this.callManager = new Ko(), this.healthMonitor = new Tu(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Lo(), this.animationId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 0.8, this.noiseSpeed = 0.15, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 1, this.audioSmoothing = 0.03, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.15, this.handleAudioTrack = async (n) => {
41319
41319
  const t = n.detail;
41320
41320
  if (!(!t || !this.audioAnalyzer))
41321
41321
  try {
@@ -41743,7 +41743,7 @@ wt([
41743
41743
  re({ type: Number, attribute: "sound-volume" })
41744
41744
  ], yt.prototype, "soundVolume", 2);
41745
41745
  yt = wt([
41746
- Lo("hanc-ai-pill-call")
41746
+ Do("hanc-ai-pill-call")
41747
41747
  ], yt);
41748
41748
  const uR = {
41749
41749
  core: "#ffffff",
@@ -42471,7 +42471,7 @@ var gR = Object.defineProperty, vR = Object.getOwnPropertyDescriptor, lt = (n, e
42471
42471
  };
42472
42472
  let $e = class extends es {
42473
42473
  constructor() {
42474
- super(...arguments), this.orbRenderer = null, this.orbContainerRef = Do(), this.audioSimPhase = 0, this.animationId = null, this.callManager = null, this.soundManager = null, this.size = 300, this.headerLogo = "HANC.ai", this.headerTitle = "Lina-Voice AI", this.showBranding = !0, this.version = "v1.2.6", this.agentId = "", this.voiceServiceUrl = "", this.btnStartText = "Start", this.btnEndText = "End", this.colors = {}, this.soundsEnabled = !0, this.soundsVolume = 0.4, this.brandingLogoColor = "rgba(255, 255, 255, 0.9)", this.brandingTitleColor = "rgba(255, 255, 255, 0.6)", this.brandingDividerColor = "rgba(255, 255, 255, 0.3)", this.versionColor = "rgba(255, 255, 255, 0.3)", this.buttonBackground = "linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%)", this.buttonTextColor = "rgba(255, 255, 255, 0.95)", this.requireConsent = !0, this.termsUrl = "/terms", this.privacyUrl = "/privacy", this.consentTitle = "Before we start", this.consentText = "By starting this call, you agree to our Terms of Service and Privacy Policy.", this.consentAcceptText = "I Agree", this.consentDeclineText = "Decline", this.currentState = "idle", this.callStatus = "idle", this.showConsentDialog = !1, this.isLoading = !0, this._hasMicPermission = null, this._localAudioContext = null, this._localAudioAnalyser = null, this._localAudioMonitorId = null, this._agentAudioContext = null, this._agentAudioAnalyser = null, this._agentAudioMonitorId = null, this._agentIsSpeaking = !1, this._interruptionTimeout = null, this._lastInterruptionTime = 0, this.handleConsentAccept = () => {
42474
+ super(...arguments), this.orbRenderer = null, this.orbContainerRef = Lo(), this.audioSimPhase = 0, this.animationId = null, this.callManager = null, this.soundManager = null, this.size = 300, this.headerLogo = "HANC.ai", this.headerTitle = "Lina-Voice AI", this.showBranding = !0, this.version = "v1.2.7", this.agentId = "", this.voiceServiceUrl = "", this.btnStartText = "Start", this.btnEndText = "End", this.colors = {}, this.soundsEnabled = !0, this.soundsVolume = 0.4, this.brandingLogoColor = "rgba(255, 255, 255, 0.9)", this.brandingTitleColor = "rgba(255, 255, 255, 0.6)", this.brandingDividerColor = "rgba(255, 255, 255, 0.3)", this.versionColor = "rgba(255, 255, 255, 0.3)", this.buttonBackground = "linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%)", this.buttonTextColor = "rgba(255, 255, 255, 0.95)", this.requireConsent = !0, this.termsUrl = "/terms", this.privacyUrl = "/privacy", this.consentTitle = "Before we start", this.consentText = "By starting this call, you agree to our Terms of Service and Privacy Policy.", this.consentAcceptText = "I Agree", this.consentDeclineText = "Decline", this.currentState = "idle", this.callStatus = "idle", this.showConsentDialog = !1, this.isLoading = !0, this._hasMicPermission = null, this._localAudioContext = null, this._localAudioAnalyser = null, this._localAudioMonitorId = null, this._agentAudioContext = null, this._agentAudioAnalyser = null, this._agentAudioMonitorId = null, this._lastStateChangeTime = 0, this._stateChangeDebounceMs = 300, this._agentIsSpeaking = !1, this._interruptionTimeout = null, this._lastInterruptionTime = 0, this.handleConsentAccept = () => {
42475
42475
  this.saveConsent(), this.showConsentDialog = !1, this.startCall();
42476
42476
  }, this.handleConsentDecline = () => {
42477
42477
  this.showConsentDialog = !1;
@@ -42563,9 +42563,9 @@ let $e = class extends es {
42563
42563
  this._localAudioContext = new AudioContext(), this._localAudioAnalyser = this._localAudioContext.createAnalyser(), this._localAudioAnalyser.fftSize = 256;
42564
42564
  const e = new MediaStream([n]);
42565
42565
  this._localAudioContext.createMediaStreamSource(e).connect(this._localAudioAnalyser);
42566
- const i = new Uint8Array(this._localAudioAnalyser.frequencyBinCount), s = 25;
42566
+ const i = new Uint8Array(this._localAudioAnalyser.frequencyBinCount), s = 30;
42567
42567
  let r = 0;
42568
- const o = 5, a = () => {
42568
+ const o = 10, a = () => {
42569
42569
  var d;
42570
42570
  if (!this._localAudioAnalyser || this.callStatus !== "active") {
42571
42571
  this.stopLocalAudioMonitoring();
@@ -42575,7 +42575,17 @@ let $e = class extends es {
42575
42575
  let c = 0;
42576
42576
  for (let u = 0; u < i.length; u++)
42577
42577
  c += i[u];
42578
- c / i.length > s ? (r++, r >= o && (this._agentIsSpeaking ? this.handleUserInterruption() : this.currentState !== "listening" && (this.currentState = "listening", (d = this.orbRenderer) == null || d.setState("listening")))) : r = 0, this._localAudioMonitorId = requestAnimationFrame(a);
42578
+ if (c / i.length > s) {
42579
+ if (r++, r >= o)
42580
+ if (this._agentIsSpeaking)
42581
+ this.handleUserInterruption();
42582
+ else {
42583
+ const u = Date.now();
42584
+ this.currentState !== "listening" && u - this._lastStateChangeTime >= this._stateChangeDebounceMs && (this.currentState = "listening", (d = this.orbRenderer) == null || d.setState("listening"), this._lastStateChangeTime = u);
42585
+ }
42586
+ } else
42587
+ r = 0;
42588
+ this._localAudioMonitorId = requestAnimationFrame(a);
42579
42589
  };
42580
42590
  this._localAudioMonitorId = requestAnimationFrame(a);
42581
42591
  } catch (e) {
@@ -42585,6 +42595,7 @@ let $e = class extends es {
42585
42595
  stopLocalAudioMonitoring() {
42586
42596
  this._localAudioMonitorId && (cancelAnimationFrame(this._localAudioMonitorId), this._localAudioMonitorId = null), this._localAudioContext && (this._localAudioContext.close(), this._localAudioContext = null), this._localAudioAnalyser = null;
42587
42597
  }
42598
+ // Minimum time between state changes
42588
42599
  /**
42589
42600
  * Monitor agent audio to detect when agent is actually speaking
42590
42601
  */
@@ -42594,21 +42605,22 @@ let $e = class extends es {
42594
42605
  this._agentAudioContext = new AudioContext(), this._agentAudioAnalyser = this._agentAudioContext.createAnalyser(), this._agentAudioAnalyser.fftSize = 256;
42595
42606
  const e = new MediaStream([n]);
42596
42607
  this._agentAudioContext.createMediaStreamSource(e).connect(this._agentAudioAnalyser);
42597
- const i = new Uint8Array(this._agentAudioAnalyser.frequencyBinCount), s = 15;
42598
- let r = 0;
42599
- const o = 15, a = () => {
42600
- var d, u;
42608
+ const i = new Uint8Array(this._agentAudioAnalyser.frequencyBinCount), s = 20;
42609
+ let r = 0, o = 0;
42610
+ const a = 30, c = 10, l = () => {
42611
+ var f, g;
42601
42612
  if (!this._agentAudioAnalyser || this.callStatus !== "active") {
42602
42613
  this.stopAgentAudioMonitoring();
42603
42614
  return;
42604
42615
  }
42605
42616
  this._agentAudioAnalyser.getByteFrequencyData(i);
42606
- let c = 0;
42607
- for (let h = 0; h < i.length; h++)
42608
- c += i[h];
42609
- c / i.length > s ? (r = 0, this._agentIsSpeaking || (this._agentIsSpeaking = !0, this.currentState !== "speaking" && (this.currentState = "speaking", (d = this.orbRenderer) == null || d.setState("speaking")))) : (r++, r >= o && this._agentIsSpeaking && (this._agentIsSpeaking = !1, this.currentState === "speaking" && (this.currentState = "listening", (u = this.orbRenderer) == null || u.setState("listening")))), this._agentAudioMonitorId = requestAnimationFrame(a);
42617
+ let d = 0;
42618
+ for (let v = 0; v < i.length; v++)
42619
+ d += i[v];
42620
+ const u = d / i.length, h = Date.now();
42621
+ u > s ? (r = 0, o++, o >= c && !this._agentIsSpeaking && h - this._lastStateChangeTime >= this._stateChangeDebounceMs && (this._agentIsSpeaking = !0, this.currentState !== "speaking" && (this.currentState = "speaking", (f = this.orbRenderer) == null || f.setState("speaking"), this._lastStateChangeTime = h))) : (r++, o = 0, r >= a && this._agentIsSpeaking && h - this._lastStateChangeTime >= this._stateChangeDebounceMs && (this._agentIsSpeaking = !1, this.currentState === "speaking" && (this.currentState = "listening", (g = this.orbRenderer) == null || g.setState("listening"), this._lastStateChangeTime = h))), this._agentAudioMonitorId = requestAnimationFrame(l);
42610
42622
  };
42611
- this._agentAudioMonitorId = requestAnimationFrame(a);
42623
+ this._agentAudioMonitorId = requestAnimationFrame(l);
42612
42624
  } catch (e) {
42613
42625
  console.warn("Failed to start agent audio monitoring:", e);
42614
42626
  }
@@ -43345,7 +43357,7 @@ lt([
43345
43357
  ki()
43346
43358
  ], $e.prototype, "isLoading", 2);
43347
43359
  $e = lt([
43348
- Lo("lina-voice-widget")
43360
+ Do("lina-voice-widget")
43349
43361
  ], $e);
43350
43362
  export {
43351
43363
  pt as FloatingCall,