r3f-performance 0.1.3 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,55 +1,348 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode('._perfS_ans5i_1{position:fixed;z-index:9999;font-family:Roboto Mono,-apple-system,BlinkMacSystemFont,monospace;background-color:#000c;color:#fff;padding:6px 0 6px 6px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;display:flex;flex-direction:column}._containerHeight_ans5i_16{min-height:110px}._topLeft_ans5i_21{top:0;left:0}._topRight_ans5i_22{top:0;right:0}._bottomLeft_ans5i_23{bottom:0;left:0}._bottomRight_ans5i_24{bottom:0;right:0}._minimal_ans5i_26{background-color:#242424d9}._perfIContainer_ans5i_30{display:flex;flex-wrap:wrap;gap:5px 10px}._perfIContainer_ans5i_30{display:flex;flex-wrap:wrap;gap:6px 12px;width:100%;padding-right:6px;box-sizing:border-box}._perfI_ans5i_30{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;width:55px;height:auto;position:relative;margin-right:4px}._perfI_ans5i_30 small{font-size:12px;color:#e0e0e0;font-weight:500;padding-left:0;margin-bottom:2px;white-space:nowrap}._perfB_ans5i_69{position:relative;bottom:auto;right:auto;text-align:left;font-size:8px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;color:#65c5bc;width:100%;opacity:.9}._toggleContainer_ans5i_83{display:flex;justify-content:flex-end;padding-right:4px}._toggle_ans5i_83{cursor:pointer;font-size:10px;background-color:#ffffff1a;color:#fff;padding:4px 8px;border-radius:2px;margin-left:4px;transition:all .2s}._toggle_ans5i_83:hover{background-color:#fff3;color:#fff}._activeTab_ans5i_105{background-color:#65c5bc4d;color:#fff}._containerScroll_ans5i_110{max-height:50vh;overflow-y:auto}._programGeo_ans5i_115{margin-bottom:2px;pointer-events:auto}._programHeader_ans5i_120{display:flex;align-items:center;justify-content:space-between;background-color:#ffffff0f;padding:6px 8px;border-radius:4px;cursor:pointer;transition:background-color .2s;min-height:24px;border:1px solid transparent}._programHeader_ans5i_120:hover{background-color:#ffffff1a;border-color:#ffffff1a}._programHeader_ans5i_120 *{cursor:pointer!important}._programHeader_ans5i_120 small{font-size:9px}._programHeader_ans5i_120>b{margin-right:4px;cursor:pointer}._headerLeft_ans5i_149{display:flex;align-items:center;flex:1;overflow:hidden}._programTitle_ans5i_156{font-weight:700;font-size:12px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:10px}._toggleArrow_ans5i_166{font-size:10px;margin-right:8px;color:#888;width:12px;text-align:center;transition:transform .2s}._toggleVisible_ans5i_175{pointer-events:auto;justify-content:center;cursor:pointer;font-size:12px;background-color:#292b2d;width:auto;margin:0;color:#919191;text-align:center;display:inline-block;vertical-align:middle;padding:4px 6px}._toggleVisible_ans5i_175:hover{background-color:#1f1f1f}._toggleVisible_ans5i_175 svg{width:12px;height:12px;float:left}._programConsole_ans5i_200{font-weight:700;letter-spacing:.02em;background-color:#292b2d;color:#d3d3d3;overflow:hidden;text-overflow:ellipsis;cursor:pointer;display:block;font-size:11px;padding:5px;margin:4px auto;border:none;width:100%;text-align:center}._programsContainer_ans5i_218{margin-top:0}._headerRight_ans5i_222{display:flex;align-items:center;gap:6px}._metricBadge_ans5i_228{display:flex;align-items:center;background-color:#0000004d;padding:2px 6px;border-radius:3px;font-size:10px;color:#aaa;white-space:nowrap}._metricBadge_ans5i_228 b{color:#4fd1c5;margin-right:4px;font-weight:600;font-size:11px}._programsULHeader_ans5i_246{display:flex;position:relative;font-weight:700;color:#fff;line-height:14px;margin:4px 0}._programsULHeader_ans5i_246 svg{margin-right:4px;display:inline-block}._programsUL_ans5i_246{display:block;position:relative;padding-left:10px;margin:6px;list-style:none}._programsUL_ans5i_246 img{max-height:60px;max-width:100%;margin:6px auto;display:block}._programsUL_ans5i_246:after{content:"";position:absolute;left:0;top:0;width:1px;height:100%;background-color:gray;transform:translate(-50%);max-height:50vh;overflow-y:auto}._programsUL_ans5i_246 li{border-bottom:1px solid #313131;display:block;padding:4px;margin:0;line-height:1}._programsUL_ans5i_246 b{font-weight:700}._programsUL_ans5i_246 small{text-align:revert;letter-spacing:1px;font-size:10px;font-weight:500;margin-left:2px;color:#65c5bc}._programsGeoLi_ans5i_309{display:flex!important;height:auto!important}._programsGeoLi_ans5i_309 span{display:block;position:relative}._programsGeoLi_ans5i_309 b{padding-left:12px}._graph_ans5i_324{width:100%;height:66px;overflow:hidden;position:absolute;pointer-events:none;display:flex;top:0;left:0;justify-content:center;z-index:0}._graphpc_ans5i_336{text-align:center;font-weight:700;font-size:12px;line-height:12px;display:flex;justify-content:center;align-items:center;vertical-align:middle;color:#f1f1f1;padding:7px;width:100%;background-color:#242425cc;z-index:1;position:absolute;height:100%}._visibilityBtn_ans5i_354{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:3px;margin-left:4px;color:#666;background:transparent;transition:all .2s}._visibilityBtn_ans5i_354:hover{background-color:#fff3;color:#fff}._visibilityBtn_ans5i_354._active_ans5i_105{color:#fff}')),document.head.appendChild(i)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { jsx as n, jsxs as y, Fragment as z } from "react/jsx-runtime";
3
- import { forwardRef as Te, useRef as I, useLayoutEffect as oe, useMemo as Y, useEffect as U, useState as O } from "react";
4
- import { useThree as we, addEffect as Ae, addAfterEffect as Se, addTail as Ne, Canvas as Re, useFrame as _e } from "@react-three/fiber";
5
- import { createRoot as Fe } from "react-dom/client";
6
- import * as E from "three";
7
- import { MathUtils as Pe } from "three";
8
- import { createWithEqualityFn as Ue } from "zustand/traditional";
9
- import { shallow as Ge } from "zustand/shallow";
10
- import Be from "eventemitter3";
11
- const be = Te(
12
- ({ portal: r, className: e, children: t, name: i, ...m }, o) => {
13
- const a = we((d) => d.gl), c = I(null), v = I(null), s = (r == null ? void 0 : r.current) != null ? r.current : a.domElement.parentNode;
14
- return oe(() => {
15
- if (!c.current || !s) return;
16
- const d = document.createElement("div"), f = v.current = Fe(d);
17
- return s.appendChild(d), () => {
18
- f.unmount(), v.current = null, s.removeChild(d);
2
+ import { jsx as p, jsxs as x, Fragment as q } from "react/jsx-runtime";
3
+ import z, { forwardRef as Ke, useRef as T, useLayoutEffect as pe, useMemo as J, useEffect as P, useState as B } from "react";
4
+ import { useThree as De, addEffect as Qe, addAfterEffect as Ye, addTail as Xe, Canvas as Je, useFrame as Ge } from "@react-three/fiber";
5
+ import { createRoot as Ze } from "react-dom/client";
6
+ import * as I from "three";
7
+ import { MathUtils as et } from "three";
8
+ const We = Ke(
9
+ ({ portal: t, className: e, children: n, name: o, ...d }, f) => {
10
+ const h = De((a) => a.gl), u = T(null), g = T(null), r = (t == null ? void 0 : t.current) != null ? t.current : h.domElement.parentNode;
11
+ return pe(() => {
12
+ if (!u.current || !r) return;
13
+ const a = document.createElement("div"), i = g.current = Ze(a);
14
+ return r.appendChild(a), () => {
15
+ i.unmount(), g.current = null, r.removeChild(a);
19
16
  };
20
- }, [s]), oe(() => {
21
- const d = v.current;
22
- d && d.render(
23
- /* @__PURE__ */ n("div", { ref: o, className: e, children: t })
17
+ }, [r]), pe(() => {
18
+ const a = g.current;
19
+ a && a.render(
20
+ /* @__PURE__ */ p("div", { ref: f, className: e, children: n })
24
21
  );
25
- }), /* @__PURE__ */ n("group", { name: i, ...m, ref: c });
22
+ }), /* @__PURE__ */ p("group", { name: o, ...d, ref: u });
26
23
  }
27
24
  );
28
- be.displayName = "HtmlMinimal";
29
- const ee = Ue((r, e) => {
30
- function t() {
31
- var w;
32
- const { accumulated: i, startTime: m, infos: o, estimatedMemory: a } = e(), c = (w = e().log) == null ? void 0 : w.maxMemory, { totalFrames: v, log: s, gl: d, max: f } = i, p = {
33
- calls: d.calls / v,
34
- triangles: d.triangles / v,
35
- points: d.points / v,
36
- lines: d.lines / v
37
- }, h = {
38
- gpu: s.gpu / v,
39
- cpu: s.cpu / v,
40
- mem: s.mem / v,
41
- fps: s.fps / v
25
+ We.displayName = "HtmlMinimal";
26
+ function Be(t) {
27
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
28
+ }
29
+ var ae = { exports: {} }, te = {}, Q = { exports: {} }, re = {};
30
+ /**
31
+ * @license React
32
+ * use-sync-external-store-shim.production.js
33
+ *
34
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE file in the root directory of this source tree.
38
+ */
39
+ var he;
40
+ function tt() {
41
+ if (he) return re;
42
+ he = 1;
43
+ var t = z;
44
+ function e(i, m) {
45
+ return i === m && (i !== 0 || 1 / i === 1 / m) || i !== i && m !== m;
46
+ }
47
+ var n = typeof Object.is == "function" ? Object.is : e, o = t.useState, d = t.useEffect, f = t.useLayoutEffect, h = t.useDebugValue;
48
+ function u(i, m) {
49
+ var c = m(), s = o({ inst: { value: c, getSnapshot: m } }), y = s[0].inst, l = s[1];
50
+ return f(
51
+ function() {
52
+ y.value = c, y.getSnapshot = m, g(y) && l({ inst: y });
53
+ },
54
+ [i, c, m]
55
+ ), d(
56
+ function() {
57
+ return g(y) && l({ inst: y }), i(function() {
58
+ g(y) && l({ inst: y });
59
+ });
60
+ },
61
+ [i]
62
+ ), h(c), c;
63
+ }
64
+ function g(i) {
65
+ var m = i.getSnapshot;
66
+ i = i.value;
67
+ try {
68
+ var c = m();
69
+ return !n(i, c);
70
+ } catch {
71
+ return !0;
72
+ }
73
+ }
74
+ function r(i, m) {
75
+ return m();
76
+ }
77
+ var a = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? r : u;
78
+ return re.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : a, re;
79
+ }
80
+ var ne = {};
81
+ /**
82
+ * @license React
83
+ * use-sync-external-store-shim.development.js
84
+ *
85
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
86
+ *
87
+ * This source code is licensed under the MIT license found in the
88
+ * LICENSE file in the root directory of this source tree.
89
+ */
90
+ var ge;
91
+ function rt() {
92
+ return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
93
+ function t(c, s) {
94
+ return c === s && (c !== 0 || 1 / c === 1 / s) || c !== c && s !== s;
95
+ }
96
+ function e(c, s) {
97
+ a || d.startTransition === void 0 || (a = !0, console.error(
98
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
99
+ ));
100
+ var y = s();
101
+ if (!i) {
102
+ var l = s();
103
+ f(y, l) || (console.error(
104
+ "The result of getSnapshot should be cached to avoid an infinite loop"
105
+ ), i = !0);
106
+ }
107
+ l = h({
108
+ inst: { value: y, getSnapshot: s }
109
+ });
110
+ var E = l[0].inst, _ = l[1];
111
+ return g(
112
+ function() {
113
+ E.value = y, E.getSnapshot = s, n(E) && _({ inst: E });
114
+ },
115
+ [c, y, s]
116
+ ), u(
117
+ function() {
118
+ return n(E) && _({ inst: E }), c(function() {
119
+ n(E) && _({ inst: E });
120
+ });
121
+ },
122
+ [c]
123
+ ), r(y), y;
124
+ }
125
+ function n(c) {
126
+ var s = c.getSnapshot;
127
+ c = c.value;
128
+ try {
129
+ var y = s();
130
+ return !f(c, y);
131
+ } catch {
132
+ return !0;
133
+ }
134
+ }
135
+ function o(c, s) {
136
+ return s();
137
+ }
138
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
139
+ var d = z, f = typeof Object.is == "function" ? Object.is : t, h = d.useState, u = d.useEffect, g = d.useLayoutEffect, r = d.useDebugValue, a = !1, i = !1, m = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? o : e;
140
+ ne.useSyncExternalStore = d.useSyncExternalStore !== void 0 ? d.useSyncExternalStore : m, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
141
+ }()), ne;
142
+ }
143
+ var ye;
144
+ function je() {
145
+ return ye || (ye = 1, process.env.NODE_ENV === "production" ? Q.exports = tt() : Q.exports = rt()), Q.exports;
146
+ }
147
+ /**
148
+ * @license React
149
+ * use-sync-external-store-shim/with-selector.production.js
150
+ *
151
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
152
+ *
153
+ * This source code is licensed under the MIT license found in the
154
+ * LICENSE file in the root directory of this source tree.
155
+ */
156
+ var ve;
157
+ function nt() {
158
+ if (ve) return te;
159
+ ve = 1;
160
+ var t = z, e = je();
161
+ function n(r, a) {
162
+ return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a;
163
+ }
164
+ var o = typeof Object.is == "function" ? Object.is : n, d = e.useSyncExternalStore, f = t.useRef, h = t.useEffect, u = t.useMemo, g = t.useDebugValue;
165
+ return te.useSyncExternalStoreWithSelector = function(r, a, i, m, c) {
166
+ var s = f(null);
167
+ if (s.current === null) {
168
+ var y = { hasValue: !1, value: null };
169
+ s.current = y;
170
+ } else y = s.current;
171
+ s = u(
172
+ function() {
173
+ function E(w) {
174
+ if (!_) {
175
+ if (_ = !0, b = w, w = m(w), c !== void 0 && y.hasValue) {
176
+ var L = y.value;
177
+ if (c(L, w))
178
+ return S = L;
179
+ }
180
+ return S = w;
181
+ }
182
+ if (L = S, o(b, w)) return L;
183
+ var O = m(w);
184
+ return c !== void 0 && c(L, O) ? (b = w, L) : (b = w, S = O);
185
+ }
186
+ var _ = !1, b, S, C = i === void 0 ? null : i;
187
+ return [
188
+ function() {
189
+ return E(a());
190
+ },
191
+ C === null ? void 0 : function() {
192
+ return E(C());
193
+ }
194
+ ];
195
+ },
196
+ [a, i, m, c]
197
+ );
198
+ var l = d(r, s[0], s[1]);
199
+ return h(
200
+ function() {
201
+ y.hasValue = !0, y.value = l;
202
+ },
203
+ [l]
204
+ ), g(l), l;
205
+ }, te;
206
+ }
207
+ var se = {};
208
+ /**
209
+ * @license React
210
+ * use-sync-external-store-shim/with-selector.development.js
211
+ *
212
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
213
+ *
214
+ * This source code is licensed under the MIT license found in the
215
+ * LICENSE file in the root directory of this source tree.
216
+ */
217
+ var _e;
218
+ function st() {
219
+ return _e || (_e = 1, process.env.NODE_ENV !== "production" && function() {
220
+ function t(r, a) {
221
+ return r === a && (r !== 0 || 1 / r === 1 / a) || r !== r && a !== a;
222
+ }
223
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
224
+ var e = z, n = je(), o = typeof Object.is == "function" ? Object.is : t, d = n.useSyncExternalStore, f = e.useRef, h = e.useEffect, u = e.useMemo, g = e.useDebugValue;
225
+ se.useSyncExternalStoreWithSelector = function(r, a, i, m, c) {
226
+ var s = f(null);
227
+ if (s.current === null) {
228
+ var y = { hasValue: !1, value: null };
229
+ s.current = y;
230
+ } else y = s.current;
231
+ s = u(
232
+ function() {
233
+ function E(w) {
234
+ if (!_) {
235
+ if (_ = !0, b = w, w = m(w), c !== void 0 && y.hasValue) {
236
+ var L = y.value;
237
+ if (c(L, w))
238
+ return S = L;
239
+ }
240
+ return S = w;
241
+ }
242
+ if (L = S, o(b, w))
243
+ return L;
244
+ var O = m(w);
245
+ return c !== void 0 && c(L, O) ? (b = w, L) : (b = w, S = O);
246
+ }
247
+ var _ = !1, b, S, C = i === void 0 ? null : i;
248
+ return [
249
+ function() {
250
+ return E(a());
251
+ },
252
+ C === null ? void 0 : function() {
253
+ return E(C());
254
+ }
255
+ ];
256
+ },
257
+ [a, i, m, c]
258
+ );
259
+ var l = d(r, s[0], s[1]);
260
+ return h(
261
+ function() {
262
+ y.hasValue = !0, y.value = l;
263
+ },
264
+ [l]
265
+ ), g(l), l;
266
+ }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
267
+ }()), se;
268
+ }
269
+ process.env.NODE_ENV === "production" ? ae.exports = nt() : ae.exports = st();
270
+ var it = ae.exports;
271
+ const at = /* @__PURE__ */ Be(it), Ee = (t) => {
272
+ let e;
273
+ const n = /* @__PURE__ */ new Set(), o = (r, a) => {
274
+ const i = typeof r == "function" ? r(e) : r;
275
+ if (!Object.is(i, e)) {
276
+ const m = e;
277
+ e = a ?? (typeof i != "object" || i === null) ? i : Object.assign({}, e, i), n.forEach((c) => c(e, m));
278
+ }
279
+ }, d = () => e, u = { setState: o, getState: d, getInitialState: () => g, subscribe: (r) => (n.add(r), () => n.delete(r)) }, g = e = t(o, d, u);
280
+ return u;
281
+ }, ot = (t) => t ? Ee(t) : Ee, { useSyncExternalStoreWithSelector: ct } = at, lt = (t) => t;
282
+ function ut(t, e = lt, n) {
283
+ const o = ct(
284
+ t.subscribe,
285
+ t.getState,
286
+ t.getInitialState,
287
+ e,
288
+ n
289
+ );
290
+ return z.useDebugValue(o), o;
291
+ }
292
+ const be = (t, e) => {
293
+ const n = ot(t), o = (d, f = e) => ut(n, d, f);
294
+ return Object.assign(o, n), o;
295
+ }, ft = (t, e) => t ? be(t, e) : be, xe = (t) => Symbol.iterator in t, Se = (t) => (
296
+ // HACK: avoid checking entries type
297
+ "entries" in t
298
+ ), we = (t, e) => {
299
+ const n = t instanceof Map ? t : new Map(t.entries()), o = e instanceof Map ? e : new Map(e.entries());
300
+ if (n.size !== o.size)
301
+ return !1;
302
+ for (const [d, f] of n)
303
+ if (!o.has(d) || !Object.is(f, o.get(d)))
304
+ return !1;
305
+ return !0;
306
+ }, mt = (t, e) => {
307
+ const n = t[Symbol.iterator](), o = e[Symbol.iterator]();
308
+ let d = n.next(), f = o.next();
309
+ for (; !d.done && !f.done; ) {
310
+ if (!Object.is(d.value, f.value))
311
+ return !1;
312
+ d = n.next(), f = o.next();
313
+ }
314
+ return !!d.done && !!f.done;
315
+ };
316
+ function dt(t, e) {
317
+ return Object.is(t, e) ? !0 : typeof t != "object" || t === null || typeof e != "object" || e === null || Object.getPrototypeOf(t) !== Object.getPrototypeOf(e) ? !1 : xe(t) && xe(e) ? Se(t) && Se(e) ? we(t, e) : mt(t, e) : we(
318
+ { entries: () => Object.entries(t) },
319
+ { entries: () => Object.entries(e) }
320
+ );
321
+ }
322
+ const oe = ft((t, e) => {
323
+ function n() {
324
+ var y;
325
+ const { accumulated: o, startTime: d, infos: f, estimatedMemory: h } = e(), u = (y = e().log) == null ? void 0 : y.maxMemory, { totalFrames: g, log: r, gl: a, max: i } = o, m = {
326
+ calls: a.calls / g,
327
+ triangles: a.triangles / g,
328
+ points: a.points / g,
329
+ lines: a.lines / g
330
+ }, c = {
331
+ gpu: r.gpu / g,
332
+ cpu: r.cpu / g,
333
+ mem: r.mem / g,
334
+ fps: r.fps / g
42
335
  };
43
336
  return {
44
- sessionTime: (window.performance.now() - m) / 1e3,
45
- infos: o,
46
- memory: a,
337
+ sessionTime: (window.performance.now() - d) / 1e3,
338
+ infos: f,
339
+ memory: h,
47
340
  // Thêm memory vào report
48
- log: h,
49
- gl: p,
50
- max: f,
51
- maxMemory: c,
52
- totalFrames: v
341
+ log: c,
342
+ gl: m,
343
+ max: i,
344
+ maxMemory: u,
345
+ totalFrames: g
53
346
  };
54
347
  }
55
348
  return {
@@ -114,16 +407,16 @@ const ee = Ue((r, e) => {
114
407
  programs: /* @__PURE__ */ new Map(),
115
408
  sceneLength: void 0,
116
409
  tab: "infos",
117
- getReport: t
410
+ getReport: n
118
411
  };
119
- }), L = (r) => ee(r, Ge);
120
- Object.assign(L, ee);
121
- const { getState: R, setState: M } = ee, S = {
412
+ }), A = (t) => oe(t, dt);
413
+ Object.assign(A, oe);
414
+ const { getState: F, setState: M } = oe, R = {
122
415
  value: 0,
123
416
  fpsLimit: 60,
124
417
  isOverLimit: 0
125
- }, H = (r) => (r == null ? void 0 : r.reduce((e, t) => e + t, 0)) / r.length;
126
- class De {
418
+ }, V = (t) => (t == null ? void 0 : t.reduce((e, n) => e + n, 0)) / t.length;
419
+ class pt {
127
420
  constructor(e = {}) {
128
421
  this.names = [""], this.finished = [], this.paused = !1, this.overClock = !1, this.queryHasResult = !1, this.queryCreated = !1, this.isWebGL2 = !0, this.memAccums = [], this.gpuAccums = [], this.activeAccums = [], this.logsAccums = {
129
422
  mem: [],
@@ -138,7 +431,7 @@ class De {
138
431
  }, this.t0 = 0, window.GLPerf = window.GLPerf || {}, Object.assign(this, e), this.fpsChart = new Array(this.chartLen).fill(0), this.gpuChart = new Array(this.chartLen).fill(0), this.cpuChart = new Array(this.chartLen).fill(0), this.memChart = new Array(this.chartLen).fill(0), this.now = () => window.performance && window.performance.now ? window.performance.now() : Date.now(), this.initGpu(), this.is120hz();
139
432
  }
140
433
  initGpu() {
141
- this.uuid = Pe.generateUUID(), this.gl && (this.isWebGL2 = !0, this.extension || (this.extension = this.gl.getExtension(
434
+ this.uuid = et.generateUUID(), this.gl && (this.isWebGL2 = !0, this.extension || (this.extension = this.gl.getExtension(
142
435
  "EXT_disjoint_timer_query_webgl2"
143
436
  )), this.extension === null && (this.isWebGL2 = !1));
144
437
  }
@@ -147,10 +440,10 @@ class De {
147
440
  */
148
441
  is120hz() {
149
442
  let e = 0;
150
- const t = (i) => {
151
- ++e < 20 ? this.rafId = window.requestAnimationFrame(t) : (this.detected = Math.ceil(1e3 * e / (i - this.t0) / 70), window.cancelAnimationFrame(this.rafId)), this.t0 || (this.t0 = i);
443
+ const n = (o) => {
444
+ ++e < 20 ? this.rafId = window.requestAnimationFrame(n) : (this.detected = Math.ceil(1e3 * e / (o - this.t0) / 70), window.cancelAnimationFrame(this.rafId)), this.t0 || (this.t0 = o);
152
445
  };
153
- this.rafId = window.requestAnimationFrame(t);
446
+ this.rafId = window.requestAnimationFrame(n);
154
447
  }
155
448
  /**
156
449
  * Explicit UI add
@@ -160,8 +453,8 @@ class De {
160
453
  this.names.indexOf(e) === -1 && (this.names.push(e), this.gpuAccums.push(0), this.activeAccums.push(!1));
161
454
  }
162
455
  nextFps(e) {
163
- const t = 16.666666666666668, i = t - e.timeRemaining(), m = t * S.fpsLimit / 10 / i;
164
- m < 0 || (S.value = m, S.isOverLimit < 25 ? S.isOverLimit++ : M({ overclockingFps: !0 }));
456
+ const n = 16.666666666666668, o = n - e.timeRemaining(), d = n * R.fpsLimit / 10 / o;
457
+ d < 0 || (R.value = d, R.isOverLimit < 25 ? R.isOverLimit++ : M({ overclockingFps: !0 }));
165
458
  }
166
459
  /**
167
460
  * Increase frameID
@@ -169,49 +462,49 @@ class De {
169
462
  */
170
463
  nextFrame(e) {
171
464
  this.frameId++;
172
- const t = e || this.now(), i = t - this.paramTime;
173
- let m = 0;
465
+ const n = e || this.now(), o = n - this.paramTime;
466
+ let d = 0;
174
467
  if (this.frameId <= 1)
175
- this.paramFrame = this.frameId, this.paramTime = t;
176
- else if (t >= this.paramTime) {
468
+ this.paramFrame = this.frameId, this.paramTime = n;
469
+ else if (n >= this.paramTime) {
177
470
  this.maxMemory = window.performance.memory ? window.performance.memory.jsHeapSizeLimit / 1048576 : 0;
178
- const o = this.frameId - this.paramFrame, a = o * 1e3 / i, c = R().overclockingFps ? S.value : a;
179
- if (m = this.isWebGL2 ? this.gpuAccums[0] : this.gpuAccums[0] / i, this.isWebGL2 ? this.gpuAccums[0] = 0 : Promise.all(this.finished).then(() => {
471
+ const f = this.frameId - this.paramFrame, h = f * 1e3 / o, u = F().overclockingFps ? R.value : h;
472
+ if (d = this.isWebGL2 ? this.gpuAccums[0] : this.gpuAccums[0] / o, this.isWebGL2 ? this.gpuAccums[0] = 0 : Promise.all(this.finished).then(() => {
180
473
  this.gpuAccums[0] = 0, this.finished = [];
181
474
  }), this.currentMem = Math.round(
182
475
  window.performance && window.performance.memory ? window.performance.memory.usedJSHeapSize / 1048576 : 0
183
476
  ), window.performance && this.startCpuProfiling) {
184
477
  window.performance.mark("cpu-finished");
185
- const v = performance.measure(
478
+ const g = performance.measure(
186
479
  "cpu-duration",
187
480
  "cpu-started",
188
481
  "cpu-finished"
189
482
  );
190
- this.currentCpu = (v == null ? void 0 : v.duration) || 0, this.logsAccums.cpu.push(this.currentCpu), this.startCpuProfiling = !1;
483
+ this.currentCpu = (g == null ? void 0 : g.duration) || 0, this.logsAccums.cpu.push(this.currentCpu), this.startCpuProfiling = !1;
191
484
  }
192
- this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(a), this.logsAccums.fps.push(c), this.logsAccums.gpu.push(m), this.overClock && typeof window.requestIdleCallback < "u" && (S.isOverLimit > 0 && c > a ? S.isOverLimit-- : R().overclockingFps && M({ overclockingFps: !1 })), t >= this.paramTime + 1e3 / this.logsPerSecond && (this.paramLogger({
193
- cpu: H(this.logsAccums.cpu),
194
- gpu: H(this.logsAccums.gpu),
195
- mem: H(this.logsAccums.mem),
196
- fps: H(this.logsAccums.fps),
197
- duration: Math.round(i),
485
+ this.logsAccums.mem.push(this.currentMem), this.logsAccums.fpsFixed.push(h), this.logsAccums.fps.push(u), this.logsAccums.gpu.push(d), this.overClock && typeof window.requestIdleCallback < "u" && (R.isOverLimit > 0 && u > h ? R.isOverLimit-- : F().overclockingFps && M({ overclockingFps: !1 })), n >= this.paramTime + 1e3 / this.logsPerSecond && (this.paramLogger({
486
+ cpu: V(this.logsAccums.cpu),
487
+ gpu: V(this.logsAccums.gpu),
488
+ mem: V(this.logsAccums.mem),
489
+ fps: V(this.logsAccums.fps),
490
+ duration: Math.round(o),
198
491
  maxMemory: this.maxMemory,
199
- frameCount: o
200
- }), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime = t), this.overClock && t - this.lastCalculateFixed >= 2 * 1e3 && (this.lastCalculateFixed = e, S.fpsLimit = Math.round(H(this.logsAccums.fpsFixed) / 10) * 100, M({ fpsLimit: S.fpsLimit / 10 }), this.logsAccums.fpsFixed = [], this.paramFrame = this.frameId, this.paramTime = t);
492
+ frameCount: f
493
+ }), this.logsAccums.mem = [], this.logsAccums.fps = [], this.logsAccums.gpu = [], this.logsAccums.cpu = [], this.paramFrame = this.frameId, this.paramTime = n), this.overClock && n - this.lastCalculateFixed >= 2 * 1e3 && (this.lastCalculateFixed = e, R.fpsLimit = Math.round(V(this.logsAccums.fpsFixed) / 10) * 100, M({ fpsLimit: R.fpsLimit / 10 }), this.logsAccums.fpsFixed = [], this.paramFrame = this.frameId, this.paramTime = n);
201
494
  }
202
495
  if (!this.detected || !this.chartFrame)
203
- this.chartFrame = this.frameId, this.chartTime = t, this.circularId = 0;
496
+ this.chartFrame = this.frameId, this.chartTime = n, this.circularId = 0;
204
497
  else {
205
- const o = t - this.chartTime;
206
- let a = this.chartHz * o / 1e3;
207
- for (; --a > 0 && this.detected; ) {
208
- const v = (this.frameId - this.chartFrame) / o * 1e3, s = R().overclockingFps ? S.value : v;
209
- this.fpsChart[this.circularId % this.chartLen] = s;
210
- const d = 1e3 / this.currentMem, f = this.currentCpu, p = (this.isWebGL2 ? this.gpuAccums[1] * 2 : Math.round(this.gpuAccums[1] / i * 100)) + 4;
211
- p > 0 && (this.gpuChart[this.circularId % this.chartLen] = p), f > 0 && (this.cpuChart[this.circularId % this.chartLen] = f), d > 0 && (this.memChart[this.circularId % this.chartLen] = d);
212
- for (let h = 0; h < this.names.length; h++)
498
+ const f = n - this.chartTime;
499
+ let h = this.chartHz * f / 1e3;
500
+ for (; --h > 0 && this.detected; ) {
501
+ const g = (this.frameId - this.chartFrame) / f * 1e3, r = F().overclockingFps ? R.value : g;
502
+ this.fpsChart[this.circularId % this.chartLen] = r;
503
+ const a = 1e3 / this.currentMem, i = this.currentCpu, m = (this.isWebGL2 ? this.gpuAccums[1] * 2 : Math.round(this.gpuAccums[1] / o * 100)) + 4;
504
+ m > 0 && (this.gpuChart[this.circularId % this.chartLen] = m), i > 0 && (this.cpuChart[this.circularId % this.chartLen] = i), a > 0 && (this.memChart[this.circularId % this.chartLen] = a);
505
+ for (let c = 0; c < this.names.length; c++)
213
506
  this.chartLogger({
214
- i: h,
507
+ i: c,
215
508
  data: {
216
509
  fps: this.fpsChart,
217
510
  gpu: this.gpuChart,
@@ -220,31 +513,31 @@ class De {
220
513
  },
221
514
  circularId: this.circularId
222
515
  });
223
- this.circularId++, this.chartFrame = this.frameId, this.chartTime = t;
516
+ this.circularId++, this.chartFrame = this.frameId, this.chartTime = n;
224
517
  }
225
518
  }
226
519
  }
227
520
  startGpu() {
228
- const e = this.gl, t = this.extension;
229
- if (!(!e || !t) && this.isWebGL2) {
230
- let i = !1, m, o;
521
+ const e = this.gl, n = this.extension;
522
+ if (!(!e || !n) && this.isWebGL2) {
523
+ let o = !1, d, f;
231
524
  if (this.query) {
232
525
  this.queryHasResult = !1;
233
- let a = this.query;
234
- if (i = e.getQueryParameter(a, e.QUERY_RESULT_AVAILABLE), m = e.getParameter(t.GPU_DISJOINT_EXT), i && !m) {
235
- o = e.getQueryParameter(this.query, e.QUERY_RESULT);
236
- const c = o * 1e-6;
237
- (i || m) && (e.deleteQuery(this.query), a = null), i && c > 0 && (m || this.activeAccums.forEach((v, s) => {
238
- this.gpuAccums[s] = c;
526
+ let h = this.query;
527
+ if (o = e.getQueryParameter(h, e.QUERY_RESULT_AVAILABLE), d = e.getParameter(n.GPU_DISJOINT_EXT), o && !d) {
528
+ f = e.getQueryParameter(this.query, e.QUERY_RESULT);
529
+ const u = f * 1e-6;
530
+ (o || d) && (e.deleteQuery(this.query), h = null), o && u > 0 && (d || this.activeAccums.forEach((g, r) => {
531
+ this.gpuAccums[r] = u;
239
532
  }));
240
533
  }
241
534
  }
242
- (i || !this.query) && (this.queryCreated = !0, this.query = e.createQuery(), e.beginQuery(t.TIME_ELAPSED_EXT, this.query));
535
+ (o || !this.query) && (this.queryCreated = !0, this.query = e.createQuery(), e.beginQuery(n.TIME_ELAPSED_EXT, this.query));
243
536
  }
244
537
  }
245
538
  endGpu() {
246
- const e = this.extension, t = this.gl;
247
- this.isWebGL2 && this.queryCreated && t.getQuery(e.TIME_ELAPSED_EXT, t.CURRENT_QUERY) && t.endQuery(e.TIME_ELAPSED_EXT);
539
+ const e = this.extension, n = this.gl;
540
+ this.isWebGL2 && this.queryCreated && n.getQuery(e.TIME_ELAPSED_EXT, n.CURRENT_QUERY) && n.endQuery(e.TIME_ELAPSED_EXT);
248
541
  }
249
542
  /**
250
543
  * Begin named measurement
@@ -261,15 +554,15 @@ class De {
261
554
  this.endGpu(), this.updateAccums(e);
262
555
  }
263
556
  updateAccums(e) {
264
- let t = this.names.indexOf(e);
265
- t === -1 && (t = this.names.length, this.addUI(e));
266
- const i = this.now();
267
- this.activeAccums[t] = !this.activeAccums[t], this.t0 = i;
557
+ let n = this.names.indexOf(e);
558
+ n === -1 && (n = this.names.length, this.addUI(e));
559
+ const o = this.now();
560
+ this.activeAccums[n] = !this.activeAccums[n], this.t0 = o;
268
561
  }
269
562
  dispose() {
270
- const e = this.gl, t = this.extension;
563
+ const e = this.gl, n = this.extension;
271
564
  try {
272
- this.isWebGL2 && e && t && e.getQuery(t.TIME_ELAPSED_EXT, e.CURRENT_QUERY) && e.endQuery(t.TIME_ELAPSED_EXT);
565
+ this.isWebGL2 && e && n && e.getQuery(n.TIME_ELAPSED_EXT, e.CURRENT_QUERY) && e.endQuery(n.TIME_ELAPSED_EXT);
273
566
  } catch {
274
567
  }
275
568
  if (e && this.query) {
@@ -282,80 +575,187 @@ class De {
282
575
  this.queryCreated = !1, this.queryHasResult = !1;
283
576
  }
284
577
  }
285
- const We = (r) => {
286
- r.forEach((e) => {
287
- const { meshes: t } = e;
288
- if (!t)
578
+ const ht = (t) => {
579
+ t.forEach((e) => {
580
+ const { meshes: n } = e;
581
+ if (!n)
289
582
  return;
290
- const i = {
583
+ const o = {
291
584
  total: 0,
292
585
  type: "Triangle",
293
586
  data: []
294
587
  };
295
- Object.keys(t).forEach((m) => {
296
- const o = t[m], { geometry: a, material: c } = o, v = a.index, s = a.attributes.position;
297
- if (!s) return;
298
- let d = 1;
299
- c.wireframe === !0 && (d = 0);
300
- const f = v !== null ? v.count : s.count, p = a.drawRange.start * d, h = a.drawRange.count * d, u = p, w = Math.min(f, p + h) - 1;
301
- let g = 1;
302
- const _ = o.count || 1;
303
- let x = "Triangle", b = 0;
304
- o.isMesh ? c.wireframe === !0 ? (x = "Line", g = g / 2) : (x = "Triangle", g = g / 3) : o.isLine ? (x = "Line", o.isLineSegments ? g = g / 2 : o.isLineLoop ? g = g : g = g - 1) : o.isPoints ? (x = "Point", g = g) : o.isSprite && (x = "Triangle", g = g / 3);
305
- const C = Math.round(
306
- Math.max(0, w - u + 1) * (g * _)
588
+ Object.keys(n).forEach((d) => {
589
+ const f = n[d], { geometry: h, material: u } = f, g = h.index, r = h.attributes.position;
590
+ if (!r) return;
591
+ let a = 1;
592
+ u.wireframe === !0 && (a = 0);
593
+ const i = g !== null ? g.count : r.count, m = h.drawRange.start * a, c = h.drawRange.count * a, s = m, y = Math.min(i, m + c) - 1;
594
+ let l = 1;
595
+ const E = f.count || 1;
596
+ let _ = "Triangle", b = 0;
597
+ f.isMesh ? u.wireframe === !0 ? (_ = "Line", l = l / 2) : (_ = "Triangle", l = l / 3) : f.isLine ? (_ = "Line", f.isLineSegments ? l = l / 2 : f.isLineLoop ? l = l : l = l - 1) : f.isPoints ? (_ = "Point", l = l) : f.isSprite && (_ = "Triangle", l = l / 3);
598
+ const S = Math.round(
599
+ Math.max(0, y - s + 1) * (l * E)
307
600
  );
308
- C > b && (b = C, i.type = x), i.total += C, i.data.push({ drawCount: C, type: x }), o.userData.drawCount = {
309
- type: x,
310
- count: C
601
+ S > b && (b = S, o.type = _), o.total += S, o.data.push({ drawCount: S, type: _ }), f.userData.drawCount = {
602
+ type: _,
603
+ count: S
311
604
  };
312
- }), e.drawCounts = i;
605
+ }), e.drawCounts = o;
313
606
  });
314
- }, te = new Be();
315
- function Oe(r, e, t) {
316
- return te.on(r, e);
607
+ };
608
+ var Ve = { exports: {} };
609
+ (function(t) {
610
+ var e = Object.prototype.hasOwnProperty, n = "~";
611
+ function o() {
612
+ }
613
+ Object.create && (o.prototype = /* @__PURE__ */ Object.create(null), new o().__proto__ || (n = !1));
614
+ function d(g, r, a) {
615
+ this.fn = g, this.context = r, this.once = a || !1;
616
+ }
617
+ function f(g, r, a, i, m) {
618
+ if (typeof a != "function")
619
+ throw new TypeError("The listener must be a function");
620
+ var c = new d(a, i || g, m), s = n ? n + r : r;
621
+ return g._events[s] ? g._events[s].fn ? g._events[s] = [g._events[s], c] : g._events[s].push(c) : (g._events[s] = c, g._eventsCount++), g;
622
+ }
623
+ function h(g, r) {
624
+ --g._eventsCount === 0 ? g._events = new o() : delete g._events[r];
625
+ }
626
+ function u() {
627
+ this._events = new o(), this._eventsCount = 0;
628
+ }
629
+ u.prototype.eventNames = function() {
630
+ var r = [], a, i;
631
+ if (this._eventsCount === 0) return r;
632
+ for (i in a = this._events)
633
+ e.call(a, i) && r.push(n ? i.slice(1) : i);
634
+ return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(a)) : r;
635
+ }, u.prototype.listeners = function(r) {
636
+ var a = n ? n + r : r, i = this._events[a];
637
+ if (!i) return [];
638
+ if (i.fn) return [i.fn];
639
+ for (var m = 0, c = i.length, s = new Array(c); m < c; m++)
640
+ s[m] = i[m].fn;
641
+ return s;
642
+ }, u.prototype.listenerCount = function(r) {
643
+ var a = n ? n + r : r, i = this._events[a];
644
+ return i ? i.fn ? 1 : i.length : 0;
645
+ }, u.prototype.emit = function(r, a, i, m, c, s) {
646
+ var y = n ? n + r : r;
647
+ if (!this._events[y]) return !1;
648
+ var l = this._events[y], E = arguments.length, _, b;
649
+ if (l.fn) {
650
+ switch (l.once && this.removeListener(r, l.fn, void 0, !0), E) {
651
+ case 1:
652
+ return l.fn.call(l.context), !0;
653
+ case 2:
654
+ return l.fn.call(l.context, a), !0;
655
+ case 3:
656
+ return l.fn.call(l.context, a, i), !0;
657
+ case 4:
658
+ return l.fn.call(l.context, a, i, m), !0;
659
+ case 5:
660
+ return l.fn.call(l.context, a, i, m, c), !0;
661
+ case 6:
662
+ return l.fn.call(l.context, a, i, m, c, s), !0;
663
+ }
664
+ for (b = 1, _ = new Array(E - 1); b < E; b++)
665
+ _[b - 1] = arguments[b];
666
+ l.fn.apply(l.context, _);
667
+ } else {
668
+ var S = l.length, C;
669
+ for (b = 0; b < S; b++)
670
+ switch (l[b].once && this.removeListener(r, l[b].fn, void 0, !0), E) {
671
+ case 1:
672
+ l[b].fn.call(l[b].context);
673
+ break;
674
+ case 2:
675
+ l[b].fn.call(l[b].context, a);
676
+ break;
677
+ case 3:
678
+ l[b].fn.call(l[b].context, a, i);
679
+ break;
680
+ case 4:
681
+ l[b].fn.call(l[b].context, a, i, m);
682
+ break;
683
+ default:
684
+ if (!_) for (C = 1, _ = new Array(E - 1); C < E; C++)
685
+ _[C - 1] = arguments[C];
686
+ l[b].fn.apply(l[b].context, _);
687
+ }
688
+ }
689
+ return !0;
690
+ }, u.prototype.on = function(r, a, i) {
691
+ return f(this, r, a, i, !1);
692
+ }, u.prototype.once = function(r, a, i) {
693
+ return f(this, r, a, i, !0);
694
+ }, u.prototype.removeListener = function(r, a, i, m) {
695
+ var c = n ? n + r : r;
696
+ if (!this._events[c]) return this;
697
+ if (!a)
698
+ return h(this, c), this;
699
+ var s = this._events[c];
700
+ if (s.fn)
701
+ s.fn === a && (!m || s.once) && (!i || s.context === i) && h(this, c);
702
+ else {
703
+ for (var y = 0, l = [], E = s.length; y < E; y++)
704
+ (s[y].fn !== a || m && !s[y].once || i && s[y].context !== i) && l.push(s[y]);
705
+ l.length ? this._events[c] = l.length === 1 ? l[0] : l : h(this, c);
706
+ }
707
+ return this;
708
+ }, u.prototype.removeAllListeners = function(r) {
709
+ var a;
710
+ return r ? (a = n ? n + r : r, this._events[a] && h(this, a)) : (this._events = new o(), this._eventsCount = 0), this;
711
+ }, u.prototype.off = u.prototype.removeListener, u.prototype.addListener = u.prototype.on, u.prefixed = n, u.EventEmitter = u, t.exports = u;
712
+ })(Ve);
713
+ var gt = Ve.exports;
714
+ const yt = /* @__PURE__ */ Be(gt), ce = new yt();
715
+ function vt(t, e, n) {
716
+ return ce.on(t, e);
317
717
  }
318
- function ke(r, e, t) {
319
- te.removeListener(
320
- r,
718
+ function _t(t, e, n) {
719
+ ce.removeListener(
720
+ t,
321
721
  e,
322
- (t == null ? void 0 : t.context) ?? null,
323
- t == null ? void 0 : t.once
722
+ (n == null ? void 0 : n.context) ?? null,
723
+ n == null ? void 0 : n.once
324
724
  );
325
725
  }
326
- function He(r, e) {
327
- te.emit(r, e);
726
+ function Et(t, e) {
727
+ ce.emit(t, e);
328
728
  }
329
- function qe(r) {
330
- let e = 0, t = 0;
331
- const i = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
332
- return r.traverse((o) => {
333
- if (o.isMesh) {
334
- const a = o;
335
- if (a.geometry && !i.has(a.geometry.uuid)) {
336
- i.add(a.geometry.uuid);
337
- const s = a.geometry.attributes;
338
- for (const d in s) {
339
- const f = s[d];
340
- f.array && (t += f.array.byteLength);
729
+ function bt(t) {
730
+ let e = 0, n = 0;
731
+ const o = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
732
+ return t.traverse((f) => {
733
+ if (f.isMesh) {
734
+ const h = f;
735
+ if (h.geometry && !o.has(h.geometry.uuid)) {
736
+ o.add(h.geometry.uuid);
737
+ const r = h.geometry.attributes;
738
+ for (const a in r) {
739
+ const i = r[a];
740
+ i.array && (n += i.array.byteLength);
341
741
  }
342
- a.geometry.index && a.geometry.index.array && (t += a.geometry.index.array.byteLength);
742
+ h.geometry.index && h.geometry.index.array && (n += h.geometry.index.array.byteLength);
343
743
  }
344
- const c = a.material;
345
- (Array.isArray(c) ? c : [c]).forEach((s) => {
346
- if (s)
347
- for (const d in s) {
348
- const f = s[d];
349
- if (f && f.isTexture) {
350
- const p = f;
351
- if (!m.has(p.uuid)) {
352
- if (m.add(p.uuid), p.isCompressedTexture && p.mipmaps)
353
- p.mipmaps.forEach((h) => {
354
- h.data && (e += h.data.byteLength);
744
+ const u = h.material;
745
+ (Array.isArray(u) ? u : [u]).forEach((r) => {
746
+ if (r)
747
+ for (const a in r) {
748
+ const i = r[a];
749
+ if (i && i.isTexture) {
750
+ const m = i;
751
+ if (!d.has(m.uuid)) {
752
+ if (d.add(m.uuid), m.isCompressedTexture && m.mipmaps)
753
+ m.mipmaps.forEach((c) => {
754
+ c.data && (e += c.data.byteLength);
355
755
  });
356
- else if (p.image) {
357
- const h = p.image, u = h.width || 0, w = h.height || 0, g = p.generateMipmaps ? 1.33 : 1;
358
- e += u * w * 4 * g;
756
+ else if (m.image) {
757
+ const c = m.image, s = c.width || 0, y = c.height || 0, l = m.generateMipmaps ? 1.33 : 1;
758
+ e += s * y * 4 * l;
359
759
  }
360
760
  }
361
761
  }
@@ -363,151 +763,151 @@ function qe(r) {
363
763
  });
364
764
  }
365
765
  }), {
366
- geometry: t,
766
+ geometry: n,
367
767
  texture: e,
368
- total: t + e
768
+ total: n + e
369
769
  };
370
770
  }
371
- const ce = E.Object3D.prototype.updateMatrixWorld, le = E.Object3D.prototype.updateWorldMatrix, ue = E.Object3D.prototype.updateMatrix, me = ["calls", "triangles", "points", "lines"], de = ["gpu", "cpu", "mem", "fps"], je = (r) => /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
372
- r
373
- ), pe = (r, e) => {
374
- r.defines || (r.defines = {}), r.defines.muiPerf || (r.defines = Object.assign(r.defines || {}, {
375
- muiPerf: r.uuid
376
- }), r.needsUpdate = !0);
377
- const t = r.uuid;
378
- return e[t] || (e[t] = { meshes: {}, material: r }), r.needsUpdate = !1, t;
379
- }, ze = (r) => r === "muiPerf", Ve = ({
380
- overClock: r,
771
+ const Le = I.Object3D.prototype.updateMatrixWorld, Ce = I.Object3D.prototype.updateWorldMatrix, Oe = I.Object3D.prototype.updateMatrix, Ie = ["calls", "triangles", "points", "lines"], Me = ["gpu", "cpu", "mem", "fps"], xt = (t) => /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(
772
+ t
773
+ ), Te = (t, e) => {
774
+ t.defines || (t.defines = {}), t.defines.muiPerf || (t.defines = Object.assign(t.defines || {}, {
775
+ muiPerf: t.uuid
776
+ }), t.needsUpdate = !0);
777
+ const n = t.uuid;
778
+ return e[n] || (e[n] = { meshes: {}, material: t }), t.needsUpdate = !1, n;
779
+ }, St = (t) => t === "muiPerf", wt = ({
780
+ overClock: t,
381
781
  logsPerSecond: e,
382
- chart: t,
383
- deepAnalyze: i,
384
- matrixUpdate: m
782
+ chart: n,
783
+ deepAnalyze: o,
784
+ matrixUpdate: d
385
785
  }) => {
386
- const { gl: o, scene: a } = we();
387
- M({ gl: o, scene: a });
388
- const c = 1e3;
389
- let v = 0;
390
- const s = Y(() => {
391
- const d = new De({
786
+ const { gl: f, scene: h } = De();
787
+ M({ gl: f, scene: h });
788
+ const u = 1e3;
789
+ let g = 0;
790
+ const r = J(() => {
791
+ const a = new pt({
392
792
  trackGPU: !0,
393
- overClock: r,
394
- chartLen: t ? t.length : 120,
395
- chartHz: t ? t.hz : 60,
793
+ overClock: t,
794
+ chartLen: n ? n.length : 120,
795
+ chartHz: n ? n.hz : 60,
396
796
  logsPerSecond: e || 10,
397
- gl: o.getContext(),
398
- chartLogger: (g) => {
399
- M({ chart: g });
797
+ gl: f.getContext(),
798
+ chartLogger: (l) => {
799
+ M({ chart: l });
400
800
  },
401
- paramLogger: (g) => {
402
- var T;
403
- const _ = {
404
- maxMemory: g.maxMemory,
405
- gpu: g.gpu,
406
- cpu: g.cpu,
407
- mem: g.mem,
408
- fps: g.fps,
409
- totalTime: g.duration,
410
- frameCount: g.frameCount
801
+ paramLogger: (l) => {
802
+ var C;
803
+ const E = {
804
+ maxMemory: l.maxMemory,
805
+ gpu: l.gpu,
806
+ cpu: l.cpu,
807
+ mem: l.mem,
808
+ fps: l.fps,
809
+ totalTime: l.duration,
810
+ frameCount: l.frameCount
411
811
  };
412
- M({ log: _ });
413
- const { accumulated: x } = R(), b = o.info.render;
414
- x.totalFrames++, x.gl.calls += b.calls, x.gl.triangles += b.triangles, x.gl.points += b.points, x.gl.lines += b.lines, x.log.gpu += g.gpu, x.log.cpu += g.cpu, x.log.mem += g.mem, x.log.fps += g.fps;
415
- for (let F = 0; F < me.length; F++) {
416
- const A = me[F], P = b[A];
417
- P > x.max.gl[A] && (x.max.gl[A] = P);
812
+ M({ log: E });
813
+ const { accumulated: _ } = F(), b = f.info.render;
814
+ _.totalFrames++, _.gl.calls += b.calls, _.gl.triangles += b.triangles, _.gl.points += b.points, _.gl.lines += b.lines, _.log.gpu += l.gpu, _.log.cpu += l.cpu, _.log.mem += l.mem, _.log.fps += l.fps;
815
+ for (let w = 0; w < Ie.length; w++) {
816
+ const L = Ie[w], O = b[L];
817
+ O > _.max.gl[L] && (_.max.gl[L] = O);
418
818
  }
419
- for (let F = 0; F < de.length; F++) {
420
- const A = de[F], P = g[A];
421
- P > x.max.log[A] && (x.max.log[A] = P);
819
+ for (let w = 0; w < Me.length; w++) {
820
+ const L = Me[w], O = l[L];
821
+ O > _.max.log[L] && (_.max.log[L] = O);
422
822
  }
423
- M({ accumulated: x });
424
- const C = {
425
- calls: o.info.render.calls,
426
- triangles: o.info.render.triangles,
427
- points: o.info.render.points,
428
- lines: o.info.render.lines,
429
- geometries: o.info.memory.geometries,
430
- textures: o.info.memory.textures,
431
- programs: ((T = o.info.programs) == null ? void 0 : T.length) || 0
823
+ M({ accumulated: _ });
824
+ const S = {
825
+ calls: f.info.render.calls,
826
+ triangles: f.info.render.triangles,
827
+ points: f.info.render.points,
828
+ lines: f.info.render.lines,
829
+ geometries: f.info.memory.geometries,
830
+ textures: f.info.memory.textures,
831
+ programs: ((C = f.info.programs) == null ? void 0 : C.length) || 0
432
832
  };
433
- He("log", [_, C]);
833
+ Et("log", [E, S]);
434
834
  }
435
- }), f = o.getContext();
436
- let p = null, h = null;
437
- const u = f.getExtension("WEBGL_debug_renderer_info"), w = f.getParameter(f.VERSION);
438
- return u && (p = f.getParameter(u.UNMASKED_RENDERER_WEBGL), h = f.getParameter(u.UNMASKED_VENDOR_WEBGL)), h || (h = "Unknown vendor"), p || (p = f.getParameter(f.RENDERER)), M({
835
+ }), i = f.getContext();
836
+ let m = null, c = null;
837
+ const s = i.getExtension("WEBGL_debug_renderer_info"), y = i.getParameter(i.VERSION);
838
+ return s && (m = i.getParameter(s.UNMASKED_RENDERER_WEBGL), c = i.getParameter(s.UNMASKED_VENDOR_WEBGL)), c || (c = "Unknown vendor"), m || (m = i.getParameter(i.RENDERER)), M({
439
839
  startTime: window.performance.now(),
440
840
  infos: {
441
- version: w,
442
- renderer: p,
443
- vendor: h
841
+ version: y,
842
+ renderer: m,
843
+ vendor: c
444
844
  }
445
- }), d;
446
- }, [r, t, e, o]);
447
- return U(() => {
448
- s && (s.overClock = r || !1, r === !1 && (M({ overclockingFps: !1 }), S.value = 0, S.isOverLimit = 0), s.chartHz = (t == null ? void 0 : t.hz) || 60, s.chartLen = (t == null ? void 0 : t.length) || 120);
449
- }, [s, r, t == null ? void 0 : t.hz, t == null ? void 0 : t.length]), U(() => {
450
- if (!o.info) return;
451
- o.info.autoReset = !1, m && (E.Object3D.prototype.updateMatrixWorld = function(...p) {
452
- return this.matrixWorldNeedsUpdate || p[0], ce.apply(this, p);
453
- }, E.Object3D.prototype.updateWorldMatrix = function(...p) {
454
- return le.apply(this, p);
455
- }, E.Object3D.prototype.updateMatrix = function(...p) {
456
- return ue.apply(this, p);
845
+ }), a;
846
+ }, [t, n, e, f]);
847
+ return P(() => {
848
+ r && (r.overClock = t || !1, t === !1 && (M({ overclockingFps: !1 }), R.value = 0, R.isOverLimit = 0), r.chartHz = (n == null ? void 0 : n.hz) || 60, r.chartLen = (n == null ? void 0 : n.length) || 120);
849
+ }, [r, t, n == null ? void 0 : n.hz, n == null ? void 0 : n.length]), P(() => {
850
+ if (!f.info) return;
851
+ f.info.autoReset = !1, d && (I.Object3D.prototype.updateMatrixWorld = function(...m) {
852
+ return this.matrixWorldNeedsUpdate || m[0], Le.apply(this, m);
853
+ }, I.Object3D.prototype.updateWorldMatrix = function(...m) {
854
+ return Ce.apply(this, m);
855
+ }, I.Object3D.prototype.updateMatrix = function(...m) {
856
+ return Oe.apply(this, m);
457
857
  });
458
- const d = Ae(() => {
459
- R().paused && M({ paused: !1 }), s == null || s.begin("profiler"), window.performance && (window.performance.mark("cpu-started"), s.startCpuProfiling = !0), o.info.reset();
460
- }), f = Se(() => {
461
- var w, g;
462
- s == null || s.end("profiler"), s && !s.paused && (s.nextFrame(window.performance.now()), r && typeof window.requestIdleCallback < "u" && (s.idleCbId = requestIdleCallback(s.nextFps)));
463
- const p = window.performance.now();
464
- if (p - v > c) {
465
- v = p;
466
- const _ = qe(a), x = s.currentMem || 0;
858
+ const a = Qe(() => {
859
+ F().paused && M({ paused: !1 }), r == null || r.begin("profiler"), window.performance && (window.performance.mark("cpu-started"), r.startCpuProfiling = !0), f.info.reset();
860
+ }), i = Ye(() => {
861
+ var y, l;
862
+ r == null || r.end("profiler"), r && !r.paused && (r.nextFrame(window.performance.now()), t && typeof window.requestIdleCallback < "u" && (r.idleCbId = requestIdleCallback(r.nextFps)));
863
+ const m = window.performance.now();
864
+ if (m - g > u) {
865
+ g = m;
866
+ const E = bt(h), _ = r.currentMem || 0;
467
867
  M({
468
868
  estimatedMemory: {
469
- vram: _.total / 1024 / 1024,
869
+ vram: E.total / 1024 / 1024,
470
870
  // Đổi ra MB
471
- tex: _.texture / 1024 / 1024,
472
- geo: _.geometry / 1024 / 1024,
473
- ram: x
871
+ tex: E.texture / 1024 / 1024,
872
+ geo: E.geometry / 1024 / 1024,
873
+ ram: _
474
874
  // Đã là MB
475
875
  }
476
876
  });
477
877
  }
478
- if (!i) return;
479
- const h = {}, u = /* @__PURE__ */ new Map();
480
- a.traverse((_) => {
481
- if (_ instanceof E.Mesh || _ instanceof E.Points) {
482
- if (!_.material) return;
483
- let x = _.material.uuid;
484
- const b = Array.isArray(_.material) && _.material.length > 1;
485
- x = pe(b ? _.material[1] : _.material, h), h[x].meshes[_.uuid] = _;
878
+ if (!o) return;
879
+ const c = {}, s = /* @__PURE__ */ new Map();
880
+ h.traverse((E) => {
881
+ if (E instanceof I.Mesh || E instanceof I.Points) {
882
+ if (!E.material) return;
883
+ let _ = E.material.uuid;
884
+ const b = Array.isArray(E.material) && E.material.length > 1;
885
+ _ = Te(b ? E.material[1] : E.material, c), c[_].meshes[E.uuid] = E;
486
886
  }
487
- }), (g = (w = o == null ? void 0 : o.info) == null ? void 0 : w.programs) == null || g.forEach((_) => {
488
- const x = _.cacheKey.split(","), b = x[x.findIndex(ze) + 1];
489
- if (je(b) && h[b]) {
490
- const { material: C, meshes: T } = h[b];
491
- u.set(b, {
492
- program: _,
493
- material: C,
494
- meshes: T,
887
+ }), (l = (y = f == null ? void 0 : f.info) == null ? void 0 : y.programs) == null || l.forEach((E) => {
888
+ const _ = E.cacheKey.split(","), b = _[_.findIndex(St) + 1];
889
+ if (xt(b) && c[b]) {
890
+ const { material: S, meshes: C } = c[b];
891
+ s.set(b, {
892
+ program: E,
893
+ material: S,
894
+ meshes: C,
495
895
  drawCounts: { total: 0, type: "triangle", data: [] },
496
896
  expand: !1,
497
897
  visible: !0
498
898
  });
499
899
  }
500
- }), u.size !== R().programs.size && (We(u), M({
501
- programs: u,
502
- triggerProgramsUpdate: R().triggerProgramsUpdate + 1
900
+ }), s.size !== F().programs.size && (ht(s), M({
901
+ programs: s,
902
+ triggerProgramsUpdate: F().triggerProgramsUpdate + 1
503
903
  }));
504
904
  });
505
905
  return () => {
506
- var p;
507
- s && typeof window.cancelIdleCallback < "u" && window.cancelIdleCallback(s.idleCbId), (p = s == null ? void 0 : s.dispose) == null || p.call(s), m && (E.Object3D.prototype.updateMatrixWorld = ce, E.Object3D.prototype.updateWorldMatrix = le, E.Object3D.prototype.updateMatrix = ue), d(), f();
906
+ var m;
907
+ r && typeof window.cancelIdleCallback < "u" && window.cancelIdleCallback(r.idleCbId), (m = r == null ? void 0 : r.dispose) == null || m.call(r), d && (I.Object3D.prototype.updateMatrixWorld = Le, I.Object3D.prototype.updateWorldMatrix = Ce, I.Object3D.prototype.updateMatrix = Oe), a(), i();
508
908
  };
509
- }, [s, o, a, i, r, m]), U(() => {
510
- const d = Ne(() => (s && (s.paused = !0, M({
909
+ }, [r, f, h, o, t, d]), P(() => {
910
+ const a = Xe(() => (r && (r.paused = !0, M({
511
911
  paused: !0,
512
912
  log: {
513
913
  maxMemory: 0,
@@ -519,67 +919,67 @@ const ce = E.Object3D.prototype.updateMatrixWorld, le = E.Object3D.prototype.upd
519
919
  frameCount: 0
520
920
  }
521
921
  })), !1));
522
- return () => d();
523
- }, [s]), null;
922
+ return () => a();
923
+ }, [r]), null;
524
924
  };
525
- function re(r, e, t = [], i) {
526
- const m = I(e);
527
- U(() => {
528
- m.current = e;
529
- }, [e]), U(() => {
530
- const o = (c) => {
531
- var v;
532
- return (v = m.current) == null ? void 0 : v.call(m, c);
533
- }, a = Oe(r, o);
534
- return () => ke(r, o, {
535
- ...i,
536
- context: a
925
+ function le(t, e, n = [], o) {
926
+ const d = T(e);
927
+ P(() => {
928
+ d.current = e;
929
+ }, [e]), P(() => {
930
+ const f = (u) => {
931
+ var g;
932
+ return (g = d.current) == null ? void 0 : g.call(d, u);
933
+ }, h = vt(t, f);
934
+ return () => _t(t, f, {
935
+ ...o,
936
+ context: h
537
937
  });
538
- }, [r, i == null ? void 0 : i.once, ...t]);
938
+ }, [t, o == null ? void 0 : o.once, ...n]);
539
939
  }
540
- function $e(r) {
940
+ function Lt(t) {
541
941
  let e = 0;
542
- for (const i in r.attributes) {
543
- const m = r.getAttribute(i);
544
- e += m.count * m.itemSize * m.array.BYTES_PER_ELEMENT;
942
+ for (const o in t.attributes) {
943
+ const d = t.getAttribute(o);
944
+ e += d.count * d.itemSize * d.array.BYTES_PER_ELEMENT;
545
945
  }
546
- const t = r.getIndex();
547
- return e += t ? t.count * t.itemSize * t.array.BYTES_PER_ELEMENT : 0, e;
946
+ const n = t.getIndex();
947
+ return e += n ? n.count * n.itemSize * n.array.BYTES_PER_ELEMENT : 0, e;
548
948
  }
549
- const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_ans5i_21", Ke = "_topRight_ans5i_22", Je = "_bottomLeft_ans5i_23", Ze = "_bottomRight_ans5i_24", et = "_minimal_ans5i_26", tt = "_perfIContainer_ans5i_30", rt = "_perfI_ans5i_30", st = "_perfB_ans5i_69", nt = "_toggleContainer_ans5i_83", it = "_toggle_ans5i_83", at = "_activeTab_ans5i_105", ot = "_containerScroll_ans5i_110", ct = "_programGeo_ans5i_115", lt = "_programHeader_ans5i_120", ut = "_headerLeft_ans5i_149", mt = "_programTitle_ans5i_156", dt = "_toggleArrow_ans5i_166", pt = "_programConsole_ans5i_200", ft = "_programsContainer_ans5i_218", ht = "_headerRight_ans5i_222", gt = "_metricBadge_ans5i_228", yt = "_programsULHeader_ans5i_246", vt = "_programsUL_ans5i_246", xt = "_programsGeoLi_ans5i_309", wt = "_graph_ans5i_324", _t = "_visibilityBtn_ans5i_354", bt = "_active_ans5i_105", l = {
550
- perfS: Qe,
551
- containerHeight: Xe,
552
- topLeft: Ye,
553
- topRight: Ke,
554
- bottomLeft: Je,
555
- bottomRight: Ze,
556
- minimal: et,
557
- perfIContainer: tt,
558
- perfI: rt,
559
- perfB: st,
560
- toggleContainer: nt,
561
- toggle: it,
562
- activeTab: at,
563
- containerScroll: ot,
564
- programGeo: ct,
565
- programHeader: lt,
566
- headerLeft: ut,
567
- programTitle: mt,
568
- toggleArrow: dt,
569
- programConsole: pt,
570
- programsContainer: ft,
571
- headerRight: ht,
572
- metricBadge: gt,
573
- programsULHeader: yt,
574
- programsUL: vt,
575
- programsGeoLi: xt,
576
- graph: wt,
577
- visibilityBtn: _t,
578
- active: bt
579
- }, fe = (r, e) => {
580
- var m, o;
581
- const t = (a) => {
582
- switch (a) {
949
+ const Ct = "_perfS_ans5i_1", Ot = "_containerHeight_ans5i_16", It = "_topLeft_ans5i_21", Mt = "_topRight_ans5i_22", Tt = "_bottomLeft_ans5i_23", At = "_bottomRight_ans5i_24", Rt = "_minimal_ans5i_26", Nt = "_perfIContainer_ans5i_30", Ft = "_perfI_ans5i_30", Pt = "_perfB_ans5i_69", Ut = "_toggleContainer_ans5i_83", Dt = "_toggle_ans5i_83", Gt = "_activeTab_ans5i_105", Wt = "_containerScroll_ans5i_110", Bt = "_programGeo_ans5i_115", jt = "_programHeader_ans5i_120", Vt = "_headerLeft_ans5i_149", Ht = "_programTitle_ans5i_156", kt = "_toggleArrow_ans5i_166", qt = "_programConsole_ans5i_200", zt = "_programsContainer_ans5i_218", $t = "_headerRight_ans5i_222", Kt = "_metricBadge_ans5i_228", Qt = "_programsULHeader_ans5i_246", Yt = "_programsUL_ans5i_246", Xt = "_programsGeoLi_ans5i_309", Jt = "_graph_ans5i_324", Zt = "_visibilityBtn_ans5i_354", er = "_active_ans5i_105", v = {
950
+ perfS: Ct,
951
+ containerHeight: Ot,
952
+ topLeft: It,
953
+ topRight: Mt,
954
+ bottomLeft: Tt,
955
+ bottomRight: At,
956
+ minimal: Rt,
957
+ perfIContainer: Nt,
958
+ perfI: Ft,
959
+ perfB: Pt,
960
+ toggleContainer: Ut,
961
+ toggle: Dt,
962
+ activeTab: Gt,
963
+ containerScroll: Wt,
964
+ programGeo: Bt,
965
+ programHeader: jt,
966
+ headerLeft: Vt,
967
+ programTitle: Ht,
968
+ toggleArrow: kt,
969
+ programConsole: qt,
970
+ programsContainer: zt,
971
+ headerRight: $t,
972
+ metricBadge: Kt,
973
+ programsULHeader: Qt,
974
+ programsUL: Yt,
975
+ programsGeoLi: Xt,
976
+ graph: Jt,
977
+ visibilityBtn: Zt,
978
+ active: er
979
+ }, Ae = (t, e) => {
980
+ var d, f;
981
+ const n = (h) => {
982
+ switch (h) {
583
983
  case 1e3:
584
984
  return "RepeatWrapping";
585
985
  case 1001:
@@ -589,8 +989,8 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
589
989
  default:
590
990
  return "ClampToEdgeWrapping";
591
991
  }
592
- }, i = (a) => {
593
- switch (a) {
992
+ }, o = (h) => {
993
+ switch (h) {
594
994
  case 3e3:
595
995
  return "LinearEncoding";
596
996
  case 3001:
@@ -612,30 +1012,30 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
612
1012
  }
613
1013
  };
614
1014
  return {
615
- name: r,
616
- url: (m = e == null ? void 0 : e.image) == null ? void 0 : m.currentSrc,
617
- encoding: i(e.encoding),
618
- wrapT: t(e.wrapT),
619
- flipY: (o = e.flipY) == null ? void 0 : o.toString()
1015
+ name: t,
1016
+ url: (d = e == null ? void 0 : e.image) == null ? void 0 : d.currentSrc,
1017
+ encoding: o(e.encoding),
1018
+ wrapT: n(e.wrapT),
1019
+ flipY: (f = e.flipY) == null ? void 0 : f.toString()
620
1020
  };
621
- }, Z = ({
622
- value: r,
1021
+ }, ie = ({
1022
+ value: t,
623
1023
  label: e,
624
- unit: t,
625
- title: i
626
- }) => r == null || r === 0 || r === "0" ? null : /* @__PURE__ */ y("div", { className: l.metricBadge, title: i, children: [
627
- /* @__PURE__ */ n("b", { children: r }),
1024
+ unit: n,
1025
+ title: o
1026
+ }) => t == null || t === 0 || t === "0" ? null : /* @__PURE__ */ x("div", { className: v.metricBadge, title: o, children: [
1027
+ /* @__PURE__ */ p("b", { children: t }),
628
1028
  " ",
629
- t || e
630
- ] }), Ct = ({ program: r, material: e, setTexNumber: t }) => {
631
- const i = L((a) => a.gl), [m, o] = O(null);
632
- return U(() => {
633
- if (i) {
634
- const a = r == null ? void 0 : r.getUniforms();
635
- let c = 0;
636
- const v = /* @__PURE__ */ new Map();
637
- a && a.seq && a.seq.forEach((s) => {
638
- if (!s.id.includes("uTroika") && ![
1029
+ n || e
1030
+ ] }), tr = ({ program: t, material: e, setTexNumber: n }) => {
1031
+ const o = A((h) => h.gl), [d, f] = B(null);
1032
+ return P(() => {
1033
+ if (o) {
1034
+ const h = t == null ? void 0 : t.getUniforms();
1035
+ let u = 0;
1036
+ const g = /* @__PURE__ */ new Map();
1037
+ h && h.seq && h.seq.forEach((r) => {
1038
+ if (!r.id.includes("uTroika") && ![
639
1039
  "isOrthographic",
640
1040
  "uvTransform",
641
1041
  "lightProbe",
@@ -644,136 +1044,136 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
644
1044
  "normalMatrix",
645
1045
  "modelMatrix",
646
1046
  "modelViewMatrix"
647
- ].includes(s.id)) {
648
- const d = [], f = { name: s.id };
649
- s.cache && (s.cache.forEach((p) => {
650
- typeof p < "u" && d.push(p.toString().substring(0, 4));
651
- }), f.value = d.join(), e[s.id] && e[s.id].image && (c++, f.value = fe(s.id, e[s.id])), f.value || (f.value = "empty"), v.set(s.id, f));
1047
+ ].includes(r.id)) {
1048
+ const a = [], i = { name: r.id };
1049
+ r.cache && (r.cache.forEach((m) => {
1050
+ typeof m < "u" && a.push(m.toString().substring(0, 4));
1051
+ }), i.value = a.join(), e[r.id] && e[r.id].image && (u++, i.value = Ae(r.id, e[r.id])), i.value || (i.value = "empty"), g.set(r.id, i));
652
1052
  }
653
- }), e.uniforms && Object.keys(e.uniforms).forEach((s) => {
654
- const d = e.uniforms[s];
655
- if (d.value) {
656
- const { value: f } = d, p = { name: s };
657
- if (s.includes("uTroika")) return;
658
- if (f.isTexture)
659
- c++, p.value = fe(s, f);
1053
+ }), e.uniforms && Object.keys(e.uniforms).forEach((r) => {
1054
+ const a = e.uniforms[r];
1055
+ if (a.value) {
1056
+ const { value: i } = a, m = { name: r };
1057
+ if (r.includes("uTroika")) return;
1058
+ if (i.isTexture)
1059
+ u++, m.value = Ae(r, i);
660
1060
  else {
661
- let h = JSON.stringify(f);
1061
+ let c = JSON.stringify(i);
662
1062
  try {
663
- h = JSON.stringify(f);
1063
+ c = JSON.stringify(i);
664
1064
  } catch {
665
- h = f.toString();
1065
+ c = i.toString();
666
1066
  }
667
- p.value = h;
1067
+ m.value = c;
668
1068
  }
669
- v.set(s, p);
1069
+ g.set(r, m);
670
1070
  }
671
- }), t(c), o(v);
1071
+ }), n(u), f(g);
672
1072
  }
673
- }, [i, e, r, t]), /* @__PURE__ */ n("ul", { className: l.programsUL, children: m && Array.from(m.values()).map((a) => /* @__PURE__ */ n("span", { children: typeof a.value == "string" ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ y("span", { children: [
674
- a.name,
1073
+ }, [o, e, t, n]), /* @__PURE__ */ p("ul", { className: v.programsUL, children: d && Array.from(d.values()).map((h) => /* @__PURE__ */ p("span", { children: typeof h.value == "string" ? /* @__PURE__ */ p("li", { children: /* @__PURE__ */ x("span", { children: [
1074
+ h.name,
675
1075
  " :",
676
1076
  " ",
677
- /* @__PURE__ */ y("b", { children: [
678
- a.value.substring(0, 30),
679
- a.value.length > 30 ? "..." : ""
1077
+ /* @__PURE__ */ x("b", { children: [
1078
+ h.value.substring(0, 30),
1079
+ h.value.length > 30 ? "..." : ""
680
1080
  ] })
681
- ] }) }) : /* @__PURE__ */ y(z, { children: [
682
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ y("b", { children: [
683
- a.value.name,
1081
+ ] }) }) : /* @__PURE__ */ x(q, { children: [
1082
+ /* @__PURE__ */ p("li", { children: /* @__PURE__ */ x("b", { children: [
1083
+ h.value.name,
684
1084
  ":"
685
1085
  ] }) }),
686
- /* @__PURE__ */ y("div", { children: [
687
- Object.keys(a.value).map(
688
- (c) => c !== "name" ? /* @__PURE__ */ n("div", { children: c === "url" ? /* @__PURE__ */ n(
1086
+ /* @__PURE__ */ x("div", { children: [
1087
+ Object.keys(h.value).map(
1088
+ (u) => u !== "name" ? /* @__PURE__ */ p("div", { children: u === "url" ? /* @__PURE__ */ p(
689
1089
  "a",
690
1090
  {
691
- href: a.value[c],
1091
+ href: h.value[u],
692
1092
  target: "_blank",
693
1093
  rel: "noreferrer",
694
- children: /* @__PURE__ */ n("img", { src: a.value[c], alt: "texture" })
1094
+ children: /* @__PURE__ */ p("img", { src: h.value[u], alt: "texture" })
695
1095
  }
696
- ) : /* @__PURE__ */ y("li", { children: [
697
- c,
1096
+ ) : /* @__PURE__ */ x("li", { children: [
1097
+ u,
698
1098
  ": ",
699
- /* @__PURE__ */ n("b", { children: a.value[c] })
700
- ] }) }, c) : null
1099
+ /* @__PURE__ */ p("b", { children: h.value[u] })
1100
+ ] }) }, u) : null
701
1101
  ),
702
- /* @__PURE__ */ y(
1102
+ /* @__PURE__ */ x(
703
1103
  "button",
704
1104
  {
705
- className: l.programConsole,
1105
+ className: v.programConsole,
706
1106
  onClick: () => {
707
- var c;
1107
+ var u;
708
1108
  console.info(
709
- e[a.value.name] || ((c = e == null ? void 0 : e.uniforms[a.value.name]) == null ? void 0 : c.value)
1109
+ e[h.value.name] || ((u = e == null ? void 0 : e.uniforms[h.value.name]) == null ? void 0 : u.value)
710
1110
  );
711
1111
  },
712
1112
  children: [
713
1113
  "console.info(",
714
- a.value.name,
1114
+ h.value.name,
715
1115
  ");"
716
1116
  ]
717
1117
  }
718
1118
  )
719
1119
  ] })
720
- ] }) }, a.name)) });
721
- }, Et = ({ el: r }) => {
722
- const [e, t] = O(r.visible), [i, m] = O(r.expand), [o, a] = O(0), { meshes: c, program: v, material: s } = r, d = L((u) => u.gl), f = () => {
723
- if (!d || !d.info || !d.info.render) return 0;
724
- const u = d.info.render.triangles + d.info.render.lines + d.info.render.points;
725
- if (u === 0) return 0;
726
- const w = Math.round(r.drawCounts.total / u * 100 * 10) / 10;
727
- return isFinite(w) && w || 0;
728
- }, p = Object.keys(c).length, h = f();
729
- return /* @__PURE__ */ y("div", { className: l.programGeo, children: [
730
- /* @__PURE__ */ y(
1120
+ ] }) }, h.name)) });
1121
+ }, rr = ({ el: t }) => {
1122
+ const [e, n] = B(t.visible), [o, d] = B(t.expand), [f, h] = B(0), { meshes: u, program: g, material: r } = t, a = A((s) => s.gl), i = () => {
1123
+ if (!a || !a.info || !a.info.render) return 0;
1124
+ const s = a.info.render.triangles + a.info.render.lines + a.info.render.points;
1125
+ if (s === 0) return 0;
1126
+ const y = Math.round(t.drawCounts.total / s * 100 * 10) / 10;
1127
+ return isFinite(y) && y || 0;
1128
+ }, m = Object.keys(u).length, c = i();
1129
+ return /* @__PURE__ */ x("div", { className: v.programGeo, children: [
1130
+ /* @__PURE__ */ x(
731
1131
  "div",
732
1132
  {
733
- className: l.programHeader,
1133
+ className: v.programHeader,
734
1134
  onClick: () => {
735
- Object.keys(c).forEach((u) => {
736
- c[u].material.wireframe = !1;
737
- }), m(!i);
1135
+ Object.keys(u).forEach((s) => {
1136
+ u[s].material.wireframe = !1;
1137
+ }), d(!o);
738
1138
  },
739
1139
  children: [
740
- /* @__PURE__ */ y("div", { className: l.headerLeft, children: [
741
- /* @__PURE__ */ n(
1140
+ /* @__PURE__ */ x("div", { className: v.headerLeft, children: [
1141
+ /* @__PURE__ */ p(
742
1142
  "div",
743
1143
  {
744
- className: l.toggleArrow,
1144
+ className: v.toggleArrow,
745
1145
  style: {
746
- transform: i ? "rotate(90deg)" : "rotate(0deg)"
1146
+ transform: o ? "rotate(90deg)" : "rotate(0deg)"
747
1147
  },
748
1148
  children: "▶"
749
1149
  }
750
1150
  ),
751
- v && /* @__PURE__ */ n("span", { className: l.programTitle, children: v.name })
1151
+ g && /* @__PURE__ */ p("span", { className: v.programTitle, children: g.name })
752
1152
  ] }),
753
- /* @__PURE__ */ y("div", { className: l.headerRight, children: [
754
- /* @__PURE__ */ n(
755
- Z,
1153
+ /* @__PURE__ */ x("div", { className: v.headerRight, children: [
1154
+ /* @__PURE__ */ p(
1155
+ ie,
756
1156
  {
757
- value: p,
758
- unit: p > 1 ? "users" : "user"
1157
+ value: m,
1158
+ unit: m > 1 ? "users" : "user"
759
1159
  }
760
1160
  ),
761
- /* @__PURE__ */ n(Z, { value: o, unit: "tex" }),
762
- r.drawCounts.total > 0 && /* @__PURE__ */ y(
1161
+ /* @__PURE__ */ p(ie, { value: f, unit: "tex" }),
1162
+ t.drawCounts.total > 0 && /* @__PURE__ */ x(
763
1163
  "div",
764
1164
  {
765
- className: l.metricBadge,
766
- title: `${h}% of total render`,
1165
+ className: v.metricBadge,
1166
+ title: `${c}% of total render`,
767
1167
  children: [
768
- /* @__PURE__ */ n("b", { children: r.drawCounts.total }),
769
- r.drawCounts.type === "Triangle" ? "tris" : r.drawCounts.type,
770
- r.visible && !r.material.wireframe && /* @__PURE__ */ y(
1168
+ /* @__PURE__ */ p("b", { children: t.drawCounts.total }),
1169
+ t.drawCounts.type === "Triangle" ? "tris" : t.drawCounts.type,
1170
+ t.visible && !t.material.wireframe && /* @__PURE__ */ x(
771
1171
  "span",
772
1172
  {
773
1173
  style: { marginLeft: "4px", opacity: 0.6, fontSize: "9px" },
774
1174
  children: [
775
1175
  "(",
776
- h,
1176
+ c,
777
1177
  "%)"
778
1178
  ]
779
1179
  }
@@ -781,27 +1181,27 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
781
1181
  ]
782
1182
  }
783
1183
  ),
784
- s.glslVersion === "300 es" && /* @__PURE__ */ n(Z, { value: "300", unit: "es" }),
785
- /* @__PURE__ */ n(
1184
+ r.glslVersion === "300 es" && /* @__PURE__ */ p(ie, { value: "300", unit: "es" }),
1185
+ /* @__PURE__ */ p(
786
1186
  "div",
787
1187
  {
788
- className: `${l.visibilityBtn} ${e ? l.active : ""}`,
1188
+ className: `${v.visibilityBtn} ${e ? v.active : ""}`,
789
1189
  onPointerEnter: () => {
790
- Object.keys(c).forEach(
791
- (u) => c[u].material.wireframe = !0
1190
+ Object.keys(u).forEach(
1191
+ (s) => u[s].material.wireframe = !0
792
1192
  );
793
1193
  },
794
1194
  onPointerLeave: () => {
795
- Object.keys(c).forEach(
796
- (u) => c[u].material.wireframe = !1
1195
+ Object.keys(u).forEach(
1196
+ (s) => u[s].material.wireframe = !1
797
1197
  );
798
1198
  },
799
- onClick: (u) => {
800
- u.stopPropagation();
801
- const w = !e;
802
- Object.keys(c).forEach((g) => {
803
- c[g] && (c[g].visible = w);
804
- }), t(w);
1199
+ onClick: (s) => {
1200
+ s.stopPropagation();
1201
+ const y = !e;
1202
+ Object.keys(u).forEach((l) => {
1203
+ u[l] && (u[l].visible = y);
1204
+ }), n(y);
805
1205
  },
806
1206
  children: e ? "👁" : "×"
807
1207
  }
@@ -810,19 +1210,19 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
810
1210
  ]
811
1211
  }
812
1212
  ),
813
- /* @__PURE__ */ y("div", { style: { display: i ? "block" : "none" }, children: [
814
- /* @__PURE__ */ n("div", { className: l.programsULHeader, style: { marginTop: "4px" }, children: "Uniforms" }),
815
- /* @__PURE__ */ n(
816
- Ct,
1213
+ /* @__PURE__ */ x("div", { style: { display: o ? "block" : "none" }, children: [
1214
+ /* @__PURE__ */ p("div", { className: v.programsULHeader, style: { marginTop: "4px" }, children: "Uniforms" }),
1215
+ /* @__PURE__ */ p(
1216
+ tr,
817
1217
  {
818
- program: v,
819
- material: s,
820
- setTexNumber: a
1218
+ program: g,
1219
+ material: r,
1220
+ setTexNumber: h
821
1221
  }
822
1222
  ),
823
- /* @__PURE__ */ n("div", { className: l.programsULHeader, children: "Geometries" }),
824
- /* @__PURE__ */ n("ul", { className: l.programsUL, children: c && Object.keys(c).map(
825
- (u) => c[u] && c[u].geometry && /* @__PURE__ */ n("li", { className: l.programsGeoLi, children: /* @__PURE__ */ y(
1223
+ /* @__PURE__ */ p("div", { className: v.programsULHeader, children: "Geometries" }),
1224
+ /* @__PURE__ */ p("ul", { className: v.programsUL, children: u && Object.keys(u).map(
1225
+ (s) => u[s] && u[s].geometry && /* @__PURE__ */ p("li", { className: v.programsGeoLi, children: /* @__PURE__ */ x(
826
1226
  "div",
827
1227
  {
828
1228
  style: {
@@ -832,8 +1232,8 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
832
1232
  alignItems: "center"
833
1233
  },
834
1234
  children: [
835
- /* @__PURE__ */ n("span", { children: c[u].geometry.type }),
836
- c[u].userData && c[u].userData.drawCount && /* @__PURE__ */ y(
1235
+ /* @__PURE__ */ p("span", { children: u[s].geometry.type }),
1236
+ u[s].userData && u[s].userData.drawCount && /* @__PURE__ */ x(
837
1237
  "span",
838
1238
  {
839
1239
  style: {
@@ -843,16 +1243,16 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
843
1243
  gap: "6px"
844
1244
  },
845
1245
  children: [
846
- /* @__PURE__ */ y("span", { children: [
847
- /* @__PURE__ */ n("b", { children: c[u].userData.drawCount.count }),
1246
+ /* @__PURE__ */ x("span", { children: [
1247
+ /* @__PURE__ */ p("b", { children: u[s].userData.drawCount.count }),
848
1248
  " ",
849
- c[u].userData.drawCount.type,
1249
+ u[s].userData.drawCount.type,
850
1250
  "s"
851
1251
  ] }),
852
- /* @__PURE__ */ n("span", { style: { opacity: 0.3 }, children: "|" }),
853
- /* @__PURE__ */ y("span", { children: [
854
- /* @__PURE__ */ n("b", { children: Math.round(
855
- $e(c[u].geometry) / 1024 * 100
1252
+ /* @__PURE__ */ p("span", { style: { opacity: 0.3 }, children: "|" }),
1253
+ /* @__PURE__ */ x("span", { children: [
1254
+ /* @__PURE__ */ p("b", { children: Math.round(
1255
+ Lt(u[s].geometry) / 1024 * 100
856
1256
  ) / 100 }),
857
1257
  " ",
858
1258
  "KB"
@@ -862,85 +1262,85 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
862
1262
  )
863
1263
  ]
864
1264
  }
865
- ) }, u)
1265
+ ) }, s)
866
1266
  ) }),
867
- /* @__PURE__ */ y(
1267
+ /* @__PURE__ */ x(
868
1268
  "button",
869
1269
  {
870
- className: l.programConsole,
871
- onClick: () => console.info(s),
1270
+ className: v.programConsole,
1271
+ onClick: () => console.info(r),
872
1272
  children: [
873
1273
  "Log Material (",
874
- s.type,
1274
+ r.type,
875
1275
  ")"
876
1276
  ]
877
1277
  }
878
1278
  )
879
1279
  ] })
880
1280
  ] });
881
- }, Mt = () => {
882
- L((e) => e.triggerProgramsUpdate);
883
- const r = L((e) => e.programs);
884
- return /* @__PURE__ */ n(
1281
+ }, nr = () => {
1282
+ A((e) => e.triggerProgramsUpdate);
1283
+ const t = A((e) => e.programs);
1284
+ return /* @__PURE__ */ p(
885
1285
  "div",
886
1286
  {
887
- className: l.programsContainer,
1287
+ className: v.programsContainer,
888
1288
  onWheel: (e) => e.stopPropagation(),
889
- children: r && Array.from(r.values()).map((e) => e ? /* @__PURE__ */ n(Et, { el: e }, e.material.uuid) : null)
1289
+ children: t && Array.from(t.values()).map((e) => e ? /* @__PURE__ */ p(rr, { el: e }, e.material.uuid) : null)
890
1290
  }
891
1291
  );
892
- }, It = ({
893
- minimal: r,
1292
+ }, sr = ({
1293
+ minimal: t,
894
1294
  chart: e = { length: 120, hz: 60 }
895
1295
  }) => {
896
- const t = Y(() => ({
1296
+ const n = J(() => ({
897
1297
  fps: new Float32Array(e.length * 3),
898
1298
  cpu: new Float32Array(e.length * 3),
899
1299
  gpu: new Float32Array(e.length * 3)
900
- }), [e]), i = I(null), m = I(null), o = I(null), a = I(null), c = Y(() => new E.Vector3(0, 0, 0), []), v = (s, d = 1, f, p) => {
901
- let h = 0;
902
- const { width: u, height: w } = p, g = R().chart.data[s];
903
- if (!g || g.length === 0)
1300
+ }), [e]), o = T(null), d = T(null), f = T(null), h = T(null), u = J(() => new I.Vector3(0, 0, 0), []), g = (r, a = 1, i, m) => {
1301
+ let c = 0;
1302
+ const { width: s, height: y } = m, l = F().chart.data[r];
1303
+ if (!l || l.length === 0)
904
1304
  return;
905
- const _ = r ? 2 : 6, x = r ? 12 : 50, b = g.length;
906
- for (let C = 0; C < b; C++) {
907
- const T = (R().chart.circularId + C + 1) % b;
908
- g[T] !== void 0 && (g[T] > h && (h = g[T] * d), c.set(
909
- _ + C / (b - 1) * (u - _ * 2) - u / 2,
910
- Math.min(100, g[T]) * d / 100 * (w - _ * 2 - x) - w / 2,
1305
+ const E = t ? 2 : 6, _ = t ? 12 : 50, b = l.length;
1306
+ for (let S = 0; S < b; S++) {
1307
+ const C = (F().chart.circularId + S + 1) % b;
1308
+ l[C] !== void 0 && (l[C] > c && (c = l[C] * a), u.set(
1309
+ E + S / (b - 1) * (s - E * 2) - s / 2,
1310
+ Math.min(100, l[C]) * a / 100 * (y - E * 2 - _) - y / 2,
911
1311
  0
912
- ), c.toArray(f.attributes.position.array, C * 3));
1312
+ ), u.toArray(i.attributes.position.array, S * 3));
913
1313
  }
914
- f.attributes.position.needsUpdate = !0;
1314
+ i.attributes.position.needsUpdate = !0;
915
1315
  };
916
- return _e(function({ viewport: d }) {
917
- v("fps", 1, i.current, d), m.current && m.current.color.set(
918
- R().overclockingFps ? N.overClock : N.fps
919
- ), v("gpu", 5, o.current, d), v("cpu", 5, a.current, d);
920
- }), /* @__PURE__ */ y(z, { children: [
921
- /* @__PURE__ */ y(
1316
+ return Ge(function({ viewport: a }) {
1317
+ g("fps", 1, o.current, a), d.current && d.current.color.set(
1318
+ F().overclockingFps ? N.overClock : N.fps
1319
+ ), g("gpu", 5, f.current, a), g("cpu", 5, h.current, a);
1320
+ }), /* @__PURE__ */ x(q, { children: [
1321
+ /* @__PURE__ */ x(
922
1322
  "line",
923
1323
  {
924
- onUpdate: (s) => {
925
- s.updateMatrix(), s.matrixWorld.copy(s.matrix);
1324
+ onUpdate: (r) => {
1325
+ r.updateMatrix(), r.matrixWorld.copy(r.matrix);
926
1326
  },
927
1327
  children: [
928
- /* @__PURE__ */ n("bufferGeometry", { ref: i, children: /* @__PURE__ */ n(
1328
+ /* @__PURE__ */ p("bufferGeometry", { ref: o, children: /* @__PURE__ */ p(
929
1329
  "bufferAttribute",
930
1330
  {
931
1331
  attach: "attributes-position",
932
1332
  count: e.length,
933
- args: [t.fps, 3],
934
- array: t.fps,
1333
+ args: [n.fps, 3],
1334
+ array: n.fps,
935
1335
  itemSize: 3,
936
- usage: E.DynamicDrawUsage,
1336
+ usage: I.DynamicDrawUsage,
937
1337
  needsUpdate: !0
938
1338
  }
939
1339
  ) }),
940
- /* @__PURE__ */ n(
1340
+ /* @__PURE__ */ p(
941
1341
  "lineBasicMaterial",
942
1342
  {
943
- ref: m,
1343
+ ref: d,
944
1344
  color: N.fps,
945
1345
  transparent: !0,
946
1346
  opacity: 0.5
@@ -949,87 +1349,87 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
949
1349
  ]
950
1350
  }
951
1351
  ),
952
- /* @__PURE__ */ y(
1352
+ /* @__PURE__ */ x(
953
1353
  "line",
954
1354
  {
955
- onUpdate: (s) => {
956
- s.updateMatrix(), s.matrixWorld.copy(s.matrix);
1355
+ onUpdate: (r) => {
1356
+ r.updateMatrix(), r.matrixWorld.copy(r.matrix);
957
1357
  },
958
1358
  children: [
959
- /* @__PURE__ */ n("bufferGeometry", { ref: o, children: /* @__PURE__ */ n(
1359
+ /* @__PURE__ */ p("bufferGeometry", { ref: f, children: /* @__PURE__ */ p(
960
1360
  "bufferAttribute",
961
1361
  {
962
1362
  attach: "attributes-position",
963
1363
  count: e.length,
964
- array: t.gpu,
965
- args: [t.gpu, 3],
1364
+ array: n.gpu,
1365
+ args: [n.gpu, 3],
966
1366
  itemSize: 3,
967
- usage: E.DynamicDrawUsage,
1367
+ usage: I.DynamicDrawUsage,
968
1368
  needsUpdate: !0
969
1369
  }
970
1370
  ) }),
971
- /* @__PURE__ */ n("lineBasicMaterial", { color: N.gpu, transparent: !0, opacity: 0.5 })
1371
+ /* @__PURE__ */ p("lineBasicMaterial", { color: N.gpu, transparent: !0, opacity: 0.5 })
972
1372
  ]
973
1373
  }
974
1374
  ),
975
- /* @__PURE__ */ y(
1375
+ /* @__PURE__ */ x(
976
1376
  "line",
977
1377
  {
978
- onUpdate: (s) => {
979
- s.updateMatrix(), s.matrixWorld.copy(s.matrix);
1378
+ onUpdate: (r) => {
1379
+ r.updateMatrix(), r.matrixWorld.copy(r.matrix);
980
1380
  },
981
1381
  children: [
982
- /* @__PURE__ */ n("bufferGeometry", { ref: a, children: /* @__PURE__ */ n(
1382
+ /* @__PURE__ */ p("bufferGeometry", { ref: h, children: /* @__PURE__ */ p(
983
1383
  "bufferAttribute",
984
1384
  {
985
1385
  attach: "attributes-position",
986
1386
  count: e.length,
987
- array: t.cpu,
988
- args: [t.cpu, 3],
1387
+ array: n.cpu,
1388
+ args: [n.cpu, 3],
989
1389
  itemSize: 3,
990
- usage: E.DynamicDrawUsage,
1390
+ usage: I.DynamicDrawUsage,
991
1391
  needsUpdate: !0
992
1392
  }
993
1393
  ) }),
994
- /* @__PURE__ */ n("lineBasicMaterial", { color: N.cpu, transparent: !0, opacity: 0.5 })
1394
+ /* @__PURE__ */ p("lineBasicMaterial", { color: N.cpu, transparent: !0, opacity: 0.5 })
995
1395
  ]
996
1396
  }
997
1397
  )
998
1398
  ] });
999
- }, Lt = ({
1000
- chart: r,
1399
+ }, ir = ({
1400
+ chart: t,
1001
1401
  showGraph: e = !0,
1002
- antialias: t = !0,
1003
- minimal: i
1402
+ antialias: n = !0,
1403
+ minimal: o
1004
1404
  }) => {
1005
- const m = I(void 0), o = L((a) => a.paused);
1006
- return /* @__PURE__ */ n(
1405
+ const d = T(void 0), f = A((h) => h.paused);
1406
+ return /* @__PURE__ */ p(
1007
1407
  "div",
1008
1408
  {
1009
- className: l.graph,
1409
+ className: v.graph,
1010
1410
  style: {
1011
1411
  display: "flex",
1012
1412
  marginTop: 6,
1013
1413
  position: "absolute",
1014
1414
  width: "100%",
1015
- height: `${i ? 37 : e ? 100 : 60}px`
1415
+ height: `${o ? 37 : e ? 100 : 60}px`
1016
1416
  },
1017
- children: /* @__PURE__ */ n(
1018
- Re,
1417
+ children: /* @__PURE__ */ p(
1418
+ Je,
1019
1419
  {
1020
- ref: m,
1420
+ ref: d,
1021
1421
  orthographic: !0,
1022
1422
  camera: { rotation: [0, 0, 0] },
1023
- dpr: t ? [1, 2] : 1,
1423
+ dpr: n ? [1, 2] : 1,
1024
1424
  gl: {
1025
1425
  antialias: !0,
1026
1426
  alpha: !0,
1027
1427
  stencil: !1,
1028
1428
  depth: !1
1029
1429
  },
1030
- onCreated: ({ scene: a }) => {
1031
- a.traverse((c) => {
1032
- c.matrixWorldAutoUpdate = !1, c.matrixAutoUpdate = !1;
1430
+ onCreated: ({ scene: h }) => {
1431
+ h.traverse((u) => {
1432
+ u.matrixWorldAutoUpdate = !1, u.matrixAutoUpdate = !1;
1033
1433
  });
1034
1434
  },
1035
1435
  flat: !0,
@@ -1039,116 +1439,116 @@ const Qe = "_perfS_ans5i_1", Xe = "_containerHeight_ans5i_16", Ye = "_topLeft_an
1039
1439
  pointerEvents: "none",
1040
1440
  background: "transparent !important",
1041
1441
  width: "100%",
1042
- height: `${i ? 37 : e ? 100 : 60}px`
1442
+ height: `${o ? 37 : e ? 100 : 60}px`
1043
1443
  },
1044
- children: o ? null : /* @__PURE__ */ y(z, { children: [
1045
- /* @__PURE__ */ n(Tt, {}),
1046
- e && /* @__PURE__ */ n(It, { minimal: i, chart: r })
1444
+ children: f ? null : /* @__PURE__ */ x(q, { children: [
1445
+ /* @__PURE__ */ p(ar, {}),
1446
+ e && /* @__PURE__ */ p(sr, { minimal: o, chart: t })
1047
1447
  ] })
1048
1448
  }
1049
1449
  )
1050
1450
  }
1051
1451
  );
1052
- }, Tt = () => (_e(function({ gl: e, scene: t, camera: i }) {
1053
- i.updateMatrix(), i.matrixWorld.copy(i.matrix), i.matrixWorldInverse.copy(i.matrixWorld).invert(), e.render(t, i);
1054
- }, 1 / 0), null), he = {
1452
+ }, ar = () => (Ge(function({ gl: e, scene: n, camera: o }) {
1453
+ o.updateMatrix(), o.matrixWorld.copy(o.matrix), o.matrixWorldInverse.copy(o.matrixWorld).invert(), e.render(n, o);
1454
+ }, 1 / 0), null), Re = {
1055
1455
  fps: { fg: "#00ffff", bg: "#000022" },
1056
1456
  // Chỉnh màu nền đậm hơn chút
1057
1457
  cpu: { fg: "#00ff00", bg: "#002200" },
1058
1458
  gpu: { fg: "#ff0080", bg: "#220011" }
1059
- }, D = [
1459
+ }, G = [
1060
1460
  { key: "fps", label: "FPS", maxVal: 120 },
1061
1461
  { key: "cpu", label: "CPU", maxVal: 40 },
1062
1462
  { key: "gpu", label: "GPU", maxVal: 40 }
1063
- ], W = 48, Ce = 15, Q = 2, j = Ce, q = W - j - 2, X = 6, At = 15, ge = 1e3 / At;
1064
- function St({
1065
- show: r = !0,
1463
+ ], W = 48, He = 15, Y = 2, k = He, H = W - k - 2, X = 6, or = 15, Ne = 1e3 / or;
1464
+ function cr({
1465
+ show: t = !0,
1066
1466
  opacity: e = 1,
1067
1467
  // Tăng opacity lên 1 để bớt trong suốt
1068
- className: t,
1069
- style: i
1468
+ className: n,
1469
+ style: o
1070
1470
  }) {
1071
- const m = L((h) => h.paused), o = I(null), a = I(null), [c, v] = O(300), s = Y(
1471
+ const d = A((c) => c.paused), f = T(null), h = T(null), [u, g] = B(300), r = J(
1072
1472
  () => Math.max(1, Math.round(window.devicePixelRatio || 1)),
1073
1473
  []
1074
1474
  );
1075
- U(() => {
1076
- if (!a.current) return;
1077
- const h = new ResizeObserver((u) => {
1078
- for (const w of u)
1079
- v(w.contentRect.width);
1475
+ P(() => {
1476
+ if (!h.current) return;
1477
+ const c = new ResizeObserver((s) => {
1478
+ for (const y of s)
1479
+ g(y.contentRect.width);
1080
1480
  });
1081
- return h.observe(a.current), () => h.disconnect();
1481
+ return c.observe(h.current), () => c.disconnect();
1082
1482
  }, []);
1083
- const d = (D.length - 1) * X, f = Math.max(0, (c - d) / D.length), p = Math.max(0, f - Q);
1084
- return U(() => {
1085
- const h = o.current;
1086
- if (!h) return;
1087
- h.width = c * s, h.height = W * s, h.style.width = "100%", h.style.height = `${W}px`;
1088
- const u = h.getContext("2d");
1089
- if (u) {
1090
- u.setTransform(1, 0, 0, 1, 0, 0), u.scale(s, s), u.imageSmoothingEnabled = !1, u.font = "bold 9px Roboto Mono, monospace", u.textBaseline = "top", u.clearRect(0, 0, c, W);
1091
- for (let w = 0; w < D.length; w++) {
1092
- const { key: g } = D[w], _ = w * (f + X), { bg: x } = he[g];
1093
- u.fillStyle = x, u.globalAlpha = e, u.fillRect(_, 0, f, W), u.globalAlpha = 1;
1483
+ const a = (G.length - 1) * X, i = Math.max(0, (u - a) / G.length), m = Math.max(0, i - Y);
1484
+ return P(() => {
1485
+ const c = f.current;
1486
+ if (!c) return;
1487
+ c.width = u * r, c.height = W * r, c.style.width = "100%", c.style.height = `${W}px`;
1488
+ const s = c.getContext("2d");
1489
+ if (s) {
1490
+ s.setTransform(1, 0, 0, 1, 0, 0), s.scale(r, r), s.imageSmoothingEnabled = !1, s.font = "bold 9px Roboto Mono, monospace", s.textBaseline = "top", s.clearRect(0, 0, u, W);
1491
+ for (let y = 0; y < G.length; y++) {
1492
+ const { key: l } = G[y], E = y * (i + X), { bg: _ } = Re[l];
1493
+ s.fillStyle = _, s.globalAlpha = e, s.fillRect(E, 0, i, W), s.globalAlpha = 1;
1094
1494
  }
1095
1495
  }
1096
- }, [s, c, f, e]), U(() => {
1097
- if (!r) return;
1098
- const h = o.current;
1099
- if (!h) return;
1100
- const u = h.getContext("2d");
1101
- if (!u) return;
1102
- let w = 0, g = 0;
1103
- const _ = {
1496
+ }, [r, u, i, e]), P(() => {
1497
+ if (!t) return;
1498
+ const c = f.current;
1499
+ if (!c) return;
1500
+ const s = c.getContext("2d");
1501
+ if (!s) return;
1502
+ let y = 0, l = 0;
1503
+ const E = {
1104
1504
  fps: { min: 1 / 0, max: 0 },
1105
1505
  cpu: { min: 1 / 0, max: 0 },
1106
1506
  gpu: { min: 1 / 0, max: 0 }
1107
1507
  };
1108
- function x(b) {
1109
- if (!h || !u || (w = requestAnimationFrame(x), m)) return;
1110
- const C = b - g;
1111
- if (C < ge) return;
1112
- g = b - C % ge;
1113
- const T = R(), F = T.chart.circularId;
1114
- for (let A = 0; A < D.length; A++) {
1115
- const { key: P, label: Ee, maxVal: se } = D[A], k = A * (f + X), { fg: ne, bg: ie } = he[P], V = T.chart.data[P], K = (V == null ? void 0 : V.length) || 0;
1116
- let $ = 0;
1117
- if (K > 0) {
1118
- const Le = (F - 1 + K) % K;
1119
- $ = V[Le] ?? 0;
1508
+ function _(b) {
1509
+ if (!c || !s || (y = requestAnimationFrame(_), d)) return;
1510
+ const S = b - l;
1511
+ if (S < Ne) return;
1512
+ l = b - S % Ne;
1513
+ const C = F(), w = C.chart.circularId;
1514
+ for (let L = 0; L < G.length; L++) {
1515
+ const { key: O, label: ke, maxVal: ue } = G[L], j = L * (i + X), { fg: fe, bg: me } = Re[O], $ = C.chart.data[O], Z = ($ == null ? void 0 : $.length) || 0;
1516
+ let K = 0;
1517
+ if (Z > 0) {
1518
+ const $e = (w - 1 + Z) % Z;
1519
+ K = $[$e] ?? 0;
1120
1520
  }
1121
- const B = _[P];
1122
- B.min = Math.min(B.min, $), B.max = Math.max(B.max, $), u.fillStyle = ie, u.globalAlpha = 1, u.fillRect(k, 0, f, Ce), u.fillStyle = ne;
1123
- const Me = `${Ee} (${Math.round(B.min)}-${Math.round(B.max)})`;
1124
- u.fillText(Me, k + 3, 2), p > 1 && u.drawImage(
1125
- h,
1126
- (k + Q + 1) * s,
1127
- j * s,
1128
- (p - 1) * s,
1129
- q * s,
1130
- k + Q,
1131
- j,
1132
- p - 1,
1133
- q
1521
+ const D = E[O];
1522
+ D.min = Math.min(D.min, K), D.max = Math.max(D.max, K), s.fillStyle = me, s.globalAlpha = 1, s.fillRect(j, 0, i, He), s.fillStyle = fe;
1523
+ const qe = `${ke} (${Math.round(D.min)}-${Math.round(D.max)})`;
1524
+ s.fillText(qe, j + 3, 2), m > 1 && s.drawImage(
1525
+ c,
1526
+ (j + Y + 1) * r,
1527
+ k * r,
1528
+ (m - 1) * r,
1529
+ H * r,
1530
+ j + Y,
1531
+ k,
1532
+ m - 1,
1533
+ H
1134
1534
  );
1135
- const ae = k + Q + p - 1;
1136
- u.fillStyle = ie, u.globalAlpha = 1, u.fillRect(ae, j, 1, q), u.fillStyle = ne, u.globalAlpha = 1;
1137
- const Ie = Math.min($, se) / se, J = Math.round(Ie * q);
1138
- J > 0 && u.fillRect(ae, j + q - J, 1, J);
1535
+ const de = j + Y + m - 1;
1536
+ s.fillStyle = me, s.globalAlpha = 1, s.fillRect(de, k, 1, H), s.fillStyle = fe, s.globalAlpha = 1;
1537
+ const ze = Math.min(K, ue) / ue, ee = Math.round(ze * H);
1538
+ ee > 0 && s.fillRect(de, k + H - ee, 1, ee);
1139
1539
  }
1140
1540
  }
1141
- return w = requestAnimationFrame(x), () => cancelAnimationFrame(w);
1142
- }, [m, r, s, f, p]), r ? /* @__PURE__ */ n(
1541
+ return y = requestAnimationFrame(_), () => cancelAnimationFrame(y);
1542
+ }, [d, t, r, i, m]), t ? /* @__PURE__ */ p(
1143
1543
  "div",
1144
1544
  {
1145
- ref: a,
1146
- className: t,
1147
- style: { width: "100%", ...i, marginTop: X },
1148
- children: /* @__PURE__ */ n(
1545
+ ref: h,
1546
+ className: n,
1547
+ style: { width: "100%", ...o, marginTop: X },
1548
+ children: /* @__PURE__ */ p(
1149
1549
  "canvas",
1150
1550
  {
1151
- ref: o,
1551
+ ref: f,
1152
1552
  style: {
1153
1553
  display: "block",
1154
1554
  pointerEvents: "none",
@@ -1172,208 +1572,208 @@ const N = {
1172
1572
  // 255,208,0
1173
1573
  vram: "#FF8C00"
1174
1574
  // 255,140,0
1175
- }, ye = ({
1176
- metric: r,
1575
+ }, Fe = ({
1576
+ metric: t,
1177
1577
  decimal: e = 0,
1178
- suffix: t = ""
1578
+ suffix: n = ""
1179
1579
  }) => {
1180
- const i = I(null);
1181
- return re("log", (m) => {
1182
- const [o] = m;
1183
- if (o && i.current) {
1184
- const a = o[r];
1185
- i.current.innerText = (typeof a == "number" ? a.toFixed(e) : "0") + t;
1580
+ const o = T(null);
1581
+ return le("log", (d) => {
1582
+ const [f] = d;
1583
+ if (f && o.current) {
1584
+ const h = f[t];
1585
+ o.current.innerText = (typeof h == "number" ? h.toFixed(e) : "0") + n;
1186
1586
  }
1187
- }), /* @__PURE__ */ y("span", { ref: i, children: [
1587
+ }), /* @__PURE__ */ x("span", { ref: o, children: [
1188
1588
  "0",
1189
- t
1589
+ n
1190
1590
  ] });
1191
- }, G = ({
1192
- metric: r,
1591
+ }, U = ({
1592
+ metric: t,
1193
1593
  suffix: e = ""
1194
1594
  }) => {
1195
- const t = I(null);
1196
- return re("log", (i) => {
1197
- const [, m] = i;
1198
- if (m && t.current) {
1199
- let o = m[r];
1200
- r === "calls" && o === 1 && (o = "--"), t.current.innerText = o + e;
1595
+ const n = T(null);
1596
+ return le("log", (o) => {
1597
+ const [, d] = o;
1598
+ if (d && n.current) {
1599
+ let f = d[t];
1600
+ t === "calls" && f === 1 && (f = "--"), n.current.innerText = f + e;
1201
1601
  }
1202
- }), /* @__PURE__ */ y("span", { ref: t, children: [
1602
+ }), /* @__PURE__ */ x("span", { ref: n, children: [
1203
1603
  "0",
1204
1604
  e
1205
1605
  ] });
1206
- }, ve = ({ type: r }) => {
1207
- const e = L((t) => t.estimatedMemory[r]);
1208
- return /* @__PURE__ */ y("span", { children: [
1606
+ }, Pe = ({ type: t }) => {
1607
+ const e = A((n) => n.estimatedMemory[t]);
1608
+ return /* @__PURE__ */ x("span", { children: [
1209
1609
  e.toFixed(0),
1210
1610
  " MB"
1211
1611
  ] });
1212
- }, Nt = () => {
1213
- const r = L((m) => m.overclockingFps), e = L((m) => m.fpsLimit), t = I(null);
1214
- re("log", (m) => {
1215
- const [o] = m;
1216
- o && t.current && (t.current.innerText = Math.round(o.fps).toString());
1612
+ }, lr = () => {
1613
+ const t = A((d) => d.overclockingFps), e = A((d) => d.fpsLimit), n = T(null);
1614
+ le("log", (d) => {
1615
+ const [f] = d;
1616
+ f && n.current && (n.current.innerText = Math.round(f.fps).toString());
1217
1617
  });
1218
- const i = r ? N.overClock : N.fps;
1219
- return /* @__PURE__ */ y("div", { className: l.perfI, children: [
1220
- /* @__PURE__ */ y("span", { className: l.perfB, style: { color: i }, children: [
1618
+ const o = t ? N.overClock : N.fps;
1619
+ return /* @__PURE__ */ x("div", { className: v.perfI, children: [
1620
+ /* @__PURE__ */ x("span", { className: v.perfB, style: { color: o }, children: [
1221
1621
  "FPS ",
1222
- r ? ` ${e}🚀` : ""
1622
+ t ? ` ${e}🚀` : ""
1223
1623
  ] }),
1224
- /* @__PURE__ */ n("small", { className: l.perfSmallI, ref: t, children: "0" })
1624
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, ref: n, children: "0" })
1225
1625
  ] });
1226
- }, Rt = ({ showGraph: r, minimal: e }) => L((i) => i.gl) ? /* @__PURE__ */ y("div", { className: l.perfIContainer, children: [
1227
- /* @__PURE__ */ n(Nt, { showGraph: r }),
1228
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1229
- /* @__PURE__ */ n("span", { className: l.perfB, style: { color: N.cpu }, children: "CPU" }),
1230
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(ye, { metric: "cpu", decimal: 2, suffix: " ms" }) })
1626
+ }, ur = ({ showGraph: t, minimal: e }) => A((o) => o.gl) ? /* @__PURE__ */ x("div", { className: v.perfIContainer, children: [
1627
+ /* @__PURE__ */ p(lr, { showGraph: t }),
1628
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1629
+ /* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.cpu }, children: "CPU" }),
1630
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Fe, { metric: "cpu", decimal: 2, suffix: " ms" }) })
1231
1631
  ] }),
1232
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1233
- /* @__PURE__ */ n("span", { className: l.perfB, style: { color: N.gpu }, children: "GPU" }),
1234
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(ye, { metric: "gpu", decimal: 2, suffix: " ms" }) })
1632
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1633
+ /* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.gpu }, children: "GPU" }),
1634
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Fe, { metric: "gpu", decimal: 2, suffix: " ms" }) })
1235
1635
  ] }),
1236
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1237
- /* @__PURE__ */ n("span", { className: l.perfB, style: { color: N.memory }, children: "MEMORY" }),
1238
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(ve, { type: "ram" }) })
1636
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1637
+ /* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.memory }, children: "MEMORY" }),
1638
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Pe, { type: "ram" }) })
1239
1639
  ] }),
1240
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1241
- /* @__PURE__ */ n("span", { className: l.perfB, style: { color: N.vram }, children: "VRAM" }),
1242
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(ve, { type: "vram" }) })
1640
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1641
+ /* @__PURE__ */ p("span", { className: v.perfB, style: { color: N.vram }, children: "VRAM" }),
1642
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(Pe, { type: "vram" }) })
1243
1643
  ] }),
1244
- !e && /* @__PURE__ */ y("div", { className: l.perfI, children: [
1245
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Calls" }),
1246
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "calls" }) })
1644
+ !e && /* @__PURE__ */ x("div", { className: v.perfI, children: [
1645
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Calls" }),
1646
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "calls" }) })
1247
1647
  ] })
1248
- ] }) : null, Ft = ({ matrixUpdate: r }) => /* @__PURE__ */ y("div", { className: l.perfIContainer, children: [
1249
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1250
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Geometries" }),
1251
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "geometries" }) })
1648
+ ] }) : null, fr = ({ matrixUpdate: t }) => /* @__PURE__ */ x("div", { className: v.perfIContainer, children: [
1649
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1650
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Geometries" }),
1651
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "geometries" }) })
1252
1652
  ] }),
1253
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1254
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Textures" }),
1255
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "textures" }) })
1653
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1654
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Textures" }),
1655
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "textures" }) })
1256
1656
  ] }),
1257
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1258
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Shaders" }),
1259
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "programs" }) })
1657
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1658
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Shaders" }),
1659
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "programs" }) })
1260
1660
  ] }),
1261
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1262
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Triangles" }),
1263
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "triangles" }) })
1661
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1662
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Triangles" }),
1663
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "triangles" }) })
1264
1664
  ] }),
1265
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1266
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Lines" }),
1267
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "lines" }) })
1665
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1666
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Lines" }),
1667
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "lines" }) })
1268
1668
  ] }),
1269
- /* @__PURE__ */ y("div", { className: l.perfI, children: [
1270
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Points" }),
1271
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: /* @__PURE__ */ n(G, { metric: "points" }) })
1669
+ /* @__PURE__ */ x("div", { className: v.perfI, children: [
1670
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Points" }),
1671
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: /* @__PURE__ */ p(U, { metric: "points" }) })
1272
1672
  ] }),
1273
- r && /* @__PURE__ */ y("div", { className: l.perfI, children: [
1274
- /* @__PURE__ */ n("span", { className: l.perfB, children: "Matrices" }),
1275
- /* @__PURE__ */ n("small", { className: l.perfSmallI, children: r })
1673
+ t && /* @__PURE__ */ x("div", { className: v.perfI, children: [
1674
+ /* @__PURE__ */ p("span", { className: v.perfB, children: "Matrices" }),
1675
+ /* @__PURE__ */ p("small", { className: v.perfSmallI, children: t })
1276
1676
  ] })
1277
- ] }), xe = ({ tab: r, title: e, set: t }) => {
1278
- const i = L((m) => m.tab);
1279
- return /* @__PURE__ */ n(
1677
+ ] }), Ue = ({ tab: t, title: e, set: n }) => {
1678
+ const o = A((d) => d.tab);
1679
+ return /* @__PURE__ */ p(
1280
1680
  "div",
1281
1681
  {
1282
- className: `${l.toggle} ${i === r ? l.activeTab : ""}`,
1682
+ className: `${v.toggle} ${o === t ? v.activeTab : ""}`,
1283
1683
  onClick: () => {
1284
- t(!0), M({ tab: r });
1684
+ n(!0), M({ tab: t });
1285
1685
  },
1286
1686
  children: e
1287
1687
  }
1288
1688
  );
1289
- }, Pt = ({
1290
- openByDefault: r,
1689
+ }, mr = ({
1690
+ openByDefault: t,
1291
1691
  showGraph: e,
1292
- deepAnalyze: t,
1293
- matrixUpdate: i,
1294
- graphType: m,
1295
- perfContainerRef: o,
1296
- antialias: a,
1297
- chart: c,
1298
- minimal: v
1692
+ deepAnalyze: n,
1693
+ matrixUpdate: o,
1694
+ graphType: d,
1695
+ perfContainerRef: f,
1696
+ antialias: h,
1697
+ chart: u,
1698
+ minimal: g
1299
1699
  }) => {
1300
- const [s, d] = O(r || !1), f = L((p) => p.tab);
1301
- return /* @__PURE__ */ y(z, { children: [
1302
- /* @__PURE__ */ y("div", { style: { display: s ? "block" : "none", marginTop: "4px" }, children: [
1303
- /* @__PURE__ */ n(Ft, { matrixUpdate: i }),
1304
- e && (m === "bar" ? /* @__PURE__ */ n(St, {}) : /* @__PURE__ */ n(
1305
- Lt,
1700
+ const [r, a] = B(t || !1), i = A((m) => m.tab);
1701
+ return /* @__PURE__ */ x(q, { children: [
1702
+ /* @__PURE__ */ x("div", { style: { display: r ? "block" : "none", marginTop: "4px" }, children: [
1703
+ /* @__PURE__ */ p(fr, { matrixUpdate: o }),
1704
+ e && (d === "bar" ? /* @__PURE__ */ p(cr, {}) : /* @__PURE__ */ p(
1705
+ ir,
1306
1706
  {
1307
- perfContainerRef: o,
1308
- chart: c,
1707
+ perfContainerRef: f,
1708
+ chart: u,
1309
1709
  showGraph: e,
1310
- antialias: a,
1311
- minimal: v,
1312
- matrixUpdate: i
1710
+ antialias: h,
1711
+ minimal: g,
1712
+ matrixUpdate: o
1313
1713
  }
1314
1714
  )),
1315
- s && /* @__PURE__ */ n("div", { className: l.containerScroll, children: f === "programs" && /* @__PURE__ */ n(Mt, {}) })
1715
+ r && /* @__PURE__ */ p("div", { className: v.containerScroll, children: i === "programs" && /* @__PURE__ */ p(nr, {}) })
1316
1716
  ] }),
1317
- r && !t ? null : /* @__PURE__ */ y(
1717
+ t && !n ? null : /* @__PURE__ */ x(
1318
1718
  "div",
1319
1719
  {
1320
- className: l.toggleContainer,
1321
- style: s && e && m === "line" ? { marginTop: 50 } : { marginTop: 6 },
1720
+ className: v.toggleContainer,
1721
+ style: r && e && d === "line" ? { marginTop: 50 } : { marginTop: 6 },
1322
1722
  children: [
1323
- t && /* @__PURE__ */ n(xe, { tab: "programs", title: "Programs", set: d }),
1324
- t && /* @__PURE__ */ n(xe, { tab: "infos", title: "Infos", set: d }),
1325
- /* @__PURE__ */ n("div", { className: l.toggle, onClick: () => d(!s), children: s ? "Minimize" : "More" })
1723
+ n && /* @__PURE__ */ p(Ue, { tab: "programs", title: "Programs", set: a }),
1724
+ n && /* @__PURE__ */ p(Ue, { tab: "infos", title: "Infos", set: a }),
1725
+ /* @__PURE__ */ p("div", { className: v.toggle, onClick: () => a(!r), children: r ? "Minimize" : "More" })
1326
1726
  ]
1327
1727
  }
1328
1728
  )
1329
1729
  ] });
1330
- }, qt = ({
1331
- showGraph: r = !0,
1730
+ }, vr = ({
1731
+ showGraph: t = !0,
1332
1732
  openByDefault: e = !0,
1333
- className: t,
1334
- overClock: i = !1,
1335
- graphType: m = "bar",
1336
- style: o,
1337
- position: a = "top-right",
1338
- chart: c,
1339
- logsPerSecond: v,
1340
- deepAnalyze: s = !1,
1341
- antialias: d = !0,
1342
- matrixUpdate: f,
1343
- minimal: p
1733
+ className: n,
1734
+ overClock: o = !1,
1735
+ graphType: d = "bar",
1736
+ style: f,
1737
+ position: h = "top-right",
1738
+ chart: u,
1739
+ logsPerSecond: g,
1740
+ deepAnalyze: r = !1,
1741
+ antialias: a = !0,
1742
+ matrixUpdate: i,
1743
+ minimal: m
1344
1744
  }) => {
1345
- const h = I(null), u = a === "top-left" ? l.topLeft : a === "bottom-left" ? l.bottomLeft : a === "bottom-right" ? l.bottomRight : l.topRight, w = r && m === "line" && !s;
1346
- return /* @__PURE__ */ y(z, { children: [
1347
- /* @__PURE__ */ n(
1348
- Ve,
1745
+ const c = T(null), s = h === "top-left" ? v.topLeft : h === "bottom-left" ? v.bottomLeft : h === "bottom-right" ? v.bottomRight : v.topRight, y = t && d === "line" && !r;
1746
+ return /* @__PURE__ */ x(q, { children: [
1747
+ /* @__PURE__ */ p(
1748
+ wt,
1349
1749
  {
1350
- logsPerSecond: v,
1351
- chart: c,
1352
- overClock: i,
1353
- deepAnalyze: s,
1354
- matrixUpdate: f
1750
+ logsPerSecond: g,
1751
+ chart: u,
1752
+ overClock: o,
1753
+ deepAnalyze: r,
1754
+ matrixUpdate: i
1355
1755
  }
1356
1756
  ),
1357
- /* @__PURE__ */ n(be, { name: "r3f-perf", children: /* @__PURE__ */ y(
1757
+ /* @__PURE__ */ p(We, { name: "r3f-perf", children: /* @__PURE__ */ x(
1358
1758
  "div",
1359
1759
  {
1360
- className: `${l.perfS} ${u} ${p ? l.minimal : ""} ${t || ""} ${w ? l.containerHeight : ""}`,
1361
- style: o,
1362
- ref: h,
1760
+ className: `${v.perfS} ${s} ${m ? v.minimal : ""} ${n || ""} ${y ? v.containerHeight : ""}`,
1761
+ style: f,
1762
+ ref: c,
1363
1763
  children: [
1364
- /* @__PURE__ */ n(Rt, { showGraph: r, minimal: p }),
1365
- !p && /* @__PURE__ */ n(
1366
- Pt,
1764
+ /* @__PURE__ */ p(ur, { showGraph: t, minimal: m }),
1765
+ !m && /* @__PURE__ */ p(
1766
+ mr,
1367
1767
  {
1368
- showGraph: r,
1369
- deepAnalyze: s,
1370
- matrixUpdate: f,
1768
+ showGraph: t,
1769
+ deepAnalyze: r,
1770
+ matrixUpdate: i,
1371
1771
  openByDefault: e,
1372
- graphType: m,
1373
- perfContainerRef: h,
1374
- antialias: d,
1375
- chart: c,
1376
- minimal: p
1772
+ graphType: d,
1773
+ perfContainerRef: c,
1774
+ antialias: a,
1775
+ chart: u,
1776
+ minimal: m
1377
1777
  }
1378
1778
  )
1379
1779
  ]
@@ -1382,5 +1782,5 @@ const N = {
1382
1782
  ] });
1383
1783
  };
1384
1784
  export {
1385
- qt as PerformanceMonitor
1785
+ vr as PerfMonitor
1386
1786
  };